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