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