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