Updating href on textPath doesn't update its rendering
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-22  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Updating href on textPath doesn't update its rendering
4         https://bugs.webkit.org/show_bug.cgi?id=191920
5
6         Reviewed by Dean Jackson.
7
8         Fixed the bug by invalidating the RenderSVGResource in SVGTextPathElement::svgAttributeChanged
9         in addition to updating the pending resources.
10
11         Test: svg/text/textpath-reference-update.html
12
13         * svg/SVGTextPathElement.cpp:
14         (WebCore::SVGTextPathElement::svgAttributeChanged):
15
16 2018-11-23  Ross Kirsling  <ross.kirsling@sony.com>
17
18         Introduce user-defined literal for LayoutUnit
19         https://bugs.webkit.org/show_bug.cgi?id=191915
20
21         Reviewed by Dean Jackson.
22
23         * platform/LayoutUnit.h:
24         Introduce a user-defined literal for LayoutUnit, _lu, replacing the existing "fromPixel" factory function.
25
26         * layout/FormattingContextGeometry.cpp:
27         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
28         * layout/inlineformatting/InlineLineBreaker.cpp:
29         * page/FrameView.cpp:
30         * page/FrameViewLayoutContext.h:
31         * page/Page.cpp:
32         * page/SpatialNavigation.h:
33         * platform/ScrollableArea.cpp:
34         * rendering/EllipsisBox.cpp:
35         * rendering/FlexibleBoxAlgorithm.cpp:
36         * rendering/FloatingObjects.cpp:
37         * rendering/GridLayoutFunctions.cpp:
38         * rendering/GridTrackSizingAlgorithm.cpp:
39         * rendering/InlineFlowBox.cpp:
40         * rendering/InlineTextBox.cpp:
41         * rendering/LayoutState.h:
42         * rendering/LogicalSelectionOffsetCaches.h:
43         * rendering/RenderBlock.cpp:
44         * rendering/RenderBlock.h:
45         * rendering/RenderBlockFlow.cpp:
46         * rendering/RenderBlockFlow.h:
47         * rendering/RenderBlockLineLayout.cpp:
48         * rendering/RenderBox.cpp:
49         * rendering/RenderBoxModelObject.cpp:
50         * rendering/RenderDeprecatedFlexibleBox.cpp:
51         * rendering/RenderDeprecatedFlexibleBox.h:
52         * rendering/RenderElement.cpp:
53         * rendering/RenderFlexibleBox.cpp:
54         * rendering/RenderFlexibleBox.h:
55         * rendering/RenderFragmentContainer.cpp:
56         * rendering/RenderFragmentedFlow.cpp:
57         * rendering/RenderGrid.cpp:
58         * rendering/RenderGrid.h:
59         * rendering/RenderImage.cpp:
60         * rendering/RenderLayer.cpp:
61         * rendering/RenderListMarker.cpp:
62         * rendering/RenderMultiColumnFlow.cpp:
63         * rendering/RenderMultiColumnSet.cpp:
64         * rendering/RenderReplaced.cpp:
65         * rendering/RenderReplaced.h:
66         * rendering/RenderRubyRun.h:
67         * rendering/RenderTable.cpp:
68         * rendering/RenderTable.h:
69         * rendering/RenderTableSection.cpp:
70         * rendering/RenderTheme.cpp:
71         * rendering/RenderTreeAsText.cpp:
72         * rendering/RenderView.cpp:
73         * rendering/RootInlineBox.h:
74         * rendering/SimpleLineLayout.cpp:
75         * rendering/SimpleLineLayoutPagination.cpp:
76         * rendering/TableLayout.h:
77         * rendering/line/BreakingContext.h:
78         * rendering/line/LineLayoutState.h:
79         * rendering/line/LineWidth.h:
80         * rendering/mathml/MathOperator.cpp:
81         * rendering/mathml/MathOperator.h:
82         * rendering/mathml/RenderMathMLBlock.h:
83         * rendering/mathml/RenderMathMLFraction.cpp:
84         * rendering/mathml/RenderMathMLFraction.h:
85         * rendering/mathml/RenderMathMLMath.cpp:
86         * rendering/mathml/RenderMathMLMath.h:
87         * rendering/mathml/RenderMathMLMenclose.h:
88         * rendering/mathml/RenderMathMLOperator.cpp:
89         * rendering/mathml/RenderMathMLOperator.h:
90         * rendering/mathml/RenderMathMLPadded.h:
91         * rendering/mathml/RenderMathMLRoot.cpp:
92         * rendering/mathml/RenderMathMLRoot.h:
93         * rendering/mathml/RenderMathMLRow.h:
94         * rendering/mathml/RenderMathMLScripts.cpp:
95         * rendering/mathml/RenderMathMLScripts.h:
96         * rendering/mathml/RenderMathMLSpace.h:
97         * rendering/mathml/RenderMathMLToken.cpp:
98         * rendering/mathml/RenderMathMLToken.h:
99         * rendering/mathml/RenderMathMLUnderOver.h:
100         * rendering/shapes/ShapeOutsideInfo.cpp:
101         * rendering/style/CollapsedBorderValue.h:
102         Update all instances of LayoutUnit(), LayoutUnit(0), LayoutUnit { 0 }, etc. and add any other
103         literal conversions that will be needed when making non-int LayoutUnit constructors explicit.
104         For good measure, also mark all default values for LayoutUnit parameters.
105
106 2018-11-23  Jim Mason  <jmason@ibinx.com>
107
108         [GTK] Scrollbars not following gtk-primary-button-warps-slider setting
109         https://bugs.webkit.org/show_bug.cgi?id=191067
110
111         Updated code per the style guide, removed unreachable break (non-semantic change)
112
113         Reviewed by Michael Catanzaro.
114
115         * platform/gtk/ScrollbarThemeGtk.cpp:
116         (WebCore::ScrollbarThemeGtk::handleMousePressEvent):
117
118 2018-11-23  Wenson Hsieh  <wenson_hsieh@apple.com>
119
120         Enable drag and drop support for iOSMac
121         https://bugs.webkit.org/show_bug.cgi?id=191818
122         <rdar://problem/43907454>
123
124         Reviewed by Dean Jackson.
125
126         Enables drag and drop by default on iOSMac by switching on ENABLE_DATA_INTERACTION and ENABLE_DRAG_SUPPORT. This
127         enables support for dragging links, text selections, and images, though many advanced features (e.g. custom
128         pasteboard data) will require additional support from the platform.
129
130         * Configurations/FeatureDefines.xcconfig:
131         * platform/ios/PlatformPasteboardIOS.mm:
132         (WebCore::PlatformPasteboard::informationForItemAtIndex):
133         (WebCore::registerItemToPasteboard):
134         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
135         * platform/ios/WebItemProviderPasteboard.mm:
136         (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
137         (-[WebItemProviderPasteboard numberOfFiles]):
138
139         Disable codepaths which attempt to access or set `teamData` or `preferredPresentationStyle` on `NSItemProvider`
140         in iOSMac, since these are currently unimplemented.
141
142 2018-11-23  Zalan Butjas  <zalan@apple.com>
143
144         [LFC][IFC] Add support for variable height runs.
145         https://bugs.webkit.org/show_bug.cgi?id=191925
146
147         Reviewed by Antti Koivisto.
148
149         https://www.w3.org/TR/CSS22/visudet.html#inline-box-height
150
151         10.8 Line height calculations: the 'line-height' and 'vertical-align' properties
152
153         The height of each inline-level box in the line box is calculated. For replaced elements, inline-block elements,
154         and inline-table elements, this is the height of their margin box; for inline boxes, this is their 'line-height'.
155
156         The line box height is the distance between the uppermost box top and the lowermost box bottom.
157
158         The minimum height consists of a minimum height above the baseline and a minimum depth below it,
159         exactly as if each line box starts with a zero-width inline box with the element's font and line height properties.
160         We call that imaginary box a "strut." (The name is inspired by TeX.).
161
162         Test: fast/inline/inline-content-with-image-simple.html
163
164         * layout/Verification.cpp:
165         (WebCore::Layout::checkForMatchingNonTextRuns):
166         (WebCore::Layout::checkForMatchingTextRuns):
167         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
168         * layout/inlineformatting/InlineFormattingContext.cpp:
169         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
170         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
171         (WebCore::Layout::InlineFormattingContext::createFinalRuns const):
172         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
173         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
174         * layout/inlineformatting/InlineFormattingContext.h:
175         (WebCore::Layout::InlineFormattingContext::Line::logicalHeight const):
176         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
177         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
178         * layout/inlineformatting/InlineRun.h:
179         (WebCore::Layout::InlineRun::logicalWidth const):
180         (WebCore::Layout::InlineRun::logicalHeight const):
181         (WebCore::Layout::InlineRun::setLogicalWidth):
182         (WebCore::Layout::InlineRun::width const): Deleted.
183         (WebCore::Layout::InlineRun::height const): Deleted.
184         (WebCore::Layout::InlineRun::setWidth): Deleted.
185         * layout/inlineformatting/Line.cpp:
186         (WebCore::Layout::InlineFormattingContext::Line::init):
187         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
188         (WebCore::Layout::InlineFormattingContext::Line::close):
189         * layout/layouttree/LayoutTreeBuilder.cpp:
190         (WebCore::Layout::outputInlineRuns):
191
192 2018-11-23  Antti Koivisto  <antti@apple.com>
193
194         UI side compositing doesn't paint on Mac
195         https://bugs.webkit.org/show_bug.cgi?id=191908
196
197         Reviewed by Tim Horton.
198
199         For clarity put RGB10 and RGB10A8 formats behind PLATFORM(IOS_FAMILY). They are not supported on Mac.
200
201         * platform/graphics/cocoa/IOSurface.h:
202         * platform/graphics/cocoa/IOSurface.mm:
203         (WebCore::IOSurface::IOSurface):
204         (WebCore::IOSurface::ensurePlatformContext):
205         (WebCore::IOSurface::format const):
206         (WebCore::operator<<):
207
208 2018-11-23  Javier Fernandez  <jfernandez@igalia.com>
209
210         [css-grid] Implement Baseline Alignment for grid items
211         https://bugs.webkit.org/show_bug.cgi?id=145566
212
213         Reviewed by Manuel Rego Casasnovas.
214
215         This patch impements the Baseline Self-Alignment feature for grid items according to
216         the CSS Box Alignment specification [1].
217
218         This new layout logic is handled by the Self-Alignment (justify-self and align-self)
219         and Default-Alignment (justify-items and align-items) CSS properties.
220
221         This feature allows users to align the grid items sharing a Baseline Alignment Context,
222         either row or column contexts, based on their respective baselines.
223
224         [1] https://drafts.csswg.org/css-align-3/#baseline-align-self
225
226         Tests: fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html
227                fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html
228                fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html
229                fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html
230                fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html
231                fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html
232
233         * Sources.txt:
234         * rendering/GridBaselineAlignment.cpp: Added.
235         (WebCore::GridBaselineAlignment::marginOverForChild const):
236         (WebCore::GridBaselineAlignment::marginUnderForChild const):
237         (WebCore::GridBaselineAlignment::logicalAscentForChild const):
238         (WebCore::GridBaselineAlignment::ascentForChild const):
239         (WebCore::GridBaselineAlignment::descentForChild const):
240         (WebCore::GridBaselineAlignment::isDescentBaselineForChild const):
241         (WebCore::GridBaselineAlignment::isHorizontalBaselineAxis const):
242         (WebCore::GridBaselineAlignment::isOrthogonalChildForBaseline const):
243         (WebCore::GridBaselineAlignment::isParallelToBaselineAxisForChild const):
244         (WebCore::GridBaselineAlignment::baselineGroupForChild const):
245         (WebCore::GridBaselineAlignment::updateBaselineAlignmentContext):
246         (WebCore::GridBaselineAlignment::baselineOffsetForChild const):
247         (WebCore::GridBaselineAlignment::clear):
248         (WebCore::BaselineGroup::BaselineGroup):
249         (WebCore::BaselineGroup::update):
250         (WebCore::BaselineGroup::isOppositeBlockFlow const):
251         (WebCore::BaselineGroup::isOrthogonalBlockFlow const):
252         (WebCore::BaselineGroup::isCompatible const):
253         (WebCore::BaselineContext::BaselineContext):
254         (WebCore::BaselineContext::sharedGroup const):
255         (WebCore::BaselineContext::updateSharedGroup):
256         (WebCore::BaselineContext::findCompatibleSharedGroup):
257         * rendering/GridBaselineAlignment.h: Added.
258         (WebCore::BaselineGroup::maxAscent const):
259         (WebCore::BaselineGroup::maxDescent const):
260         (WebCore::BaselineGroup::size const):
261         (WebCore::isBaselinePosition):
262         (WebCore::GridBaselineAlignment::setBlockFlow):
263         * rendering/GridLayoutFunctions.h:
264         * rendering/GridTrackSizingAlgorithm.cpp:
265         (WebCore::gridAxisForDirection):
266         (WebCore::gridDirectionForAxis):
267         (WebCore::GridTrackSizingAlgorithm::availableSpace const):
268         (WebCore::GridTrackSizingAlgorithm::isIntrinsicSizedGridArea const):
269         (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
270         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
271         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
272         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
273         (WebCore::GridTrackSizingAlgorithm::canParticipateInBaselineAlignment const):
274         (WebCore::GridTrackSizingAlgorithm::participateInBaselineAlignment const):
275         (WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext):
276         (WebCore::GridTrackSizingAlgorithm::baselineOffsetForChild const):
277         (WebCore::GridTrackSizingAlgorithm::clearBaselineItemsCache):
278         (WebCore::GridTrackSizingAlgorithm::cacheBaselineAlignedItem):
279         (WebCore::GridTrackSizingAlgorithm::copyBaselineItemsCache):
280         (WebCore::GridTrackSizingAlgorithm::setup):
281         (WebCore::GridTrackSizingAlgorithm::computeBaselineAlignmentContext):
282         * rendering/GridTrackSizingAlgorithm.h:
283         * rendering/RenderBlockFlow.cpp:
284         (WebCore::RenderBlockFlow::firstLineBaseline const):
285         * rendering/RenderGrid.cpp:
286         (WebCore::RenderGrid::layoutBlock):
287         (WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
288         (WebCore::RenderGrid::placeItemsOnGrid const):
289         (WebCore::RenderGrid::performGridItemsPreLayout const):
290         (WebCore::synthesizedBaselineFromMarginBox):
291         (WebCore::RenderGrid::isBaselineAlignmentForChild const):
292         (WebCore::RenderGrid::baselinePosition const):
293         (WebCore::RenderGrid::firstLineBaseline const):
294         (WebCore::RenderGrid::inlineBlockBaseline const):
295         (WebCore::RenderGrid::columnAxisBaselineOffsetForChild const):
296         (WebCore::RenderGrid::rowAxisBaselineOffsetForChild const):
297         (WebCore::RenderGrid::columnAxisOffsetForChild const):
298         (WebCore::RenderGrid::rowAxisOffsetForChild const):
299         * rendering/RenderGrid.h:
300
301 2018-11-22  Wenson Hsieh  <wenson_hsieh@apple.com>
302
303         Address post-review feedback after r238438
304         https://bugs.webkit.org/show_bug.cgi?id=191913
305
306         Reviewed by Ryosuke Niwa.
307
308         Replace `bool` arguments to `FrameSelection::setSelectedRange`, `Editor::replaceSelectionWithText`, and
309         `Editor::replaceSelectionWithFragment` with `enum class`es instead. In particular, introduce the following:
310
311         FrameSelection::ShouldCloseTyping { No, Yes }
312         Editor::SelectReplacement { No, Yes }
313         Editor::SmartReplace { No, Yes }
314         Editor::MatchStyle { No, Yes }
315
316         * accessibility/AccessibilityObject.cpp:
317         (WebCore::AccessibilityObject::selectText):
318         * editing/Editor.cpp:
319         (WebCore::Editor::handleTextEvent):
320         (WebCore::Editor::replaceSelectionWithFragment):
321         (WebCore::Editor::replaceSelectionWithText):
322         (WebCore::Editor::setComposition):
323         (WebCore::Editor::markMisspellingsAfterTypingToWord):
324         (WebCore::Editor::changeBackToReplacedString):
325         (WebCore::Editor::transpose):
326         (WebCore::Editor::insertAttachment):
327
328         At various call sites, replace boolean arguments with named enums.
329
330         * editing/Editor.h:
331         * editing/EditorCommand.cpp:
332         (WebCore::expandSelectionToGranularity):
333         (WebCore::executeDeleteToMark):
334         (WebCore::executeSelectToMark):
335         * editing/FrameSelection.cpp:
336         (WebCore::FrameSelection::setSelectedRange):
337         * editing/FrameSelection.h:
338         * page/Page.cpp:
339         (WebCore::replaceRanges):
340
341         Avoid a bit of ref-count churn, and adjust a few functions to take `const Vector&`s instead of `Vector&&`s.
342
343         (WebCore::Page::replaceRangesWithText):
344         (WebCore::Page::replaceSelectionWithText):
345         * page/Page.h:
346
347 2018-11-21  Ryosuke Niwa  <rniwa@webkit.org>
348
349         Modernize SVGURIReference::targetElementFromIRIString
350         https://bugs.webkit.org/show_bug.cgi?id=191898
351
352         Reviewed by Daniel Bates.
353
354         Made targetElementFromIRIString return an element and the fragment identifier,
355         and merged urlFromIRIStringWithFragmentIdentifier into it.
356
357         Also replaced the code computing the full URL using the base URL after removing
358         the fragment identifier and rejoining it later with a single call to completeURL.
359
360         No new tests since there should be no observable behavior change.
361
362         * accessibility/AccessibilitySVGElement.cpp:
363         (WebCore::AccessibilitySVGElement::targetForUseElement const):
364         * css/CSSCursorImageValue.cpp:
365         (WebCore::CSSCursorImageValue::updateCursorElement):
366         * rendering/svg/RenderSVGTextPath.cpp:
367         (WebCore::RenderSVGTextPath::layoutPath const):
368         * svg/SVGAltGlyphElement.cpp:
369         (WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
370         * svg/SVGFEImageElement.cpp:
371         (WebCore::SVGFEImageElement::buildPendingResource):
372         * svg/SVGGlyphRefElement.cpp:
373         (WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
374         * svg/SVGLinearGradientElement.cpp:
375         (WebCore::SVGLinearGradientElement::collectGradientAttributes):
376         * svg/SVGMPathElement.cpp:
377         (WebCore::SVGMPathElement::buildPendingResource):
378         (WebCore::SVGMPathElement::pathElement):
379         * svg/SVGRadialGradientElement.cpp:
380         (WebCore::SVGRadialGradientElement::collectGradientAttributes):
381         * svg/SVGTRefElement.cpp:
382         (WebCore::SVGTRefElement::detachTarget):
383         (WebCore::SVGTRefElement::buildPendingResource):
384         * svg/SVGTextPathElement.cpp:
385         (WebCore::SVGTextPathElement::buildPendingResource):
386         * svg/SVGURIReference.cpp:
387         (WebCore::SVGURIReference::targetElementFromIRIString):
388         (WebCore::urlFromIRIStringWithFragmentIdentifier): Deleted.
389         * svg/SVGURIReference.h:
390         * svg/SVGUseElement.cpp:
391         (WebCore::SVGUseElement::findTarget const):
392         * svg/animation/SVGSMILElement.cpp:
393         (WebCore::SVGSMILElement::buildPendingResource):
394         * svg/graphics/filters/SVGFEImage.cpp:
395         (WebCore::FEImage::referencedRenderer const):
396
397 2018-11-22  Dean Jackson  <dino@apple.com>
398
399         Implement WebGPUQueue and device.getQueue()
400         https://bugs.webkit.org/show_bug.cgi?id=191911
401         <rdar://problem/46214871>
402
403         Reviewed by Antoine Quint.
404
405         Implement WebGPUDevice::getQueue(), which creates a WebGPUQueue
406         instance if necessary. Also link WebGPUQueue to the existing
407         GPUQueue object, and expose the label IDL property.
408
409         This patch is based on some work from Justin Fan.
410
411         Test: webgpu/queue-creation.html
412
413         * DerivedSources.make:
414         * Sources.txt:
415         * WebCore.xcodeproj/project.pbxproj:
416             New files.
417
418         * Modules/webgpu/WebGPUCommandBuffer.h:
419         (WebCore::WebGPUCommandBuffer::commandBuffer const):
420             Expose a GPUCommandBuffer getter, used when submitting (even though
421             the actual GPU submission isn't implemented yet).
422
423         * Modules/webgpu/WebGPUDevice.cpp:
424         (WebCore::WebGPUDevice::getQueue):
425         * Modules/webgpu/WebGPUDevice.h:
426         * Modules/webgpu/WebGPUDevice.idl:
427             Implement getQueue().
428
429         * Modules/webgpu/WebGPUQueue.cpp:
430         (WebCore::WebGPUQueue::create):
431         (WebCore::WebGPUQueue::WebGPUQueue):
432         (WebCore::WebGPUQueue::submit):
433         * Modules/webgpu/WebGPUQueue.h:
434         (WebCore::WebGPUQueue::label const):
435         (WebCore::WebGPUQueue::setLabel):
436         * Modules/webgpu/WebGPUQueue.idl:
437             New class. Mostly sends stuff onto GPUQueue.
438
439         * bindings/js/WebCoreBuiltinNames.h:
440             Add WebGPUQueue.
441
442         * platform/graphics/gpu/GPUQueue.h:
443         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
444         (WebCore::GPUQueue::create):
445         (WebCore::GPUQueue::submit):
446         (WebCore::GPUQueue::label const):
447         (WebCore::GPUQueue::setLabel const):
448             "label" getter/setter that uses
449             the underlying MTLCommandQueue label property, but prefixes
450             it with a WebKit identifier, so it can be correctly
451             identified in system crash logs as coming from WebGPU.
452
453 2018-11-22  Zalan Bujtas  <zalan@apple.com>
454
455         [LFC][IFC] Merge addNonBreakableStart/NonBreakableEnd calls.
456         https://bugs.webkit.org/show_bug.cgi?id=191903
457
458         Reviewed by Antti Koivisto.
459
460         * layout/inlineformatting/InlineFormattingContext.cpp:
461         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
462
463 2018-11-22  Zalan Bujtas  <zalan@apple.com>
464
465         [LFC][IFC] Offset formatting context root runs with horizontal margins.
466         https://bugs.webkit.org/show_bug.cgi?id=191900
467
468         Reviewed by Antti Koivisto.
469
470         Inline runs generated by formatting roots (inline-block) need to be adjusted with the horizontal margins.
471         (The test case has padding and border as well, but they are _inside_ the formatting context.)
472
473         Test: fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html
474
475         * layout/inlineformatting/InlineFormattingContext.cpp:
476         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
477
478 2018-11-22  Simon Fraser  <simon.fraser@apple.com>
479
480         Extremely small monospace text size when SVG is included as an img
481         https://bugs.webkit.org/show_bug.cgi?id=191834
482
483         Reviewed by Myles C. Maxfield.
484
485         Give defaultFixedFontSize a reasonable default value in Settings, so that clients
486         who omit to set it (like SVGImages) don't get broken rendering.
487
488         Test: svg/text/monospace-text-size-in-img.html
489
490         * page/Settings.yaml:
491
492 2018-11-22  Javier Fernandez  <jfernandez@igalia.com>
493
494         Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline
495         https://bugs.webkit.org/show_bug.cgi?id=191881
496
497         Reviewed by Manuel Rego Casasnovas.
498
499         We should use the font's descent value when wriring-mode flips line flow (vertical-lr).
500
501         This change also fixes bug 170175, since Flexbox use the same code to determine the first
502         line baseline of a flex item.
503
504         Test: fast/writing-mode/vertical-align-table-baseline-latin.html
505
506         * rendering/RenderBlockFlow.cpp:
507         (WebCore::RenderBlockFlow::firstLineBaseline const):
508
509 2018-11-21  Ryosuke Niwa  <rniwa@webkit.org>
510
511         Phantom focus/blur events fire on clicking between text input fields when listening with addEventListener
512         https://bugs.webkit.org/show_bug.cgi?id=179990
513
514         Reviewed by Tim Horton.
515
516         The bug was caused by TemporarySelectionChange which is used by TextIndicator::createWithRange
517         to set and restore the selection putting the focus on the newly mouse-down'ed input element
518         and restoring the focus back to the input element which originally had the focus immediately.
519
520         Fixed the bug by avoiding to set the focus since only selection highlights need to be updated here.
521         Also made TemporarySelectionOption an enum class.
522
523         Unfortunately, no new tests since force click testing is broken :( See <rdar://problem/31301721>.
524
525         * editing/Editor.cpp:
526         (WebCore::TemporarySelectionChange::TemporarySelectionChange):
527         (WebCore::TemporarySelectionChange::~TemporarySelectionChange):
528         (WebCore::TemporarySelectionChange::setSelection): Extracted. Fixed the bug by adding
529         FrameSelection::DoNotSetFocus to the option when TemporarySelectionOption::DoNotSetFocus is set.
530         * editing/Editor.h:
531         * page/DragController.cpp:
532         (WebCore::DragController::performDragOperation):
533         * page/TextIndicator.cpp:
534         (WebCore::TextIndicator::createWithRange): Set TemporarySelectionOption::DoNotSetFocus.
535
536 2018-11-21  Wenson Hsieh  <wenson_hsieh@apple.com>
537
538         [Cocoa] [WebKit2] Add support for replacing find-in-page text matches
539         https://bugs.webkit.org/show_bug.cgi?id=191786
540         <rdar://problem/45813871>
541
542         Reviewed by Ryosuke Niwa.
543
544         Add support for replacing Find-in-Page matches. See below for details. Covered by new layout tests as well as a
545         new API test.
546
547         Tests: editing/find/find-and-replace-adjacent-words.html
548                editing/find/find-and-replace-at-editing-boundary.html
549                editing/find/find-and-replace-basic.html
550                editing/find/find-and-replace-in-subframes.html
551                editing/find/find-and-replace-no-matches.html
552                editing/find/find-and-replace-noneditable-matches.html
553                editing/find/find-and-replace-replacement-text-input-events.html
554
555         API test: WebKit.FindAndReplace
556
557         * page/Page.cpp:
558         (WebCore::replaceRanges):
559         (WebCore::Page::replaceRangesWithText):
560
561         Add a helper that, given a list of Ranges, replaces each range with the given text. To do this, we first map
562         each Range to editing offsets within the topmost editable root for each Range. This results in a map of editable
563         root to list of editing offsets we need to replace. To apply the replacements, for each editable root in the
564         map, we iterate over each replacement range (i.e. an offset and length), set the current selection to contain
565         that replacement range, and use `Editor::replaceSelectionWithText`. To prevent prior text replacements from
566         clobbering the offsets of latter text replacement ranges, we also iterate backwards through text replacement
567         ranges when performing each replacement.
568
569         Likewise, we also apply text replacement to each editing container in backwards order: for nodes in the same
570         frame, we compare their position in the document, and for nodes in different frames, we instead compare their
571         frames in frame tree traversal order.
572
573         We map Ranges to editing offsets and back when performing text replacement because each text replacement may
574         split or merge text nodes, which causes adjacent Ranges to shrink or extend while replacing text. In an earlier
575         attempt to implement this, I simply iterated over each Range to replace and carried out text replacement for
576         each Range. This led to incorrect behavior in some cases, such as replacing adjacent matches. Thus, by computing
577         the set of text replacement offsets prior to replacing any text, we're able to target the correct ranges for
578         replacement.
579
580         (WebCore::Page::replaceSelectionWithText):
581
582         Add a helper method on Page to replace the current selection with some text. This simply calls out to
583         `Editor::replaceSelectionWithText`.
584
585         * page/Page.h:
586
587 2018-11-21  Andy Estes  <aestes@apple.com>
588
589         [Cocoa] Create a soft-linking file for PassKit
590         https://bugs.webkit.org/show_bug.cgi?id=191875
591         <rdar://problem/46203215>
592
593         Reviewed by Myles Maxfield.
594
595         * Modules/applepay/cocoa/PaymentContactCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
596         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm: Ditto.
597         * SourcesCocoa.txt: Removed @no-unify from PaymentMerchantSessionCocoa.mm.
598         * WebCore.xcodeproj/project.pbxproj: Removed PaymentMerchantSessionCocoa.mm from the WebCore target.
599         * rendering/RenderThemeCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
600
601 2018-11-21  Zalan Bujtas  <zalan@apple.com>
602
603         [LFC] LayoutState should always be initialized with the initial containing block.
604         https://bugs.webkit.org/show_bug.cgi?id=191896
605
606         Reviewed by Antti Koivisto.
607
608         There should always be only one LayoutState per layout tree (it does not mean that layout always starts at the ICB).
609         The ICB is a special formatting context root because it does not have a parent formatting context. All the other formatting contexts
610         first need to be laid out (partially at least e.g margin) in their parent formatting context.
611         Having a non-null parent formatting context as root could lead to undefined behaviour.
612
613         * layout/LayoutFormattingState.cpp:
614         (WebCore::Layout::LayoutState::LayoutState):
615         (WebCore::Layout::LayoutState::initializeRoot): Deleted.
616         * layout/LayoutFormattingState.h:
617         * layout/Verification.cpp:
618         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
619         * page/FrameViewLayoutContext.cpp:
620         (WebCore::layoutUsingFormattingContext):
621
622 2018-11-21  Zalan Bujtas  <zalan@apple.com>
623
624         [LFC][IFC] Horizontal margins should be considered as non-breakable space
625         https://bugs.webkit.org/show_bug.cgi?id=191894
626
627         Reviewed by Antti Koivisto.
628
629         Like padding and border, horizontal margins also force run breaks and offset them.
630
631         Test: fast/inline/inline-content-with-margin-left-right.html
632
633         * layout/inlineformatting/InlineFormattingContext.cpp:
634         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
635
636 2018-11-20  Ryosuke Niwa  <rniwa@webkit.org>
637
638         Mutation observers doesn't get notified of character data mutation made by the parser
639         https://bugs.webkit.org/show_bug.cgi?id=191874
640
641         Reviewed by Antti Koivisto.
642
643         Fixed the bug that CharacterData::parserAppendData was never notifying MutationObserver.
644
645         Test: fast/dom/MutationObserver/observe-parser-character-data-change.html
646
647         * dom/CharacterData.cpp:
648         (WebCore::CharacterData::parserAppendData):
649
650 2018-11-21  Claudio Saavedra  <csaavedra@igalia.com>
651
652         [SOUP] Follow-up robustness improvements to the certificate decoder
653         https://bugs.webkit.org/show_bug.cgi?id=191892
654
655         Reviewed by Michael Catanzaro.
656
657         If at any point the certificate fails to be constructed from
658         the DER data, bail out. Likewise, if the certificate returned
659         is NULL, return false from the decoder to notify the failure
660         to decode it.
661
662         * platform/network/soup/CertificateInfo.h:
663         (WTF::Persistence::certificateFromCertificatesDataList):
664         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
665
666 2018-11-21  Zalan Bujtas  <zalan@apple.com>
667
668         [LFC][IFC] Border should be considered as non-breakable space
669         https://bugs.webkit.org/show_bug.cgi?id=191891
670
671         Reviewed by Antti Koivisto.
672
673         Like padding, border also forces run breaks and offsets them.
674
675         Test: fast/inline/inline-content-with-border-left-right.html
676
677         * layout/inlineformatting/InlineFormattingContext.cpp:
678         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
679
680 2018-11-21  Zalan Bujtas  <zalan@apple.com>
681
682         [LFC][IFC] Use contains and containsAll in InlineFormattingContext::splitInlineRunIfNeeded consistently
683         https://bugs.webkit.org/show_bug.cgi?id=191890
684
685         Rearrange the comment numbers to match the logic below.
686
687         Reviewed by Antti Koivisto.
688
689         * layout/inlineformatting/InlineFormattingContext.cpp:
690         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
691
692 2018-11-20  Dean Jackson  <dino@apple.com>
693
694         Move WebGPU platform code to platform/graphics/gpu
695         https://bugs.webkit.org/show_bug.cgi?id=191867
696         <rdar://problem/46190993>
697
698         Reviewed by Antoine Quint.
699
700         The underlying implementation of WebGPU doesn't need to live in
701         Modules, since it technically could be used by other parts of the system. It
702         makes more sense for it to be in platform/graphics/gpu.
703
704         Move...
705         - Modules/webgpu/GPU* -> platform/graphics/gpu
706         - Modules/webgpu/cocoa -> platform/graphics/gpu/cocoa
707         - platform/graphics/gpu/GPULegacy* -> platform/graphics/gpu/legacy/
708         - platform/graphics/gpu/cocoa/GPULegacy* -> platform/graphics/gpu/legacy/cocoa
709
710         * Sources.txt:
711         * SourcesCocoa.txt:
712         * WebCore.xcodeproj/project.pbxproj:
713         * platform/graphics/gpu/GPUCommandBuffer.h: Renamed from Source/WebCore/Modules/webgpu/GPUCommandBuffer.h.
714         * platform/graphics/gpu/GPUDevice.cpp: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.cpp.
715         (WebCore::GPUDevice::createShaderModule const):
716         (WebCore::GPUDevice::createRenderPipeline const):
717         (WebCore::GPUDevice::createCommandBuffer):
718         (WebCore::GPUDevice::getQueue):
719         * platform/graphics/gpu/GPUDevice.h: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.h.
720         (WebCore::GPUDevice::platformDevice const):
721         * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineDescriptorBase.h.
722         * platform/graphics/gpu/GPUPipelineStageDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineStageDescriptor.h.
723         * platform/graphics/gpu/GPUQueue.h: Renamed from Source/WebCore/Modules/webgpu/GPUQueue.h.
724         (WebCore::GPUQueue::platformQueue const):
725         * platform/graphics/gpu/GPURenderPipeline.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipeline.h.
726         (WebCore::GPURenderPipeline::platformRenderPipeline const):
727         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipelineDescriptor.h.
728         * platform/graphics/gpu/GPUShaderModule.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModule.h.
729         (WebCore::GPUShaderModule::platformShaderModule const):
730         * platform/graphics/gpu/GPUShaderModuleDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModuleDescriptor.h.
731         * platform/graphics/gpu/GPUSwapChain.h: Renamed from Source/WebCore/Modules/webgpu/GPUSwapChain.h.
732         (WebCore::GPUSwapChain::platformLayer const):
733         * platform/graphics/gpu/GPUTexture.h: Renamed from Source/WebCore/Modules/webgpu/GPUTexture.h.
734         * platform/graphics/gpu/GPUTextureFormatEnum.h: Renamed from Source/WebCore/Modules/webgpu/GPUTextureFormatEnum.h.
735         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUCommandBufferMetal.mm.
736         (WebCore::GPUCommandBuffer::create):
737         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
738         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUDeviceMetal.mm.
739         (WebCore::GPUDevice::create):
740         (WebCore::GPUDevice::GPUDevice):
741         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUQueueMetal.mm.
742         (WebCore::GPUQueue::create):
743         (WebCore::GPUQueue::GPUQueue):
744         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipelineMetal.mm.
745         (WebCore::setFunctionsForPipelineDescriptor):
746         (WebCore::GPURenderPipeline::create):
747         (WebCore::GPURenderPipeline::GPURenderPipeline):
748         * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUShaderModuleMetal.mm.
749         (WebCore::GPUShaderModule::create):
750         (WebCore::GPUShaderModule::GPUShaderModule):
751         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChainMetal.mm.
752         (WebCore::GPUSwapChain::create):
753         (WebCore::GPUSwapChain::GPUSwapChain):
754         (WebCore::GPUSwapChain::setDevice):
755         (WebCore::platformTextureFormatForGPUTextureFormat):
756         (WebCore::GPUSwapChain::setFormat):
757         (WebCore::GPUSwapChain::reshape):
758         (WebCore::GPUSwapChain::getNextTexture):
759         (WebCore::GPUSwapChain::present):
760         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUTextureMetal.mm.
761         (WebCore::GPUTexture::create):
762         (WebCore::GPUTexture::GPUTexture):
763         (WebCore::GPUTexture::createDefaultTextureView):
764         * platform/graphics/gpu/legacy/GPULegacyBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.cpp.
765         (WebCore::GPULegacyBuffer::~GPULegacyBuffer):
766         (WebCore::GPULegacyBuffer::length const):
767         * platform/graphics/gpu/legacy/GPULegacyBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.h.
768         (WebCore::GPULegacyBuffer::contents const):
769         (WebCore::GPULegacyBuffer::metal const):
770         * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.cpp.
771         (WebCore::GPULegacyCommandBuffer::~GPULegacyCommandBuffer):
772         * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.h.
773         (WebCore::GPULegacyCommandBuffer::metal const):
774         * platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.cpp.
775         (WebCore::GPULegacyCommandQueue::~GPULegacyCommandQueue):
776         * platform/graphics/gpu/legacy/GPULegacyCommandQueue.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.h.
777         (WebCore::GPULegacyCommandQueue::metal const):
778         * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.cpp.
779         (WebCore::GPULegacyComputeCommandEncoder::~GPULegacyComputeCommandEncoder):
780         * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.h.
781         * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.cpp.
782         (WebCore::GPULegacyComputePipelineState::~GPULegacyComputePipelineState):
783         * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.h.
784         (WebCore::GPULegacyComputePipelineState::metal const):
785         * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.cpp.
786         (WebCore::GPULegacyDepthStencilDescriptor::~GPULegacyDepthStencilDescriptor):
787         * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.h.
788         (WebCore::GPULegacyDepthStencilDescriptor::metal const):
789         * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.cpp.
790         (WebCore::GPULegacyDepthStencilState::~GPULegacyDepthStencilState):
791         * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.h.
792         (WebCore::GPULegacyDepthStencilState::metal const):
793         * platform/graphics/gpu/legacy/GPULegacyDevice.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.cpp.
794         (WebCore::GPULegacyDevice::~GPULegacyDevice):
795         * platform/graphics/gpu/legacy/GPULegacyDevice.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.h.
796         (WebCore::GPULegacyDevice::layer const):
797         (WebCore::GPULegacyDevice::metal const):
798         (WebCore::GPULegacyDevice::markLayerComposited const):
799         * platform/graphics/gpu/legacy/GPULegacyDrawable.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.cpp.
800         (WebCore::GPULegacyDrawable::~GPULegacyDrawable):
801         * platform/graphics/gpu/legacy/GPULegacyDrawable.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.h.
802         * platform/graphics/gpu/legacy/GPULegacyEnums.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyEnums.h.
803         * platform/graphics/gpu/legacy/GPULegacyFunction.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.cpp.
804         (WebCore::GPULegacyFunction::~GPULegacyFunction):
805         * platform/graphics/gpu/legacy/GPULegacyFunction.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.h.
806         (WebCore::GPULegacyFunction::metal const):
807         * platform/graphics/gpu/legacy/GPULegacyLibrary.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.cpp.
808         (WebCore::GPULegacyLibrary::~GPULegacyLibrary):
809         * platform/graphics/gpu/legacy/GPULegacyLibrary.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.h.
810         (WebCore::GPULegacyLibrary::metal const):
811         * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.cpp.
812         (WebCore::GPULegacyRenderCommandEncoder::~GPULegacyRenderCommandEncoder):
813         * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.h.
814         * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.cpp.
815         (WebCore::GPULegacyRenderPassAttachmentDescriptor::~GPULegacyRenderPassAttachmentDescriptor):
816         * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.h.
817         * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.cpp.
818         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::~GPULegacyRenderPassColorAttachmentDescriptor):
819         * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.h.
820         * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.cpp.
821         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::~GPULegacyRenderPassDepthAttachmentDescriptor):
822         * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.h.
823         * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.cpp.
824         (WebCore::GPULegacyRenderPassDescriptor::~GPULegacyRenderPassDescriptor):
825         * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.h.
826         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp.
827         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::~GPULegacyRenderPipelineColorAttachmentDescriptor):
828         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.h.
829         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.cpp.
830         (WebCore::GPULegacyRenderPipelineDescriptor::~GPULegacyRenderPipelineDescriptor):
831         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.h.
832         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.cpp.
833         (WebCore::GPULegacyRenderPipelineState::~GPULegacyRenderPipelineState):
834         * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.h.
835         * platform/graphics/gpu/legacy/GPULegacySize.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacySize.h.
836         * platform/graphics/gpu/legacy/GPULegacyTexture.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.cpp.
837         (WebCore::GPULegacyTexture::~GPULegacyTexture):
838         * platform/graphics/gpu/legacy/GPULegacyTexture.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.h.
839         * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.cpp.
840         (WebCore::GPULegacyTextureDescriptor::~GPULegacyTextureDescriptor):
841         * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.h.
842         * platform/graphics/gpu/legacy/cocoa/GPULegacyBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyBufferMetal.mm.
843         (WebCore::GPULegacyBuffer::GPULegacyBuffer):
844         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandBufferMetal.mm.
845         (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
846         (WebCore::GPULegacyCommandBuffer::presentDrawable const):
847         (WebCore::GPULegacyCommandBuffer::commit const):
848         * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandQueueMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandQueueMetal.mm.
849         (WebCore::GPULegacyCommandQueue::GPULegacyCommandQueue):
850         (WebCore::GPULegacyCommandQueue::label const):
851         (WebCore::GPULegacyCommandQueue::setLabel const):
852         * platform/graphics/gpu/legacy/cocoa/GPULegacyComputeCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputeCommandEncoderMetal.mm.
853         (WebCore::MTLSizeMake):
854         (WebCore::GPULegacyComputeCommandEncoder::GPULegacyComputeCommandEncoder):
855         (WebCore::GPULegacyComputeCommandEncoder::setComputePipelineState const):
856         (WebCore::GPULegacyComputeCommandEncoder::setBuffer const):
857         (WebCore::GPULegacyComputeCommandEncoder::dispatch const):
858         (WebCore::GPULegacyComputeCommandEncoder::endEncoding const):
859         * platform/graphics/gpu/legacy/cocoa/GPULegacyComputePipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputePipelineStateMetal.mm.
860         (WebCore::GPULegacyComputePipelineState::GPULegacyComputePipelineState):
861         * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilDescriptorMetal.mm.
862         (WebCore::GPULegacyDepthStencilDescriptor::GPULegacyDepthStencilDescriptor):
863         (WebCore::GPULegacyDepthStencilDescriptor::depthWriteEnabled const):
864         (WebCore::GPULegacyDepthStencilDescriptor::setDepthWriteEnabled const):
865         (WebCore::GPULegacyDepthStencilDescriptor::depthCompareFunction const):
866         (WebCore::GPULegacyDepthStencilDescriptor::setDepthCompareFunction const):
867         * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilStateMetal.mm.
868         (WebCore::GPULegacyDepthStencilState::GPULegacyDepthStencilState):
869         (WebCore::GPULegacyDepthStencilState::label const):
870         (WebCore::GPULegacyDepthStencilState::setLabel const):
871         * platform/graphics/gpu/legacy/cocoa/GPULegacyDeviceMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDeviceMetal.mm.
872         (WebCore::GPULegacyDevice::GPULegacyDevice):
873         (WebCore::GPULegacyDevice::disconnect):
874         (WebCore::GPULegacyDevice::reshape const):
875         (WebCore::GPULegacyDevice::platformLayer const):
876         (WebCore::GPULegacyDevice::operator! const):
877         * platform/graphics/gpu/legacy/cocoa/GPULegacyDrawableMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDrawableMetal.mm.
878         (WebCore::GPULegacyDrawable::GPULegacyDrawable):
879         (WebCore::GPULegacyDrawable::release):
880         (WebCore::GPULegacyDrawable::metal const):
881         (WebCore::GPULegacyDrawable::texture const):
882         * platform/graphics/gpu/legacy/cocoa/GPULegacyFunctionMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyFunctionMetal.mm.
883         (WebCore::GPULegacyFunction::GPULegacyFunction):
884         (WebCore::GPULegacyFunction::name const):
885         (WebCore::GPULegacyFunction::operator! const):
886         * platform/graphics/gpu/legacy/cocoa/GPULegacyLibraryMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyLibraryMetal.mm.
887         (WebCore::GPULegacyLibrary::GPULegacyLibrary):
888         (WebCore::GPULegacyLibrary::label const):
889         (WebCore::GPULegacyLibrary::setLabel const):
890         (WebCore::GPULegacyLibrary::functionNames const):
891         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderCommandEncoderMetal.mm.
892         (WebCore::GPULegacyRenderCommandEncoder::GPULegacyRenderCommandEncoder):
893         (WebCore::GPULegacyRenderCommandEncoder::setRenderPipelineState const):
894         (WebCore::GPULegacyRenderCommandEncoder::setDepthStencilState const):
895         (WebCore::GPULegacyRenderCommandEncoder::setVertexBuffer const):
896         (WebCore::GPULegacyRenderCommandEncoder::setFragmentBuffer const):
897         (WebCore::GPULegacyRenderCommandEncoder::drawPrimitives const):
898         (WebCore::GPULegacyRenderCommandEncoder::endEncoding const):
899         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassAttachmentDescriptorMetal.mm.
900         (WebCore::GPULegacyRenderPassAttachmentDescriptor::GPULegacyRenderPassAttachmentDescriptor):
901         (WebCore::GPULegacyRenderPassAttachmentDescriptor::loadAction const):
902         (WebCore::GPULegacyRenderPassAttachmentDescriptor::setLoadAction const):
903         (WebCore::GPULegacyRenderPassAttachmentDescriptor::storeAction const):
904         (WebCore::GPULegacyRenderPassAttachmentDescriptor::setStoreAction const):
905         (WebCore::GPULegacyRenderPassAttachmentDescriptor::setTexture const):
906         (WebCore::GPULegacyRenderPassAttachmentDescriptor::metal const):
907         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm.
908         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::GPULegacyRenderPassColorAttachmentDescriptor):
909         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::clearColor const):
910         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::setClearColor const):
911         (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::metal const):
912         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm.
913         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::GPULegacyRenderPassDepthAttachmentDescriptor):
914         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::clearDepth const):
915         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::setClearDepth const):
916         (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::metal const):
917         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDescriptorMetal.mm.
918         (WebCore::GPULegacyRenderPassDescriptor::GPULegacyRenderPassDescriptor):
919         (WebCore::GPULegacyRenderPassDescriptor::colorAttachments const):
920         (WebCore::GPULegacyRenderPassDescriptor::depthAttachment const):
921         (WebCore::GPULegacyRenderPassDescriptor::metal const):
922         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm.
923         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::GPULegacyRenderPipelineColorAttachmentDescriptor):
924         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::pixelFormat const):
925         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::setPixelFormat const):
926         (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::metal const):
927         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineDescriptorMetal.mm.
928         (WebCore::GPULegacyRenderPipelineDescriptor::GPULegacyRenderPipelineDescriptor):
929         (WebCore::GPULegacyRenderPipelineDescriptor::depthAttachmentPixelFormat const):
930         (WebCore::GPULegacyRenderPipelineDescriptor::setDepthAttachmentPixelFormat const):
931         (WebCore::GPULegacyRenderPipelineDescriptor::setVertexFunction const):
932         (WebCore::GPULegacyRenderPipelineDescriptor::setFragmentFunction const):
933         (WebCore::GPULegacyRenderPipelineDescriptor::colorAttachments const):
934         (WebCore::GPULegacyRenderPipelineDescriptor::reset const):
935         (WebCore::GPULegacyRenderPipelineDescriptor::metal const):
936         * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineStateMetal.mm.
937         (WebCore::GPULegacyRenderPipelineState::GPULegacyRenderPipelineState):
938         (WebCore::GPULegacyRenderPipelineState::label const):
939         (WebCore::GPULegacyRenderPipelineState::setLabel const):
940         (WebCore::GPULegacyRenderPipelineState::metal const):
941         * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureDescriptorMetal.mm.
942         (WebCore::GPULegacyTextureDescriptor::GPULegacyTextureDescriptor):
943         (WebCore::GPULegacyTextureDescriptor::width const):
944         (WebCore::GPULegacyTextureDescriptor::setWidth const):
945         (WebCore::GPULegacyTextureDescriptor::height const):
946         (WebCore::GPULegacyTextureDescriptor::setHeight const):
947         (WebCore::GPULegacyTextureDescriptor::sampleCount const):
948         (WebCore::GPULegacyTextureDescriptor::setSampleCount const):
949         (WebCore::GPULegacyTextureDescriptor::textureType const):
950         (WebCore::GPULegacyTextureDescriptor::setTextureType const):
951         (WebCore::GPULegacyTextureDescriptor::storageMode const):
952         (WebCore::GPULegacyTextureDescriptor::setStorageMode const):
953         (WebCore::GPULegacyTextureDescriptor::usage const):
954         (WebCore::GPULegacyTextureDescriptor::setUsage const):
955         (WebCore::GPULegacyTextureDescriptor::metal const):
956         * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureMetal.mm.
957         (WebCore::GPULegacyTexture::GPULegacyTexture):
958         (WebCore::GPULegacyTexture::width const):
959         (WebCore::GPULegacyTexture::height const):
960         (WebCore::GPULegacyTexture::metal const):
961
962 2018-11-21  Adrian Perez de Castro  <aperez@igalia.com>
963
964         [SOUP] Certificate decoder always returns GByteArray with zero size
965         https://bugs.webkit.org/show_bug.cgi?id=191888
966
967         Reviewed by Žan Doberšek.
968
969         No new tests needed.
970
971         * platform/network/soup/CertificateInfo.h:
972         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Add missing
973         call to g_byte_array_set_size() to make sure byteArray->len has the
974         correct value.
975
976 2018-11-21  Zalan Butjas  <zalan@apple.com>
977
978         [LFC][IFC] Take nonBreakableStart/End into use.
979         https://bugs.webkit.org/show_bug.cgi?id=191873
980
981         Reviewed by Antti Koivisto.
982
983         Offset the final inline runs with the nonBreakableStart/End values.
984         (This patch also fixes relative positioned run verification.)
985
986         Test: fast/inline/inline-content-with-padding-left-right.html
987
988         * layout/Verification.cpp:
989         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
990         * layout/inlineformatting/InlineFormattingContext.cpp:
991         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
992
993 2018-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
994
995         REGRESSION(r237845): [cairo] Hyperlink underscore layout issue
996         https://bugs.webkit.org/show_bug.cgi?id=191630
997
998         Reviewed by Michael Catanzaro.
999
1000         Only flip Y in GlyphToPathTranslator for ports using CG.
1001
1002         * platform/graphics/FontCascade.cpp:
1003         (WebCore::GlyphToPathTranslator::GlyphToPathTranslator):
1004
1005 2018-11-21  Alicia Boya García  <aboya@igalia.com>
1006
1007         [MSE][GStreamer] Refactor AppendPipeline deinitialization
1008         https://bugs.webkit.org/show_bug.cgi?id=191759
1009
1010         Reviewed by Xabier Rodriguez-Calvar.
1011
1012         AppendPipeline currently has a method, clearPlayerPrivate(), that the
1013         client code uses to deinitialize most of the AppendPipeline... just
1014         before actually destructing it in the next line of code.
1015
1016         Since at that point there should not be alive RefPtr's pointing to the
1017         AppendPipeline there is no need for this kind of pre-deinitialization
1018         in this usage pattern. Instead, we can just rely on C++ destructors,
1019         cleaning the code a bit and removing the potential for the question
1020         "what if `clearPlayerPrivate() has been called before?`": it has not.
1021
1022         Assertions have been added to ensure that there is only one alive
1023         RefPtr pointing to AppendPipeline, therefore guaranteeing its immediate
1024         destruction.
1025
1026         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1027         (WebCore::AppendPipeline::~AppendPipeline):
1028         (WebCore::AppendPipeline::deinitialize):
1029         (WebCore::AppendPipeline::clearPlayerPrivate): Deleted.
1030         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1031         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1032         (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
1033         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
1034         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
1035
1036 2018-11-20  Dean Jackson  <dino@apple.com>
1037
1038         Removing using namespace WebCore from WebLayer
1039         https://bugs.webkit.org/show_bug.cgi?id=191870
1040         <rdar://problem/46192206>
1041
1042         Rubber-stamped by Sam Weinig.
1043
1044         Remove "using namespace WebCore" from WebLayer.mm
1045         because it will cause type clashes in unified source
1046         builds.
1047
1048         * platform/graphics/mac/WebLayer.mm:
1049         (-[WebLayer drawInContext:]):
1050         (-[WebSimpleLayer setNeedsDisplay]):
1051         (-[WebSimpleLayer setNeedsDisplayInRect:]):
1052         (-[WebSimpleLayer display]):
1053         (-[WebSimpleLayer drawInContext:]):
1054
1055 2018-11-20  Ryosuke Niwa  <rniwa@webkit.org>
1056
1057         Input element gains focus when a selectstart event listener on document prevents the default action
1058         https://bugs.webkit.org/show_bug.cgi?id=191714
1059         <rdar://problem/46174389>
1060
1061         Reviewed by Antti Koivisto.
1062
1063         The bug was caused by WebKit keep firing selectstart upon mousemove after the drag had already started
1064         when preventDefault had been called in the previous firings of selectstart event. Because input element
1065         has its own editable element and fires selectstart on the input element itself, which won't be prevented
1066         by selectstart on docuemnt, this allowed the selection to be set inside the input element even though
1067         the mouse cursor was simply passing over the input element after the drag had already started.
1068
1069         Fixed the bug by not firing selectstart if the default action had been prevented by the initial firing
1070         of selectstart by setting m_mouseDownMayStartDrag to false. This also matches the behaviors of Chrome
1071         and Firefox.
1072
1073         Test: fast/events/selectstart-prevent-default-should-not-focus-input.html
1074
1075         * page/EventHandler.cpp:
1076         (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
1077         (WebCore::EventHandler::updateSelectionForMouseDrag):
1078
1079 2018-11-20  Christopher Reid  <chris.reid@sony.com>
1080
1081         Remove the need for LocalizedStringsWPE.cpp
1082         https://bugs.webkit.org/show_bug.cgi?id=191854
1083
1084         Reviewed by Michael Catanzaro.
1085
1086         No change in behavior.
1087
1088         Consolidate "Search the Web" as the default search context menu text on non-COCOA ports.
1089
1090         GTK, WPE, and non-CF WIN all had the same default localizedString function
1091         of String::fromUTF8. Move that to LocalizedString.cpp as the default implementation
1092         for all ports not using CF.
1093
1094         * en.lproj/Localizable.strings:
1095         * platform/LocalizedStrings.cpp:
1096         * platform/gtk/LocalizedStringsGtk.cpp:
1097         * platform/win/LocalizedStringsWin.cpp:
1098         * platform/wpe/LocalizedStringsWPE.cpp: Removed.
1099
1100 2018-11-20  Zan Dobersek  <zdobersek@igalia.com>
1101
1102         Segfaults on https://terminalizer.com/
1103         https://bugs.webkit.org/show_bug.cgi?id=191805
1104
1105         Reviewed by Michael Catanzaro.
1106
1107         In HarfBuzzFace, the CacheEntry's HashMap object that caches Unicode
1108         codepoints and their corresponding glyph indices should allow zero
1109         values as valid keys since zero is a valid Unicode codepoint.
1110
1111         This change enables properly caching zero codepoints, avoiding
1112         repetitive additions to the HashMap cache that end up in a crash.
1113
1114         * platform/graphics/harfbuzz/HarfBuzzFace.h: Move the elongated
1115         GlyphCache type alias to the public section of HarfBuzzFace class
1116         declaration, making it reusable in the helper HarfBuzzFontData struct.
1117         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
1118
1119 2018-11-20  Antti Koivisto  <antti@apple.com>
1120
1121         Update hover state in composed tree
1122         https://bugs.webkit.org/show_bug.cgi?id=191860
1123
1124         Reviewed by Zalan Bujtas.
1125
1126         The code was already mostly switched over from render tree to composed tree.
1127         This patch replaces the remaining common ancestor search code with a DOM based equivalent.
1128
1129         * dom/Document.cpp:
1130         (WebCore::findNearestCommonComposedAncestor):
1131         (WebCore::Document::updateHoverActiveState):
1132         (WebCore::nearestCommonHoverAncestor): Deleted.
1133         * rendering/RenderBlock.cpp:
1134         (WebCore::RenderBlock::hoverAncestor const): Deleted.
1135         * rendering/RenderBlock.h:
1136         * rendering/RenderElement.cpp:
1137         (WebCore::RenderElement::hoverAncestor const): Deleted.
1138
1139         No longer needed.
1140
1141         * rendering/RenderElement.h:
1142
1143 2018-11-20  Zalan Bujtas  <zalan@apple.com>
1144
1145         [LFC][IFC] Measure run with non-breakable start/end.
1146         https://bugs.webkit.org/show_bug.cgi?id=191850
1147
1148         Reviewed by Antti Koivisto.
1149
1150         Line breaking needs to know the complete width of the run including padding etc.
1151
1152         * layout/Verification.cpp:
1153         (WebCore::Layout::collectFlowBoxSubtree):
1154         (WebCore::Layout::collectInlineBoxes):
1155         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
1156         * layout/inlineformatting/InlineFormattingContext.cpp:
1157         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1158         * layout/inlineformatting/InlineFormattingContext.h:
1159         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1160         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
1161         * layout/inlineformatting/InlineLineBreaker.cpp:
1162         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
1163         (WebCore::Layout::InlineLineBreaker::runWidth const):
1164         (WebCore::Layout::InlineLineBreaker::textWidth const):
1165         * layout/inlineformatting/InlineLineBreaker.h:
1166         * layout/inlineformatting/text/TextUtil.cpp:
1167         (WebCore::Layout::TextUtil::hyphenPositionBefore):
1168         (WebCore::Layout::TextUtil::width):
1169         (WebCore::Layout::TextUtil::fixedPitchWidth):
1170         (WebCore::Layout::TextUtil::TextUtil): Deleted.
1171         (WebCore::Layout::TextUtil::width const): Deleted.
1172         (WebCore::Layout::TextUtil::hyphenPositionBefore const): Deleted.
1173         (WebCore::Layout::TextUtil::textWidth const): Deleted.
1174         (WebCore::Layout::TextUtil::fixedPitchWidth const): Deleted.
1175         * layout/inlineformatting/text/TextUtil.h:
1176
1177 2018-11-20  Zalan Bujtas  <zalan@apple.com>
1178
1179         [LFC][IFC] InlineFormattingContext::Line should hold the list of runs for the current line.
1180         https://bugs.webkit.org/show_bug.cgi?id=191845
1181
1182         Reviewed by Antti Koivisto.
1183
1184         Collect the runs in InlineFormattingContext::Line and transfer them to InlineFormattingState during line closing.
1185         (In the most common cases, this is only one extra vector::append() call.)
1186
1187         * layout/inlineformatting/InlineFormattingContext.cpp:
1188         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1189         (WebCore::Layout::InlineFormattingContext::createFinalRuns const):
1190         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
1191         (WebCore::Layout::InlineFormattingContext::closeLine const):
1192         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
1193         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
1194         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
1195         (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const): Deleted.
1196         * layout/inlineformatting/InlineFormattingContext.h:
1197         (WebCore::Layout::InlineFormattingContext::Line::hasContent const):
1198         (WebCore::Layout::InlineFormattingContext::Line::runs):
1199         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1200         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
1201         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
1202         (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns):
1203         * layout/inlineformatting/Line.cpp:
1204         (WebCore::Layout::InlineFormattingContext::Line::init):
1205         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
1206         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
1207         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
1208         (WebCore::Layout::InlineFormattingContext::Line::close):
1209         (WebCore::Layout::InlineFormattingContext::Line::Line): Deleted.
1210
1211 2018-11-20  Zalan Butjas  <zalan@apple.com>
1212
1213         [LFC][IFC] Introduce InlineItem::nonBreakableStart/End
1214         https://bugs.webkit.org/show_bug.cgi?id=191839
1215
1216         Reviewed by Antti Koivisto.
1217
1218         Non-breakable start/end marks margin/padding/border space (even when it does not directly come from the associated layout box)
1219
1220         <span style="padding: 5px"><span>nested content with padding parent</span</span>
1221         <nested content with padding parent> <- inline run has 5px non-breakable start/end.
1222
1223         <span style="border: 5px solid green"><span style="padding-right: 10px; margin-right: 1px">1</span>2</span><span>    3</span>
1224         <1> <- inline run has 5px non-breakable start and 11px non-breakable end.
1225         <2> <- inline run has 0px non-breakable start and 5px non-breakable end.
1226         <3> <- no non-breakable values.
1227
1228         This is what the runs look like (input to line breaking)
1229         <     1           2     >
1230         < > (whitespace)
1231         <3>
1232         The line breaking treats the paddding/border etc space as part of the run and as non-breaking opportunity.
1233         With the given runs the first position where we can break the line is at the whitespace.
1234
1235         * layout/inlineformatting/InlineFormattingContext.cpp:
1236         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1237         * layout/inlineformatting/InlineItem.h:
1238         (WebCore::Layout::InlineItem::nonBreakableStart const):
1239         (WebCore::Layout::InlineItem::nonBreakableEnd const):
1240         (WebCore::Layout::InlineItem::addNonBreakableStart):
1241         (WebCore::Layout::InlineItem::addNonBreakableEnd):
1242
1243 2018-11-20  Zalan Bujtas  <zalan@apple.com>
1244
1245         [LFC][IFC] Move detaching rules from InlineFormattingState to InlineItem
1246         https://bugs.webkit.org/show_bug.cgi?id=191838
1247
1248         Reviewed by Antti Koivisto.
1249
1250         This is in preparation for adding more context to InlineItem. In addition to
1251         detaching rules it will also hold non-breakable start/end information.
1252
1253         * layout/inlineformatting/InlineFormattingContext.cpp:
1254         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
1255         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1256         * layout/inlineformatting/InlineFormattingState.cpp:
1257         (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
1258         (WebCore::Layout::InlineFormattingState::detachingRules const): Deleted.
1259         * layout/inlineformatting/InlineFormattingState.h:
1260         (WebCore::Layout::InlineFormattingState::setDetachingRules): Deleted.
1261         * layout/inlineformatting/InlineItem.h:
1262         (WebCore::Layout::InlineItem::addDetachingRule):
1263         (WebCore::Layout::InlineItem::detachingRules const):
1264
1265 2018-11-20  Zalan Bujjtas  <zalan@apple.com>
1266
1267         [LFC][IFC] InlineRunProvider::append() should just take const InlineItem&.
1268         https://bugs.webkit.org/show_bug.cgi?id=191837
1269
1270         Reviewed by Antti Koivisto.
1271
1272         This allows us to remove the InlineFormattingState dependency as well.
1273
1274         * layout/inlineformatting/InlineFormattingContext.cpp:
1275         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1276         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1277         * layout/inlineformatting/InlineRunProvider.cpp:
1278         (WebCore::Layout::InlineRunProvider::InlineRunProvider):
1279         (WebCore::Layout::InlineRunProvider::append):
1280         * layout/inlineformatting/InlineRunProvider.h:
1281
1282 2018-11-20  Thibault Saunier  <tsaunier@igalia.com>
1283
1284         [GStreamer] Enhance debugging by making sure to print the pipeline in MediaPlayerPrivateGStreamer
1285         https://bugs.webkit.org/show_bug.cgi?id=191586
1286
1287         Reviewed by Xabier Rodriguez-Calvar.
1288
1289         This is minor changes that do not require tests.
1290
1291         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1292         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
1293         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
1294         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
1295         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
1296         (WebCore::MediaPlayerPrivateGStreamer::commitLoad):
1297         (WebCore::MediaPlayerPrivateGStreamer::readyTimerFired):
1298         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
1299         (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
1300         (WebCore::MediaPlayerPrivateGStreamer::play):
1301         (WebCore::MediaPlayerPrivateGStreamer::pause):
1302         (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
1303         (WebCore::MediaPlayerPrivateGStreamer::seek):
1304         (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
1305         (WebCore::MediaPlayerPrivateGStreamer::paused const):
1306         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
1307         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
1308         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
1309         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
1310         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1311         (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
1312         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
1313         (WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const):
1314         (WebCore::MediaPlayerPrivateGStreamer::totalBytes const):
1315         (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
1316         (WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback):
1317         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
1318         (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
1319         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
1320         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
1321         (WebCore::MediaPlayerPrivateGStreamer::didEnd):
1322         (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
1323         (WebCore::MediaPlayerPrivateGStreamer::setPreload):
1324         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1325
1326 2018-11-20  Manuel Rego Casasnovas  <rego@igalia.com>
1327
1328         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
1329         https://bugs.webkit.org/show_bug.cgi?id=191656
1330
1331         Reviewed by Javier Fernandez.
1332
1333         We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
1334         that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
1335         but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
1336
1337         The patch modifies the method so it takes into account scrollbar size
1338         in order to compute the position of the columns/rows depending on the direction and the writing mode.
1339
1340         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
1341                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
1342                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
1343
1344         * rendering/RenderGrid.cpp:
1345         (WebCore::RenderGrid::populateGridPositionsForDirection):
1346
1347 2018-11-19  Ryosuke Niwa  <rniwa@webkit.org>
1348
1349         Click on node assigned to slot in button's shadow cause loss of button focus
1350         https://bugs.webkit.org/show_bug.cgi?id=191694
1351         <rdar://problem/46107920>
1352
1353         Reviewed by Wenson Hsieh.
1354
1355         Fixed the bug by traversing the parent in the composed tree when looking for an element to focus.
1356
1357         Test: fast/shadow-dom/focus-slot-parent.html
1358
1359         * page/EventHandler.cpp:
1360         (WebCore::EventHandler::dispatchMouseEvent): Fixed the bug. Also use RefPtr instead of a raw pointer.
1361
1362 2018-11-19  Fujii Hironori  <Hironori.Fujii@sony.com>
1363
1364         REGRESSION(r238350) [curl] CertificateInfo.h: error: template specialization requires 'template<>'
1365         https://bugs.webkit.org/show_bug.cgi?id=191849
1366
1367         Unreviewed build fix for clang-cl builds.
1368
1369         No new tests because there's no behaviour change.
1370
1371         * platform/network/curl/CertificateInfo.h:
1372         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
1373         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
1374
1375 2018-11-19  Basuke Suzuki  <basuke.suzuki@sony.com>
1376
1377         [Curl] Add API for CertificateInfo.
1378         https://bugs.webkit.org/show_bug.cgi?id=191647
1379
1380         Reviewed by Alex Christensen.
1381
1382         Minor changes for WebKit API.
1383
1384         Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp
1385
1386         * platform/network/curl/CertificateInfo.h:
1387         * platform/network/curl/CertificateInfoCurl.cpp:
1388         (WebCore::CertificateInfo::CertificateInfo):
1389         (WebCore::CertificateInfo::makeCertificate):
1390         * platform/network/curl/CurlSSLVerifier.cpp:
1391         (WebCore::BIOHolder::asCertificate):
1392
1393 2018-11-19  Justin Fan  <justin_fan@apple.com>
1394
1395         [WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormatEnum, and WebGPUSwapChain::configure upgrades
1396         https://bugs.webkit.org/show_bug.cgi?id=191794
1397
1398         Reviewed by Dean Jackson.
1399
1400         Test: webgpu/textures-textureviews.html
1401
1402         Implement basic functionality for getting the next WebGPUTexture and TextureView from the WebGPURenderingContext
1403         to use as a render destination for the next draw call. Also introduce WebGPUTextureFormatEnum and the ability to 
1404         configure the context with a chosen texture format. 
1405
1406         * CMakeLists.txt:
1407         * DerivedSources.make:
1408         * Modules/webgpu/GPUSwapChain.h: Texture/Pixel format can now be set.
1409         * Modules/webgpu/GPUTexture.h: Added. Interface to a MTLTexture.
1410         * Modules/webgpu/GPUTextureFormatEnum.h: Added.
1411         * Modules/webgpu/WebGPUDevice.cpp:
1412         (WebCore::WebGPUDevice::createRenderPipeline const): Removed now-unnecessary enum class cast.
1413         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Rather than duplicate GPURenderPipelineDescriptor::PrimitiveTopology, alias to it.
1414         * Modules/webgpu/WebGPUSwapChain.cpp:
1415         (WebCore::WebGPUSwapChain::configure): Can now specify a specific texture format for the underlying CAMetalLayer.
1416         (WebCore::WebGPUSwapChain::getNextTexture): Added. Request the next drawable texture.
1417         * Modules/webgpu/WebGPUSwapChain.h: Expose getNextTexture().
1418         * Modules/webgpu/WebGPUSwapChain.idl:
1419         * Modules/webgpu/WebGPUTexture.cpp: Added. 
1420         (WebCore::WebGPUTexture::create):
1421         (WebCore::WebGPUTexture::WebGPUTexture):
1422         (WebCore::WebGPUTexture::createDefaultTextureView):
1423         * Modules/webgpu/WebGPUTexture.h: Added.
1424         * Modules/webgpu/WebGPUTexture.idl: Added.
1425         * Modules/webgpu/WebGPUTextureFormatEnum.h: Added. Type alias for GPUTextureFormatEnum.
1426         * Modules/webgpu/WebGPUTextureFormatEnum.idl: Added. Used to represent any texture format used by WebGPU.
1427         * Modules/webgpu/WebGPUTextureView.cpp: Added.
1428         (WebCore::WebGPUTextureView::create):
1429         (WebCore::WebGPUTextureView::WebGPUTextureView):
1430         * Modules/webgpu/WebGPUTextureView.h: Added.
1431         * Modules/webgpu/WebGPUTextureView.idl: Added.
1432         * Modules/webgpu/cocoa/GPUSwapChainMetal.mm: 
1433         (WebCore::GPUSwapChain::create):
1434         (WebCore::GPUSwapChain::setFormat): Called by WebGPUSwapChain::configure().
1435         (WebCore::GPUSwapChain::getNextTexture):
1436         * Modules/webgpu/cocoa/GPUTextureFormatEnumMetal.mm: Added.
1437         (WebCore::convertAndValidate): Convert the WebGPUTextureFormatEnum to a MTLPixelFormat.
1438         * Modules/webgpu/cocoa/GPUTextureMetal.mm: Added.
1439         (WebCore::GPUTexture::create):
1440         (WebCore::GPUTexture::GPUTexture):
1441         (WebCore::GPUTexture::createDefaultTextureView): Uses the pixelFormat of the original texture.
1442         * Sources.txt:
1443         * SourcesCocoa.txt:
1444         * WebCore.xcodeproj/project.pbxproj:
1445         * bindings/js/WebCoreBuiltinNames.h:
1446
1447 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
1448
1449         Web Inspector: "Reload Web Inspector" button no longer partially works
1450         https://bugs.webkit.org/show_bug.cgi?id=191773
1451         <rdar://problem/46139932>
1452
1453         Reviewed by Devin Rousso.
1454
1455         * inspector/InspectorFrontendClient.h:
1456         * inspector/InspectorFrontendHost.cpp:
1457         (WebCore::InspectorFrontendHost::reopen):
1458         * inspector/InspectorFrontendHost.h:
1459         * inspector/InspectorFrontendHost.idl:
1460         Provide a host call to reopen an inspector window to reload it.
1461
1462         * testing/Internals.cpp:
1463         Stub implementation, this is not used in tests.
1464
1465 2018-11-19  Rob Buis  <rbuis@igalia.com>
1466
1467         Setting document.title should have no effect for non SVG/HTML documents
1468         https://bugs.webkit.org/show_bug.cgi?id=191643
1469
1470         Reviewed by Chris Dumez.
1471
1472         Setting document.title should have no effect for non SVG/HTML documents,
1473         see https://html.spec.whatwg.org/multipage/dom.html#document.title.
1474
1475         Behavior matches Firefox and Chrome.
1476
1477         Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html
1478
1479         * dom/Document.cpp:
1480         (WebCore::Document::setTitle):
1481
1482 2018-11-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1483
1484         Dragging image with a border-image larger than the image element crashes
1485         https://bugs.webkit.org/show_bug.cgi?id=191817
1486         <rdar://problem/46159222>
1487
1488         Reviewed by Ryosuke Niwa.
1489
1490         When dragging an image element, if the image element has:
1491
1492         (1) box-sizing: border-box;
1493         (2) a border-image
1494         (3) a border-top-width that is at least as large as the height of the element and/or a border-left-width that is
1495             at least as large as the width of the element
1496
1497         ...then upon drag, we will fail to create a suitable drag image using the bounding box of the image element
1498         since the size is empty, thereby causing a crash. To fix this, we bail out of this bounding-rect-dependent
1499         codepath for generating a drag image in the case where the bounding rect is empty, and instead fall back to an
1500         icon representation for the drag image.
1501
1502         Test: fast/events/drag-image-with-border-image.html
1503
1504         * page/DragController.cpp:
1505         (WebCore::DragController::doImageDrag):
1506
1507 2018-11-18  Zan Dobersek  <zdobersek@igalia.com>
1508
1509         HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap
1510         https://bugs.webkit.org/show_bug.cgi?id=191825
1511
1512         Reviewed by Michael Catanzaro.
1513
1514         The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry
1515         objects is used to map given Unicode codepoints to corresponding
1516         glyph indices (which occurs in the harfBuzzGetGlyph() function that's
1517         invoked by HarfBuzz).
1518
1519         The 16-bit unsigned integer as the map's value type is not enough here
1520         when the glyph index mapping is done through Freetype -- its API returns
1521         32-bit glyph indices, and Cairo assigns this value to the 64-bit
1522         unsigned index variable in the cairo_glyph_t struct. The value type is
1523         thus bumped to 32 bits to match the unsigned type size of the index's
1524         origin.
1525
1526         * platform/graphics/harfbuzz/HarfBuzzFace.h:
1527         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
1528
1529 2018-11-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1530
1531         [iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
1532         https://bugs.webkit.org/show_bug.cgi?id=191819
1533
1534         Reviewed by Dan Bernstein.
1535
1536         Replace UIItemProvider (and related classes) with NSItemProvider.
1537
1538         * platform/ios/PlatformPasteboardIOS.mm:
1539         (WebCore::registerItemToPasteboard):
1540         * platform/ios/WebItemProviderPasteboard.h:
1541         * platform/ios/WebItemProviderPasteboard.mm:
1542         (-[WebItemProviderDataRegistrar registerItemProvider:]):
1543         (-[WebItemProviderWritableObjectRegistrar initWithObject:]):
1544         (-[WebItemProviderWritableObjectRegistrar representingObject]):
1545         (-[WebItemProviderWritableObjectRegistrar registerItemProvider:]):
1546         (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
1547         (-[WebItemProviderRegistrationInfoList itemProvider]):
1548         (-[WebItemProviderPasteboard pasteboardTypes]):
1549         (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
1550         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
1551         (allLoadableClasses):
1552         (classForTypeIdentifier):
1553         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
1554         (-[WebItemProviderPasteboard numberOfFiles]):
1555         (-[WebItemProviderPasteboard itemProviderAtIndex:]):
1556         (-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
1557         * platform/mac/DragDataMac.mm:
1558         (WebCore::DragData::containsURL const):
1559
1560 2018-11-17  Ross Kirsling  <ross.kirsling@sony.com>
1561
1562         Remove superfluous LayoutUnit initializations
1563         https://bugs.webkit.org/show_bug.cgi?id=191791
1564
1565         Reviewed by Simon Fraser.
1566
1567         First step toward making LayoutUnit constructors explicit:
1568         eliminate `= 0` when constructing LayoutUnit lvalues.
1569
1570         * editing/Editor.cpp:
1571         (WebCore::Editor::firstRectForRange const):
1572         * editing/FrameSelection.cpp:
1573         (WebCore::FrameSelection::modify):
1574         (WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation):
1575         * html/shadow/SliderThumbElement.cpp:
1576         (WebCore::RenderSliderContainer::computeLogicalHeight const):
1577         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1578         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
1579         * page/FrameView.cpp:
1580         (WebCore::FrameView::forceLayoutForPagination):
1581         * page/SpatialNavigation.cpp:
1582         (WebCore::scrollInDirection):
1583         (WebCore::distanceDataForNode):
1584         * rendering/AutoTableLayout.cpp:
1585         (WebCore::AutoTableLayout::layout):
1586         * rendering/GridTrackSizingAlgorithm.cpp:
1587         (WebCore::marginIntrinsicLogicalWidthForChild):
1588         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
1589         * rendering/InlineFlowBox.cpp:
1590         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
1591         (WebCore::InlineFlowBox::paintFillLayer):
1592         (WebCore::InlineFlowBox::paintBoxDecorations):
1593         (WebCore::InlineFlowBox::paintMask):
1594         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
1595         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
1596         * rendering/RenderBlock.cpp:
1597         (WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const):
1598         (WebCore::RenderBlock::layoutPositionedObject):
1599         (WebCore::RenderBlock::selectionGapRectsForRepaint):
1600         (WebCore::RenderBlock::paintSelection):
1601         (WebCore::RenderBlock::textIndentOffset const):
1602         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
1603         * rendering/RenderBlockFlow.cpp:
1604         (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
1605         (WebCore::RenderBlockFlow::layoutBlock):
1606         (WebCore::RenderBlockFlow::layoutBlockChildren):
1607         (WebCore::RenderBlockFlow::marginValuesForChild const):
1608         (WebCore::RenderBlockFlow::estimateLogicalTopPosition):
1609         (WebCore::RenderBlockFlow::applyBeforeBreak):
1610         (WebCore::RenderBlockFlow::applyAfterBreak):
1611         (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
1612         (WebCore::RenderBlockFlow::clearFloats):
1613         (WebCore::RenderBlockFlow::lowestFloatLogicalBottom const):
1614         (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
1615         (WebCore::RenderBlockFlow::addOverhangingFloats):
1616         (WebCore::RenderBlockFlow::getClearDelta):
1617         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
1618         * rendering/RenderBlockLineLayout.cpp:
1619         (WebCore::setLogicalWidthForTextRun):
1620         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1621         (WebCore::RenderBlockFlow::determineStartPosition):
1622         * rendering/RenderBox.cpp:
1623         (WebCore::RenderBox::fillAvailableMeasure const):
1624         (WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const):
1625         (WebCore::RenderBox::computeLogicalWidthInFragmentUsing const):
1626         (WebCore::RenderBox::computePercentageLogicalHeight const):
1627         (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
1628         (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
1629         (WebCore::RenderBox::computePositionedLogicalHeightUsing const):
1630         (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
1631         (WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
1632         * rendering/RenderBoxModelObject.cpp:
1633         (WebCore::RenderBoxModelObject::computedCSSPadding const):
1634         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
1635         * rendering/RenderDeprecatedFlexibleBox.cpp:
1636         (WebCore::marginWidthForChild):
1637         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1638         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
1639         * rendering/RenderFileUploadControl.cpp:
1640         (WebCore::RenderFileUploadControl::paintObject):
1641         * rendering/RenderFragmentedFlow.cpp:
1642         (WebCore::RenderFragmentedFlow::validateFragments):
1643         (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
1644         (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
1645         * rendering/RenderFrameSet.cpp:
1646         (WebCore::RenderFrameSet::paint):
1647         * rendering/RenderListItem.cpp:
1648         (WebCore::RenderListItem::positionListMarker):
1649         * rendering/RenderListMarker.cpp:
1650         (WebCore::RenderListMarker::computePreferredLogicalWidths):
1651         (WebCore::RenderListMarker::updateMargins):
1652         * rendering/RenderMultiColumnSet.cpp:
1653         (WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const):
1654         * rendering/RenderRubyRun.cpp:
1655         (WebCore::RenderRubyRun::layoutBlock):
1656         * rendering/RenderTable.cpp:
1657         (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
1658         (WebCore::RenderTable::layout):
1659         (WebCore::RenderTable::offsetWidthForColumn const):
1660         (WebCore::RenderTable::offsetHeightForColumn const):
1661         (WebCore::RenderTable::outerBorderBefore const):
1662         (WebCore::RenderTable::outerBorderAfter const):
1663         (WebCore::RenderTable::outerBorderStart const):
1664         (WebCore::RenderTable::outerBorderEnd const):
1665         * rendering/RenderTableCell.cpp:
1666         (WebCore::RenderTableCell::logicalWidthFromColumns const):
1667         (WebCore::RenderTableCell::computeIntrinsicPadding):
1668         * rendering/RenderTableSection.cpp:
1669         (WebCore::RenderTableSection::calcRowLogicalHeight):
1670         (WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows):
1671         (WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows):
1672         (WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight):
1673         (WebCore::RenderTableSection::layoutRows):
1674         (WebCore::RenderTableSection::calcOuterBorderBefore const):
1675         (WebCore::RenderTableSection::calcOuterBorderAfter const):
1676         (WebCore::RenderTableSection::calcOuterBorderStart const):
1677         (WebCore::RenderTableSection::calcOuterBorderEnd const):
1678         * rendering/RootInlineBox.cpp:
1679         (WebCore::RootInlineBox::alignBoxesInBlockDirection):
1680         (WebCore::RootInlineBox::beforeAnnotationsAdjustment const):
1681         (WebCore::RootInlineBox::lineSnapAdjustment const):
1682         (WebCore::RootInlineBox::verticalPositionForBox):
1683         * rendering/line/BreakingContext.h:
1684         (WebCore::inlineLogicalWidth):
1685         * rendering/mathml/RenderMathMLBlock.cpp:
1686         (WebCore::RenderMathMLBlock::layoutItems):
1687         * rendering/mathml/RenderMathMLFraction.cpp:
1688         (WebCore::RenderMathMLFraction::layoutBlock):
1689         * rendering/mathml/RenderMathMLOperator.cpp:
1690         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
1691         * rendering/mathml/RenderMathMLRoot.cpp:
1692         (WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
1693         (WebCore::RenderMathMLRoot::paint):
1694         * rendering/mathml/RenderMathMLRow.cpp:
1695         (WebCore::RenderMathMLRow::computePreferredLogicalWidths):
1696         * rendering/mathml/RenderMathMLScripts.cpp:
1697         (WebCore::RenderMathMLScripts::layoutBlock):
1698         * rendering/mathml/RenderMathMLUnderOver.cpp:
1699         (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
1700         (WebCore::RenderMathMLUnderOver::layoutBlock):
1701         * rendering/style/RenderStyle.cpp:
1702         (WebCore::RenderStyle::getShadowInsetExtent const):
1703         * rendering/svg/RenderSVGText.cpp:
1704         (WebCore::RenderSVGText::layout):
1705
1706 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
1707
1708         Avoid triggering compositing updates when only the root layer is composited
1709         https://bugs.webkit.org/show_bug.cgi?id=191813
1710
1711         Reviewed by Zalan Bujtas.
1712
1713         If we know that the only composited layer is the root, we can avoid triggering deep
1714         compositing updates sometimes, for example when layout changes size or position,
1715         or when z-order lists change.
1716
1717         * rendering/RenderLayer.cpp:
1718         (WebCore::RenderLayer::addChild):
1719         (WebCore::RenderLayer::removeChild):
1720         (WebCore::RenderLayer::updateLayerPosition):
1721         (WebCore::RenderLayer::scrollTo):
1722         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
1723         (WebCore::outputPaintOrderTreeRecursive):
1724         * rendering/RenderLayerCompositor.cpp:
1725         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant()
1726         flag to cut off descendants traversal when possible.
1727         (WebCore::RenderLayerCompositor::layerStyleChanged):
1728
1729 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
1730
1731         Fix an error in 238354 - !=, not ==.
1732         
1733         Fixes test failures.
1734
1735         * rendering/RenderLayerCompositor.cpp:
1736         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
1737
1738 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
1739
1740         Clarify RenderLayerCompositor::hasAnyAdditionalCompositedLayers() and related code.
1741         https://bugs.webkit.org/show_bug.cgi?id=191810
1742
1743         Reviewed by Zalan Bujtas.
1744
1745         Rename m_compositedLayerCount to m_contentLayersCount and have it track layers other
1746         than the RenderView's layer.
1747
1748         hasAnyAdditionalCompositedLayers() is really about whether we can drop out of compositing
1749         because no content layer is composited, and overlays don't require compositing, so
1750         rename it.
1751
1752         * rendering/RenderLayerCompositor.cpp:
1753         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1754         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1755         (WebCore::RenderLayerCompositor::needsCompositingForContentOrOverlays const):
1756         (WebCore::RenderLayerCompositor::layerBecameComposited):
1757         (WebCore::RenderLayerCompositor::layerBecameNonComposited):
1758         (WebCore::RenderLayerCompositor::layerTreeAsText):
1759         (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): Deleted.
1760         * rendering/RenderLayerCompositor.h:
1761
1762 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
1763
1764         Rename RenderLayerCompositor::inCompositingMode() to usesCompositing()
1765         https://bugs.webkit.org/show_bug.cgi?id=191808
1766
1767         Reviewed by Zalan Bujtas.
1768
1769         Other code uses "usesCompositing" so standardize on that (future changes will make
1770         "compositing mode" more ambiguous). Also remove a FrameView function that only
1771         had one caller.
1772
1773         * page/FrameView.cpp:
1774         (WebCore::FrameView::clearBackingStores):
1775         (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange):
1776         (WebCore::FrameView::delegatesScrollingDidChange):
1777         (WebCore::FrameView::hasCompositedContent const): Deleted.
1778         * page/FrameView.h:
1779         * rendering/RenderLayer.cpp:
1780         (WebCore::RenderLayer::addChild):
1781         (WebCore::RenderLayer::removeChild):
1782         (WebCore::RenderLayer::rebuildZOrderLists):
1783         (WebCore::RenderLayer::updateLayerPosition):
1784         (WebCore::RenderLayer::scrollTo):
1785         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
1786         * rendering/RenderLayerCompositor.cpp:
1787         (WebCore::RenderLayerCompositor::updateCompositingPolicy):
1788         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1789         (WebCore::RenderLayerCompositor::layerStyleChanged):
1790         (WebCore::RenderLayerCompositor::updateBacking):
1791         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1792         (WebCore::RenderLayerCompositor::setIsInWindow):
1793         (WebCore::RenderLayerCompositor::needsToBeComposited const):
1794         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
1795         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
1796         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
1797         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
1798         * rendering/RenderLayerCompositor.h:
1799         * rendering/RenderView.cpp:
1800         (WebCore::RenderView::repaintViewAndCompositedLayers):
1801         (WebCore::RenderView::usesCompositing const):
1802
1803 2018-11-17  Devin Rousso  <drousso@apple.com>
1804
1805         Web Inspector: Network: add button to show system certificate dialog
1806         https://bugs.webkit.org/show_bug.cgi?id=191458
1807         <rdar://problem/45977019>
1808
1809         Reviewed by Joseph Pecoraro.
1810
1811         Test: http/tests/inspector/network/getSerializedCertificate.html
1812
1813         * inspector/agents/InspectorNetworkAgent.h:
1814         * inspector/agents/InspectorNetworkAgent.cpp:
1815         (WebCore::InspectorNetworkAgent::getSerializedCertificate): Added.
1816
1817         * inspector/InspectorFrontendHost.idl:
1818         * inspector/InspectorFrontendHost.h:
1819         * inspector/InspectorFrontendHost.cpp:
1820         (WebCore::InspectorFrontendHost::supportsShowCertificate): Added.
1821         (WebCore::InspectorFrontendHost::showCertificate): Added.
1822         * inspector/InspectorFrontendClient.h:
1823         (InspectorFrontendClient::showCertificate): Added.
1824         * testing/Internals.cpp:
1825         (InspectorStubFrontend::showCertificate): Added.
1826
1827         * platform/network/cf/CertificateInfo.h:
1828         (WTF::Persistence::encodeCFData): Added.
1829         (WTF::Persistence::decodeCFData): Added.
1830         (WTF::Persistence::encodeSecTrustRef): Added.
1831         (WTF::Persistence::decodeSecTrustRef): Added.
1832         (WTF::Persistence::encodeCertificateChain): Added.
1833         (WTF::Persistence::decodeCertificateChain): Added.
1834         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
1835         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
1836         * platform/network/cf/CertificateInfoCFNet.cpp:
1837         * platform/network/cocoa/CertificateInfoCocoa.mm:
1838
1839         * platform/network/curl/CertificateInfo.h:
1840         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
1841         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
1842
1843         * platform/network/soup/CertificateInfo.h:
1844         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode): Added.
1845         (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Added.
1846         (WTF::Persistence::certificatesDataListFromCertificateInfo): Added.
1847         (WTF::Persistence::certificateFromCertificatesDataList): Added.
1848         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
1849         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
1850
1851 2018-11-17  Zalan Bujtas  <zalan@apple.com>
1852
1853         [LFC][IFC] InlineFormattingState::addDetachingRule should accumulate rules.
1854         https://bugs.webkit.org/show_bug.cgi?id=191801
1855
1856         Reviewed by Antti Koivisto.
1857
1858         before<span style="position: relative">positioned</span>after
1859         In the example above the <positioned> inline box has both the BreakAtStart and the BreakAtEnd rules.
1860         While walking through the inline tree, we add BreakAtStart first and when we figure it's the last child too,
1861         we add BreakAtEnd as well. BreakAtEnd should not clear the BreakAtStart rule.
1862
1863         Test: fast/inline/simple-inline-with-out-of-flow-descendant2.html
1864
1865         * layout/inlineformatting/InlineFormattingContext.cpp:
1866         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1867         * layout/inlineformatting/InlineFormattingState.cpp:
1868         (WebCore::Layout::InlineFormattingState::addDetachingRule):
1869         * layout/inlineformatting/InlineFormattingState.h:
1870         (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
1871
1872 2018-11-17  Jonathan Hammer  <jonathan@e3software.com>
1873
1874         Caret stops blinking after context menu shown
1875         https://bugs.webkit.org/show_bug.cgi?id=191715
1876
1877         Reviewed by Ryosuke Niwa.
1878
1879         Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that
1880         the caret continues to blink even after the context menu is dismissed. The normal
1881         way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does
1882         not apply in the case of context menus because handleMouseReleaseEvent is not
1883         called once the context menu is up.
1884
1885         Test: fast/events/contextmenu-dismiss-blink-caret.html
1886
1887         * page/EventHandler.cpp:
1888         (WebCore::EventHandler::sendContextMenuEvent):
1889         * testing/Internals.cpp:
1890         (WebCore::Internals::isCaretBlinkingSuspended):
1891         * testing/Internals.h:
1892         * testing/Internals.idl:
1893
1894 2018-11-16  Antoine Quint  <graouts@apple.com>
1895
1896         [Pointer Events] event.isPrimary doesn't always represent the oldest active touch
1897         https://bugs.webkit.org/show_bug.cgi?id=191752
1898         <rdar://problem/46129270>
1899
1900         Reviewed by Dean Jackson.
1901
1902         Provide isPrimary to the constructor so its value can be determined at the call site.
1903
1904         Test: pointerevents/ios/pointer-events-is-primary.html
1905
1906         * dom/PointerEvent.h:
1907         * dom/ios/PointerEventIOS.cpp:
1908         (WebCore::PointerEvent::create):
1909         (WebCore::PointerEvent::PointerEvent):
1910         (WebCore::m_isPrimary):
1911
1912 2018-11-16  Alex Christensen  <achristensen@webkit.org>
1913
1914         Tweak _showSafeBrowsingWarningWithTitle SPI
1915         https://bugs.webkit.org/show_bug.cgi?id=191799
1916
1917         Reviewed by Wenson Hsieh.
1918
1919         It turns out I needed to expose both sentinel values used in safe browsing for my application of this SPI in Mac Safari.
1920         Allowing the caller to make its own sentinel values is insufficient because the malware confirmation needs to be over the warning.
1921         The completion handler parameter should just be a bool indicating whether the user has chosen to continue after all warnings.
1922
1923         Covered by updated API tests.
1924
1925         * en.lproj/Localizable.strings:
1926         * platform/LocalizedStrings.cpp:
1927         (WebCore::formControlCancelButtonTitle):
1928         Make "Cancel"'s description a little more generic.
1929
1930 2018-11-16  Simon Fraser  <simon.fraser@apple.com>
1931
1932         Optimize composited iframe layer hookup
1933         https://bugs.webkit.org/show_bug.cgi?id=191778
1934
1935         Reviewed by Zalan Bujtas.
1936
1937         The change made in r238229 can be more targeted; we only need to hook up iframe content
1938         layers when the layer is already composited (otherwise the updateBacking() above would have triggered
1939         the work), and when it's a RenderWidget layer.
1940         
1941         Tested by existing tests.
1942
1943         * rendering/RenderLayer.cpp:
1944         (WebCore::outputPaintOrderTreeRecursive):
1945         * rendering/RenderLayerCompositor.cpp:
1946         (WebCore::RenderLayerCompositor::layerStyleChanged):
1947
1948 2018-11-16  Ross Kirsling  <ross.kirsling@sony.com>
1949
1950         Provide default implementation of Widget
1951         https://bugs.webkit.org/show_bug.cgi?id=191784
1952
1953         Reviewed by Michael Catanzaro.
1954
1955         * SourcesWPE.txt:
1956         * platform/Widget.cpp:
1957         (WebCore::Widget::Widget):
1958         (WebCore::Widget::frameRect const):
1959         (WebCore::Widget::~Widget):
1960         (WebCore::Widget::setFrameRect):
1961         (WebCore::Widget::paint):
1962         (WebCore::Widget::setFocus):
1963         (WebCore::Widget::setCursor):
1964         (WebCore::Widget::show):
1965         (WebCore::Widget::hide):
1966         (WebCore::Widget::setIsSelected):
1967         * platform/gtk/WidgetGtk.cpp:
1968         (WebCore::Widget::Widget): Deleted.
1969         (WebCore::Widget::frameRect const): Deleted.
1970         * platform/win/WidgetWin.cpp:
1971         (WebCore::Widget::Widget): Deleted.
1972         (WebCore::Widget::frameRect const): Deleted.
1973         * platform/wpe/WidgetWPE.cpp: Removed.
1974
1975 2018-11-16  Chris Dumez  <cdumez@apple.com>
1976
1977         [macOS] Label "prewarmed" WebContent processes in Activity Monitor
1978         https://bugs.webkit.org/show_bug.cgi?id=191765
1979         <rdar://problem/45953463>
1980
1981         Reviewed by Geoffrey Garen.
1982
1983         * en.lproj/Localizable.strings:
1984
1985 2018-11-16  Jeremy Jones  <jeremyj@apple.com>
1986
1987         Enable external playback for video in element fullscreen.
1988         https://bugs.webkit.org/show_bug.cgi?id=190359
1989         rdar://problem/42560085
1990
1991         Reviewed by Jer Noble.
1992
1993         No new tests because we don't have a good way to test external playback.
1994
1995         Any video that might be auto-pipped from element fullscreen should also enable external playback for video out.
1996         PiP and external playback are mutually exclusive. Instead of preventing PiP when external playback is active,
1997         allow PiP, but disable external playback while PiP is active.
1998
1999         * html/HTMLMediaElement.cpp:
2000         (WebCore::HTMLMediaElement::setVideoFullscreenStandby):
2001         * html/HTMLMediaElement.h:
2002         * platform/graphics/MediaPlayer.cpp:
2003         (WebCore::MediaPlayer::setVideoFullscreenStandby):
2004         (WebCore::MediaPlayer::videoFullscreenStandby const):
2005         * platform/graphics/MediaPlayer.h:
2006         (WebCore::MediaPlayerClient::mediaPlayerVideoFullscreenStandby const):
2007         * platform/graphics/MediaPlayerPrivate.h:
2008         (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenStandby):
2009         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2010         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenStandby):
2011         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
2012
2013 2018-11-16  Jer Noble  <jer.noble@apple.com>
2014
2015         Regression(r233865): Causes synchronous IPC in the middle of layout
2016         https://bugs.webkit.org/show_bug.cgi?id=188307
2017         <rdar://problem/42807306>
2018
2019         Reviewed by Eric Carlson.
2020
2021         Revert the changes added in r233865. Rather than make a syncronous call to the UIProcess to
2022         query whether the view has been backgrounded while (e.g.) JS has been spinning, perform the
2023         steps of the requestFullscreen() method on the next run loop, allowing messages from the
2024         UIProcess about page visibilty to be delivered first.
2025
2026         * dom/Document.cpp:
2027         (WebCore::Document::requestFullScreenForElement):
2028         * html/HTMLMediaElement.cpp:
2029         (WebCore::HTMLMediaElement::enterFullscreen):
2030         * html/HTMLMediaElement.h:
2031         * page/ChromeClient.h:
2032
2033 2018-11-16  Ross Kirsling  <ross.kirsling@sony.com>
2034
2035         Provide default implementation of Cursor
2036         https://bugs.webkit.org/show_bug.cgi?id=191772
2037
2038         Reviewed by Michael Catanzaro.
2039
2040         * SourcesWPE.txt:
2041         * platform/Cursor.cpp:
2042         (WebCore::Cursor::ensurePlatformCursor const):
2043         * platform/wpe/CursorWPE.cpp: Removed.
2044
2045 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
2046
2047         EditorWPE should be EditorLibWPE
2048         https://bugs.webkit.org/show_bug.cgi?id=191774
2049
2050         Reviewed by Michael Catanzaro.
2051
2052         The platform specific implementations of Editor are all around the
2053         platform's Pasteboard. Since the Pasteboard implementation is now based
2054         around USE(LIBWPE) EditorWPE should be renamed to EditorLibWPE.
2055
2056         * SourcesWPE.txt:
2057         * editing/libwpe/EditorLibWPE.cpp: Renamed from Source/WebCore/editing/wpe/EditorWPE.cpp.
2058
2059 2018-11-16  Jeremy Jones  <jeremyj@apple.com>
2060
2061         Include AirPlay destination name in AirPlay placard.
2062         https://bugs.webkit.org/show_bug.cgi?id=191574
2063         rdar://problem/45536144
2064
2065         Reviewed by Eric Carlson.
2066
2067         Updated existing tests.
2068
2069         Include the name of the AirPlay destination in the video element's AirPlay placard.
2070
2071         * Modules/modern-media-controls/controls/airplay-placard.js:
2072         (AirplayPlacard):
2073         * Modules/modern-media-controls/controls/placard.js:
2074         * Modules/modern-media-controls/media/placard-support.js:
2075         (PlacardSupport.prototype._updatePlacard):
2076         (PlacardSupport.prototype._updateAirPlayPlacard):
2077         (PlacardSupport):
2078         * en.lproj/modern-media-controls-localized-strings.js:
2079
2080 2018-11-16  Zalan Bujtas  <zalan@apple.com>
2081
2082         Add DidFirstMeaningfulPaint milestone.
2083         https://bugs.webkit.org/show_bug.cgi?id=191754
2084
2085         Reviewed by Simon Fraser.
2086
2087         This milestone fires sone after the paint triggered by the first visually non-empty layout.
2088
2089         * page/FrameView.cpp:
2090         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
2091         (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
2092         * page/LayoutMilestone.h:
2093
2094 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
2095
2096         Provide default implementations of Image and Icon
2097         https://bugs.webkit.org/show_bug.cgi?id=191764
2098
2099         Reviewed by Michael Catanzaro.
2100
2101         Makes IconWPE and ImageWPE implementations the default.
2102
2103         * Sources.txt:
2104         * SourcesWPE.txt:
2105         * platform/graphics/Icon.cpp: Renamed from Source/WebCore/platform/graphics/wpe/IconWPE.cpp.
2106         * platform/graphics/Image.cpp:
2107         (WebCore::BitmapImage::invalidatePlatformData): Placed here for consistency with implementing ports.
2108         (WebCore::Image::loadPlatformResource):
2109         * platform/graphics/wpe/ImageWPE.cpp: Removed.
2110
2111 2018-11-16  Brent Fulgham  <bfulgham@apple.com>
2112
2113         [Win] Reduce the use of WKSI library calls: CFNetwork
2114         https://bugs.webkit.org/show_bug.cgi?id=191718
2115         <rdar://problem/46108732>
2116
2117         Reviewed by Alex Christensen.
2118
2119         Remove custom WKSI CFNetwork calls, since the SPI is already documented in PAL. Just
2120         make the same calls on Windows, like we did for iOS and macOS back in 2017.
2121
2122         Stop including WebKitSystemInterface.h for files that used to rely on it
2123         for font-related features.
2124         
2125         Tested by existing Windows regression tests. There should be no change in behavior.
2126
2127         * platform/graphics/win/FontCacheWin.cpp:
2128         * platform/graphics/win/FontCustomPlatformData.cpp:
2129         * platform/graphics/win/FontPlatformDataCGWin.cpp:
2130         * platform/network/cf/CookieStorageCFNet.cpp:
2131         * platform/network/cf/CredentialStorageCFNet.cpp:
2132         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2133         (WebCore::createPrivateStorageSession):
2134         (WebCore::NetworkStorageSession::switchToNewTestingSession):
2135         (WebCore::NetworkStorageSession::ensureSession):
2136         * platform/network/cf/ResourceError.h:
2137         * platform/network/cf/ResourceErrorCF.cpp:
2138         (WebCore::getSSLPeerCertificateData):
2139         (WebCore::setSSLPeerCertificateData):
2140         (WebCore::ResourceError::getSSLPeerCertificateDataBytePtr):
2141         (WebCore::ResourceError::platformLazyInit):
2142         (WebCore::ResourceError::cfError const):
2143         * platform/network/cf/ResourceHandleCFNet.cpp:
2144         (WebCore::setClientCertificateInSSLProperties):
2145         (WebCore::ResourceHandle::createCFURLConnection):
2146         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
2147         * platform/network/cf/ResourceRequestCFNet.cpp:
2148         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2149
2150 2018-11-16  Timothy Hatcher  <timothy@apple.com>
2151
2152         Add html{color:text} to the simpleUserAgentStyleSheet on macOS.
2153         https://bugs.webkit.org/show_bug.cgi?id=191760
2154
2155         Reviewed by Antti Koivisto.
2156
2157         * css/CSSDefaultStyleSheets.cpp: Added html{color:text} to simpleUserAgentStyleSheet inside
2158         a PLATFORM(MAC) copy of the string.
2159
2160 2018-11-16  Jer Noble  <jer.noble@apple.com>
2161
2162         An early return from updateSchedulingInfo can leave some variables uninitialized.
2163         https://bugs.webkit.org/show_bug.cgi?id=191755
2164         <rdar://problem/39910089>
2165
2166         Reviewed by Brent Fulgham.
2167
2168         * Modules/webaudio/AudioBufferSourceNode.cpp:
2169         (WebCore::AudioBufferSourceNode::process):
2170         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2171         (WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
2172         * Modules/webaudio/OscillatorNode.cpp:
2173         (WebCore::OscillatorNode::process):
2174
2175 2018-11-16  Alicia Boya García  <aboya@igalia.com>
2176
2177         [MSE][GStreamer] Ignore caps notifications when tearing down the pipeline
2178         https://bugs.webkit.org/show_bug.cgi?id=191578
2179
2180         Reviewed by Xabier Rodriguez-Calvar.
2181
2182         Changing the demuxer to READY state (which is done only in the main
2183         thread) triggers the unlinking of its srcpads, which in turns emits a
2184         caps change notification in the previously linked element since they
2185         become unnegotiated again.
2186
2187         We are not interested in caps notifications in these cases, so let's
2188         just ignore caps notifications emitted from the main thread.
2189
2190         This fixes an assertion failure in the debug builds.
2191
2192         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2193         (WebCore::AppendPipeline::AppendPipeline):
2194
2195 2018-11-16  Sihui Liu  <sihui_liu@apple.com>
2196
2197         Storing blobs in IDB on iOS: "Error preparing blob/file"
2198         https://bugs.webkit.org/show_bug.cgi?id=188438
2199         <rdar://problem/43097279>
2200
2201         Reviewed by Alex Christensen.
2202
2203         Grant sandbox extension of temp folder to network process, because we suggested network process had access to 
2204         the folder on iOS device but it didn't. 
2205
2206         This makes some existing tests about IDB blob pass on iOS device.
2207
2208         * Modules/indexeddb/server/IDBBackingStore.h:
2209         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
2210         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
2211         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
2212         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
2213         * Modules/indexeddb/shared/InProcessIDBServer.h:
2214
2215 2018-11-16  Don Olmstead  <don.olmstead@sony.com>
2216
2217         Add USE(LIBWPE) to WebCore
2218         https://bugs.webkit.org/show_bug.cgi?id=191401
2219
2220         Reviewed by Michael Catanzaro.
2221
2222         No new tests. No change in behavior.
2223
2224         Migrates all PLATFORM(WPE) code that calls into wpe_* APIs to
2225         USE(LIBWPE) instead.
2226
2227         Renames classes and files to use the suffix LibWPE.
2228
2229         * PlatformWPE.cmake:
2230         * SourcesWPE.txt:
2231         * platform/Pasteboard.h:
2232         * platform/PasteboardStrategy.h:
2233         * platform/PlatformKeyboardEvent.h:
2234         * platform/PlatformPasteboard.h:
2235         * platform/graphics/PlatformDisplay.cpp:
2236         (WebCore::PlatformDisplay::createPlatformDisplay):
2237         * platform/graphics/PlatformDisplay.h:
2238         * platform/graphics/egl/GLContextEGL.h:
2239         * platform/graphics/egl/GLContextEGLLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp.
2240         (WebCore::GLContextEGL::createWPEContext):
2241         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2242         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2243         * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp.
2244         (WebCore::PlatformDisplayLibWPE::create):
2245         (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE):
2246         (WebCore::PlatformDisplayLibWPE::~PlatformDisplayLibWPE):
2247         (WebCore::PlatformDisplayLibWPE::initialize):
2248         * platform/graphics/libwpe/PlatformDisplayLibWPE.h: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.h.
2249         * platform/libwpe/PasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PasteboardWPE.cpp.
2250         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformKeyboardEventWPE.cpp.
2251         * platform/libwpe/PlatformPasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp.
2252
2253 2018-11-16  Zalan Bujtas  <zalan@apple.com>
2254
2255         [iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click).
2256         https://bugs.webkit.org/show_bug.cgi?id=191712
2257         <rdar://problem/45612900>
2258
2259         Reviewed by Simon Fraser.
2260
2261         In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click.
2262         In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar)
2263         and no need to dispatch a click event.
2264         The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely
2265         only for tooltip-like reasons and it's ok to proceed with the click event.
2266
2267         Test: fast/events/touch/ios/click-instead-of-hover-simple.html
2268
2269         * rendering/updating/RenderTreeUpdater.cpp:
2270         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
2271
2272 2018-11-16  Zalan Bujtas  <zalan@apple.com>
2273
2274         [LFC][IFC] Add support for out-of-flow positioned boxes
2275         https://bugs.webkit.org/show_bug.cgi?id=191726
2276
2277         Reviewed by Antti Koivisto.
2278
2279         While laying out formatting context roots (inline-block, floats) in an inline formatting context, we need to make sure
2280         that their out-of-flow descendants get laid out as well.
2281
2282         Test: fast/inline/simple-inline-with-out-of-flow-descendant.html
2283
2284         * layout/inlineformatting/InlineFormattingContext.cpp:
2285         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2286         * layout/layouttree/LayoutTreeBuilder.cpp: This was returning the wrong context root when the container was also a context root.
2287         (WebCore::Layout::TreeBuilder::createSubTree):
2288
2289 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
2290
2291         [GStreamer][WebRTC] Add API to enable/disable device mocks
2292         https://bugs.webkit.org/show_bug.cgi?id=191699
2293
2294         This basically us to test MediaStream/WebRTC support without
2295         requiring cameras or microphones and is quite useful.
2296
2297         Also fix the GStreamerAudioMock by:
2298           - Stop setting `leaky-upstream` on the GStreamerCapturer queue,
2299             this was usefull when we were trying to bring the MediaStream
2300             sources inside the main pipeline, it is not the case anymore
2301             (and not doable with latest version of LibWebRTC).
2302           - Use a 'ticks' wave on the gstreamer audiotestsrc so the test
2303             stream is similar to what Apple port does.
2304
2305         Reviewed by Xabier Rodriguez-Calvar.
2306
2307         The mocks are already tested and the API is really simple.
2308
2309         * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
2310         (WebCore::GStreamerAudioCapturer::createSource):
2311         * platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
2312         * platform/mediastream/gstreamer/GStreamerCapturer.cpp:
2313         (WebCore::GStreamerCapturer::addSink):
2314         * platform/mediastream/gstreamer/GStreamerCapturer.h:
2315
2316 2018-11-16  Thibault Saunier  <tsaunier@igalia.com>
2317
2318         [GStreamer][MediaStream] Handle track addition and removal
2319         https://bugs.webkit.org/show_bug.cgi?id=191599
2320
2321         Reviewed by Xabier Rodriguez-Calvar.
2322
2323         Test: fast/mediastream/MediaStream-video-element-remove-track.html
2324
2325         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
2326         (WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver):
2327         (WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver):
2328         (WebCore::webkitMediaStreamSrcFinalize):
2329         (WebCore::webkitMediaStreamSrcChangeState):
2330         (WebCore::webkit_media_stream_src_init):
2331         (WebCore::webkitMediaStreamSrcSetupSrc):
2332         (WebCore::webkitMediaStreamSrcAddTrack):
2333         (WebCore::webkitMediaStreamSrcRemoveTrackByType):
2334         (WebCore::webkitMediaStreamSrcSetStream):
2335
2336 2018-11-16  Zan Dobersek  <zdobersek@igalia.com>
2337
2338         ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
2339         https://bugs.webkit.org/show_bug.cgi?id=191354
2340
2341         Reviewed by Michael Catanzaro.
2342
2343         ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
2344         index validity and, if the index is valid, check for completeness of the
2345         corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
2346         also only retrieve duration for already-complete frames.
2347
2348         Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
2349         as that method goes on and decodes image data to determine specific
2350         information. The ImageSource class that's querying this information
2351         doesn't anticipate this, and doesn't handle the increased memory
2352         consumption of the decoded data, leaving MemoryCache in the blind about
2353         the image resource's actual amount of consumed memory. ImageSource can
2354         instead gracefully handle any incomplete frame by marking the decoding
2355         status for this frame as only partial.
2356
2357         * platform/image-decoders/ScalableImageDecoder.cpp:
2358         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
2359         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
2360         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
2361
2362 2018-11-16  Antoine Quint  <graouts@apple.com>
2363
2364         PointerEvents should not require touch event listeners to be registered
2365         https://bugs.webkit.org/show_bug.cgi?id=191333
2366         <rdar://problem/45857523>
2367
2368         Reviewed by Dean Jackson.
2369
2370         Tests: pointerevents/ios/pointer-events-dispatch-on-touch.html
2371                pointerevents/ios/pointer-events-prevent-default.html
2372
2373         * dom/EventNames.h:
2374         (WebCore::EventNames::isTouchEventType const):
2375         (WebCore::EventNames::touchAndPointerEventNames const):
2376         (WebCore::EventNames::touchEventNames const): Deleted.
2377         * dom/Node.cpp:
2378         (WebCore::Node::moveNodeToNewDocument):
2379
2380 2018-11-15  Zalan Bujtas  <zalan@apple.com>
2381
2382         [iOS] Do not get stuck in indeterminate content observation state.
2383         https://bugs.webkit.org/show_bug.cgi?id=191719
2384
2385         Reviewed by Simon Fraser.
2386
2387         Reset the _WKContentChange flag to WKContentNoChange when the last observing timer is removed and we are in
2388         the "can't decide yet if it's a hover or click" state.
2389         This bug prevents us from firing click event when JS installs and removes the same set of timer(s) during mouse-move dispatch.
2390
2391         Test: fast/events/touch/ios/stuck-with-hover-state.html
2392
2393         * platform/ios/wak/WKContentObservation.cpp:
2394         (WebThreadRemoveObservedContentModifier):
2395
2396 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
2397
2398         REGRESSION (r238090) Composited iframes that resize from zero don't show
2399         https://bugs.webkit.org/show_bug.cgi?id=191733
2400         rdar://problem/46107764
2401
2402         Reviewed by Zalan Bujtas.
2403         
2404         A zero-sized iframe whose contents are composited should not trigger compositing in the
2405         parent document (see code in requiresCompositingForFrame()), but when the <iframe> element
2406         was resized without a style change (e.g. because it's width: 100%, height: 100% and the
2407         parent resizes), there was no code that triggered a compositing update.
2408
2409         Fix by having RenderLayer::updateLayerPosition() trigger an update when the size changes,
2410         for a RenderWidget whose contents are composited.
2411
2412         Test: compositing/iframes/resize-from-zero-size.html
2413
2414         * rendering/RenderLayer.cpp:
2415         (WebCore::RenderLayer::updateLayerPosition):
2416
2417 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
2418
2419         Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
2420         https://bugs.webkit.org/show_bug.cgi?id=158342
2421         rdar://problem/26652811
2422
2423         Reviewed by Zalan Bujtas.
2424         
2425         Patch partly by Frédéric Wang.
2426
2427         This commit fixes an issue when resizing the content of a -webkit-overflow-scrolling: touch
2428         overflow node on iOS. Indeed, the RenderLayerBacking's scrolling layer may not be properly
2429         created and hence the UIProcess receives a null UIScrollView pointer. This triggers an
2430         assertion in debug mode and prevents the user from scrolling the overflow node in release
2431         mode. This was partially fixed by the refactoring of bug 90342 but this commit addresses
2432         the remaining issues by forcing a configuration update after layout in order to ensure that
2433         RenderLayerBacking's scrolling layer is available. For an overflow element that is not yet
2434         composited, trigger a post-layout update that is necessary to check if we need to make it
2435         composited when it gains scrollable overflow.
2436
2437         Tests: fast/scrolling/ios/change-scrollability-on-content-resize-nested.html
2438                fast/scrolling/ios/change-scrollability-on-content-resize.html
2439
2440         * rendering/RenderLayer.cpp:
2441         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Force a configuration update so that
2442         RenderLayerCompositor::updateBackingAndHierarchy will later instantiate
2443         RenderLayerBacking::m_scrollingLayer.
2444
2445 2018-11-15  Fujii Hironori  <Hironori.Fujii@sony.com>
2446
2447         [curl] warning: delete called on non-final 'WebCore::CurlDownload' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
2448         https://bugs.webkit.org/show_bug.cgi?id=191582
2449
2450         Reviewed by Alex Christensen.
2451
2452         No new tests because there's no behaviour change.
2453
2454         * platform/network/curl/CurlDownload.h: Marked CurlDownload final.
2455
2456 2018-11-15  Truitt Savell  <tsavell@apple.com>
2457
2458         Unreviewed, rolling out r238244.
2459
2460         Caused High Sierra test runs to fail early with 50 crashes and
2461         casued 25 API failures.
2462
2463         Reverted changeset:
2464
2465         "[css-logical] Implement flow-relative margin, padding and
2466         border shorthands"
2467         https://bugs.webkit.org/show_bug.cgi?id=188697
2468         https://trac.webkit.org/changeset/238244
2469
2470 2018-11-15  Jer Noble  <jer.noble@apple.com>
2471
2472         AVKit will set videoGravity to a nil string when building against iosmac
2473         https://bugs.webkit.org/show_bug.cgi?id=191573
2474
2475         Reviewed by Dean Jackson.
2476
2477         Workaround AVKit behavior by treating nil videoGravity as the default,
2478         which is AVLayerVideoGravityResizeAspect.
2479
2480         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2481         (-[WebAVPlayerLayer setVideoGravity:]):
2482
2483 2018-11-15  Brent Fulgham  <bfulgham@apple.com>
2484
2485         [Win] Reduce the use of WKSI library calls: Font Handling
2486         https://bugs.webkit.org/show_bug.cgi?id=191701
2487         <rdar://problem/46104809>
2488
2489         Reviewed by Myles C. Maxfield.
2490
2491         Move the old Windows font handling code out of WKSI to our regular
2492         repository. We now handle SPI differently, and don't need to keep
2493         these implementations in a separate library. This should also help
2494         avoid the somewhat frequent build failures caused when WKSI is not
2495         updated in sync with WebKit.
2496
2497         Tested by existing Windows test cases.
2498
2499         * platform/graphics/FontCascade.h:
2500         * platform/graphics/win/FontCGWin.cpp:
2501         (WebCore::FontCascade::drawGlyphs):
2502         (WebCore::FontCascade::setFontSmoothingLevel):
2503         (WebCore::setCGFontSmoothingStyle):
2504         (WebCore::FontCascade::setFontSmoothingStyle):
2505         (WebCore::FontCascade::setFontSmoothingContrast):
2506         (WebCore::clearTypeContrast):
2507         (WebCore::FontCascade::systemFontSmoothingChanged):
2508         (WebCore::FontCascade::setCGContextFontRenderingStyle):
2509         (WebCore::renderingStyleForFont):
2510         (WebCore::FontCascade::getGlyphAdvances):
2511         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
2512         (WebCore::GlyphPage::fill):
2513         * platform/graphics/win/GraphicsContextCGWin.cpp:
2514         (WebCore::GraphicsContext::drawFocusRing):
2515         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
2516         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2517         (WebCore::Font::platformWidthForGlyph const):
2518         * rendering/RenderMediaControls.cpp:
2519         (WebCore::RenderMediaControls::adjustMediaSliderThumbSize):
2520
2521 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
2522
2523         [WebAuthN] Use a real nonce for CTAPHID_INIT
2524         https://bugs.webkit.org/show_bug.cgi?id=191533
2525         <rdar://problem/46103502>
2526
2527         Reviewed by Brent Fulgham.
2528
2529         New tests are added into existing test files.
2530
2531         * Modules/webauthn/fido/FidoConstants.h:
2532
2533 2018-11-15  Justin Fan  <justin_fan@apple.com>
2534
2535         [WebGPU] WebGPUCommandBuffer prototype
2536         https://bugs.webkit.org/show_bug.cgi?id=191663
2537
2538         Reviewed by Dean Jackson.
2539
2540         Begin implementation of WebGPUCommandBuffers as well as GPUQueues (MTLCommandBuffer, MTLCommandQueue).
2541
2542         Test: webgpu/command-buffers.html
2543
2544         * CMakeLists.txt:
2545         * DerivedSources.make:
2546         * Modules/webgpu/GPUCommandBuffer.h: Added. Wrapper class around a MTLCommandBuffer.
2547         * Modules/webgpu/GPUDevice.cpp:
2548         (WebCore::GPUDevice::createCommandBuffer): Added.
2549         (WebCore::GPUDevice::getQueue): Returns RefPtr to the device's singleton queue.
2550         * Modules/webgpu/GPUDevice.h: Now manages the device's GPUQueue.
2551         (WebCore::GPUDevice::platformDevice const):
2552         * Modules/webgpu/GPUQueue.h: Added. Wrapper class around a MTLCommandQueue.
2553         (WebCore::GPUQueue::platformQueue const):
2554         * Modules/webgpu/GPURenderPipeline.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipeline.h.
2555         (WebCore::GPURenderPipeline::platformRenderPipeline const):
2556         * Modules/webgpu/GPUShaderModule.h:
2557         (WebCore::GPUShaderModule::platformShaderModule const):
2558         * Modules/webgpu/GPUSwapChain.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChain.h.
2559         (WebCore::GPUSwapChain::platformLayer const):
2560         * Modules/webgpu/WebGPUCommandBuffer.cpp: Added. Web interface for a GPU device's command buffer.
2561         (WebCore::WebGPUCommandBuffer::create):
2562         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
2563         * Modules/webgpu/WebGPUCommandBuffer.h: Added.
2564         * Modules/webgpu/WebGPUCommandBuffer.idl: Added.
2565         * Modules/webgpu/WebGPUDevice.cpp:
2566         (WebCore::WebGPUDevice::createCommandBuffer const): Added.
2567         * Modules/webgpu/WebGPUDevice.h:
2568         * Modules/webgpu/WebGPUDevice.idl:
2569         * Modules/webgpu/cocoa/GPUCommandBufferMetal.mm: Added. MTLCommandBuffer impl for GPUCommandBuffer.
2570         (WebCore::GPUCommandBuffer::create): Create a MTLCommandBuffer from the MTLCommandQueue.
2571         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
2572         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
2573         (WebCore::GPUDevice::GPUDevice):
2574         * Modules/webgpu/cocoa/GPUQueueMetal.mm: Added. MTLCommandQueue impl for GPUQueue.
2575         (WebCore::GPUQueue::create):
2576         (WebCore::GPUQueue::GPUQueue):
2577         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
2578         (WebCore::GPURenderPipeline::GPURenderPipeline):
2579         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
2580         (WebCore::GPUShaderModule::create):
2581         (WebCore::GPUShaderModule::GPUShaderModule):
2582         * Sources.txt:
2583         * SourcesCocoa.txt:
2584         * WebCore.xcodeproj/project.pbxproj:
2585         * bindings/js/WebCoreBuiltinNames.h:
2586
2587 2018-11-15  Oriol Brufau  <obrufau@igalia.com>
2588
2589         [css-logical] Implement flow-relative margin, padding and border shorthands
2590         https://bugs.webkit.org/show_bug.cgi?id=188697
2591
2592         Reviewed by Simon Fraser and Antti Koivisto.
2593
2594         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
2595                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
2596                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
2597                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
2598                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
2599                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
2600                webexposed/css-properties-as-js-properties.html
2601                webexposed/css-properties-behind-flags.html
2602                webexposed/css-property-listing.html
2603
2604         * css/CSSComputedStyleDeclaration.cpp:
2605         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2606         Allow the new properties to serialize their computed value.
2607
2608         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
2609         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
2610         * css/CSSComputedStyleDeclaration.h:
2611         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
2612         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
2613         shorthands.
2614
2615         * css/CSSProperties.json:
2616         Add the new properties behind the CSSLogicalEnabled runtime flag.
2617
2618         * css/CSSStyleDeclaration.cpp:
2619         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
2620         Prevent CSS properties disabled behind a runtime flag from being exposed in
2621         style declarations.
2622
2623         * css/StyleProperties.cpp:
2624         (WebCore::StyleProperties::getPropertyValue const):
2625         Allow the new properties to serialize their specified value.
2626
2627         (WebCore::StyleProperties::get2Values const):
2628         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
2629
2630         (WebCore::StyleProperties::borderPropertyValue const):
2631         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
2632         corresponding to width, style and color.
2633
2634         (WebCore::MutableStyleProperties::setProperty):
2635         Prevent CSS properties disabled behind a runtime flag from being set a value.
2636
2637         (WebCore::StyleProperties::asText const):
2638         Allow the new properties to be serialized in cssText.
2639         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
2640         and serialize the longhands instead. Note that there could be another shorthand
2641         available which is enabled, but a proper solution would require bug 190496.
2642
2643         * css/StyleProperties.h:
2644         Update declarations of borderPropertyValue and get2Values.
2645
2646         * css/makeprop.pl:
2647         (addProperty):
2648         Add isEnabledCSSProperty function for checking that a CSS property is not
2649         disabled behind a runtime flag.
2650
2651         * css/parser/CSSPropertyParser.cpp:
2652         (WebCore::cssPropertyID):
2653         Prevent CSS properties disabled behind a runtime flag from being exposed in
2654         computed styles.
2655
2656         (WebCore::CSSPropertyParser::addProperty):
2657         Prevent CSS properties disabled behind a runtime flag from being set a value.
2658
2659         (WebCore::CSSPropertyParser::consumeBorder):
2660         Change consumeBorder to provide the caller with the parsed values instead of
2661         setting properties. Then the caller can decide to which properties the values
2662         should be set, and whether border-image should be reset or not.
2663
2664         (WebCore::CSSPropertyParser::consume2ValueShorthand):
2665         (WebCore::CSSPropertyParser::consume4ValueShorthand):
2666         Rename consume4Values to consume4ValueShorthand, and add analogous
2667         consume2ValueShorthand for parsing shorthands with two longhands.
2668
2669         (WebCore::CSSPropertyParser::parseShorthand):
2670         Allow the new properties to be parsed.
2671
2672         * css/parser/CSSPropertyParser.h:
2673         Update declarations of consumeBorder, consume2ValueShorthand and
2674         consume4ValueShorthand.
2675
2676         * inspector/agents/InspectorCSSAgent.cpp:
2677         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
2678         Prevent CSS properties disabled behind a runtime flag from being exposed in
2679         the CSS inspector tool.
2680
2681         * page/RuntimeEnabledFeatures.h:
2682         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
2683         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
2684         Add the CSSLogicalEnabled runtime flag.
2685
2686 2018-11-15  Truitt Savell  <tsavell@apple.com>
2687
2688         Unreviewed, rolling out r238220.
2689
2690         Introduced failing tests to iOS and is slowing down EWS
2691
2692         Reverted changeset:
2693
2694         "[css-grid] Consider scrollbars in
2695         populateGridPositionsForDirection()"
2696         https://bugs.webkit.org/show_bug.cgi?id=191656
2697         https://trac.webkit.org/changeset/238220
2698
2699 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
2700
2701         [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
2702         https://bugs.webkit.org/show_bug.cgi?id=191522
2703
2704         Reviewed by Brent Fulgham.
2705
2706         Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional.
2707         https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria
2708
2709         Covered by existing tests.
2710
2711         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
2712         (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
2713
2714 2018-11-15  Ross Kirsling  <ross.kirsling@sony.com>
2715
2716         DragImage should have a complete default implementation
2717         https://bugs.webkit.org/show_bug.cgi?id=191666
2718
2719         Reviewed by Dean Jackson.
2720
2721         Move WPE's stub implementation down into the base implementation file.
2722
2723         * SourcesWPE.txt:
2724         * platform/DragImage.cpp:
2725         (WebCore::dragImageSize):
2726         (WebCore::deleteDragImage):
2727         (WebCore::scaleDragImage):
2728         (WebCore::dissolveDragImageToFraction):
2729         (WebCore::createDragImageFromImage):
2730         (WebCore::createDragImageIconForCachedImageFilename):
2731         (WebCore::createDragImageForLink):
2732         * platform/wpe/DragImageWPE.cpp: Removed.
2733
2734 2018-11-15  Jiewen Tan  <jiewen_tan@apple.com>
2735
2736         [WebAuthN] UserHandle can be null
2737         https://bugs.webkit.org/show_bug.cgi?id=191521
2738
2739         Reviewed by Alex Christensen.
2740
2741         According to the newest spec as of 7 August, 2018: https://www.w3.org/TR/webauthn/#conforming-authenticators-u2f.
2742         UserHandle can now be null.
2743
2744         Covered by existing tests.
2745
2746         * Modules/webauthn/AuthenticatorAssertionResponse.h:
2747         (WebCore::AuthenticatorAssertionResponse::create):
2748         (WebCore::AuthenticatorAssertionResponse::userHandle const):
2749         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
2750         * Modules/webauthn/AuthenticatorAssertionResponse.idl:
2751         * Modules/webauthn/PublicKeyCredential.cpp:
2752         (WebCore::PublicKeyCredential::tryCreate):
2753         * Modules/webauthn/PublicKeyCredentialData.h:
2754         (WebCore::PublicKeyCredentialData::encode const):
2755         (WebCore::PublicKeyCredentialData::decode):
2756         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
2757         (fido::readCTAPGetAssertionResponse):
2758
2759 2018-11-15  Youenn Fablet  <youenn@apple.com>
2760
2761         Modernize RTCPeerConnection handling of pendingActivity
2762         https://bugs.webkit.org/show_bug.cgi?id=191661
2763
2764         Reviewed by Eric Carlson.
2765
2766         makePendingActivity is the modern way to handle set/unset of pending activity.
2767         No change of behavior.
2768
2769         * Modules/mediastream/RTCPeerConnection.cpp:
2770         (WebCore::RTCPeerConnection::create):
2771         (WebCore::RTCPeerConnection::doStop):
2772         * Modules/mediastream/RTCPeerConnection.h:
2773
2774 2018-11-15  Keith Rollin  <krollin@apple.com>
2775
2776         Delete old .xcfilelist files
2777         https://bugs.webkit.org/show_bug.cgi?id=191669
2778         <rdar://problem/46081994>
2779
2780         Reviewed by Chris Dumez.
2781
2782         .xcfilelist files were created and added to the Xcode project files in
2783         https://trac.webkit.org/changeset/238008/webkit. However, they caused
2784         build issues and they were removed from the Xcode projects in
2785         https://trac.webkit.org/changeset/238055/webkit. This check-in removes
2786         the files from the repository altogether. They'll ultimately be
2787         replaced with new files with names that indicate whether the
2788         associated files are inputs to the Run Script phase or are files
2789         created by the Run Script phase.
2790
2791         No new tests -- no changed functionality.
2792
2793         * DerivedSources.xcfilelist: Removed.
2794         * UnifiedSources.xcfilelist: Removed.
2795
2796 2018-11-15  Youenn Fablet  <youenn@apple.com>
2797
2798         Update RTCPeerConnection JS built-ins to be closer to specWe
2799         https://bugs.webkit.org/show_bug.cgi?id=191665
2800
2801         Reviewed by Eric Carlson.
2802
2803         Simplify JS built-ins since we no longer need to support callback versions of the API.
2804         Make sure to have the right number of parameters in the JS built-in functions.
2805         Make some simplification to the code.
2806         Covered by existing tests and rebased test.
2807
2808         * Modules/mediastream/RTCPeerConnection.js:
2809         (createOffer):
2810         (createAnswer):
2811         (setLocalDescription):
2812         (setRemoteDescription):
2813         (addIceCandidate):
2814         * Modules/mediastream/RTCPeerConnectionInternals.js:
2815         (enqueueOperation):
2816         (callbacksAndDictionaryOverload): Deleted.
2817
2818 2018-11-15  Simon Fraser  <simon.fraser@apple.com>
2819
2820         REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari
2821         https://bugs.webkit.org/show_bug.cgi?id=191673
2822         rdar://problem/46083440
2823
2824         Reviewed by Antti Koivisto.
2825
2826         Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer
2827         tree for every Frame. They get re-attached on tab show, and for subframes this involves
2828         the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition().
2829         
2830         The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that
2831         fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary
2832         layer configuration update that gets iframe layers parented.
2833         
2834         This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future
2835         patch will optimize this, and add a layout test.
2836
2837         * rendering/RenderLayerCompositor.cpp:
2838         (WebCore::RenderLayerCompositor::layerStyleChanged):
2839
2840 2018-11-15  Zalan Bujtas  <zalan@apple.com>
2841
2842         [LFC][IFC] Skip non-inflow boxes while splitting the inline runs.
2843         https://bugs.webkit.org/show_bug.cgi?id=191690
2844
2845         Reviewed by Antti Koivisto.
2846
2847         Skip all non-inflow boxes (floats, out-of-flow positioned elements). They don't participate in the inline run context.
2848
2849         * layout/Verification.cpp:
2850         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
2851         * layout/inlineformatting/InlineFormattingContext.cpp:
2852         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2853
2854 2018-11-15  Zalan Bujtas  <zalan@apple.com>
2855
2856         [LFC] FormattingContext base class should not declare computeStaticPosition.
2857         https://bugs.webkit.org/show_bug.cgi?id=191683
2858
2859         Reviewed by Antti Koivisto.
2860
2861         Apparently only BlockFormattingContext uses it.
2862
2863         * layout/FormattingContext.h:
2864         * layout/blockformatting/BlockFormattingContext.h:
2865         * layout/inlineformatting/InlineFormattingContext.cpp:
2866         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): Deleted.
2867         * layout/inlineformatting/InlineFormattingContext.h:
2868
2869 2018-11-14  Zalan Bujtas  <zalan@apple.com>
2870
2871         [LFC][IFC] Add support for in-flow positioned inline boxes.
2872         https://bugs.webkit.org/show_bug.cgi?id=191672
2873
2874         Reviewed by Antti Koivisto.
2875
2876         We might offset the in-flow positioned runs differently once runs are moved over to the display tree.
2877
2878         Test: fast/inline/simple-inline-inflow-positioned.html
2879
2880         * layout/Verification.cpp:
2881         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2882         * layout/inlineformatting/InlineFormattingContext.cpp:
2883         (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const):
2884         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
2885         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
2886         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2887         * layout/inlineformatting/InlineFormattingContext.h:
2888         * layout/inlineformatting/InlineRun.h:
2889         (WebCore::Layout::InlineRun::moveVertically):
2890         * layout/layouttree/LayoutTreeBuilder.cpp:
2891         (WebCore::Layout::outputInlineRuns):
2892
2893 2018-11-15  Thibault Saunier  <tsaunier@igalia.com>
2894
2895         [GStreamer][WebRTC] Add support for sending silence or silencing an incoming track
2896         https://bugs.webkit.org/show_bug.cgi?id=191631
2897
2898         Reviewed by Xabier Rodriguez-Calvar.
2899
2900         This will be tested once webkit.org/b/186933 is implemented.
2901
2902         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
2903         (WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
2904         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
2905         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
2906
2907 2018-11-15  Antti Koivisto  <antti@apple.com>
2908
2909         REGRESSION(r238178): fast/forms/access-key-mutated.html and fast/forms/access-key-case-insensitive.html are timing out
2910         https://bugs.webkit.org/show_bug.cgi?id=191642
2911
2912         Reviewed by Zalan Bujtas.
2913
2914         Invalidate access key map even when thorttling style recalcs.
2915
2916         * dom/Document.cpp:
2917         (WebCore::Document::scheduleStyleRecalc):
2918
2919 2018-11-15  Antti Koivisto  <antti@apple.com>
2920
2921         Remove fonts from CSSFontFaceSet safely
2922         https://bugs.webkit.org/show_bug.cgi?id=191676
2923
2924         Reviewed by Zalan Bujtas.
2925
2926         Test: fast/text/font-face-set-remove-safely.html
2927
2928         * css/CSSFontFaceSet.cpp:
2929         (WebCore::CSSFontFaceSet::remove):
2930
2931 2018-11-15  Manuel Rego Casasnovas  <rego@igalia.com>
2932
2933         [css-grid] Consider scrollbars in populateGridPositionsForDirection()
2934         https://bugs.webkit.org/show_bug.cgi?id=191656
2935
2936         Reviewed by Javier Fernandez.
2937
2938         We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
2939         that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
2940         but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
2941
2942         The patch modifies the method so it takes into account scrollbar size
2943         in order to compute the position of the columns/rows depending on the direction and the writing mode.
2944
2945         Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
2946                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
2947                imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
2948
2949         * rendering/RenderGrid.cpp:
2950         (WebCore::RenderGrid::populateGridPositionsForDirection):
2951
2952 2018-11-14  Keith Rollin  <krollin@apple.com>
2953
2954         Move scripts for Derived and Unified Sources to external files
2955         https://bugs.webkit.org/show_bug.cgi?id=191670
2956         <rdar://problem/46082278>
2957
2958         Reviewed by Keith Miller.
2959
2960         Move the scripts in the Generate Derived Sources and Generate Unified
2961         Sources Run Script phases from the Xcode projects to external shell
2962         script files. Then invoke those scripts from the Run Script phases.
2963         This refactoring is being performed to support later work that will
2964         invoke these scripts in other contexts.
2965
2966         The scripts were maintained as-is when making the move. I did a little
2967         reformatting and added 'set -e' to the top of each file, but that's
2968         it.
2969
2970         No new tests -- no changed functionality.
2971
2972         * Scripts/generate-derived-sources.sh: Added.
2973         * Scripts/generate-unified-sources.sh: Added.
2974         * WebCore.xcodeproj/project.pbxproj:
2975
2976 2018-11-14  Keith Rollin  <krollin@apple.com>
2977
2978         Fix #end vs. #endif typo.
2979         https://bugs.webkit.org/show_bug.cgi?id=191668
2980         <rdar://problem/46081704>
2981
2982         Reviewed by Alexey Proskuryakov.
2983
2984         Source/WebCore/SourcesCocoa.txt had a #end that should have been a
2985         #endif. Fix this, an add a check to generate-unified-source-bundles.rb
2986         to detect similar typos.
2987
2988         No new tests -- no changed functionality.
2989
2990         * SourcesCocoa.txt:
2991
2992 2018-11-14  Keith Rollin  <krollin@apple.com>
2993
2994         Remove VideoFullscreenLayerManager.mm from WebCore/SourcesCocoa.txt
2995         https://bugs.webkit.org/show_bug.cgi?id=191667
2996         <rdar://problem/46081286>
2997
2998         Reviewed by Eric Carlson.
2999
3000         VideoFullscreenLayerManager.mm no longer exists.
3001
3002         No new tests -- No changed functionality.
3003
3004         * SourcesCocoa.txt:
3005
3006 2018-11-14  Timothy Hatcher  <timothy@apple.com>
3007
3008         Enabled dark mode CSS support by default.
3009         https://bugs.webkit.org/show_bug.cgi?id=191609
3010         rdar://problem/46046861
3011
3012         Reviewed by Megan Gardner.
3013
3014         * page/RuntimeEnabledFeatures.h: Set m_isDarkModeCSSEnabled to true.
3015
3016 2018-11-14  Timothy Hatcher  <timothy@apple.com>
3017
3018         Default the view background color and text color to different values when in dark mode.
3019         https://bugs.webkit.org/show_bug.cgi?id=191607
3020         rdar://problem/46045854
3021
3022         Reviewed by Dean Jackson.
3023
3024         Test: css-dark-mode/default-colors.html
3025
3026         * css/html.css:
3027         (html): Set color: text on macOS.
3028         * dom/Document.cpp:
3029         (WebCore::Document::processSupportedColorSchemes): Call recalculateBaseBackgroundColor().
3030         * editing/EditingStyle.cpp:
3031         (WebCore::caretColorFromStyle): Added.
3032         (WebCore::EditingStyle::prepareToApplyAt): Use equalIgnoringSemanticColor. Check for
3033         caret-color directly since removeEquivalentProperties fails with semantic colors.
3034         (WebCore::extractPropertiesNotIn): Use equalIgnoringSemanticColor. Check for caret-color
3035         directly since removeEquivalentProperties fails with semantic colors.
3036         * page/Frame.cpp:
3037         (WebCore::Frame::createView): Drop backgroundColor.
3038         * page/Frame.h:
3039         * page/FrameView.cpp:
3040         (WebCore::FrameView::recalculateBaseBackgroundColor): Added.
3041         (WebCore::FrameView::updateBackgroundRecursively): Drop backgroundColor argument.
3042         Calculate the backgroundColor based on the transparent argument only.
3043         * page/FrameView.h:
3044         * platform/graphics/Color.h:
3045         (WebCore::equalIgnoringSemanticColor): Added for EditingStyle.
3046         * rendering/RenderBox.cpp:
3047         (WebCore::RenderBox::styleDidChange): Call recalculateBaseBackgroundColor().
3048         * rendering/RenderLayerBacking.cpp:
3049         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): Use isWhiteColor()
3050         since it ignores the semantic color flag.
3051         * testing/Internals.cpp:
3052         (WebCore::Internals::setViewIsTransparent): Drop backgroundColor.
3053         (WebCore::Internals::viewBaseBackgroundColor): Added.
3054         * testing/Internals.h:
3055         * testing/Internals.idl: Added viewBaseBackgroundColor.
3056
3057 2018-11-14  Justin Fan  <justin_fan@apple.com>
3058
3059         [WebGPU] Code quality concerns raised for 191291: [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
3060         https://bugs.webkit.org/show_bug.cgi?id=191383
3061
3062         Reviewed by Dean Jackson.
3063
3064         Covered by existing WebGPU tests introduced in original patch.
3065
3066         * Modules/webgpu/GPUDevice.h:
3067         * Modules/webgpu/GPUPipelineStageDescriptor.h:
3068         * Modules/webgpu/GPURenderPipelineDescriptor.h: Now a base struct with a guaranteed vertex stage member.
3069         (): Refactored into enum class.
3070         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Removed in favor of init-list construction.
3071         (WebCore::GPURenderPipelineDescriptor::primitiveTopology): Now a proper enum class member.
3072         * Modules/webgpu/GPUShaderModule.h:
3073         * Modules/webgpu/WebGPUDevice.cpp:
3074         (WebCore::WebGPUDevice::createRenderPipeline const):
3075         * Modules/webgpu/WebGPUShaderModule.h:
3076         (WebCore::WebGPUShaderModule::module const):
3077         * Modules/webgpu/WebGPUShaderStage.h: Replaced enum with constants to better reflect IDL.
3078         * Modules/webgpu/cocoa/GPURenderPipeline.h:
3079         * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
3080         (WebCore::setFunctionsForPipelineDescriptor):
3081         (WebCore::GPURenderPipeline::create):
3082         * Modules/webgpu/cocoa/GPUSwapChain.h:
3083         * WebCore.xcodeproj/project.pbxproj: Removed GPUPipelineDescriptorBase.
3084
3085 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
3086
3087         Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
3088         https://bugs.webkit.org/show_bug.cgi?id=191612
3089
3090         Reviewed by Matt Baker.
3091
3092         * inspector/InspectorController.cpp:
3093         (WebCore::InspectorController::connectFrontend):
3094         (WebCore::InspectorController::disconnectFrontend):
3095         (WebCore::InspectorController::show):
3096         * inspector/InspectorController.h:
3097         * inspector/WorkerInspectorController.cpp:
3098         (WebCore::WorkerInspectorController::connectFrontend):
3099         (WebCore::WorkerInspectorController::disconnectFrontend):
3100         * page/PageDebuggable.cpp:
3101         (WebCore::PageDebuggable::connect):
3102         (WebCore::PageDebuggable::disconnect):
3103         * page/PageDebuggable.h:
3104         * testing/Internals.cpp:
3105         (WebCore::InspectorStubFrontend::InspectorStubFrontend):
3106         (WebCore::InspectorStubFrontend::closeWindow):
3107         * workers/service/context/ServiceWorkerDebuggable.cpp:
3108         (WebCore::ServiceWorkerDebuggable::connect):
3109         (WebCore::ServiceWorkerDebuggable::disconnect):
3110         * workers/service/context/ServiceWorkerDebuggable.h:
3111         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
3112         (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
3113         (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
3114         * workers/service/context/ServiceWorkerInspectorProxy.h:
3115
3116 2018-11-14  Timothy Hatcher  <timothy@apple.com>
3117
3118         Update prefers-color-scheme media query matching based on GitHub issue #3278.
3119         https://bugs.webkit.org/show_bug.cgi?id=191654
3120         rdar://problem/46074307
3121
3122         Reviewed by Simon Fraser.
3123
3124         Test: css-dark-mode/prefers-color-scheme.html
3125
3126         * css/MediaQueryEvaluator.cpp:
3127         (WebCore::prefersColorSchemeEvaluate): Return true when there is no value. Return false
3128         for `no-preference` since there is no macOS option for no user preference.
3129         * css/MediaQueryExpression.cpp:
3130         (WebCore::isFeatureValidWithoutValue): Added prefers-color-scheme.
3131
3132 2018-11-14  Devin Rousso  <drousso@apple.com>
3133
3134         Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
3135         https://bugs.webkit.org/show_bug.cgi?id=191628
3136
3137         Reviewed by Dean Jackson.
3138
3139         Updated existing test: inspector/model/recording.html
3140
3141         * inspector/InspectorCanvas.h:
3142         * inspector/InspectorCanvas.cpp:
3143         (WebCore::InspectorCanvas::indexForData):
3144         (WebCore::InspectorCanvas::buildInitialState):
3145         (WebCore::InspectorCanvas::buildAction):
3146         Drive-by: prevent de-duplicated objects from being destroyed while recording.
3147
3148 2018-11-14  Stephan Szabo  <stephan.szabo@sony.com>
3149
3150         [Win] Compile Service Worker support
3151         https://bugs.webkit.org/show_bug.cgi?id=191409
3152
3153         Reviewed by Youenn Fablet.
3154
3155         Fix compilation errors when ENABLE(SERVICE_WORKER)
3156         on Windows with clang-cl. Clang on dllexport
3157         platforms does not support specifying the
3158         dllexport on both a class and members of the class
3159         and unistd.h isn't provided but also appeared to
3160         not be used.
3161
3162         No new tests, should be covered by existing tests.
3163
3164         * workers/service/ServiceWorkerProvider.h:
3165         * workers/service/context/SWContextManager.cpp:
3166
3167 2018-11-14  Joseph Pecoraro  <pecoraro@apple.com>
3168
3169         Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
3170         https://bugs.webkit.org/show_bug.cgi?id=191494
3171         <rdar://problem/45469854>
3172
3173         Reviewed by Devin Rousso.
3174
3175         * inspector/InspectorClient.h:
3176         (WebCore::InspectorClient::allowRemoteInspectionToPageDirectly const):
3177         Provide a hook so that a client may wish to allow direct remote inspection of the Page.
3178         This is used by WebKitLegacy only.
3179
3180         * page/Page.cpp:
3181         (Page::Page):
3182         Only enable the PageDebuggable if the client wishes remote inspection of the Page directly.
3183         This is used by WebKitLegacy only.
3184
3185         * inspector/InspectorController.cpp:
3186         (WebCore::InspectorController::connectFrontend):
3187         * inspector/InspectorController.h:
3188         * page/PageDebuggable.cpp:
3189         (WebCore::PageDebuggable::connect):
3190         (WebCore::PageDebuggable::disconnect):
3191         * page/PageDebuggable.h:
3192         When a frontend connects, always enable the developer extras for the Page.
3193         This is pretty much only for the remote path, which allows inspection if developer
3194         extras were not already enabled (iOS). This simplifies the logic, and toggling
3195         developer extras after it was already enabled is not really important.
3196
3197 2018-11-14  Per Arne Vollan  <pvollan@apple.com>
3198
3199         REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
3200         https://bugs.webkit.org/show_bug.cgi?id=190884
3201
3202         Reviewed by Dean Jackson.
3203
3204         Only notify display refresh monitors with matching display ID.
3205
3206         Test: fast/animation/request-animation-frame-in-two-pages.html
3207
3208         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3209         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
3210         * platform/graphics/DisplayRefreshMonitorManager.h:
3211
3212 2018-11-14  Youenn Fablet  <youenn@apple.com>
3213
3214         Convert libwebrtc error types to DOM exceptions
3215         https://bugs.webkit.org/show_bug.cgi?id=191590
3216
3217         Reviewed by Alex Christensen.
3218
3219         Make use of overloaded callback method that provides an error type.
3220         This type is then used to create a DOM exception with the correct type.
3221         Covered by existing tests.
3222
3223         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3224         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
3225         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
3226         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
3227         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
3228         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3229         * Modules/mediastream/libwebrtc/LibWebRTCObservers.h:
3230         (WebCore::toExceptionCode):
3231
3232 2018-11-14  Youenn Fablet  <youenn@apple.com>
3233
3234         Allow to remove MediaStreamPrivate observers when iterating over observers
3235         https://bugs.webkit.org/show_bug.cgi?id=187256
3236
3237         Reviewed by Eric Carlson.
3238
3239         Migrate the observer list from a Vector to a HashSet.
3240         This is more robust to multiple observing and keeping of order of observers is not required.
3241         Copy the set of observers to a vector before iterating over it.
3242         This allows to remove an observer while iterating, which is now used in UserMediaRequest.
3243
3244         Covered by existing tests.
3245
3246         * Modules/mediastream/UserMediaRequest.cpp:
3247         (WebCore::UserMediaRequest::mediaStreamIsReady):
3248         * platform/mediastream/MediaStreamPrivate.cpp:
3249         (WebCore::MediaStreamPrivate::addObserver):
3250         (WebCore::MediaStreamPrivate::removeObserver):
3251         (WebCore::MediaStreamPrivate::forEachObserver const):
3252         (WebCore::MediaStreamPrivate::updateActiveState):
3253         (WebCore::MediaStreamPrivate::addTrack):
3254         (WebCore::MediaStreamPrivate::removeTrack):
3255         (WebCore::MediaStreamPrivate::characteristicsChanged):
3256         * platform/mediastream/MediaStreamPrivate.h:
3257
3258 2018-11-14  Youenn Fablet  <youenn@apple.com>
3259
3260         Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
3261         https://bugs.webkit.org/show_bug.cgi?id=191603
3262
3263         Reviewed by Chris Dumez.
3264
3265         Make sure to check that the sender peer connection backend is matching.
3266         Covered by rebased WPT test.
3267
3268         * Modules/mediastream/RTCPeerConnection.cpp:
3269         (WebCore::RTCPeerConnection::removeTrack):
3270         * Modules/mediastream/RTCRtpSender.cpp:
3271         (WebCore::RTCRtpSender::isCreatedBy const):
3272         * Modules/mediastream/RTCRtpSender.h:
3273
3274 2018-11-14  Fujii Hironori  <Hironori.Fujii@sony.com>
3275
3276         [curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl
3277         https://bugs.webkit.org/show_bug.cgi?id=191620
3278
3279         Reviewed by Alex Christensen.
3280
3281         Remove a abstract class CookieJarCurl which is not needed anymore.
3282         And, rename CookieJarCurlDatabase to CookieJarCurl.
3283
3284         No new tests because there's no behaviour change in WebCore.
3285
3286         * platform/Curl.cmake: Replaced CookieJarCurlDatabase.cpp with CookieJarCurl.cpp.
3287         * platform/network/curl/CookieJarCurl.cpp: Renamed from Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp.
3288         * platform/network/curl/CookieJarCurl.h: Merged CookieJarCurl.h and CookieJarCurlDatabase.h.
3289         * platform/network/curl/CookieJarCurlDatabase.h: Removed.
3290         * platform/network/curl/NetworkStorageSessionCurl.cpp:
3291         (WebCore::NetworkStorageSession::NetworkStorageSession): Replaced CookieJarCurlDatabase with CookieJarCurl.
3292
3293 2018-11-14  Christopher Reid  <chris.reid@sony.com>
3294
3295         [WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp
3296         https://bugs.webkit.org/show_bug.cgi?id=191606
3297
3298         Reviewed by Michael Catanzaro.
3299
3300         No behavior change.
3301
3302         Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString.
3303
3304         * platform/wpe/PlatformKeyboardEventWPE.cpp:
3305         (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
3306         (WebCore::PlatformKeyboardEvent::singleCharacterString):
3307
3308 2018-11-13  Zalan Bujtas  <zalan@apple.com>
3309
3310         [LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
3311         https://bugs.webkit.org/show_bug.cgi?id=191623
3312
3313         Reviewed by Antti Koivisto.
3314
3315         This patch expands the breaking behaviour to support separate start/end breaks.
3316
3317         <span>parent </span><span style="padding: 10px;">start<span> middle </span>end</span><span> parent</span>
3318
3319         input to line breaking -> <parent start middle end parent>
3320         output of line breaking (considering infinite constraint) -> <parent start middle end parent>
3321         due to padding, final runs -> <parent><start middle end><parent>
3322
3323         "parent" -> n/a
3324         "start" -> BreakAtStart
3325         " middle " -> n/a
3326         "end" -> BreakAtEnd
3327         "parent" -> n/a
3328
3329         Another example:
3330         <span>parent </span><span style="padding-right: 10px;">start<span> middle </span>end</span><span> parent</span>
3331
3332         line breaking -> <parent start middle end parent>
3333         due to padding-right, final runs -> <parent start middle end><parent>
3334
3335         "parent" -> n/a
3336         "start" -> n/a
3337         " middle " -> n/a
3338         "end" -> BreakAtEnd
3339         "parent" -> n/a
3340
3341         * layout/inlineformatting/InlineFormattingContext.cpp:
3342         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
3343         (WebCore::Layout::InlineFormattingContext::collectInlineContent const): Move to a recursive algorithm (which is fine, inline contents don't tend to be too deep)
3344         (WebCore::Layout::InlineFormattingContext::contentRequiresSeparateRun const): Deleted.
3345         * layout/inlineformatting/InlineFormattingContext.h:
3346         * layout/inlineformatting/InlineFormattingState.cpp:
3347         (WebCore::Layout::InlineFormattingState::detachingRules const):
3348         * layout/inlineformatting/InlineFormattingState.h:
3349         (WebCore::Layout::InlineFormattingState::lastInlineItem const):
3350         (WebCore::Layout::InlineFormattingState::addDetachingRule):
3351
3352 2018-11-14  Youenn Fablet  <youenn@apple.com>
3353
3354         Add support for RTCRtpCodecParameters.sdpFmtpLine
3355         https://bugs.webkit.org/show_bug.cgi?id=191591
3356
3357         Reviewed by Eric Carlson.
3358
3359         Covered by rebased test.
3360
3361         * Modules/mediastream/RTCRtpCodecParameters.h:
3362         * Modules/mediastream/RTCRtpCodecParameters.idl:
3363         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
3364         (WebCore::toRTCCodecParameters):
3365
3366 2018-11-14  Youenn Fablet  <youenn@apple.com>
3367
3368         Add support for transport and peerConnection stats
3369         https://bugs.webkit.org/show_bug.cgi?id=191592
3370
3371         Reviewed by Alex Christensen.
3372
3373         Covered by rebased tests.
3374
3375         * Modules/mediastream/RTCStatsReport.h:
3376         (WebCore::RTCStatsReport::TransportStats::TransportStats):
3377         (WebCore::RTCStatsReport::PeerConnectionStats::PeerConnectionStats):
3378         * Modules/mediastream/RTCStatsReport.idl:
3379         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
3380         (WebCore::fillRTCTransportStats):
3381         (WebCore::fillRTCPeerConnectionStats):
3382         (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
3383
3384 2018-11-14  Ali Juma  <ajuma@chromium.org>
3385
3386         Transform of composited layer not updated when layer also needs repaint
3387         https://bugs.webkit.org/show_bug.cgi?id=191598
3388
3389         Reviewed by Simon Fraser.
3390
3391         Trigger a compositing geometry update whenever a RenderLayer's transform changes,
3392         even when other parts of its style have changed in a way that produces a
3393         StyleDifference greater than RecompositeLayer.
3394
3395         Test: compositing/geometry/transform-and-repaint-updates-geometry.html
3396
3397         * rendering/RenderLayerCompositor.cpp:
3398         (WebCore::RenderLayerCompositor::layerStyleChanged):
3399
3400 2018-11-13  Jiewen Tan  <jiewen_tan@apple.com>
3401
3402         [WebAuthN] Support CTAP HID authenticators on macOS