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