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