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