Make all SVG shape interfaces inherit from SVGGeometryElement
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-05-18  Dirk Schulze  <krit@webkit.org>
2
3         Make all SVG shape interfaces inherit from SVGGeometryElement
4         https://bugs.webkit.org/show_bug.cgi?id=185600
5
6         Reviewed by Antti Koivisto.
7
8         Make all SVG shape interfaces inherit from SVGGeometryElement
9         as defined by SVG2:
10
11         https://svgwg.org/svg2-draft/shapes.html#DOMInterfaces
12
13         Tests: svg/dom/SVGGeometry-circle.xhtml
14                svg/dom/SVGGeometry-ellipse.xhtml
15                svg/dom/SVGGeometry-line.xhtml
16                svg/dom/SVGGeometry-polygon.xhtml
17                svg/dom/SVGGeometry-polyline.xhtml
18                svg/dom/SVGGeometry-rect.xhtml
19
20         * rendering/svg/RenderSVGShape.cpp:
21         (WebCore::RenderSVGShape::getTotalLength const): Added shape
22                 independent implementation for all methods defined
23                 by SVGGeometryElement interface. Calculations are
24                 based on the Path object created and referenced by
25                 RenderSVGShape.
26         (WebCore::RenderSVGShape::getPointAtLength const):
27         * rendering/svg/RenderSVGShape.h:
28         * svg/SVGCircleElement.cpp:
29                 Repeating pattern: Change inheritance from
30                 SVGGraphicsElement to SVGGeometryElement.
31         (WebCore::SVGCircleElement::SVGCircleElement):
32         * svg/SVGCircleElement.h:
33         * svg/SVGCircleElement.idl:
34         * svg/SVGEllipseElement.cpp:
35         (WebCore::SVGEllipseElement::SVGEllipseElement):
36         * svg/SVGEllipseElement.h:
37         * svg/SVGEllipseElement.idl:
38         * svg/SVGGeometryElement.cpp:
39         (WebCore::SVGGeometryElement::getTotalLength const):
40         (WebCore::SVGGeometryElement::getPointAtLength const):
41         * svg/SVGGeometryElement.h:
42         * svg/SVGLineElement.cpp:
43         (WebCore::SVGLineElement::SVGLineElement):
44         * svg/SVGLineElement.h:
45         * svg/SVGLineElement.idl:
46         * svg/SVGPolyElement.cpp:
47         (WebCore::SVGPolyElement::SVGPolyElement):
48         * svg/SVGPolyElement.h:
49         * svg/SVGPolygonElement.idl:
50         * svg/SVGPolylineElement.idl:
51         * svg/SVGRectElement.cpp:
52         (WebCore::SVGRectElement::SVGRectElement):
53         * svg/SVGRectElement.h:
54         * svg/SVGRectElement.idl:
55
56 2018-05-18  Zalan Bujtas  <zalan@apple.com>
57
58         [LFC] Implement height computation for replaced elements.
59         https://bugs.webkit.org/show_bug.cgi?id=185756
60
61         Reviewed by Antti Koivisto.
62
63         * layout/FormattingContext.cpp:
64         (WebCore::Layout::FormattingContext::computeHeight const):
65         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
66         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
67         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
68         (WebCore::Layout::FormattingContext::computeReplacedHeight const):
69         (WebCore::Layout::FormattingContext::computeReplacedWidth const):
70         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedHeight const):
71         * layout/FormattingContext.h:
72
73 2018-05-18  Zalan Bujtas  <zalan@apple.com>
74
75         [LFC] Implement width computation for non-replaced floating elements.
76         https://bugs.webkit.org/show_bug.cgi?id=185759
77
78         Reviewed by Antti Koivisto.
79
80         * layout/FormattingContext.cpp:
81         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
82         (WebCore::Layout::FormattingContext::computeFloatingNonReplacedWidth const):
83         * layout/FormattingContext.h:
84
85 2018-05-18  Antoine Quint  <graouts@apple.com>
86
87         [modern-media-controls] AirPlaySupport should be disabled by default
88         https://bugs.webkit.org/show_bug.cgi?id=185658
89         <rdar://problem/40272213>
90
91         Reviewed by Simon Fraser.
92
93         We now only enable AirplaySupport if the controls are visible to the user _and_ media has played.
94
95         Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-until-play.html
96
97         * Modules/modern-media-controls/media/airplay-support.js:
98         (AirplaySupport.prototype.enable):
99         (AirplaySupport.prototype.controlsUserVisibilityDidChange):
100         (AirplaySupport.prototype._shouldBeEnabled):
101         (AirplaySupport):
102
103 2018-05-18  Tim Horton  <timothy_horton@apple.com>
104
105         Stop softlinking QuickLook when loading from client-registered schemes
106         https://bugs.webkit.org/show_bug.cgi?id=185716
107         <rdar://problem/40303227>
108
109         Reviewed by Dan Bernstein.
110
111         No new tests, just a performance improvement.
112
113         * dom/Document.cpp:
114         * platform/SchemeRegistry.cpp:
115         * platform/ios/QuickLook.h:
116         * platform/ios/QuickLook.mm:
117         (WebCore::isQuickLookPreviewURL):
118         (WebCore::QLPreviewProtocol): Deleted.
119         Hard-code the QuickLook preview URL scheme, instead of loading the QuickLook
120         framework to retrieve it. It will never change, and just in case it does,
121         add an ASSERT (which does load QuickLook) so that we'll find out.
122
123 2018-05-18  Antoine Quint  <graouts@apple.com>
124
125         [Web Animations] Turn Web Animations with CSS integration on for test runners
126         https://bugs.webkit.org/show_bug.cgi?id=184819
127         <rdar://problem/39597337>
128
129         Reviewed by Jon Lee.
130
131         We ensure we always call into both CSSAnimationController::cancelAnimations() and
132         AnimationTimeline::cancelDeclarativeAnimationsForElement() since we want teardown of animations
133         to be performed no matter which animation code path is used. What that in mind, we don't
134         conditionalize the CSSAnimationController-related ASSERT() in FrameView::didDestroyRenderTree().
135
136         * dom/Element.cpp:
137         (WebCore::Element::removedFromAncestor):
138         * dom/PseudoElement.cpp:
139         (WebCore::PseudoElement::clearHostElement):
140         * page/FrameView.cpp:
141         (WebCore::FrameView::didDestroyRenderTree):
142         * page/RuntimeEnabledFeatures.h:
143         * rendering/updating/RenderTreeUpdater.cpp:
144         (WebCore::RenderTreeUpdater::tearDownRenderers):
145
146 2018-05-17  David Kilzer  <ddkilzer@apple.com>
147
148         Lazily create WebCore::Timer for WebCore::Image
149         <https://webkit.org/b/185752>
150
151         Reviewed by Simon Fraser.
152
153         Not every image is an animated image, so lazily creating
154         m_animationStartTimer saves 64 bytes per instance of
155         WebCore::Image.
156
157         * platform/graphics/Image.cpp:
158         (WebCore::Image::Image): Remove default initializer for
159         m_animationStartTimer.
160         (WebCore::Image::startAnimationAsynchronously): Initialize
161         m_animationStartTimer if it's not already created.
162         * platform/graphics/Image.h:
163         (WebCore::Image::animationPending const): Update to check if
164         m_animationStartTimer has been set before dereferencing it.
165         (WebCore::Image::m_animationStartTimer): Change type to
166         std::unique_ptr<Timer>.
167
168 2018-05-17  Nan Wang  <n_wang@apple.com>
169
170         AX: [macOS] Expose the primary screen height through AX API
171         https://bugs.webkit.org/show_bug.cgi?id=185742
172
173         Reviewed by Chris Fleizach.
174
175         Added a new attribute to expose the primary screen size on both
176         WebAccessibilityObjectWrapper and WKAccessibilityWebPageObject.
177
178         Test: accessibility/mac/primary-screen-height.html
179
180         * WebCore.xcodeproj/project.pbxproj:
181         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
182         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
183         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
184         (-[WebAccessibilityObjectWrapper primaryScreenHeight]):
185         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
186         * platform/PlatformScreen.h:
187         * platform/mac/PlatformScreenMac.mm:
188         (WebCore::screenRectForPrimaryScreen):
189
190 2018-05-17  Chris Dumez  <cdumez@apple.com>
191
192         RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its cross-origin parent
193         https://bugs.webkit.org/show_bug.cgi?id=185664
194         <rdar://problem/36185260>
195
196         Reviewed by Simon Fraser.
197
198         RenderLayer::scrollRectToVisible() should not propagate a subframe's scroll to its
199         cross-origin parent. There was logic in FrameLoader::scrollToFragmentWithParentBoundary()
200         to temporarily set the 'safeToPropagateScrollToParent' flag to false on the cross-origin
201         ancestor frame during the call to FrameView::scrollToFragment(). This would correctly
202         prevent RenderLayer::scrollRectToVisible() to propagate the scroll to the cross-origin
203         ancestor frame when scrollRectToVisible() is called synchronously. However,
204         scrollRectToVisible() can get called asynchronously in case of a dirty layout, as part
205         of the post layout tasks.
206
207         To address the issue, we get rid of the safeToPropagateScrollToParent flag on FrameView
208         and instead update FrameView::safeToPropagateScrollToParent() to do the cross-origin
209         check. FrameView::safeToPropagateScrollToParent() is called by RenderLayer::scrollRectToVisible()
210         and this is a lot more robust than relying on a flag which gets temporarily set.
211
212         Test: http/tests/navigation/fragment-navigation-cross-origin-subframe-no-scrolling-parent.html
213
214         * dom/Document.cpp:
215         * dom/Document.h:
216         * loader/FrameLoader.cpp:
217         (WebCore::FrameLoader::scrollToFragmentWithParentBoundary):
218         * page/FrameView.cpp:
219         (WebCore::FrameView::FrameView):
220         (WebCore::FrameView::reset):
221         (WebCore::FrameView::safeToPropagateScrollToParent const):
222         * page/FrameView.h:
223
224 2018-05-17  Don Olmstead  <don.olmstead@sony.com>
225
226         [Curl] Enable HTTP/2 Multiplexing
227         https://bugs.webkit.org/show_bug.cgi?id=185746
228
229         Reviewed by Youenn Fablet.
230
231         Covered by existing tests.
232
233         * platform/network/curl/CurlContext.cpp:
234         (WebCore::CurlMultiHandle::CurlMultiHandle):
235
236 2018-05-17  Jeremy Jones  <jeremyj@apple.com>
237
238         Remove unnecessary exit fullscreen call on application resume
239         https://bugs.webkit.org/show_bug.cgi?id=185747
240         rdar://problem/40345725
241
242         Reviewed by Jer Noble.
243
244         No new tests because no behavior change.
245
246         Auto-PiP doesn't automatically return to fullscreen on app resume,
247         so we don't need to keep this vestigial code for handling a corner case of that feature.
248         Also, this can cause an unnecessary exit fullscreen that could cause debug asserts.
249
250         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
251         (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
252
253 2018-05-17  Jeremy Jones  <jeremyj@apple.com>
254
255         Fullscreen to PiP results in exit fullscreen call failure
256         https://bugs.webkit.org/show_bug.cgi?id=185699
257         rdar://problem/40310291
258
259         Reviewed by Eric Carlson.
260
261         No new tests because no behavior change.
262
263         Prevent multiple exit fullscreen calls when transitioning from fullscreen to picture-in-picture.
264
265         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
266         (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart:]):
267         Implement this to prevent AVKit from automatically initiating exit fullscreen on pip.
268         
269         (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
270         Set the return to fullscreen flag here, since this is where exit fullscreen happens.
271
272         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
273         Don't exit fullscreen here since it is already initiated in didStartPictureInPicture.
274
275 2018-05-17  Ryan Haddad  <ryanhaddad@apple.com>
276
277         Unreviewed, rolling out r231899.
278
279         Caused flakiness in two existing modern-media-controls tests.
280
281         Reverted changeset:
282
283         "[modern-media-controls] AirPlaySupport should be disabled by
284         default"
285         https://bugs.webkit.org/show_bug.cgi?id=185658
286         https://trac.webkit.org/changeset/231899
287
288 2018-05-17  Eric Carlson  <eric.carlson@apple.com>
289
290         [iOS] Update AirPlay route monitoring
291         https://bugs.webkit.org/show_bug.cgi?id=185706
292         <rdar://problem/40230677>
293
294         Unreviewed, fix extra zoom mode build after r231913.
295
296         * platform/audio/ios/MediaSessionManagerIOS.mm:
297         (-[WebMediaSessionHelper dealloc]):
298         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
299
300 2018-05-17  Jer Noble  <jer.noble@apple.com>
301
302         CRASH in ImageDecoderAVFObjC::sampleAtIndex()
303         https://bugs.webkit.org/show_bug.cgi?id=185734
304         <rdar://problem/40295094>
305
306         Reviewed by Eric Carlson.
307
308         Test: fast/images/animated-image-mp4-crash.html
309
310         Test the correct size value before iterating over the SampleMap in presentationOrder()
311
312         * Modules/mediasource/SampleMap.h:
313         (WebCore::PresentationOrderSampleMap::size const):
314         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
315         (WebCore::ImageDecoderAVFObjC::sampleAtIndex const):
316
317 2018-05-17  Wenson Hsieh  <wenson_hsieh@apple.com>
318
319         [Extra zoom mode] Disabled adaptations are not reset upon mainframe navigation
320         https://bugs.webkit.org/show_bug.cgi?id=185735
321         <rdar://problem/40335311>
322
323         Reviewed by Tim Horton.
324
325         When performing mainframe navigation, we currently don't update the Page's ViewportConfiguration's disabled
326         adaptations. This causes disabled adaptations from the previous main document to persist. To fix this, propagate
327         the new document's disabled adaptations to the client when it becomes the main document in the page.
328
329         Test: fast/viewport/extrazoom/viewport-adaptations-after-navigation.html
330
331         * dom/Document.cpp:
332         (WebCore::Document::didBecomeCurrentDocumentInFrame):
333         (WebCore::Document::processDisabledAdaptations):
334         (WebCore::Document::dispatchDisabledAdaptationsDidChangeForMainFrame):
335         * dom/Document.h:
336
337 2018-05-17  Eric Carlson  <eric.carlson@apple.com>
338
339         [iOS] Update AirPlay route monitoring
340         https://bugs.webkit.org/show_bug.cgi?id=185706
341         <rdar://problem/40230677>
342
343         Reviewed by Jer Noble.
344
345         Use an AVRouteDetector instead of an MPVolumeView and an MPAVRoutingController for AirPlay
346         route detection and availability monitoring.
347
348         No new tests, tested manually.
349
350         * html/MediaElementSession.cpp:
351         (WebCore::MediaElementSession::hasWirelessPlaybackTargets): No need to update m_hasPlaybackTargets
352         manually, it is always updated by the session manager when route availability changes.
353
354         * platform/audio/ios/MediaSessionManagerIOS.mm:
355         (-[WebMediaSessionHelper dealloc]): Pull the logic from safelyTearDown inline.
356         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Use the AVRouteDetector.
357         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Ditto.  Simplify logic, there is no
358         need to dispatch twice.
359         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Don't release the route detector
360         completely, just disable route detection, because AVRouteDetector is a lightweight object so
361         it is not worth the overhead of dealloc/realloc to disable/enable route detection.
362         (-[WebMediaSessionHelper interruption:]): Use callOnWebThreadOrDispatchAsyncOnMainThread
363         instead of WebThreadRun so it works correctly in WK2 as well as in WK1.
364         (-[WebMediaSessionHelper applicationWillEnterForeground:]): Ditto.
365         (-[WebMediaSessionHelper applicationDidBecomeActive:]): Ditto.
366         (-[WebMediaSessionHelper applicationWillResignActive:]): Ditto.
367         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]): Ditto.
368         (-[WebMediaSessionHelper applicationDidEnterBackground:]): Ditto.
369         (safelyTearDown): Deleted.
370
371 2018-05-17  Chris Dumez  <cdumez@apple.com>
372
373         Cross-Origin-Options: deny/allow-postmessage should prevent getting navigated by cross-origin scripts
374         https://bugs.webkit.org/show_bug.cgi?id=185681
375         <rdar://problem/40296313>
376
377         Reviewed by Geoffrey Garen.
378
379         Update our canNavigate() implementation [1] to take into account the Cross-Origin-Options header.
380         If the window being navigated or the window trigerring the navigation have a Cross-Origin-Options
381         header value different than 'allow', then the attempt to navigate will be blocked.
382
383         Note that it was already not possible to navigate via setting window.location since trying to set
384         it would throw a SecurityError with 'Cross-Origin-Options: deny/allow-postmessage'. However, it was
385         possible to trigger a "targeted" navigation via <a target="foo"> or open(url, "foo").
386
387         [1] https://html.spec.whatwg.org/#allowed-to-navigate
388
389         Tests: http/wpt/cross-origin-options/navigation-from-opener-via-open-target.html
390                http/wpt/cross-origin-options/navigation-from-subframe-via-anchor-target.html
391
392         * dom/Document.cpp:
393         (WebCore::Document::canNavigate):
394
395 2018-05-17  Brent Fulgham  <bfulgham@apple.com>
396
397         Storage Access API: Allow documents that have been granted storage access to also do a popup
398         https://bugs.webkit.org/show_bug.cgi?id=185615
399         <rdar://problem/39105791>
400
401         Reviewed by Chris Dumez.
402
403         * dom/Document.cpp:
404         (WebCore::Document::consumeTemporaryUserGesture): Added. Clear the document's active one-time user
405         activity (for window opening) state.
406         (WebCore::Document::enableTemporaryUserGesture): Added. Establish a new active one-time user
407         activity (for window opening) state.
408         (WebCore::Document::requestStorageAccess): If the user approves Storage Access, establish a new
409         UserInteraction scope, then resolve the promise. Also post a task to clear the one-time user
410         gesture state.
411
412 2018-05-17  Zalan Bujtas  <zalan@apple.com>
413
414         [LFC] Introduce DisplayBox::Style
415         https://bugs.webkit.org/show_bug.cgi?id=185733
416
417         Reviewed by Antti Koivisto.
418
419         This is the collection of computed style data needed to paint/hittest the display boxtree.
420
421         * layout/LayoutContext.cpp:
422         (WebCore::Layout::LayoutContext::createDisplayBox):
423         * layout/displaytree/DisplayBox.cpp:
424         (WebCore::Display::Box::Box):
425         (WebCore::Display::Box::Style::Style):
426         (WebCore::Display::Box::borderBox const):
427         (WebCore::Display::Box::contentBox const):
428         * layout/displaytree/DisplayBox.h:
429
430 2018-05-17  Antoine Quint  <graouts@apple.com>
431
432         [modern-media-controls] AirPlaySupport should be disabled by default
433         https://bugs.webkit.org/show_bug.cgi?id=185658
434         <rdar://problem/40272213>
435
436         Reviewed by Simon Fraser.
437
438         We now only enable AirplaySupport if the controls are visible to the user _and_ media has played.
439
440         Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-until-play.html
441
442         * Modules/modern-media-controls/media/airplay-support.js:
443         (AirplaySupport.prototype.enable):
444         (AirplaySupport.prototype.controlsUserVisibilityDidChange):
445         (AirplaySupport.prototype._shouldBeEnabled):
446         (AirplaySupport):
447
448 2018-05-17  Zalan Bujtas  <zalan@apple.com>
449
450         [LFC] Replace ASSERT_NOT_REACHED with ASSERT_NOT_IMPLEMENTED_YET where applicable.
451         https://bugs.webkit.org/show_bug.cgi?id=185728
452
453         Reviewed by Antti Koivisto.
454
455         * layout/FormattingContext.cpp:
456         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const): leftover from previous patch.
457         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
458         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
459         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
460         (WebCore::Layout::FormattingContext::computeReplacedWidth const):
461         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
462         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedWidth const):
463         * layout/LayoutContext.cpp:
464         (WebCore::Layout::LayoutContext::styleChanged):
465         (WebCore::Layout::LayoutContext::formattingContext):
466         * layout/blockformatting/BlockFormattingContext.cpp:
467         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedWidth const):
468         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
469         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const):
470         * layout/layouttree/LayoutTreeBuilder.cpp:
471         (WebCore::Layout::TreeBuilder::createSubTree):
472
473 2018-05-17  Zalan Bujtas  <zalan@apple.com>
474
475         [LFC] Move replaced logic from Layout::Box to Layout::Replaced class
476         https://bugs.webkit.org/show_bug.cgi?id=185711
477
478         Reviewed by Antti Koivisto.
479
480         * Sources.txt:
481         * WebCore.xcodeproj/project.pbxproj:
482         * layout/FormattingContext.cpp:
483         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
484         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
485         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
486         (WebCore::Layout::FormattingContext::computeInFlowReplacedWidth const):
487         * layout/blockformatting/BlockFormattingContext.cpp:
488         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
489         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
490         * layout/layouttree/LayoutBox.cpp:
491         (WebCore::Layout::Box::isReplaced const): Deleted.
492         (WebCore::Layout::Box::hasIntrinsicWidth const): Deleted.
493         (WebCore::Layout::Box::hasIntrinsicHeight const): Deleted.
494         (WebCore::Layout::Box::hasIntrinsicRatio const): Deleted.
495         (WebCore::Layout::Box::intrinsicWidth const): Deleted.
496         (WebCore::Layout::Box::intrinsicHeight const): Deleted.
497         (WebCore::Layout::Box::intrinsicRatio const): Deleted.
498         * layout/layouttree/LayoutBox.h:
499         (WebCore::Layout::Box::replaced const):
500
501 2018-05-17  Zalan Bujtas  <zalan@apple.com>
502
503         [LFC] Implement width computation for replaced out if flow elements.
504         https://bugs.webkit.org/show_bug.cgi?id=185701
505
506         Reviewed by Antti Koivisto.
507         
508         The used value of 'width' is determined as for inline replaced elements.
509
510         * layout/FormattingContext.cpp:
511         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
512         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
513         (WebCore::Layout::FormattingContext::computeOutOfFlowReplacedWidth const):
514         * layout/FormattingContext.h:
515
516 2018-05-17  Thibault Saunier  <tsaunier@igalia.com>
517
518         [GStreamer]: Consider GstStream(Collection) as if if was not a GInitiallyUnowned
519         https://bugs.webkit.org/show_bug.cgi?id=185657
520
521         Reviewed by Philippe Normand.
522
523         Starting with GStreamer 1.14[1] the reference is sunk at object creation time, making it a normal
524         GObject in practice, in our GRefPtr template implementation we should just consider GstStream
525         as if it was a normal GObject and not care about its floating reference state as
526         the ref is never sunk by anyone before 1.14 though that floating ref is considered
527         as a hard reference by the GstStreamCollection (leading to assertions/)
528
529         The exact same issue happens with GstStreamCollection, so fix it at the same time.
530
531         Also do not adoptRef() on the result of gst_stream_collection_get_stream() as this function
532         is transfer-none.
533
534         [1] commit f119e93b47efb06ffc68c01d3e094d5346c30041 `gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent`
535
536         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
537         (WTF::adoptGRef):
538         (WTF::refGPtr<GstStream>):
539         (WTF::refGPtr<GstStreamCollection>):
540         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
541         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
542
543 2018-05-16  Devin Rousso  <webkit@devinrousso.com>
544
545         Web Inspector: create a navigation item for toggling the overlay rulers/guides
546         https://bugs.webkit.org/show_bug.cgi?id=185644
547
548         Reviewed by Matt Baker.
549
550         This patch is purely a visual change for WebInspector, and doesn't affect anything else.
551
552         * inspector/agents/InspectorPageAgent.h:
553         * inspector/agents/InspectorPageAgent.cpp:
554         (WebCore::InspectorPageAgent::setShowRulers): Added.
555
556         * inspector/InspectorOverlay.h:
557         * inspector/InspectorOverlay.cpp:
558         (WebCore::InspectorOverlay::shouldShowOverlay):
559         (WebCore::InspectorOverlay::update):
560         (WebCore::InspectorOverlay::setShowRulers): Added.
561         (WebCore::InspectorOverlay::drawRulers): Added.
562         (WebCore::InspectorOverlay::reset):
563
564         * inspector/InspectorOverlayPage.js:
565         (drawNodeHighlight):
566         (drawQuadHighlight):
567         (drawRulers): Added.
568         (_drawBounds): Added.
569         (reset):
570         (_drawRulers): Deleted.
571
572 2018-05-16  Michael Catanzaro  <mcatanzaro@igalia.com>
573
574         [GTK] SoupNetworkSession.h:68:62: error: unknown type name 'URL'
575         https://bugs.webkit.org/show_bug.cgi?id=185378
576
577         Unreviewed, just replace unneeded #include with a forward declaration
578
579         * platform/network/soup/SoupNetworkSession.h:
580
581 2018-05-16  Jer Noble  <jer.noble@apple.com>
582
583         CRASH: Exception thrown from -[AVContentKeySession processContentKeyRequestWithIdentifier:initializationData:options:] after -expire called
584         https://bugs.webkit.org/show_bug.cgi?id=185690
585         <rdar://problem/38297768>
586
587         Reviewed by Eric Carlson.
588
589         Reject all calls to update() after close() has been called on the session.
590
591         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
592         (WebCore::CDMSessionAVContentKeySession::update):
593
594 2018-05-16  Andy VanWagoner  <andy@vanwagoner.family>
595
596         Add support for Intl NumberFormat formatToParts
597         https://bugs.webkit.org/show_bug.cgi?id=185375
598
599         Reviewed by Yusuke Suzuki.
600
601         Test: js/intl-numberformat-format-to-parts.html
602
603         Add flag & tests for NumberFormat formatToParts.
604
605         * Configurations/FeatureDefines.xcconfig:
606
607 2018-05-16  Eric Carlson  <eric.carlson@apple.com>
608
609         Improve NowPlaying "title"
610         https://bugs.webkit.org/show_bug.cgi?id=185680
611         <rdar://problem/40296700>
612
613         Reviewed by Jer Noble.
614         
615         We send NowPlaying the element's title attribute if not empty, else the element's current url.
616         Title should be preferred because it is the most specific, but we should use the document
617         title if non-empty next, and if falling back to the element's url use just the domain instead
618         of the full url because it isn't likely to be useful to the user given the small amount of
619         space control center uses to display the title. Further, don't use any title at all when
620         in private browsing mode.
621
622         Tests: http/tests/media/now-playing-info-private-browsing.html
623                http/tests/media/now-playing-info.html
624
625         * html/HTMLMediaElement.cpp:
626         (WebCore::HTMLMediaElement::parseAttribute): Update NowPlaying when the title attribute changes.
627         (WebCore::HTMLMediaElement::finishSeek): Update NowPlaying when a seek completes.
628         (WebCore::HTMLMediaElement::mediaSessionTitle const): Update logic.
629         (WebCore::HTMLMediaElement::mediaSessionUniqueIdentifier const): Use the hash of the current 
630         url as the unique identifier.
631         * html/HTMLMediaElement.h:
632
633         * platform/audio/PlatformMediaSession.cpp:
634         (WebCore::PlatformMediaSession::uniqueIdentifier const): New.
635         (WebCore::PlatformMediaSessionClient::mediaSessionUniqueIdentifier const): Ditto.
636         * platform/audio/PlatformMediaSession.h:
637
638         * platform/audio/ios/MediaSessionManagerIOS.mm:
639         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Update m_lastUpdatedNowPlayingInfoUniqueIdentifier.
640
641         * platform/audio/mac/MediaSessionManagerMac.mm:
642         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Update.
643
644         * testing/Internals.cpp:
645         (WebCore::Internals::nowPlayingState const): Expose NowPlaying state.
646         * testing/Internals.h:
647         * testing/Internals.idl:
648
649 2018-05-16  Daniel Bates  <dabates@apple.com>
650
651         Attempt to fix the WinCairo build following r231859
652         (https://bugs.webkit.org/show_bug.cgi?id=185654)
653
654         Instantiate Cookie as a struct and set applicable fields.
655
656         * platform/network/curl/CookieJarDB.cpp:
657         (WebCore::CookieJarDB::searchCookies):
658
659 2018-05-16  Daniel Bates  <dabates@apple.com>
660
661         Cleanup platform Cookie
662         https://bugs.webkit.org/show_bug.cgi?id=185654
663
664         Reviewed by Per Arne Vollan.
665
666         Remove unnecessary constructor and use =default for default constructor.
667         Simplify Cookie::decode() by having it decode directly into a stack-allocated
668         cookie. Remove some unnecessary local variables. Fix style nits.
669
670         * platform/Cookie.h:
671         (WebCore::Cookie::Cookie):
672         (WebCore::Cookie::isNull const):
673         (WebCore::Cookie::encode const):
674         (WebCore::Cookie::decode):
675         * platform/network/cf/CookieJarCFNet.cpp:
676         (WebCore::getRawCookies):
677         * platform/network/cocoa/CookieCocoa.mm:
678         (WebCore::cookieCreated):
679         (WebCore::Cookie::Cookie):
680         (WebCore::Cookie::operator== const):
681         (WebCore::Cookie::hash const):
682         * platform/network/soup/CookieJarSoup.cpp:
683         (WebCore::getRawCookies):
684
685 2018-05-14  Yusuke Suzuki  <utatane.tea@gmail.com>
686
687         [Win] Use C++17 in MSVC
688         https://bugs.webkit.org/show_bug.cgi?id=185232
689
690         Reviewed by Alex Christensen.
691
692         Workaround for MSVC + /std:c++17.
693
694         * Modules/geolocation/Coordinates.h:
695         (WebCore::Coordinates::isolatedCopy const):
696
697 2018-05-16  Chris Nardi  <cnardi@chromium.org>
698
699         Remove Document#selectedStylesheetSet/preferredStylesheetSet
700         https://bugs.webkit.org/show_bug.cgi?id=185381
701
702         Reviewed by Darin Adler.
703
704         Document#selectedStylesheetSet/preferredStylesheetSet are non-standard methods that
705         are only implemented WebKit. Blink removed these methods in https://crbug.com/690609.
706         The standard versions of these methods are are no longer in the spec. Remove them
707         entirely from our implementation.
708
709         Updated existing tests and imported/w3c/web-platform-tests/cssom/historical.html.
710
711         * dom/Document.cpp:
712         (WebCore::Document::processHttpEquiv):
713         * dom/Document.h:
714         * dom/Document.idl:
715         * style/StyleScope.cpp:
716         (WebCore::Style::Scope::collectActiveStyleSheets):
717         * style/StyleScope.h:
718         (WebCore::Style::Scope::preferredStylesheetSetName const):
719
720 2018-05-16  Zalan Bujtas  <zalan@apple.com>
721
722         [LFC] Implement width computation for replaced inflow elements.
723         https://bugs.webkit.org/show_bug.cgi?id=185672
724
725         Reviewed by Antti Koivisto.
726
727         Replaced width for block, inline and float elements compute the same way. 
728
729         * layout/FormattingContext.cpp:
730         (WebCore::Layout::FormattingContext::computeWidth const):
731         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
732         (WebCore::Layout::FormattingContext::computeInFlowReplacedWidth const):
733         * layout/FormattingContext.h:
734         * layout/blockformatting/BlockFormattingContext.cpp:
735         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
736         * layout/layouttree/LayoutBox.cpp:
737         (WebCore::Layout::Box::hasIntrinsicWidth const):
738         (WebCore::Layout::Box::hasIntrinsicHeight const):
739         (WebCore::Layout::Box::hasIntrinsicRatio const):
740         (WebCore::Layout::Box::intrinsicWidth const):
741         (WebCore::Layout::Box::intrinsicHeight const):
742         (WebCore::Layout::Box::intrinsicRatio const):
743         * layout/layouttree/LayoutBox.h:
744
745 2018-05-16  Zalan Bujtas  <zalan@apple.com>
746
747         [LFC] Make Display::Box box sizing aware
748         https://bugs.webkit.org/show_bug.cgi?id=185649
749
750         Reviewed by Antti Koivisto.
751
752         Display::Box::width() == Display::Box::contentBox().width() <= box-sizing: content-box; (initial and default value)
753         Display::Box::width() == Display::Box::borderBox().width() <= box-sizing: border-box;
754
755         * layout/LayoutContext.cpp:
756         (WebCore::Layout::LayoutContext::createDisplayBox):
757         * layout/displaytree/DisplayBox.cpp:
758         (WebCore::Display::Box::Box):
759         (WebCore::Display::Box::marginBox const):
760         (WebCore::Display::Box::borderBox const):
761         (WebCore::Display::Box::paddingBox const):
762         (WebCore::Display::Box::contentBox const):
763         * layout/displaytree/DisplayBox.h:
764
765 2018-05-16  Antoine Quint  <graouts@apple.com>
766
767         REGRESSION (r230574): Interrupted hardware transitions don't behave correctly
768         https://bugs.webkit.org/show_bug.cgi?id=185299
769         <rdar://problem/39630230>
770
771         Reviewed by Simon Fraser.
772
773         In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first
774         process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause
775         or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation
776         running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since
777         the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a
778         newly-uncommitted animation.
779
780         Test: transitions/interrupted-transition-hardware.html
781
782         * platform/graphics/ca/GraphicsLayerCA.cpp:
783         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
784         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
785         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
786         * platform/graphics/ca/GraphicsLayerCA.h:
787         (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
788
789 2018-05-15  Yusuke Suzuki  <utatane.tea@gmail.com>
790
791         [JSC] Check TypeInfo first before calling getCallData when we would like to check whether given object is a function
792         https://bugs.webkit.org/show_bug.cgi?id=185601
793
794         Reviewed by Saam Barati.
795
796         No behavior change.
797
798         * Modules/plugins/QuickTimePluginReplacement.mm:
799         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
800         * bindings/js/JSCustomElementRegistryCustom.cpp:
801         (WebCore::getCustomElementCallback):
802         * bindings/js/JSDOMConstructorBase.h:
803         * bindings/js/JSDOMConvertCallbacks.h:
804         (WebCore::Converter<IDLCallbackFunction<T>>::convert):
805         * bindings/js/JSDOMPromise.cpp:
806         (WebCore::DOMPromise::whenSettled):
807         * bindings/js/ReadableStream.cpp:
808         (WebCore::ReadableStream::pipeTo):
809         (WebCore::ReadableStream::tee):
810         * bindings/js/ReadableStreamDefaultController.cpp:
811         (WebCore::ReadableStreamDefaultController::invoke):
812         * bindings/scripts/CodeGeneratorJS.pm:
813         (GenerateHeader):
814         (GenerateOverloadDispatcher):
815         * bindings/scripts/test/JS/JSTestObj.h:
816         * bindings/scripts/test/JS/JSTestPluginInterface.h:
817         * bridge/objc/objc_runtime.h:
818         * bridge/runtime_method.h:
819         * bridge/runtime_object.h:
820         * html/HTMLMediaElement.cpp:
821         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
822         * testing/Internals.cpp:
823         (WebCore::Internals::parserMetaData):
824         (WebCore::Internals::cloneArrayBuffer):
825
826 2018-05-15  Matt Baker  <mattbaker@apple.com>
827
828         Web Inspector: element details hanger in inspector overlay should have better placement logic
829         https://bugs.webkit.org/show_bug.cgi?id=128482
830         <rdar://problem/16020709>
831
832         Reviewed by Timothy Hatcher.
833
834         When determining the best position for the hovered element details "tooltip",
835         perform placement tests in view space, not canvas space, and account for the
836         top content inset.
837
838         * inspector/InspectorOverlayPage.js:
839         (reset): Drive by fix: added missing `.height`.
840         (_drawElementTitle):
841
842 2018-05-15  Commit Queue  <commit-queue@webkit.org>
843
844         Unreviewed, rolling out r231765.
845         https://bugs.webkit.org/show_bug.cgi?id=185668
846
847         the layout test added with this change is very flaky
848         (Requested by realdawei on #webkit).
849
850         Reverted changeset:
851
852         "REGRESSION (r230574): Interrupted hardware transitions don't
853         behave correctly"
854         https://bugs.webkit.org/show_bug.cgi?id=185299
855         https://trac.webkit.org/changeset/231765
856
857 2018-05-15  Devin Rousso  <webkit@devinrousso.com>
858
859         Web Inspector: Add rulers and guides
860         https://bugs.webkit.org/show_bug.cgi?id=32263
861         <rdar://problem/19281564>
862
863         Reviewed by Matt Baker.
864
865         This patch is purely a visual change for WebInspector, and doesn't affect anything else.
866
867         * inspector/InspectorOverlay.h:
868         * inspector/InspectorOverlay.cpp:
869         (WebCore::InspectorOverlay::update):
870         (WebCore::InspectorOverlay::reset):
871         (WebCore::InspectorOverlay::drawGutter): Deleted.
872
873         * inspector/InspectorOverlayPage.html:
874         * inspector/InspectorOverlayPage.js:
875         (Bounds): Added.
876         (Bounds.prototype.get minX): Added.
877         (Bounds.prototype.get minY): Added.
878         (Bounds.prototype.get maxX): Added.
879         (Bounds.prototype.get maxY): Added.
880         (Bounds.prototype.update): Added.
881         (drawNodeHighlight):
882         (drawQuadHighlight):
883         (reset):
884         (_isolateActions): Added.
885         (_quadToPath): Added.
886         (_quadToPath.parseQuadPoint): Added.
887         (_drawOutlinedQuad): Added.
888         (_drawPath): Added.
889         (_drawPath.parsePoints): Added.
890         (_drawOutlinedQuadWithClip): Added.
891         (_drawElementTitle):
892         (_drawShapeHighlight):
893         (_drawFragmentHighlight):
894         (_drawRulers): Added.
895         (quadToPath): Deleted.
896         (drawOutlinedQuad): Deleted.
897         (pathCommand): Deleted.
898         (drawPath): Deleted.
899         (drawOutlinedQuadWithClip): Deleted.
900         (drawGutter): Deleted.
901         * inspector/InspectorOverlayPage.css:
902         (#log): Added.
903         (#right-gutter): Deleted.
904         (#bottom-gutter): Deleted.
905
906 2018-05-15  Jer Noble  <jer.noble@apple.com>
907
908         Media continues loading after rendered invisible (removed from DOM; scrolled off screen)
909         https://bugs.webkit.org/show_bug.cgi?id=185487
910
911         Reviewed by Eric Carlson.
912
913         Test: media/video-buffering-allowed.html
914
915         When a media element is removed from the dom (e.g. through innerHTML=""), it doesn't
916         necessarily stop loading media data; it will continue to do so until its destructor is
917         called through garbage collection. Similarly, when a media element is rendered not-visible
918         by being scrolled off-screen or being made display:none, media loading continues. There
919         are legitimate use cases for out-of-DOM media loading, so only temporarily block loading
920         when the element transitions out of the document. Similarly, only block loading for non-visible
921         media elements when returning from the "page is hidden" state, and only until the media
922         element is asked to play or is otherwise made visible.
923
924         Note: this refactors a lot of code out of PlatformMediaSession and into MediaElementSession,
925         since this code is specific to "media elements".
926
927         * html/HTMLMediaElement.cpp:
928         (WebCore::HTMLMediaElement::HTMLMediaElement):
929         (WebCore::HTMLMediaElement::insertedIntoAncestor):
930         (WebCore::HTMLMediaElement::removedFromAncestor):
931         (WebCore::HTMLMediaElement::playInternal):
932         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
933         (WebCore::HTMLMediaElement::resume):
934         (WebCore::HTMLMediaElement::visibilityStateChanged):
935         (WebCore::HTMLMediaElement::createMediaPlayer):
936         (WebCore::HTMLMediaElement::setShouldBufferData):
937         (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
938         (WebCore::HTMLMediaElement::isVisibleInViewportChanged):
939         (WebCore::HTMLMediaElement::fullscreenModeChanged):
940         (WebCore::HTMLMediaElement::setInActiveDocument):
941         * html/HTMLMediaElement.h:
942         (WebCore::HTMLMediaElement::shouldBufferData const):
943         (WebCore::HTMLMediaElement::elementIsHidden const):
944         * html/MediaElementSession.cpp:
945         (WebCore::MediaElementSession::MediaElementSession):
946         (WebCore::MediaElementSession::clientWillBeginAutoplaying):
947         (WebCore::MediaElementSession::clientWillBeginPlayback):
948         (WebCore::MediaElementSession::clientWillPausePlayback):
949         (WebCore::MediaElementSession::visibilityChanged):
950         (WebCore::MediaElementSession::isVisibleInViewportChanged):
951         (WebCore::MediaElementSession::inActiveDocumentChanged):
952         (WebCore::MediaElementSession::scheduleClientDataBufferingCheck):
953         (WebCore::MediaElementSession::clientDataBufferingTimerFired):
954         (WebCore::MediaElementSession::updateClientDataBuffering):
955         (WebCore::MediaElementSession::dataBufferingPermitted const):
956         (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForAutoplay const):
957         * html/MediaElementSession.h:
958         * platform/audio/PlatformMediaSession.cpp:
959         (WebCore::PlatformMediaSession::PlatformMediaSession):
960         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying):
961         (WebCore::PlatformMediaSession::clientWillBeginPlayback):
962         (WebCore::PlatformMediaSession::clientWillPausePlayback):
963         (): Deleted.
964         (WebCore::PlatformMediaSession::visibilityChanged): Deleted.
965         (WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck): Deleted.
966         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired): Deleted.
967         (WebCore::PlatformMediaSession::updateClientDataBuffering): Deleted.
968         (WebCore::PlatformMediaSession::isHidden const): Deleted.
969         * platform/audio/PlatformMediaSession.h:
970         (WebCore::PlatformMediaSessionClient::setShouldBufferData): Deleted.
971         (WebCore::PlatformMediaSessionClient::elementIsHidden const): Deleted.
972         * platform/audio/PlatformMediaSessionManager.cpp:
973         (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia const): Deleted.
974         * platform/audio/PlatformMediaSessionManager.h:
975         * platform/audio/ios/MediaSessionManagerIOS.h:
976         * platform/audio/ios/MediaSessionManagerIOS.mm:
977         (WebCore::MediaSessionManageriOS::sessionCanLoadMedia const): Deleted.
978         * rendering/RenderVideo.cpp:
979         (WebCore::RenderVideo::willBeDestroyed):
980         * testing/Internals.cpp:
981         (WebCore::Internals::elementShouldBufferData):
982         * testing/Internals.h:
983         * testing/Internals.idl:
984
985 2018-05-15  Charles Vazac  <cvazac@gmail.com>
986
987         Add the PerformanceServerTiming Interface which makes Server-Timing header timing values available to JavaScript running in the browser.
988         https://bugs.webkit.org/show_bug.cgi?id=175569
989
990         Reviewed by Youenn Fablet.
991
992         Tests were imported from web-platform-tests: WebKit/LayoutTests/imported/w3c/web-platform-tests/server-timing/*
993
994         * Sources.txt: Added references to HeaderFieldTokenizer.cpp, ServerTiming.cpp, and ServerTimingParser.cpp.
995         * WebCore.xcodeproj/project.pbxproj: Added various files.
996         * loader/HeaderFieldTokenizer.cpp: Added.
997         (WebCore::HeaderFieldTokenizer::HeaderFieldTokenizer): Added class for tokenizing header values.
998         (WebCore::HeaderFieldTokenizer::consume): Added method to consume a specified character.
999         (WebCore::HeaderFieldTokenizer::consumeQuotedString): Added method to consume a quote-string.
1000         (WebCore::HeaderFieldTokenizer::consumeToken): Added a method to consume a token.
1001         (WebCore::HeaderFieldTokenizer::consumeTokenOrQuotedString): Added method to consume a quote-string or quote-string, depending on net character.
1002         (WebCore::HeaderFieldTokenizer::skipSpaces): Added method to skip whitespace.
1003         (WebCore::HeaderFieldTokenizer::consumeBeforeAnyCharMatch): Added method to advance the cursor up until any of a list of characters.
1004         * loader/HeaderFieldTokenizer.h: Added.
1005         * loader/HTTPHeaderField.cpp: Expose isTokenCharacter and isWhitespace.
1006         * loader/HTTPHeaderField.h: Expose isTokenCharacter and isWhitespace.
1007         * loader/PolicyChecker.cpp: Added #include so source compiled on my machine.
1008         * loader/ResourceTiming.cpp:
1009         (WebCore::ResourceTiming::ResourceTiming): Added call to initServerTiming to parse the header.
1010         (WebCore::ResourceTiming::initServerTiming): Added method to parse the header.
1011         (WebCore::ResourceTiming::populateServerTiming): Added method to populate the server timing entries on a PerformanceResourceTiming object.
1012         (WebCore::ResourceTiming::isolatedCopy const): Added code to copy over the server timing entries.
1013         * loader/ResourceTiming.h:
1014         (WebCore::ResourceTiming::ResourceTiming): Accept collection of server timing entries in c'tor.
1015         * loader/ServerTiming.cpp: Added.
1016         (WebCore::ServerTiming::setParameter): Set named parameters, ignoring unrecognized or duplicates.
1017         (WebCore::ServerTiming::isolatedCopy const): Return a new pointer to the object.
1018         * loader/ServerTiming.h: Added.
1019         (WebCore::ServerTiming::ServerTiming): Added struct for the data needed by a server timing entry.
1020         (WebCore::ServerTiming::name const): Added name field of a server timing entry.
1021         (WebCore::ServerTiming::duration const): Added duration field of a server timing entry.
1022         (WebCore::ServerTiming::description const): Added description field of a server timing entry.
1023         * loader/ServerTimingParser.cpp: Added.
1024         (WebCore::ServerTimingParser::parseServerTiming): Parses the header generating a collection of server timing structs.
1025         * loader/ServerTimingParser.h: Added.
1026         * loader/WorkerThreadableLoader.h: Fix build.
1027         * page/Performance.cpp:
1028         (WebCore::Performance::addResourceTiming): Fixed a typo.
1029         * page/PerformanceResourceTiming.cpp:
1030         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming): Given a ResourceTiming object, populate our collection of PerformanceServerTiming objects.
1031         * page/PerformanceResourceTiming.h: Added serverTiming member and getter.
1032         * page/PerformanceResourceTiming.idl: Added serverTiming member to interface.
1033         * platform/network/HTTPHeaderNames.in: Added "Server-Timing" to the header enum.
1034         * platform/network/ResourceResponseBase.cpp: Added "Server-Timing" to isSafeCrossOriginResponseHeader whitelist.
1035
1036 2018-05-15  Brady Eidson  <beidson@apple.com>
1037
1038         Fix crash after a Worker terminates but there are still IDB transactions the server is trying to open for it.
1039         <rdar://problem/33744241> and https://bugs.webkit.org/show_bug.cgi?id=185653
1040
1041         Reviewed by Andy Estes.
1042
1043         Test: storage/indexeddb/modern/worker-transaction-open-after-worker-stop.html
1044
1045         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1046         (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction): It's okay to not be able to find a pending TX
1047           that the server has started. e.g. When it was a WebWorker that asked for the TX but it has since terminated.
1048
1049 2018-05-15  Thomas Klausner  <tk@giga.or.at>
1050
1051         Add missing header to fix build.
1052         https://bugs.webkit.org/show_bug.cgi?id=185378
1053
1054         Reviewed by Michael Catanzaro.
1055
1056         * platform/network/soup/SoupNetworkSession.h:
1057
1058 2018-05-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1059
1060         [WPE] Build failure with RPi userland drivers and gstreamer-gl
1061         https://bugs.webkit.org/show_bug.cgi?id=185639
1062
1063         Reviewed by Philippe Normand.
1064
1065         When building for the RPi with userland drivers (dispmanx) override the
1066         value of GST_GL_HAVE_GLSYNC to 1 to avoid that the gstreamer-gl headers
1067         try to redefine the GLsync type that is already defined in libepoxy.
1068
1069         Defining __gl2_h_ is also needed to avoid other conflicting type
1070         definitions that happen between libepoxy and RPi GLES2 userland
1071         headers when the gstreamer-gl headers are included.
1072
1073         The issue doesn't happen with 1.14.0, so a check for that is added
1074         as well.
1075
1076         No new tests, no behavior change. It is a build fix.
1077
1078         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1079
1080 2018-05-15  Michael Catanzaro  <mcatanzaro@igalia.com>
1081
1082         Unreviewed, rolling out r230749
1083
1084         This did not work as desired.
1085
1086         * platform/UserAgentQuirks.cpp:
1087         (WebCore::urlRequiresMacintoshPlatform):
1088
1089 2018-05-15  Dirk Schulze  <krit@webkit.org>
1090
1091         Add new SVGDOM SVGFEBLEND constants
1092         https://bugs.webkit.org/show_bug.cgi?id=185581
1093
1094         Reviewed by Simon Fraser.
1095
1096         Provide new SVG DOM constants for the new blend modes added to feBlend.
1097
1098         https://drafts.fxtf.org/filter-effects-1/#InterfaceSVGFEBlendElement
1099
1100         * platform/graphics/GraphicsTypes.cpp:
1101         (WebCore::blendModeName):
1102         * platform/graphics/GraphicsTypes.h:
1103         * svg/SVGFEBlendElement.h:
1104         (WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue):
1105         (WebCore::SVGPropertyTraits<BlendMode>::toString):
1106         * svg/SVGFEBlendElement.idl:
1107
1108 2018-05-15  Antoine Quint  <graouts@apple.com>
1109
1110         [Web Animations] Expose Web Animations CSS integration as an experimental feature
1111         https://bugs.webkit.org/show_bug.cgi?id=185647
1112
1113         Reviewed by Dean Jackson.
1114
1115         Make the Web Animations CSS integration flag an experimental feature, and only indicate that it is on if the Web Animations
1116         experimental feature is also enabled.
1117
1118         * dom/Document.cpp:
1119         (WebCore::Document::didBecomeCurrentDocumentInFrame):
1120         (WebCore::Document::resume):
1121         * dom/Element.cpp:
1122         (WebCore::Element::removedFromAncestor):
1123         * dom/PseudoElement.cpp:
1124         (WebCore::PseudoElement::clearHostElement):
1125         * history/CachedFrame.cpp:
1126         (WebCore::CachedFrameBase::restore):
1127         * page/Frame.cpp:
1128         (WebCore::Frame::clearTimers):
1129         * page/FrameView.cpp:
1130         (WebCore::FrameView::didDestroyRenderTree):
1131         * page/Page.cpp:
1132         (WebCore::Page::handleLowModePowerChange):
1133         (WebCore::Page::setIsVisibleInternal):
1134         (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
1135         * page/RuntimeEnabledFeatures.h:
1136         (WebCore::RuntimeEnabledFeatures::setWebAnimationsCSSIntegrationEnabled):
1137         (WebCore::RuntimeEnabledFeatures::webAnimationsCSSIntegrationEnabled const):
1138         (WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
1139         (WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const): Deleted.
1140         * rendering/RenderLayer.cpp:
1141         (WebCore::RenderLayer::currentTransform const):
1142         (WebCore::RenderLayer::calculateClipRects const):
1143         * rendering/RenderLayerBacking.cpp:
1144         (WebCore::RenderLayerBacking::updateGeometry):
1145         * rendering/RenderLayerCompositor.cpp:
1146         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
1147         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
1148         * rendering/updating/RenderTreeUpdater.cpp:
1149         (WebCore::RenderTreeUpdater::tearDownRenderers):
1150         * style/StyleTreeResolver.cpp:
1151         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1152         * testing/InternalSettings.cpp:
1153         (WebCore::InternalSettings::webAnimationsCSSIntegrationEnabled):
1154         (WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
1155         * testing/InternalSettings.h:
1156         * testing/InternalSettings.idl:
1157         * testing/Internals.cpp:
1158         (WebCore::Internals::numberOfActiveAnimations const):
1159         (WebCore::Internals::animationsAreSuspended const):
1160         (WebCore::Internals::animationsInterval const):
1161         (WebCore::Internals::suspendAnimations const):
1162         (WebCore::Internals::resumeAnimations const):
1163
1164 2018-05-15  David Kilzer  <ddkilzer@apple.com>
1165
1166         Fix -Wreturn-std-move warnings in WebKit found by new clang compiler
1167         <https://webkit.org/b/185621>
1168
1169         Reviewed by Youenn Fablet.
1170
1171         Fix warnings like the following:
1172
1173             In file included from DerivedSources/WebCore/unified-sources/UnifiedSource139.cpp:5:
1174             ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: error: local variable 'sdp' will be copied despite being returned by name [-Werror,-Wreturn-std-move]
1175                     return sdp;
1176                            ^~~
1177             ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: note: call 'std::move' explicitly to avoid copying
1178                     return sdp;
1179                            ^~~
1180                            std::move(sdp)
1181             1 error generated.
1182
1183         * Modules/mediastream/PeerConnectionBackend.cpp:
1184         (WebCore::PeerConnectionBackend::filterSDP const):
1185         * accessibility/AccessibilityObject.cpp:
1186         (WebCore::rangeClosestToRange):
1187         * bindings/js/JSDOMConvertSequences.h:
1188         (WebCore::Detail::GenericSequenceConverter::convert):
1189         (WebCore::Detail::NumericSequenceConverter::convertArray):
1190         * bindings/js/JSDOMConvertStrings.cpp:
1191         (WebCore::stringToByteString):
1192         (WebCore::stringToUSVString):
1193         - Use WTFMove() in return statements to fix the warnings.
1194
1195 2018-05-14  Dean Jackson  <dino@apple.com>
1196
1197         Download and present System Preview
1198         https://bugs.webkit.org/show_bug.cgi?id=185459
1199         <rdar://problem/40079228>
1200
1201         Reviewed by Tim Horton.
1202
1203         If an <a> is a system preview, tell the resource request about it.
1204
1205         * html/HTMLAnchorElement.cpp:
1206         (WebCore::HTMLAnchorElement::handleClick):
1207
1208 2018-05-15  Antti Koivisto  <antti@apple.com>
1209
1210         animation-play-state: paused causes very high cpu load because of style invalidation loop
1211         https://bugs.webkit.org/show_bug.cgi?id=182436
1212         <rdar://problem/37182562>
1213
1214         Reviewed by Dean Jackson.
1215
1216         Test: animations/animation-playstate-paused-style-resolution.html
1217
1218         If the style of an element with 'animation-play-state: paused' is recomputed so it stays
1219         paused we would enter zero-duration animation timer loop.
1220
1221         * page/animation/AnimationBase.cpp:
1222         (WebCore::AnimationBase::updateStateMachine):
1223
1224         Don't move to AnimationState::PausedWaitResponse unless we get AnimationStateInput::StyleAvailable
1225         (matching the comments). Otherwise just stay in the existing paused state.
1226
1227         Remove AnimationStateInput::StartAnimation from assertion as the case can't happen.
1228
1229 2018-05-14  Youenn Fablet  <youenn@apple.com>
1230
1231         readableStreamDefaultControllerError should return early if stream is not readable
1232         https://bugs.webkit.org/show_bug.cgi?id=185602
1233
1234         Reviewed by Chris Dumez.
1235
1236         Return early if stream is not readable in @readableStreamDefaultControllerError.
1237         Update call sites to no longer check for ReadableStream state.
1238         Covered by unflaked and rebased tests.
1239
1240         * Modules/streams/ReadableStreamDefaultController.js:
1241         (error):
1242         * Modules/streams/ReadableStreamInternals.js:
1243         (readableStreamDefaultControllerError):
1244         (readableStreamDefaultControllerCallPullIfNeeded):
1245
1246 2018-05-14  Zalan Bujtas  <zalan@apple.com>
1247
1248         [LFC] Implement width computation for non-replaced block level inflow elements.
1249         https://bugs.webkit.org/show_bug.cgi?id=185641
1250
1251         Reviewed by Sam Weinig.
1252
1253         Block level inflow elements participate in block formatting context.
1254
1255         * layout/FormattingContext.cpp:
1256         (WebCore::Layout::FormattingContext::computeWidth const):
1257         * layout/FormattingContext.h:
1258         * layout/blockformatting/BlockFormattingContext.cpp:
1259         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
1260         * layout/blockformatting/BlockFormattingContext.h:
1261         * layout/inlineformatting/InlineFormattingContext.cpp:
1262         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
1263         * layout/inlineformatting/InlineFormattingContext.h:
1264
1265 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1266
1267         Unreviewed, fix the iOS build after r231779
1268
1269         Also address a minor in-person review comment by returning "extrazoom" instead of the empty string.
1270
1271         * page/DisabledAdaptations.cpp:
1272         (WebCore::extraZoomModeAdaptationName):
1273
1274 2018-05-14  Zalan Bujtas  <zalan@apple.com>
1275
1276         [LFC] FormattingContext:computeOutOfFlowNonReplacedHeight/Width should use the computed margins/paddings/borders
1277         https://bugs.webkit.org/show_bug.cgi?id=185633
1278
1279         Reviewed by Sam Weinig.
1280
1281         By the time we start computing height and width, DisplayBox should already have the computed values for margin/padding/border.
1282
1283         * layout/FormattingContext.cpp:
1284         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
1285         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
1286         * layout/displaytree/DisplayBox.h:
1287         (WebCore::Display::Box::paddingTop const):
1288         (WebCore::Display::Box::paddingLeft const):
1289         (WebCore::Display::Box::paddingBottom const):
1290         (WebCore::Display::Box::paddingRight const):
1291         (WebCore::Display::Box::borderTop const):
1292         (WebCore::Display::Box::borderLeft const):
1293         (WebCore::Display::Box::borderBottom const):
1294         (WebCore::Display::Box::borderRight const):
1295
1296 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1297
1298         [Extra zoom mode] Google search results are excessively zoomed in
1299         https://bugs.webkit.org/show_bug.cgi?id=185347
1300         <rdar://problem/39999778>
1301
1302         Reviewed by Tim Horton.
1303
1304         It turns out that basing minimum layout size and shrink-to-fit behaviors off of the `shrink-to-fit` viewport
1305         argument poses compatibility risks with web pages that already specify `shrink-to-fit` to opt out of default
1306         viewport shrinking behaviors in 1/3 multitasking mode on iPad.
1307
1308         One way to resolve this is to introduce a new viewport meta content attribute to disable viewport heuristics in
1309         extra zoom mode. However, combined shrink-to-fit and minimum device width behaviors are difficult to describe
1310         using a single backwards-compatible viewport meta content attribute, and the need to suppress the default
1311         behavior of `shrink-to-fit=no` if such an attribute is not disabled further muddles our viewport story.
1312
1313         After some internal deliberation, we’ve decided to experiment with a new meta tag named "disabled-adaptations".
1314         The content of this meta tag is a comma-separated list of adaptation names; if an adaptation name matches a
1315         known adaptation type (for instance, extra zoom mode), we disable the class of behaviors used to adapt web
1316         content. The first and only known adaptation type is extra zoom mode, which affects `shrink-to-fit` and layout
1317         size adjustments.
1318
1319         See per-method changes below for more details.
1320
1321         Test: fast/viewport/extrazoom/viewport-disable-extra-zoom-adaptations.html
1322
1323         * Sources.txt:
1324         * WebCore.xcodeproj/project.pbxproj:
1325         * dom/Document.cpp:
1326         (WebCore::Document::processDisabledAdaptations):
1327         * dom/Document.h:
1328         (WebCore::Document::disabledAdaptations const):
1329
1330         Add disabled adaptations to Document. Changes to disabled adaptations are not propagated if the parsed disabled
1331         adaptation types don't change; upon changing adaptation types, notify the client to adjust for the new disabled
1332         adaptations (currently, this only affects the viewport configuration).
1333
1334         * dom/ViewportArguments.h:
1335         * html/HTMLMetaElement.cpp:
1336         (WebCore::HTMLMetaElement::process):
1337         * html/parser/HTMLPreloadScanner.cpp:
1338         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
1339         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
1340         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
1341         * loader/FrameLoader.cpp:
1342         (WebCore::FrameLoader::commitProvisionalLoad):
1343
1344         Restore the set of disabled adaptations when restoring a page from the cache.
1345
1346         * page/Chrome.cpp:
1347         (WebCore::Chrome::dispatchDisabledAdaptationsDidChange const):
1348         * page/Chrome.h:
1349         * page/ChromeClient.h:
1350
1351         Add plumbing for changes to the set of disabled adaptations.
1352
1353         * page/DisabledAdaptations.cpp: Added.
1354         (WebCore::extraZoomModeAdaptationName):
1355         * page/DisabledAdaptations.h: Added.
1356
1357         Introduce a header containing a new enum for the extra zoom mode adaptation, as well as a helper function to
1358         return the extra zoom mode adaptation name.
1359
1360         * page/Page.cpp:
1361         (WebCore::Page::disabledAdaptations const):
1362
1363         Returns the mainframe's set of adaptations to disable.
1364
1365         * page/Page.h:
1366         * page/RemoteFrame.h:
1367         * page/RuntimeEnabledFeatures.h:
1368         (WebCore::RuntimeEnabledFeatures::setDisabledAdaptationsMetaTagEnabled):
1369         (WebCore::RuntimeEnabledFeatures::disabledAdaptationsMetaTagEnabled const):
1370
1371         Add a new runtime feature to gate handling the "disabled-adaptations" meta tag.
1372
1373         * page/ViewportConfiguration.cpp:
1374         (WebCore::shouldOverrideShrinkToFitArgument):
1375         (WebCore::needsUpdateAfterChangingDisabledAdaptations):
1376         (WebCore::ViewportConfiguration::setDisabledAdaptations):
1377         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
1378
1379         Consult whether or not extra zoom mode adaptations are disabled, instead of the shrink-to-fit attribute value.
1380
1381         (WebCore::ViewportConfiguration::updateConfiguration):
1382         * page/ViewportConfiguration.h:
1383
1384         Add an OptionSet of disabled adaptation types to ViewportConfiguration. Updates to the adaptation type are
1385         propagated to the ViewportConfiguration from Document, through the ChromeClient and the client layer (refer to
1386         changes in WebKit). Once the OptionSet is changed, we recompute the viewport configuration only if needed by the
1387         platform.
1388
1389         (WebCore::ViewportConfiguration::viewLayoutSize const):
1390         (WebCore::ViewportConfiguration::disabledAdaptations const):
1391         * page/WindowFeatures.cpp:
1392         (WebCore::parseDisabledAdaptations):
1393         * page/WindowFeatures.h:
1394
1395         Add a new helper to parse the meta content of a "disabled-adaptations" tag as an OptionSet of disabled
1396         adaptation types. The string is parsed by first splitting on the comma character, and then iterating over lower
1397         case, whitespace-stripped tokens to look for known adaptation names. So far, only extra zoom mode is supported.
1398
1399         * testing/Internals.cpp:
1400         (WebCore::Internals::extraZoomModeAdaptationName const):
1401         * testing/Internals.h:
1402         * testing/Internals.idl:
1403
1404         Expose the extra zoom mode adaptation name to the DOM, only when running layout tests.
1405
1406 2018-05-14  Joanmarie Diggs  <jdiggs@igalia.com>
1407
1408         AX: Listbox and Combobox roles embedded in labels should participate in name calculation
1409         https://bugs.webkit.org/show_bug.cgi?id=185521
1410
1411         Reviewed by Chris Fleizach.
1412
1413         Take selected children into account when computing the name in accessibleNameForNode.
1414         Add ListBox to the roles for which accessibleNameDerivesFromContent returns false so
1415         that native select elements with size > 1 are treated the same way as ARIA listbox.
1416         Also add ListBox to the roles which are treated as controls when used in ARIA. Finally,
1417         prevent labels which contain unrelated controls from being used as an AXTitleUIElement.
1418         This causes us to build a string from the label and its descendants, ensuring the latter
1419         participate in the name calculation.
1420
1421         Test: accessibility/text-alternative-calculation-from-listbox.html
1422
1423         * accessibility/AccessibilityLabel.cpp:
1424         (WebCore::childrenContainUnrelatedControls):
1425         (WebCore::AccessibilityLabel::containsUnrelatedControls const):
1426         * accessibility/AccessibilityLabel.h:
1427         * accessibility/AccessibilityNodeObject.cpp:
1428         (WebCore::accessibleNameForNode):
1429         * accessibility/AccessibilityObject.cpp:
1430         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
1431         (WebCore::AccessibilityObject::isARIAControl):
1432         * accessibility/AccessibilityRenderObject.cpp:
1433         (WebCore::AccessibilityRenderObject::exposesTitleUIElement const):
1434         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
1435
1436 2018-05-14  Antoine Quint  <graouts@apple.com>
1437
1438         [Web Animations] Tests using the new animation engine may crash under WebCore::FrameView::didDestroyRenderTree when using internals methods
1439         https://bugs.webkit.org/show_bug.cgi?id=185612
1440         <rdar://problem/39579344>
1441
1442         Reviewed by Dean Jackson.
1443
1444         Add a new internals.pseudoElement() method to obtain a pseudo element matching a given pseudo-id. This is necessary to be able to move off
1445         internals.pauseTransitionAtTimeOnPseudoElement() and internals.pauseAnimationAtTimeOnPseudoElement() for Web Animations testing.
1446
1447         * testing/Internals.cpp:
1448         (WebCore::Internals::pseudoElement):
1449         * testing/Internals.h:
1450         * testing/Internals.idl:
1451
1452 2018-05-14  Antoine Quint  <graouts@apple.com>
1453
1454         REGRESSION (r230574): Interrupted hardware transitions don't behave correctly
1455         https://bugs.webkit.org/show_bug.cgi?id=185299
1456         <rdar://problem/39630230>
1457
1458         Reviewed by Simon Fraser.
1459
1460         In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first
1461         process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause
1462         or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation
1463         running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since
1464         the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a
1465         newly-uncommitted animation.
1466
1467         Test: transitions/interrupted-transition-hardware.html
1468
1469         * platform/graphics/ca/GraphicsLayerCA.cpp:
1470         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
1471         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
1472         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1473         * platform/graphics/ca/GraphicsLayerCA.h:
1474         (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
1475
1476 2018-05-14  Thibault Saunier  <tsaunier@igalia.com>
1477
1478         [GStreamer] Fix style issue in MediaPlayerPrivateGStreamerBase
1479         https://bugs.webkit.org/show_bug.cgi?id=185510
1480
1481         Reviewed by Philippe Normand.
1482
1483         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:629:  More than one command on the same line  [whitespace/newline] [4]
1484         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:684:  More than one command on the same line  [whitespace/newline] [4]
1485         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:807:  More than one command on the same line  [whitespace/newline] [4]
1486
1487         Indentation and style issue fixed only.
1488
1489         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1490         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
1491         (WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback):
1492         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1493
1494 2018-05-14  Zalan Bujtas  <zalan@apple.com>
1495
1496         [LFC] Implement height computation for non-replaced out of flow elements.
1497         https://bugs.webkit.org/show_bug.cgi?id=185585
1498
1499         Reviewed by Antti Koivisto.
1500
1501         * layout/FormattingContext.cpp:
1502         (WebCore::Layout::FormattingContext::computeHeight const):
1503         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1504         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1505         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
1506         (WebCore::Layout::FormattingContext::computeHeightForBlockFormattingContextRootWithAutoHeight const):
1507         * layout/FormattingContext.h:
1508         * layout/blockformatting/BlockFormattingContext.h:
1509         * layout/displaytree/DisplayBox.h:
1510
1511 2018-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
1512
1513         Renaming of overrides in LayoutBox
1514         https://bugs.webkit.org/show_bug.cgi?id=185609
1515
1516         Reviewed by Javier Fernandez.
1517
1518         The names of the methods for the overrides were not consistent,
1519         this patch fixes it by using the same structure in all the cases.
1520
1521         No new tests, no change of behavior.
1522
1523         * rendering/GridLayoutFunctions.cpp:
1524         (WebCore::GridLayoutFunctions::hasOverrideContainingBlockContentSizeForChild):
1525         * rendering/GridTrackSizingAlgorithm.cpp:
1526         (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
1527         * rendering/RenderBlock.cpp:
1528         (WebCore::RenderBlock::computeChildPreferredLogicalWidths const):
1529         (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const):
1530         * rendering/RenderBlockFlow.cpp:
1531         (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
1532         * rendering/RenderBlockLineLayout.cpp:
1533         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
1534         * rendering/RenderBox.cpp:
1535         (WebCore::RenderBox::willBeDestroyed):
1536         (WebCore::RenderBox::hasOverrideContentLogicalHeight const):
1537         (WebCore::RenderBox::hasOverrideContentLogicalWidth const):
1538         (WebCore::RenderBox::setOverrideContentLogicalHeight):
1539         (WebCore::RenderBox::setOverrideContentLogicalWidth):
1540         (WebCore::RenderBox::clearOverrideContentLogicalHeight):
1541         (WebCore::RenderBox::clearOverrideContentLogicalWidth):
1542         (WebCore::RenderBox::clearOverrideContentSize):
1543         (WebCore::RenderBox::overrideContentLogicalWidth const):
1544         (WebCore::RenderBox::overrideContentLogicalHeight const):
1545         (WebCore::RenderBox::overrideContainingBlockContentLogicalWidth const):
1546         (WebCore::RenderBox::overrideContainingBlockContentLogicalHeight const):
1547         (WebCore::RenderBox::hasOverrideContainingBlockContentLogicalWidth const):
1548         (WebCore::RenderBox::hasOverrideContainingBlockContentLogicalHeight const):
1549         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth):
1550         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight):
1551         (WebCore::RenderBox::clearOverrideContainingBlockContentSize):
1552         (WebCore::RenderBox::clearOverrideContainingBlockContentLogicalHeight):
1553         (WebCore::RenderBox::containingBlockLogicalWidthForContent const):
1554         (WebCore::RenderBox::containingBlockLogicalHeightForContent const):
1555         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight const):
1556         (WebCore::RenderBox::computeLogicalWidthInFragment const):
1557         (WebCore::RenderBox::computeLogicalHeight const):
1558         (WebCore::RenderBox::computePercentageLogicalHeight const):
1559         (WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
1560         (WebCore::RenderBox::availableLogicalHeightUsing const):
1561         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
1562         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
1563         * rendering/RenderBox.h:
1564         * rendering/RenderBoxModelObject.cpp:
1565         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight const):
1566         * rendering/RenderDeprecatedFlexibleBox.cpp:
1567         (WebCore::contentWidthForChild):
1568         (WebCore::contentHeightForChild):
1569         (WebCore::gatherFlexChildrenInfo):
1570         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1571         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
1572         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
1573         (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
1574         * rendering/RenderFlexibleBox.cpp:
1575         (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
1576         (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
1577         (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution):
1578         (WebCore::RenderFlexibleBox::constructFlexItem):
1579         (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild):
1580         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
1581         * rendering/RenderFullScreen.cpp:
1582         (WebCore::RenderFullScreen::unwrapRenderer):
1583         * rendering/RenderGrid.cpp:
1584         (WebCore::RenderGrid::layoutBlock):
1585         (WebCore::RenderGrid::layoutGridItems):
1586         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
1587         * rendering/RenderRubyBase.cpp:
1588         (WebCore::RenderRubyBase::adjustInlineDirectionLineBounds const):
1589         * rendering/RenderTableCell.cpp:
1590         (WebCore::RenderTableCell::setOverrideContentLogicalHeightFromRowHeight):
1591         * rendering/RenderTableCell.h:
1592         * rendering/RenderTableSection.cpp:
1593         (WebCore::RenderTableSection::calcRowLogicalHeight):
1594         (WebCore::RenderTableSection::relayoutCellIfFlexed):
1595
1596 2018-05-14  Zalan Bujtas  <zalan@apple.com>
1597
1598         [LFC] Implement width computation for non-replaced out of flow elements.
1599         https://bugs.webkit.org/show_bug.cgi?id=185598
1600
1601         Reviewed by Antti Koivisto.
1602
1603         * layout/FormattingContext.cpp:
1604         (WebCore::Layout::FormattingContext::computeWidth const):
1605         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
1606         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1607         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
1608         (WebCore::Layout::FormattingContext::shrinkToFitWidth const):
1609         * layout/FormattingContext.h:
1610         * layout/blockformatting/BlockFormattingContext.cpp:
1611         (WebCore::Layout::BlockFormattingContext::layout const):
1612         * layout/displaytree/DisplayBox.h:
1613
1614 2018-05-14  Zan Dobersek  <zdobersek@igalia.com>
1615
1616         Drop the m_compositorTexture member variable in TextureMapperGC3DPlatformLayer.
1617         It's not used at all inside the class or outside it.
1618
1619         Rubber-stamped by Michael Catanzaro.
1620
1621         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
1622
1623 2018-05-14  Zan Dobersek  <zdobersek@igalia.com>
1624
1625         [GTK] REGRESSION(r231170) Build broken with Clang 5.0
1626         https://bugs.webkit.org/show_bug.cgi?id=185198
1627
1628         Reviewed by Michael Catanzaro.
1629
1630         Avoid gperf files using the register keyword which has been made
1631         reserved and as such unusable in C++17.
1632
1633         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
1634         * css/makeSelectorPseudoElementsMap.py:
1635         * css/makeprop.pl:
1636         * css/makevalues.pl:
1637         * platform/ColorData.gperf:
1638         * platform/ReferrerPolicy.h: With std::optional forward declaration
1639         gone, explicitly include the WTF Optional.h header.
1640         * platform/Theme.h: Ditto.
1641         * platform/network/create-http-header-name-table:
1642
1643 2018-05-14  Commit Queue  <commit-queue@webkit.org>
1644
1645         Unreviewed, rolling out r219515.
1646         https://bugs.webkit.org/show_bug.cgi?id=185603
1647
1648         It sometimes makes AudioUnitInitialize call to fail in
1649         CoreAudioCaptureSource (Requested by youenn on #webkit).
1650
1651         Reverted changeset:
1652
1653         "Remove CoreAudioCaptureSource speaker configuration"
1654         https://bugs.webkit.org/show_bug.cgi?id=174512
1655         https://trac.webkit.org/changeset/219515
1656
1657 2018-05-13  Dirk Schulze  <krit@webkit.org>
1658
1659         Implement SVGGeometryElement's isPointInFill and isPointInStroke
1660         https://bugs.webkit.org/show_bug.cgi?id=185580
1661
1662         Reviewed by Antti Koivisto.
1663
1664         Implement isPointInFill and isPointInStroke methods for
1665         SVGGeometryElement interface from SVG2.
1666
1667         https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
1668
1669         Tests: svg/dom/SVGGeometry-isPointInFill.xhtml
1670                svg/dom/SVGGeometry-isPointInStroke.xhtml
1671
1672         * rendering/svg/RenderSVGEllipse.cpp:
1673         (WebCore::RenderSVGEllipse::shapeDependentStrokeContains): Flag
1674                 to switch between local and "global" coordinate space for hit testing.
1675         * rendering/svg/RenderSVGEllipse.h:
1676         * rendering/svg/RenderSVGPath.cpp:
1677         (WebCore::RenderSVGPath::shapeDependentStrokeContains): Flag
1678                 to switch between local and "global" coordinate space for hit testing.
1679         * rendering/svg/RenderSVGPath.h:
1680         * rendering/svg/RenderSVGRect.cpp:
1681         (WebCore::RenderSVGRect::shapeDependentStrokeContains): Flag
1682                 to switch between local and "global" coordinate space for hit testing.
1683         * rendering/svg/RenderSVGRect.h:
1684         * rendering/svg/RenderSVGShape.cpp:
1685         (WebCore::RenderSVGShape::shapeDependentStrokeContains): Flag
1686                 to switch between local and "global" coordinate space for hit testing.
1687         (WebCore::RenderSVGShape::isPointInFill): Take the winding rule given by
1688                 `fill-rule` to test if a given point is in the fill area of a path.
1689         (WebCore::RenderSVGShape::isPointInStroke): Take stroke properties into
1690                 account to check if a point is on top of the stroke area.
1691         * rendering/svg/RenderSVGShape.h:
1692         * svg/SVGGeometryElement.cpp:
1693         (WebCore::SVGGeometryElement::isPointInFill):
1694         (WebCore::SVGGeometryElement::isPointInStroke):
1695         (WebCore::SVGGeometryElement::createElementRenderer): Deleted. This is getting implemented
1696                 by inheriting classes. No need to create RenderSVGPath here.
1697         * svg/SVGGeometryElement.h:
1698         * svg/SVGGeometryElement.idl:
1699
1700 2018-05-12  Zalan Bujtas  <zalan@apple.com>
1701
1702         Use WeakPtr for m_enclosingPaginationLayer in RenderLayer
1703         https://bugs.webkit.org/show_bug.cgi?id=185566
1704         <rdar://problem/36486052>
1705
1706         Reviewed by Simon Fraser.
1707
1708         Since RenderLayer does not own the enclosing pagination layout, it should
1709         construct a weak pointer instead of holding on to a raw pointer.
1710
1711         Unable to create a reliably reproducible test case.
1712
1713         * page/mac/EventHandlerMac.mm:
1714         (WebCore::scrollableAreaForEventTarget):
1715         (WebCore::scrollableAreaForContainerNode):
1716         (WebCore::EventHandler::platformPrepareForWheelEvents):
1717         * platform/ScrollableArea.h:
1718         (WebCore::ScrollableArea::weakPtrFactory const):
1719         (WebCore::ScrollableArea::createWeakPtr): Deleted.
1720         * rendering/RenderLayer.cpp:
1721         (WebCore::RenderLayer::RenderLayer):
1722         (WebCore::RenderLayer::updatePagination):
1723         * rendering/RenderLayer.h:
1724
1725 2018-05-11  Daniel Bates  <dabates@apple.com>
1726
1727         X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
1728         https://bugs.webkit.org/show_bug.cgi?id=185567
1729         <rdar://problem/40175008>
1730
1731         Reviewed by Brent Fulgham.
1732
1733         Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
1734         are same-origin with the document that delivered this header. This prevents an intermediary
1735         malicious frame from clickjacking a child frame whose document is same-origin with the top-
1736         level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
1737         the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.
1738         
1739         Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
1740         with the top-level frame's document in order to be displayed. This prevents clickjacking by
1741         a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
1742         it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
1743         if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
1744         document same origin with the victim page. We should protect against such attacks. 
1745
1746         Tests: http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-allow.html
1747                http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-deny.html
1748
1749         * loader/FrameLoader.cpp:
1750         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
1751
1752 2018-05-11  Daniel Bates  <dabates@apple.com>
1753
1754         [iOS] Text decoration of dragged content does not paint with opacity
1755         https://bugs.webkit.org/show_bug.cgi?id=185551
1756         <rdar://problem/40166867>
1757
1758         Reviewed by Wenson Hsieh.
1759
1760         Respect alpha when painting the text decoration for dragged content.
1761
1762         * rendering/InlineTextBox.cpp:
1763         (WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual): Consider alpha when
1764         comparing decoration styles for equality so that we do not coalesce styles with differing alpha.
1765         (WebCore::InlineTextBox::paintMarkedTextDecoration): Respect alpha when painting dragged content.
1766
1767 2018-05-11  Nan Wang  <n_wang@apple.com>
1768
1769         AX: In role=dialog elements with aria-modal=true VoiceOver iOS/macOS can't manually focus or read dialog paragraph description text inside the modal.
1770         https://bugs.webkit.org/show_bug.cgi?id=185219
1771         <rdar://problem/39920009>
1772
1773         Reviewed by Chris Fleizach.
1774
1775         The text node descendants of a modal dialog are ignored. Fixed it by using AccessibilityObject's 
1776         node() to determine if it's the descendant of the modal dialog node.
1777
1778         Test: accessibility/aria-modal-text-descendants.html
1779
1780         * accessibility/AccessibilityObject.cpp:
1781         (WebCore::AccessibilityObject::isModalDescendant const):
1782
1783 2018-05-11  Ryosuke Niwa  <rniwa@webkit.org>
1784
1785         Tapping after CSS-based table casues an infinite loop in wordRangeFromPosition
1786         https://bugs.webkit.org/show_bug.cgi?id=185465
1787         <rdar://problem/35263057>
1788
1789         Reviewed by Antti Koivisto.
1790
1791         The bug was caused by TextIterator not emitting a line break when exiting a CSS-based table when an element
1792         with `display: table-row` has an invisible text node. Specifically, TextIterator::exitNode is never called on
1793         an element with `table-cell: row` when m_node is a text node with whitespaces which appears after an element
1794         with `display: table-cell`.
1795
1796         For example, for a tree structure like:
1797         table-row (R)
1798           table-cell (C)
1799             "text" (1)
1800           " " (2)
1801         Getting out of (C) would result in moving onto (2) without generating a line break for (R).
1802
1803         When this happens in nextBoundary as it tries to find the end of the last word in the table cell, we end up
1804         finding the end of the document as the end of the word. As a result, nextWordBoundaryInDirection, the caller
1805         of nextBoundary, ends up infinite looping between the positon at the end of the document and the position
1806         immediately before the last word in the last table cell when it traverses words backwards.
1807
1808         This patch fixes the hang by addressing this root cause in TextIterator. Namely, TextIterator now generates
1809         a line break when exiting a block while walking up ancestors in TextIterator::advance().
1810
1811         Tests: editing/selection/tapping-in-table-at-end-of-document.html
1812                editing/text-iterator/table-at-end-of-document.html
1813
1814         * editing/TextIterator.cpp:
1815         (WebCore::TextIterator::advance): Fixed the bug.
1816         (WebCore::shouldEmitNewlineAfterNode): Do generate a new line at the end of a document when we're trying to
1817         generate every visible poitions even there are no renderers beyond this point. e.g. a position inside the
1818         last cell of a table at the end of a document hits this condition.
1819         (WebCore::shouldEmitExtraNewlineForNode): Don't emit a line break when the render box's height is 0px
1820         to avoid generating many empty lines for empty paragraph and header elements (this function is used to generate
1821         a blank line between p's and h1/h2/...'s).
1822         (WebCore::TextIterator::exitNode):
1823
1824 2018-05-11  Dean Jackson  <dino@apple.com>
1825
1826         System preview badge doesn't show on <picture> elements
1827         https://bugs.webkit.org/show_bug.cgi?id=185559
1828         <rdar://problem/40150066>
1829
1830         Reviewed by Tim Horton.
1831
1832         We should also identify <img>s that are the child of a <picture>
1833         contained inside the appropriate <a> element.
1834
1835         Tested internally, since the badge is platform specific.
1836
1837         * html/HTMLImageElement.cpp:
1838         (WebCore::HTMLImageElement::isSystemPreviewImage const): Add logic
1839         to look for <picture> parents.
1840
1841 2018-05-11  Chris Dumez  <cdumez@apple.com>
1842
1843         REGRESSION (async policy delegate): Revoking an object URL immediately after triggering download breaks file download
1844         https://bugs.webkit.org/show_bug.cgi?id=185531
1845         <rdar://problem/39909589>
1846
1847         Reviewed by Geoffrey Garen.
1848
1849         Whenever we start an asynchronous navigation policy decision for a blob URL, create a temporary
1850         blob URL pointing to the same data, and update the request's URL. This way, if the page's JS revokes
1851         the URL during the policy decision, the load will still succeed.
1852
1853         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-then-revoke.html
1854
1855         * loader/DocumentLoader.cpp:
1856         (WebCore::DocumentLoader::willSendRequest):
1857         * loader/FrameLoader.cpp:
1858         (WebCore::FrameLoader::loadURL):
1859         (WebCore::FrameLoader::load):
1860         (WebCore::FrameLoader::loadPostRequest):
1861         * loader/PolicyChecker.cpp:
1862         (WebCore::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
1863         (WebCore::PolicyChecker::checkNavigationPolicy):
1864         (WebCore::PolicyChecker::checkNewWindowPolicy):
1865         * loader/PolicyChecker.h:
1866
1867 2018-05-11  Antti Koivisto  <antti@apple.com>
1868
1869         LinkLoader fails to remove CachedResourceClient in some cases
1870         https://bugs.webkit.org/show_bug.cgi?id=185553
1871         <rdar://problem/36879656>
1872
1873         Reviewed by Geoffrey Garen.
1874
1875         Test: http/tests/preload/link-preload-client-remove.html
1876
1877         * loader/LinkLoader.cpp:
1878         (WebCore::LinkLoader::loadLink):
1879
1880         If there is a link preload already in progress, we fail to clear the client for the ongoing load.
1881         This may leave the CachedResource client map in a bad state.
1882
1883 2018-05-11  Charles Vazac  <cvazac@gmail.com>
1884
1885         Runtime feature flag for Server-Timing
1886         https://bugs.webkit.org/show_bug.cgi?id=184758
1887
1888         Reviewed by Youenn Fablet.
1889
1890         * Source/WebCore/CMakeLists.txt: Added reference to PerformanceServerTiming.idl.
1891         * Source/WebCore/DerivedSources.make: Added reference to PerformanceServerTiming.idl.
1892         * Source/WebCore/Sources.txt: Added reference to PerformanceServerTiming.cpp and JSPerformanceServerTiming.cpp.
1893         * Source/WebCore/WebCore.xcodeproj/project.pbxproj: Added references to PerformanceServerTiming.cpp, PerformanceServerTiming.h, and PerformanceServerTiming.idl.
1894         * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: Added PerformanceServerTiming.
1895         * Source/WebCore/page/PerformanceResourceTiming.h: Added serverTiming member.
1896         * Source/WebCore/page/PerformanceResourceTiming.idl: Added serverTiming attribute.
1897         * Source/WebCore/page/PerformanceServerTiming.cpp: Added.
1898         * Source/WebCore/page/PerformanceServerTiming.h: Added.
1899         * Source/WebCore/page/PerformanceServerTiming.idl: Added.
1900
1901 2018-05-11  Brady Eidson  <beidson@apple.com>
1902
1903         Make sure history navigations reuse the existing process when necessary.
1904         <rdar://problem/39746516> and https://bugs.webkit.org/show_bug.cgi?id=185532
1905
1906         Reviewed by Ryosuke Niwa.
1907
1908         Covered by new API tests.
1909
1910         In WebCore-land, make sure *all* NavigationActions to a back/forward item are tagged with
1911         the item identifier.
1912
1913         * history/HistoryItem.cpp:
1914         (WebCore::HistoryItem::HistoryItem):
1915         (WebCore::HistoryItem::logString const):
1916         * history/HistoryItem.h:
1917
1918         * loader/FrameLoader.cpp:
1919         (WebCore::FrameLoader::loadDifferentDocumentItem):
1920
1921         * loader/NavigationAction.cpp:
1922         (WebCore::NavigationAction::setTargetBackForwardItem):
1923
1924         * loader/NavigationAction.h:
1925         (WebCore::NavigationAction::targetBackForwardItemIdentifier const):
1926
1927 2018-05-11  Yacine Bandou  <yacine.bandou_ext@softathome.com>
1928
1929         [EME][GStreamer] Handle the protection event in MediaPlayerPrivate
1930         https://bugs.webkit.org/show_bug.cgi?id=185535
1931
1932         Reviewed by Xabier Rodriguez-Calvar.
1933
1934         This patch is based on this calvaris's commit
1935         https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/d966168b0d2b65f9ca9415426e26d3752c78b03e
1936
1937         It adds a handler for the protection event in MediaPalyerPrivateGStreamerBase, it extracts the InitData from the event
1938         and sends the encrypted event to JS via HTMLMediaElement.
1939         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1940         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
1941         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
1942         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1943         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: Add a new type InitData.
1944
1945 2018-05-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1946
1947         [Curl] Make the cipher suites, the signing algorithms and the curve lists configurable.
1948         https://bugs.webkit.org/show_bug.cgi?id=185139
1949
1950         Add interface to configure the cipher suites, the signing algorithms and the curve lists 
1951         used by OpenSSL and libcurl to exchange, to sign or to verify keys.
1952
1953         Reviewed by Youenn Fablet.
1954
1955         No new tests in public. Have tested internally.
1956
1957         * platform/network/curl/CurlContext.cpp:
1958         (WebCore::CurlHandle::setSslCipherList):
1959         * platform/network/curl/CurlContext.h:
1960         * platform/network/curl/CurlRequest.cpp:
1961         (WebCore::CurlRequest::setupTransfer):
1962         (WebCore::CurlRequest::willSetupSslCtx):
1963         * platform/network/curl/CurlSSLHandle.cpp:
1964         (WebCore::CurlSSLHandle::getCACertPathEnv):
1965         * platform/network/curl/CurlSSLHandle.h:
1966         (WebCore::CurlSSLHandle::getCipherList const):
1967         (WebCore::CurlSSLHandle::getSignatureAlgorithmsList const):
1968         (WebCore::CurlSSLHandle::getCurvesList const):
1969         (WebCore::CurlSSLHandle::setCipherList):
1970         (WebCore::CurlSSLHandle::setSignatureAlgorithmsList):
1971         (WebCore::CurlSSLHandle::setCurvesList):
1972         (WebCore::CurlSSLHandle::getCACertPath const):
1973         (WebCore::CurlSSLHandle::setCACertPath):
1974         * platform/network/curl/CurlSSLVerifier.cpp:
1975         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
1976
1977 2018-05-10  Daniel Bates  <dabates@apple.com>
1978
1979         Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options
1980         https://bugs.webkit.org/show_bug.cgi?id=185412
1981
1982         Reviewed by Ryosuke Niwa.
1983
1984         Consolidate the knowledge on how to determine whether security checks were performed on a ResourceResponse
1985         into LoaderStrategy::havePerformedSecurityChecks() (default implementation returns false) and query it
1986         to determine whether CSP frame-ancestors and X-Frame-Options need to be checked for a ResourceResponse.
1987
1988         Additionally, rename LoaderStrategy::isDoingLoadingSecurityChecks() to shouldPerformSecurityChecks()
1989         for consistency with havePerformedSecurityChecks(). Querying shouldPerformSecurityChecks() answers the
1990         question of whether the loader strategy is responsible for performing security checks when building up
1991         a ResourceRequest to have the loader strategy load. And LoaderStrategy::havePerformedSecurityChecks()
1992         is used to determine whether the loader strategy performed these security checks for a given ResourceResponse.
1993
1994         * inspector/agents/InspectorNetworkAgent.cpp:
1995         (WebCore::InspectorNetworkAgent::didReceiveResponse):
1996         (WebCore::InspectorNetworkAgent::didFinishLoading):
1997         (WebCore::isResponseProbablyComingFromNetworkProcess): Deleted.
1998         * loader/DocumentLoader.cpp:
1999         (WebCore::DocumentLoader::responseReceived):
2000         * loader/DocumentThreadableLoader.cpp:
2001         (WebCore::shouldPerformSecurityChecks):
2002         (WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
2003         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
2004         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
2005         (WebCore::DocumentThreadableLoader::redirectReceived):
2006         (WebCore::DocumentThreadableLoader::didFail):
2007         (WebCore::DocumentThreadableLoader::loadRequest):
2008         (WebCore::isDoingSecurityChecksInNetworkProcess): Deleted.
2009         (WebCore::isResponseComingFromNetworkProcess): Deleted.
2010         * loader/LoaderStrategy.cpp:
2011         * loader/LoaderStrategy.h:
2012         * page/Settings.yaml: Remove setting networkProcessCSPFrameAncestorsCheckingEnabled as we now make
2013         use of the loader strategy to determine whether to perform CSP frame-ancestors and X-Frame-Options
2014         checking in DocumentLoader.
2015         * platform/network/ResourceResponseBase.h:
2016         (WebCore::ResourceResponseBase::setSource): Added an ASSERT to catch the programming error of setting
2017         source to ResourceResponse::Source::Unknown. This source type represents an uninitialized ResourceResponse.
2018
2019 2018-05-10  Tim Horton  <timothy_horton@apple.com>
2020
2021         Lookup sometimes shows a second yellow highlight on top of WebKit's TextIndicator
2022         https://bugs.webkit.org/show_bug.cgi?id=185538
2023         <rdar://problem/38817825>
2024
2025         Reviewed by Sam Weinig.
2026
2027         * editing/mac/DictionaryLookup.mm:
2028         (WebCore::showPopupOrCreateAnimationController):
2029         Options can be nil, in which case we can't mutableCopy it and add
2030         LUTermOptionDisableSearchTermIndicator. Instead, create a new dictionary,
2031         and add the items from options, if it's not nil.
2032
2033 2018-05-10  Matt Baker  <mattbaker@apple.com>
2034
2035         Web Inspector: ASSERT_NOT_REACHED in PageDebuggerAgent::didAddEventListener when page adds attribute event listener
2036         https://bugs.webkit.org/show_bug.cgi?id=181580
2037         <rdar://problem/36461309>
2038
2039         Reviewed by Brian Burg.
2040
2041         EventTarget should pass newly added EventListeners to InspectorInstrumentation,
2042         instead of PageDebuggerAgent assuming the last item in the EventListenerVector
2043         is the most recently added listener. This assumption does not hold when
2044         the new listener replaces an existing listener.
2045
2046         * dom/EventTarget.cpp:
2047         (WebCore::EventTarget::addEventListener):
2048         (WebCore::EventTarget::setAttributeEventListener):
2049
2050         * inspector/InspectorInstrumentation.cpp:
2051         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
2052
2053         * inspector/InspectorInstrumentation.h:
2054         (WebCore::InspectorInstrumentation::didAddEventListener):
2055
2056         * inspector/agents/page/PageDebuggerAgent.cpp:
2057         (WebCore::PageDebuggerAgent::didAddEventListener):
2058         * inspector/agents/page/PageDebuggerAgent.h:
2059
2060 2018-05-10  Chris Dumez  <cdumez@apple.com>
2061
2062         'Cross-Origin-Options header implementation follow-up
2063         https://bugs.webkit.org/show_bug.cgi?id=185520
2064
2065         Reviewed by Ryosuke Niwa.
2066
2067         * dom/Document.cpp:
2068         * dom/Document.h:
2069         * loader/FrameLoader.cpp:
2070         (WebCore::FrameLoader::didBeginDocument):
2071         Using isNull() check is sufficient here as the header parsing
2072         function will do the right thing when passed the empty string.
2073         Also set the options directly on the window instead of the
2074         document. The window is guaranteed to have been constructed
2075         by then because didBeginDocument() is called DocumentWriter::begin()
2076         which calls Document::createDOMWindow() or Document::takeDOMWindowFrom().
2077
2078         * page/AbstractDOMWindow.cpp:
2079         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
2080         * page/AbstractDOMWindow.h:
2081         * page/DOMWindow.cpp:
2082         (WebCore::DOMWindow::DOMWindow):
2083         (WebCore::DOMWindow::didSecureTransitionTo):
2084         * page/RemoteDOMWindow.cpp:
2085         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
2086         * page/RemoteDOMWindow.h:
2087         CrossOriginOptions are now stored only on the Window, not the Document.
2088
2089         * platform/network/HTTPParsers.cpp:
2090         (WebCore::parseCrossOriginOptionsHeader):
2091         Drop strippedHeader local variable as it is not strictly needed.
2092
2093 2018-05-10  Tim Horton  <timothy_horton@apple.com>
2094
2095         Fix the build after r231393
2096         https://bugs.webkit.org/show_bug.cgi?id=185519
2097         <rdar://problem/40131741>
2098
2099         Reviewed by Simon Fraser.
2100
2101         * Configurations/WebCore.xcconfig:
2102
2103 2018-05-10  Eric Carlson  <eric.carlson@apple.com>
2104
2105         Log missing cues correctly
2106         https://bugs.webkit.org/show_bug.cgi?id=185499
2107         <rdar://problem/40113821>
2108
2109         Reviewed by Daniel Bates.
2110
2111         No new tests, tested manually.
2112
2113         * html/track/InbandGenericTextTrack.cpp:
2114         (WebCore::InbandGenericTextTrack::removeGenericCue): Log the cue we searched for, not
2115         the NULL cue.
2116
2117 2018-05-10  Zalan Bujtas  <zalan@apple.com>
2118
2119         [LFC] Implement height computation for non-replaced inflow elements.
2120         https://bugs.webkit.org/show_bug.cgi?id=185474
2121
2122         Reviewed by Antti Koivisto.
2123
2124         Initial implementation. Does not cover all the cases.
2125
2126         * layout/FormattingContext.cpp:
2127         (WebCore::Layout::FormattingContext::computeHeight const):
2128         * layout/FormattingContext.h:
2129         * layout/blockformatting/BlockFormattingContext.cpp:
2130         (WebCore::Layout::BlockFormattingContext::layout const):
2131         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
2132         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const):
2133         * layout/blockformatting/BlockFormattingContext.h:
2134         * layout/blockformatting/BlockMarginCollapse.cpp:
2135         (WebCore::Layout::collapsedMarginBottomFromLastChild):
2136         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent):
2137         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
2138         (WebCore::Layout::isMarginBottomCollapsedWithParent): Deleted.
2139         * layout/blockformatting/BlockMarginCollapse.h:
2140         * layout/inlineformatting/InlineFormattingContext.cpp:
2141         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
2142         * layout/inlineformatting/InlineFormattingContext.h:
2143         * layout/layouttree/LayoutBox.cpp:
2144         (WebCore::Layout::Box::isReplaced const):
2145         * layout/layouttree/LayoutBox.h:
2146
2147 2018-05-10  Thibault Saunier  <tsaunier@igalia.com>
2148
2149         [GTK] Implement ImageBuffer::toBGRAData
2150         https://bugs.webkit.org/show_bug.cgi?id=185511
2151
2152         Reviewed by Michael Catanzaro.
2153
2154         This was never implemented but will be required for the MediaStream API
2155         tests.
2156
2157         * platform/graphics/ImageBuffer.cpp:
2158         (WebCore::ImageBuffer::toBGRAData const):
2159         * platform/graphics/cg/ImageBufferCG.cpp:
2160         (WebCore::ImageBuffer::toBGRAData const):
2161         * platform/graphics/gtk/ImageBufferGtk.cpp:
2162         (WebCore::ImageBuffer::toBGRAData const):
2163
2164 2018-05-10  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2165
2166         [EME][GStreamer] Add a handler for GStreamer protection event
2167         https://bugs.webkit.org/show_bug.cgi?id=185245
2168
2169         Reviewed by Xabier Rodriguez-Calvar.
2170
2171         Qtdemux sends the protection event when encountered a new PSSH box (encrypted content).
2172
2173         The Decryptor is moved from AppendPipeline to PlaybackPipeline (see https://bugs.webkit.org/show_bug.cgi?id=181855),
2174         thus the protection event is no longer handled because the Decryptor is not in the same pipeline as qtdemux.
2175
2176         AppendPipeline: httpsrc-->qtdemux-->appsink
2177         PlaybackPipeline: appsrc-->parser--> decryptor-->decoder-->sink
2178
2179         This patch attaches a probe to the sink pad of the appsink in the appendPipeline in order to
2180         catch and manage the protection event.
2181
2182         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2183         (WebCore::AppendPipeline::AppendPipeline):
2184         (WebCore::AppendPipeline::~AppendPipeline):
2185         (WebCore::appendPipelineAppsinkPadEventProbe):
2186         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2187         (WebCore::AppendPipeline::playerPrivate):
2188
2189 2018-05-10  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2190
2191         [EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
2192         https://bugs.webkit.org/show_bug.cgi?id=181855
2193
2194         Reviewed by Xabier Rodriguez-Calvar.
2195
2196         The goal of this move is to handle the limitation of SVP (Secure Video Path) memory size.
2197
2198         When the decryptor is in the AppendPipeline and we use SVP, we buffer in MediaSource queue
2199         the decrypted GstBuffers that are in SVP memory.
2200         This behavior cause an out-of-memory error, because we are limited in SVP memory size.
2201
2202         By moving the decryptor in PlaybackPipeline, we avoid to buffer the decrypted GstBuffers
2203         which use the SVP memory and we buffer the encrypted GstBuffers that are in system memory.
2204
2205         This new architecture also allows to start the buffering before obtaining the DRM license
2206         and it makes easier to manage dynamic change of the license or Key.
2207
2208         The decryptor is auto plugged by GStreamer playbin in PlaybackPipeline.
2209
2210         SVP: Secure Video Path also named trusted or protected video path, it is a memory which is
2211         protected by a hardware access control engine, it is not accessible to other unauthorised
2212         software or hardware components.
2213
2214         Tests:
2215             media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
2216             media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
2217
2218         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2219         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
2220         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2221         (WebCore::dumpAppendState):
2222         (WebCore::AppendPipeline::AppendPipeline):
2223         (WebCore::AppendPipeline::handleNeedContextSyncMessage):
2224         (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
2225         (WebCore::AppendPipeline::setAppendState):
2226         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
2227         (WebCore::AppendPipeline::appsinkNewSample):
2228         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
2229         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
2230         (WebCore::appendPipelineElementMessageCallback): Deleted.
2231         (WebCore::AppendPipeline::handleElementMessage): Deleted.
2232         (WebCore::AppendPipeline::dispatchPendingDecryptionStructure): Deleted.
2233         (WebCore::AppendPipeline::dispatchDecryptionStructure): Deleted.
2234         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2235         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2236         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
2237         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2238
2239 2018-05-09  Nan Wang  <n_wang@apple.com>
2240
2241         AX: VoiceOver iframe scrolling focus jumping bug
2242         https://bugs.webkit.org/show_bug.cgi?id=176615
2243         <rdar://problem/34333067>
2244
2245         Reviewed by Chris Fleizach.
2246
2247         Scrolling to make elements visible is not working correctly for elements inside an
2248         offscreen iframe. Fixed it by using RenderLayer::scrollRectToVisible() to handle
2249         scrolling more properly.
2250
2251         Test: accessibility/scroll-to-make-visible-iframe-offscreen.html
2252
2253         * accessibility/AccessibilityObject.cpp:
2254         (WebCore::AccessibilityObject::scrollToMakeVisible const):
2255
2256 2018-05-09  Joanmarie Diggs  <jdiggs@igalia.com>
2257
2258         AX: accessibleNameForNode should simplify whitespace when using innerText
2259         https://bugs.webkit.org/show_bug.cgi?id=185498
2260
2261         Reviewed by Chris Fleizach.
2262
2263         Test: accessibility/text-alternative-calculation-from-unrendered-table.html
2264
2265         Call simplifyWhiteSpace() before returning the innerText value.
2266
2267         * accessibility/AccessibilityNodeObject.cpp:
2268         (WebCore::accessibleNameForNode):
2269
2270 2018-05-09  Chris Dumez  <cdumez@apple.com>
2271
2272         Add initial support for 'Cross-Origin-Options' HTTP response header
2273         https://bugs.webkit.org/show_bug.cgi?id=184996
2274         <rdar://problem/39664620>
2275
2276         Reviewed by Geoff Garen.
2277
2278         Add initial support for 'Cross-Origin-Options' HTTP response header behind an experimental
2279         feature flag, on by default. When the HTTP server services this HTTP response header for a
2280         main resource, we'll set these options on the corresponding Document. This will impact the
2281         behavior of the Document's associated Window API when cross-origin.
2282
2283         The HTTP header has 3 possible values:
2284         - allow: This is the default. Regular cross-origin Window API is available.
2285         - allow-postmessage: Only postMessage() is available on a cross-origin window, trying to
2286           access anything else will throw a SecurityError.
2287         - deny: Trying to do anything with a cross-origin window will throw a SecurityError.
2288
2289         The header has no effect when accessing same origin windows.
2290
2291         Note that on cross-origin access from Window A to Window B, we check the cross-origin
2292         options for both Window A and Window B and use the lowest common denominator as effective
2293         cross-origin options for the access. So if Window A has 'Cross-Origin-Options: deny' and
2294         tries to call postMessage() on Window B which has 'Cross-Origin-Options: allow-postmessage',
2295         we will throw a SecurityError. This is because Window A's more restrictive options (deny)
2296         apply.
2297
2298         Tests: http/wpt/cross-origin-options/allow-postmessage-from-deny.html
2299                http/wpt/cross-origin-options/allow-postmessage.html
2300                http/wpt/cross-origin-options/cross-origin-options-header.html
2301
2302         * bindings/js/JSDOMBindingSecurity.cpp:
2303         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginOptions):
2304         * bindings/js/JSDOMBindingSecurity.h:
2305         * bindings/js/JSDOMWindowCustom.cpp:
2306         (WebCore::effectiveCrossOriginOptionsForAccess):
2307         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2308         (WebCore::JSDOMWindow::getOwnPropertySlot):
2309         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2310         (WebCore::addCrossOriginWindowPropertyNames):
2311         (WebCore::addScopedChildrenIndexes):
2312         (WebCore::addCrossOriginWindowOwnPropertyNames):
2313         (WebCore::JSDOMWindow::getOwnPropertyNames):
2314         * bindings/js/JSDOMWindowCustom.h:
2315         * bindings/js/JSRemoteDOMWindowCustom.cpp:
2316         (WebCore::JSRemoteDOMWindow::getOwnPropertySlot):
2317         (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex):
2318         (WebCore::JSRemoteDOMWindow::getOwnPropertyNames):
2319         * bindings/scripts/CodeGeneratorJS.pm:
2320         (GenerateAttributeGetterBodyDefinition):
2321         (GetCrossOriginsOptionsFromExtendedAttributeValue):
2322         (GenerateAttributeSetterBodyDefinition):
2323         (GenerateOperationBodyDefinition):
2324         * bindings/scripts/IDLAttributes.json:
2325         * dom/Document.cpp:
2326         (WebCore::Document::setCrossOriginOptions):
2327         * dom/Document.h:
2328         (WebCore::Document::crossOriginOptions const):
2329         * loader/FrameLoader.cpp:
2330         (WebCore::FrameLoader::didBeginDocument):
2331         * page/AbstractDOMWindow.cpp:
2332         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
2333         * page/AbstractDOMWindow.h:
2334         (WebCore::AbstractDOMWindow::crossOriginOptions):
2335         (WebCore::AbstractDOMWindow::setCrossOriginOptions):
2336         * page/DOMWindow.cpp:
2337         (WebCore::DOMWindow::DOMWindow):
2338         (WebCore::DOMWindow::didSecureTransitionTo):
2339         * page/DOMWindow.idl:
2340         * page/Frame.h:
2341         * page/RemoteDOMWindow.cpp:
2342         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
2343         * page/RemoteDOMWindow.h:
2344         * page/Settings.yaml:
2345         * platform/network/HTTPHeaderNames.in:
2346         * platform/network/HTTPParsers.cpp:
2347         (WebCore::parseCrossOriginOptionsHeader):
2348         * platform/network/HTTPParsers.h:
2349
2350 2018-05-09  Ryosuke Niwa  <rniwa@webkit.org>
2351
2352         Release assert in TreeScopeOrderedMap::remove via HTMLImageElement::removedFromAncestor
2353         https://bugs.webkit.org/show_bug.cgi?id=185493
2354
2355         Reviewed by Brent Fulgham.
2356
2357         Fixed the bug that HTMLImageElement::removedFromAncestor and HTMLMapElement::removedFromAncestor
2358         were calling removeImageElementByUsemap on the document instead of the shadow tree from which it was removed.
2359
2360         Test: fast/images/imagemap-in-shadow-tree-removed.html
2361
2362         * html/HTMLImageElement.cpp:
2363         (WebCore::HTMLImageElement::removedFromAncestor):
2364         * html/HTMLMapElement.cpp:
2365         (WebCore::HTMLMapElement::removedFromAncestor):
2366
2367 2018-05-09  Joanmarie Diggs  <jdiggs@igalia.com>
2368
2369         AX: Hidden nodes which are not directly referenced should not participate name/description from content
2370         https://bugs.webkit.org/show_bug.cgi?id=185478
2371
2372         Reviewed by Chris Fleizach.
2373
2374         Add a check to AccessibilityNodeObject::textUnderElement() and return early
2375         if the node is hidden, not referenced by aria-labelledby or aria-describedby,
2376         not an HTMLLabelElement, and not fallback content for an HTMLCanvasElement.
2377
2378         Test: accessibility/text-alternative-calculation-hidden-nodes.html
2379
2380         * accessibility/AccessibilityNodeObject.cpp:
2381         (WebCore::AccessibilityNodeObject::textUnderElement const):
2382
2383 2018-05-09  Eric Carlson  <eric.carlson@apple.com>
2384
2385         Update MediaSession to use release logging
2386         https://bugs.webkit.org/show_bug.cgi?id=185376
2387         <rdar://problem/40022203>
2388
2389         Reviewed by Youenn Fablet.
2390
2391         No new tests, tested manually.
2392
2393         * Modules/mediastream/MediaStream.h: hostingDocument() doesn't need to return a const Document.
2394         * Modules/webaudio/AudioContext.cpp:
2395         (WebCore::AudioContext::hostingDocument const): Ditto.
2396         * Modules/webaudio/AudioContext.h:
2397
2398         * html/HTMLMediaElement.h: Ditto.
2399
2400         * html/MediaElementSession.cpp:
2401         (WebCore::MediaElementSession::MediaElementSession):
2402         (WebCore::MediaElementSession::addBehaviorRestriction):
2403         (WebCore::MediaElementSession::removeBehaviorRestriction):
2404         (WebCore::MediaElementSession::dataLoadingPermitted const):
2405         (WebCore::MediaElementSession::fullscreenPermitted const):
2406         (WebCore::MediaElementSession::pageAllowsDataLoading const):
2407         (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
2408         (WebCore::MediaElementSession::canShowControlsManager const):
2409         (WebCore::MediaElementSession::showPlaybackTargetPicker):
2410         (WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
2411         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
2412         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
2413         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
2414         (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
2415         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
2416         (WebCore::MediaElementSession::mediaEngineUpdated):
2417         (WebCore::MediaElementSession::willLog const): Deleted.
2418         (WebCore::MediaElementSession::logger const): Deleted.
2419         (WebCore::MediaElementSession::logIdentifier const): Deleted.
2420         (WebCore::MediaElementSession::logChannel const): Deleted.
2421         * html/MediaElementSession.h:
2422
2423         * platform/audio/PlatformMediaSession.cpp:
2424         (WebCore::nextLogIdentifier):
2425         (WebCore::convertEnumerationToString):
2426         (WebCore::PlatformMediaSession::PlatformMediaSession):
2427         (WebCore::PlatformMediaSession::setState):
2428         (WebCore::PlatformMediaSession::beginInterruption):
2429         (WebCore::PlatformMediaSession::endInterruption):
2430         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying):
2431         (WebCore::PlatformMediaSession::clientWillPausePlayback):
2432         (WebCore::PlatformMediaSession::pauseSession):
2433         (WebCore::PlatformMediaSession::stopSession):
2434         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
2435         (WebCore::PlatformMediaSession::logChannel const):
2436         (WebCore::stateName): Deleted.
2437         (WebCore::interruptionName): Deleted.
2438         * platform/audio/PlatformMediaSession.h:
2439         (WTF::LogArgument<WebCore::PlatformMediaSession::State>::toString):
2440         (WTF::LogArgument<WebCore::PlatformMediaSession::InterruptionType>::toString):
2441
2442 2018-05-09  Thibault Saunier  <tsaunier@igalia.com>
2443
2444         [GStreamer] Never call updateTracks if running on legacy pipeline
2445         https://bugs.webkit.org/show_bug.cgi?id=184581
2446
2447         This makes sure failling code path is never reached in the conditions where it should not have been reached.
2448
2449         Reviewed by Philippe Normand.
2450
2451         Re enables all tests that were disabled after fixing.
2452
2453         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2454         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2455
2456 2018-05-09  Daniel Bates  <dabates@apple.com>
2457
2458         REGRESSION (r231479): http/tests/appcache/x-frame-options-prevents-framing.php is timing out
2459         https://bugs.webkit.org/show_bug.cgi?id=185443
2460         <rdar://problem/40100660>
2461
2462         Reviewed by Andy Estes.
2463
2464         Following r231479 when using WebKit2 and Restricted HTTP Response Access is enabled (enabled in
2465         WebKitTestRunner) we only check the CSP frame-ancestors directive and X-Frame-Options in
2466         NetworkProcess. We need to check these security requirements in WebContent process whenever
2467         we are performing a substitute data load, such as for app cache, as these loads do not go
2468         through NetworkProcess.
2469
2470         * loader/DocumentLoader.cpp:
2471         (WebCore::DocumentLoader::responseReceived):
2472
2473 2018-05-09  Justin Fan  <justin_fan@apple.com>
2474
2475         Hooked up ASTC support in WebGL; requires OpenGL ES 3 context to work. 
2476         https://bugs.webkit.org/show_bug.cgi?id=185272
2477         <rdar://problem/15745737>
2478
2479         Reviewed by Dean Jackson.
2480
2481         Also added in Khronos' ASTC test from version 1.0.4 beta of their conformance test suite,
2482         although again, this requires OpenGL ES 3 context for WebKit to detect proper support.
2483
2484         Test: fast/canvas/webgl/webgl-compressed-texture-astc.html
2485
2486         * DerivedSources.make:
2487         * Sources.txt:
2488         * WebCore.xcodeproj/project.pbxproj:
2489         * bindings/js/JSDOMConvertWebGL.cpp:
2490         (WebCore::convertToJSValue):
2491         * html/canvas/WebGL2RenderingContext.cpp:
2492         (WebCore::WebGL2RenderingContext::getExtension):
2493         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
2494         * html/canvas/WebGLCompressedTextureASTC.cpp: Added.
2495         (WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC):
2496         (WebCore::WebGLCompressedTextureASTC::getName const):
2497         (WebCore::WebGLCompressedTextureASTC::supported):
2498         (WebCore::WebGLCompressedTextureASTC::getSupportedProfiles):
2499         * html/canvas/WebGLCompressedTextureASTC.h: Added.
2500         * html/canvas/WebGLCompressedTextureASTC.idl: Added.
2501         * html/canvas/WebGLExtension.h:
2502         * html/canvas/WebGLRenderingContext.cpp:
2503         (WebCore::WebGLRenderingContext::getExtension):
2504         (WebCore::WebGLRenderingContext::getSupportedExtensions):
2505         * html/canvas/WebGLRenderingContextBase.cpp:
2506         (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
2507         (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
2508         * html/canvas/WebGLRenderingContextBase.h:
2509         * platform/graphics/Extensions3D.h:
2510
2511 2018-05-09  Youenn Fablet  <youenn@apple.com>
2512
2513         Allow WebResourceLoader to cancel a load served from a service worker
2514         https://bugs.webkit.org/show_bug.cgi?id=185274
2515
2516         Reviewed by Chris Dumez.
2517
2518         Add support for cancelling a fetch from WebProcess to service worker process.
2519         Use FetchIdentifier instead of uint64_t.
2520
2521         * Modules/fetch/FetchIdentifier.h: Added.
2522         * WebCore.xcodeproj/project.pbxproj:
2523         * workers/service/context/ServiceWorkerFetch.h:
2524         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2525         (WebCore::ServiceWorkerThreadProxy::startFetch):
2526         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
2527         * workers/service/context/ServiceWorkerThreadProxy.h:
2528
2529 2018-05-09  Thibault Saunier  <tsaunier@igalia.com>
2530
2531         [GStreamer] Fix style issue in MediaPlayerPrivateGStreamer
2532         https://bugs.webkit.org/show_bug.cgi?id=185479
2533
2534         Reviewed by Philippe Normand.
2535
2536         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:114:  Multi line control clauses should use braces.  [whitespace/braces] [4]
2537         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:194:  Multi line control clauses should use braces.  [whitespace/braces] [4]
2538         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:398:  One line control clauses should not use braces.  [whitespace/braces] [4]
2539         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:440:  One line control clauses should not use braces.  [whitespace/braces] [4]
2540         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:806:  More than one command on the same line  [whitespace/newline] [4]
2541         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:869:  More than one command on the same line  [whitespace/newline] [4]
2542         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:880:  More than one command on the same line  [whitespace/newline] [4]
2543         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:940:  More than one command on the same line  [whitespace/newline] [4]
2544         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1102:  Multi line control clauses should use braces.  [whitespace/braces] [4]
2545         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1109:  Multi line control clauses should use braces.  [whitespace/braces] [4]
2546
2547         Indentation and style issue fixed only.
2548
2549         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2550         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
2551         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
2552         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
2553         (WebCore::MediaPlayerPrivateGStreamer::play):
2554         (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback):
2555         (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
2556         (WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback):
2557         (WebCore::MediaPlayerPrivateGStreamer::textChangedCallback):
2558         (WebCore::MediaPlayerPrivateGStreamer::buffered const):
2559         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2560
2561 2018-05-09  Daniel Bates  <dabates@apple.com>
2562
2563         REGRESSION (r231479): com.apple.WebCore crash in WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied()
2564         https://bugs.webkit.org/show_bug.cgi?id=185475
2565         <rdar://problem/40093853>
2566
2567         Reviewed by Andy Estes.
2568
2569         DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() must extends its lifetime
2570         until completion as dispatching a DOM load event at the associated frame can cause JavaScript execution
2571         that can do anything, including destroying the loader that dispatched the event.
2572
2573         Following r231479 DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() is now
2574         invoked by both DocumentLoader::responseReceived() and WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
2575         The latter only can happen when using WebKit2 and the experimental feature Restricted HTTP Response Access
2576         is enabled (RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()). Unlike DocumentLoader::responseReceived()
2577         WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() does not take out a ref
2578         on the DocumentLoader before invoking DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
2579         Therefore, DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() can cause its
2580         own destruction as a result of dispatching a DOM load event at the frame. We should take out a ref on
2581         the DocumentLoader when executing DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
2582
2583         * loader/DocumentLoader.cpp:
2584         (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
2585
2586 2018-05-09  Tim Horton  <timothy_horton@apple.com>
2587
2588         Fix the build by ignoring some deprecation warnings
2589
2590         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2591         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
2592
2593 2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2594
2595         [WPE] Build cleanly with GCC 8 and ICU 60
2596         https://bugs.webkit.org/show_bug.cgi?id=185462
2597
2598         Reviewed by Carlos Alberto Lopez Perez.
2599
2600         * PlatformGTK.cmake: Include directories are in the wrong place.
2601         * accessibility/AXObjectCache.cpp: Silence -Wclass-memaccess problems and leave warnings.
2602         (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
2603         (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
2604         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
2605         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
2606         * css/CSSFontFace.cpp: Silence -Wfallthrough
2607         (WebCore::CSSFontFace::fontLoadTiming const):
2608         * css/CSSSelectorList.cpp: Silence -Wclass-memaccess, this one is intentional.
2609         (WebCore::CSSSelectorList::adoptSelectorVector):
2610         * editing/TextIterator.cpp: Silence ICU deprecation warnings.
2611         * platform/Length.h:
2612         (WebCore::Length::operator=): More -Wclass-memaccess, looks benign.
2613         * platform/graphics/Gradient.cpp:
2614         (WebCore::Gradient::hash const): -Wclass-memaccess again. Leave a warning.
2615         * platform/graphics/SurrogatePairAwareTextIterator.cpp: Silence ICU deprecation warnings.
2616         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
2617         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Silence ICU deprecation.
2618         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2619         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Silence -Wcast-function-type.
2620         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2621         (WebCore::Font::canRenderCombiningCharacterSequence const): Silence ICU deprecation.
2622         * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:
2623         (gstAllocatorFastMallocMemUnmap): Fix -Wcast-function-type.
2624         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2625         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Fix bad printf.
2626         (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Another bad printf.
2627         (WebCore::findHLSQueue): Fix -Wcast-function-type.
2628         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2629         (webKitMediaClearKeyDecryptorDecrypt): Fix another bad printf.
2630         * platform/network/soup/SocketStreamHandleImplSoup.cpp: Silence -Wcast-function-type.
2631         (WebCore::SocketStreamHandleImpl::beginWaitingForSocketWritability):
2632         * platform/text/TextEncoding.cpp: Silence ICU deprecration.
2633
2634 2018-05-08  Simon Fraser  <simon.fraser@apple.com>
2635
2636         SVG lighting colors need to be converted into linearSRGB
2637         https://bugs.webkit.org/show_bug.cgi?id=181196
2638
2639         Reviewed by Darin Adler.
2640
2641         Address post-commit comments. Don't make a Color that contains linearRGB components,
2642         but use FloatComponents instead. Since these FloatComponents are in the 0-1 range,
2643         FELighting::setPixelInternal() needs to multiply by 255 since the output pixels are
2644         8-bit 0-255.
2645         
2646         Change linearToSRGBColorComponent() and sRGBToLinearColorComponent() to do math in
2647         floats without promoting to doubles.
2648
2649         * platform/graphics/ColorUtilities.cpp:
2650         (WebCore::FloatComponents::FloatComponents):
2651         (WebCore::linearToSRGBColorComponent):
2652         (WebCore::sRGBToLinearColorComponent):
2653         (WebCore::sRGBColorToLinearComponents):
2654         (WebCore::linearToSRGBColor): Deleted.
2655         (WebCore::sRGBToLinearColor): Deleted.
2656         * platform/graphics/ColorUtilities.h:
2657         * platform/graphics/filters/FELighting.cpp:
2658         (WebCore::FELighting::setPixelInternal):
2659         (WebCore::FELighting::drawLighting):
2660
2661 2018-05-09  Timothy Hatcher  <timothy@apple.com>
2662
2663         Use StyleColor::Options in more places.
2664
2665         https://bugs.webkit.org/show_bug.cgi?id=185458
2666         rdar://problem/39853798
2667
2668         Add UseDefaultAppearance to StyleColor::Options, to avoid passing yet another
2669         boolean on some of these functions.
2670
2671         Reviewed by Tim Horton.
2672
2673         * css/MediaQueryEvaluator.cpp:
2674         * css/StyleColor.h:
2675         * dom/Document.cpp:
2676         (WebCore::Document::useDefaultAppearance const):
2677         (WebCore::Document::styleColorOptions const):
2678         * dom/Document.h:
2679         * platform/Theme.cpp:
2680         (WebCore::Theme::paint):
2681         * platform/Theme.h:
2682         * platform/mac/LocalDefaultSystemAppearance.h:
2683         * platform/mac/LocalDefaultSystemAppearance.mm:
2684         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
2685         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
2686         * platform/mac/ThemeMac.h:
2687         * platform/mac/ThemeMac.mm:
2688         (WebCore::paintToggleButton):
2689         (WebCore::paintButton):
2690         (WebCore::ThemeMac::ensuredView):
2691         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
2692         (WebCore::ThemeMac::paint):
2693         (-[WebCoreThemeView initWithUseSystemAppearance:]): Deleted.
2694         * platform/wpe/ThemeWPE.cpp:
2695         (WebCore::ThemeWPE::paint):
2696         * platform/wpe/ThemeWPE.h:
2697         * rendering/RenderListBox.cpp:
2698         (WebCore::RenderListBox::paintItemBackground):
2699         * rendering/RenderTheme.cpp:
2700         (WebCore::RenderTheme::paint):
2701         (WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor const):
2702         (WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const):
2703         * rendering/RenderTheme.h:
2704         * rendering/RenderThemeGtk.cpp:
2705         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor const):
2706         * rendering/RenderThemeGtk.h:
2707         * rendering/RenderThemeMac.h:
2708         * rendering/RenderThemeMac.mm:
2709         (WebCore::RenderThemeMac::documentViewFor const):
2710         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
2711         (WebCore::RenderThemeMac::systemColor const):
2712         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
2713         (WebCore::RenderThemeMac::paintSliderThumb):
2714
2715 2018-05-09  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2716
2717         [EME][GStreamer] Crash when the mediaKeys are created before loading the media in debug conf
2718         https://bugs.webkit.org/show_bug.cgi?id=185244
2719
2720         Reviewed by Xabier Rodriguez-Calvar.
2721
2722         The function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" is expected to be called once,
2723         so there is an ASSERT(!m_cdmInstance).
2724         But when the MediaKeys are created before loading the media, the cdminstance is created and attached
2725         to the MediaPlayerPrivate via "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" before loading
2726         the media, then when the media is loading, the function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached"
2727         will be called several times via the function "mediaEngineWasUpdated" wich is called for each change
2728         in the MediaElement state, thus the WebProcess crashes in the ASSERT(!m_cdmInstance).
2729
2730         This commit avoid the crash by replacing the assert with a simple check.
2731
2732         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2733         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
2734         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
2735
2736 2018-05-09  Antti Koivisto  <antti@apple.com>
2737
2738         Add OptionSet::operator& and operator bool
2739         https://bugs.webkit.org/show_bug.cgi?id=185306
2740
2741         Reviewed by Anders Carlsson.
2742
2743         Use it in a few places.
2744
2745         * loader/FrameLoader.cpp:
2746         (WebCore::FrameLoader::reload):
2747         * rendering/RenderLayerCompositor.cpp:
2748         (WebCore::RenderLayerCompositor::logReasonsForCompositing):
2749         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2750
2751 2018-05-08  Dean Jackson  <dino@apple.com>
2752
2753         Disable system preview link fetching
2754         https://bugs.webkit.org/show_bug.cgi?id=185463
2755
2756         Reviewed by Jon Lee.
2757
2758         Temporarily disable system preview detection when a link
2759         is clicked.
2760
2761         * html/HTMLAnchorElement.cpp:
2762         (WebCore::HTMLAnchorElement::handleClick):
2763
2764 2018-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2765
2766         Unreviewed, fix the internal iOS build
2767
2768         Add a missing import statement in an implementation file.
2769
2770         * editing/cocoa/WebContentReaderCocoa.mm:
2771
2772 2018-05-08  Ryan Haddad  <ryanhaddad@apple.com>
2773
2774         Unreviewed, rolling out r231486.
2775
2776         Caused service worker LayoutTest failures on macOS Debug WK2.
2777
2778         Reverted changeset:
2779
2780         "Allow WebResourceLoader to cancel a load served from a
2781         service worker"
2782         https://bugs.webkit.org/show_bug.cgi?id=185274
2783         https://trac.webkit.org/changeset/231486
2784
2785 2018-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2786
2787         Consolidate WebContentReaderIOS and WebContentReaderMac into WebContentReaderCocoa
2788         https://bugs.webkit.org/show_bug.cgi?id=185340
2789
2790         Reviewed by Tim Horton.
2791
2792         WebContentReader::readURL is currently the only method implemented separately in iOS and macOS platform
2793         WebContentReader files. The implementation across macOS and iOS is nearly identical (with some exceptions with
2794         the way iOS handles file URLs and plain text editing), so we can merge these into a single method
2795         WebContentReaderCocoa and delete WebContentReaderIOS and WebContentReaderMac.
2796
2797         This also has the added bonus of fixing a latent bug in WebContentReaderMac, wherein URLs written to the
2798         pasteboard using -[NSPasteboard writeObjects:] are currently pasted as empty anchor elements. In this case, the
2799         link title isn't made explicit, so the `title` passed in to WebContentReader::readURL is empty. On iOS, we have
2800         code to fall back to pasting the absolute string of the URL if the title is empty, but on macOS, we'll just use
2801         this empty string as the title of the anchor.
2802
2803         Test: PasteMixedContent.PasteURLWrittenToPasteboardUsingWriteObjects
2804
2805         * SourcesCocoa.txt:
2806         * WebCore.xcodeproj/project.pbxproj:
2807         * editing/cocoa/WebContentReaderCocoa.mm:
2808         (WebCore::WebContentReader::readURL):
2809         * editing/ios/WebContentReaderIOS.mm: Removed.
2810         * editing/mac/WebContentReaderMac.mm: Removed.
2811
2812 2018-05-08  Zalan Bujtas  <zalan@apple.com>
2813
2814         [Simple line layout] Cache run resolver.
2815         https://bugs.webkit.org/show_bug.cgi?id=185411
2816
2817         Reviewed by Antti Koivisto.
2818
2819         This patch caches the run resolver on the [SimpleLine]Layout object. 
2820         In certain cases, when the block container has thousands of elements (foobar1<br>foobar2<br>.....foobar9999<br>),
2821         constructing the resolver (and its dependencies) in a repeating fashion could hang the WebProcess.
2822
2823         Covered by existing tests.
2824
2825         * rendering/SimpleLineLayout.cpp:
2826         (WebCore::SimpleLineLayout::create):
2827         (WebCore::SimpleLineLayout::Layout::create):
2828         (WebCore::SimpleLineLayout::Layout::Layout):
2829         * rendering/SimpleLineLayout.h:
2830         (WebCore::SimpleLineLayout::Layout::runResolver const):
2831         * rendering/SimpleLineLayoutFunctions.cpp:
2832         (WebCore::SimpleLineLayout::paintFlow):
2833         (WebCore::SimpleLineLayout::hitTestFlow):
2834         (WebCore::SimpleLineLayout::collectFlowOverflow):
2835         (WebCore::SimpleLineLayout::computeBoundingBox):
2836         (WebCore::SimpleLineLayout::computeFirstRunLocation):
2837         (WebCore::SimpleLineLayout::collectAbsoluteRects):
2838         (WebCore::SimpleLineLayout::collectAbsoluteQuads):
2839         (WebCore::SimpleLineLayout::textOffsetForPoint):
2840         (WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange):
2841         (WebCore::SimpleLineLayout::generateLineBoxTree):
2842         * rendering/SimpleLineLayoutResolver.cpp:
2843         (WebCore::SimpleLineLayout::LineResolver::LineResolver):
2844         * rendering/SimpleLineLayoutResolver.h:
2845         (WebCore::SimpleLineLayout::lineResolver):
2846
2847 2018-05-08  Brent Fulgham  <bfulgham@apple.com>
2848
2849         Switch some RELEASE_ASSERTS to plain debug ASSERTS in PlatformScreenMac.mm
2850         https://bugs.webkit.org/show_bug.cgi?id=185451
2851         <rdar://problem/39620348>
2852
2853         Reviewed by Zalan Bujtas.
2854
2855         Change a set of RELEASE_ASSERTS used to prevent accessing NSScreen related functions in the
2856         PlatformScreenMac implementation to less expensive Debug ASSERTS.
2857
2858         No change in behavior.
2859
2860         * platform/mac/PlatformScreenMac.mm:
2861         (WebCore::screenHasInvertedColors):
2862         (WebCore::screenDepth):
2863         (WebCore::screenDepthPerComponent):
2864         (WebCore::screenRectForDisplay):
2865         (WebCore::screenRect):
2866         (WebCore::screenAvailableRect):
2867         (WebCore::screenColorSpace):
2868         (WebCore::screenSupportsExtendedColor):
2869
2870 2018-05-08  Daniel Bates  <dabates@apple.com>
2871
2872         Resign Strong Password appearance when text field value changes
2873         https://bugs.webkit.org/show_bug.cgi?id=185433
2874         <rdar://problem/39958508>
2875
2876         Reviewed by Ryosuke Niwa.
2877
2878         Remove the Strong Password decoration when the text field's value changes to avoid interfering
2879         with web sites that allow a person to clear the password field.
2880
2881         Tests: fast/forms/auto-fill-button/auto-fill-strong-password-button-when-maxlength-changes.html
2882                fast/forms/auto-fill-button/auto-fill-strong-password-button-when-minlength-changes.html
2883                fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-value-changes.html
2884
2885         * html/HTMLInputElement.cpp:
2886         (WebCore::HTMLInputElement::resignStrongPasswordAppearance): Extracted from HTMLInputElement::updateType().
2887         (WebCore::HTMLInputElement::updateType): Extract out logic to resign the Strong Password appearance
2888         into a function that can be shared by this function and HTMLInputElement::setValue().
2889         (WebCore::HTMLInputElement::setValue): Resign the Strong Password appearance if this field was
2890         changed programmatically (i.e. no DOM change event was dispatched).
2891         * html/HTMLInputElement.h:
2892
2893 2018-05-08  Jer Noble  <jer.noble@apple.com>
2894
2895         Unreviewed build fix; add missing function definition.
2896
2897         * html/HTMLMediaElement.h:
2898         (WebCore::HTMLMediaElement::didPassCORSAccessCheck const):
2899
2900 2018-05-08  Jer Noble  <jer.noble@apple.com>
2901
2902         Mute MediaElementSourceNode when tainted.
2903         https://bugs.webkit.org/show_bug.cgi?id=184866
2904
2905         Reviewed by Eric Carlson.
2906
2907         Test: http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin.html
2908
2909         * Modules/webaudio/AudioContext.cpp:
2910         (WebCore::AudioContext::wouldTaintOrigin const):
2911         * Modules/webaudio/AudioContext.h:
2912         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
2913         (WebCore::MediaElementAudioSourceNode::setFormat):
2914         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
2915         (WebCore::MediaElementAudioSourceNode::process):
2916         * Modules/webaudio/MediaElementAudioSourceNode.h:
2917
2918 2018-05-08  Eric Carlson  <eric.carlson@apple.com>
2919
2920         Log rtcstats as JSON
2921         https://bugs.webkit.org/show_bug.cgi?id=185437
2922         <rdar://problem/40065332>
2923
2924         Reviewed by Youenn Fablet.
2925
2926         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2927         (WebCore::RTCStatsLogger::RTCStatsLogger): Create a wrapper class so we don't have to add a
2928         toJSONString method to libwebrtc.
2929         (WebCore::RTCStatsLogger::toJSONString const): Log stats as JSON.
2930         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): Don't use the LOGIDENTIFIER macro because
2931         it doesn't work well inside of a lambda.
2932         (WTF::LogArgument<WebCore::RTCStatsLogger>::toString): Move into .cpp file because it is only
2933         used here.
2934         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2935         (WTF::LogArgument<webrtc::RTCStats>::toString): Deleted. Move to .cpp file.
2936
2937 2018-05-08  Dean Jackson  <dino@apple.com>
2938
2939         System Preview links should trigger a download
2940         https://bugs.webkit.org/show_bug.cgi?id=185439
2941         <rdar://problem/40065545>
2942
2943         Reviewed by Jon Lee.
2944
2945         Add a new field to FrameLoadRequest, which then is copied
2946         into ResourceRequest, identifying if the link clicked
2947         is a system preview.
2948
2949         * html/HTMLAnchorElement.cpp:
2950         (WebCore::HTMLAnchorElement::handleClick): Look for isSystemPreviewLink().
2951         * loader/FrameLoadRequest.cpp:
2952         (WebCore::FrameLoadRequest::FrameLoadRequest):
2953         * loader/FrameLoadRequest.h: New property.
2954         (WebCore::FrameLoadRequest::FrameLoadRequest):
2955         (WebCore::FrameLoadRequest::isSystemPreview const):
2956         * loader/FrameLoader.cpp:
2957         (WebCore::FrameLoader::urlSelected):
2958         (WebCore::FrameLoader::loadURL):
2959         * loader/FrameLoader.h:
2960         * platform/network/ResourceRequestBase.cpp:
2961         (WebCore::ResourceRequestBase::isSystemPreview const):
2962         (WebCore::ResourceRequestBase::setSystemPreview):
2963         * platform/network/ResourceRequestBase.h:
2964
2965 2018-05-08  Commit Queue  <commit-queue@webkit.org>
2966
2967         Unreviewed, rolling out r231491.
2968         https://bugs.webkit.org/show_bug.cgi?id=185434
2969
2970         Setting the Created key on a cookie does not work yet, due a
2971         bug in CFNetwork (Requested by ggaren on #webkit).
2972
2973         Reverted changeset:
2974
2975         "[WKHTTPCookieStore getAllCookies] returns inconsistent
2976         creation time"
2977         https://bugs.webkit.org/show_bug.cgi?id=185041
2978         https://trac.webkit.org/changeset/231491
2979
2980 2018-05-08  Sihui Liu  <sihui_liu@apple.com>
2981
2982         [WKHTTPCookieStore getAllCookies] returns inconsistent creation time
2983         https://bugs.webkit.org/show_bug.cgi?id=185041
2984         <rdar://problem/34684214>
2985
2986         Reviewed by Geoffrey Garen.
2987
2988         Set creationtime property when creating Cookie object to keep consistency after conversion.
2989
2990         New API test: WebKit.WKHTTPCookieStoreCreationTime.
2991
2992         * platform/network/cocoa/CookieCocoa.mm:
2993         (WebCore::Cookie::operator NSHTTPCookie * const):
2994
2995 2018-05-08  Eric Carlson  <eric.carlson@apple.com>
2996
2997         Text track cue logging should include cue text
2998         https://bugs.webkit.org/show_bug.cgi?id=185353
2999         <rdar://problem/40003565>
3000
3001         Reviewed by Brent Fulgham.
3002
3003         No new tests, tested manually.
3004
3005         * html/track/VTTCue.cpp:
3006         (WebCore::VTTCue::toJSON const):
3007         * platform/graphics/InbandTextTrackPrivateClient.h:
3008         (WebCore::GenericCueData::toJSONString const):
3009         * platform/graphics/iso/ISOVTTCue.cpp:
3010         (WebCore::ISOWebVTTCue::toJSONString const):
3011
3012 2018-05-08  Sam Weinig  <sam@webkit.org>
3013
3014         More cleanup of XMLHttpRequestUpload
3015         https://bugs.webkit.org/show_bug.cgi?id=185409
3016
3017         Reviewed by Alex Christensen.
3018
3019         - Remove unneeded #includes
3020         - Rename m_xmlHttpRequest to m_request
3021         - Make some overloaded some methods private, and mark them as final rather
3022           than override.
3023
3024         * xml/XMLHttpRequestUpload.cpp:
3025         (WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
3026         * xml/XMLHttpRequestUpload.h:
3027
3028 2018-05-08  Zalan Bujtas  <zalan@apple.com>
3029
3030         [LFC] Start using BlockMarginCollapse
3031         https://bugs.webkit.org/show_bug.cgi?id=185424
3032
3033         Reviewed by Antti Koivisto.
3034
3035         BlockMarginCollapse could be all static.
3036
3037         * layout/blockformatting/BlockFormattingContext.cpp:
3038         (WebCore::Layout::BlockFormattingContext::marginTop const):
3039         (WebCore::Layout::BlockFormattingContext::marginBottom const):
3040         * layout/blockformatting/BlockMarginCollapse.cpp:
3041         (WebCore::Layout::isMarginTopCollapsedWithSibling):
3042         (WebCore::Layout::isMarginBottomCollapsedWithSibling):
3043         (WebCore::Layout::isMarginTopCollapsedWithParent):
3044         (WebCore::Layout::isMarginBottomCollapsedWithParent):
3045         (WebCore::Layout::collapsedMarginTopFromFirstChild):
3046         (WebCore::Layout::collapsedMarginBottomFromLastChild):
3047         (WebCore::Layout::nonCollapsedMarginTop):
3048         (WebCore::Layout::nonCollapsedMarginBottom):
3049         (WebCore::Layout::BlockMarginCollapse::marginTop):
3050         (WebCore::Layout::BlockMarginCollapse::marginBottom):
3051         (WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse): Deleted.
3052         (WebCore::Layout::BlockMarginCollapse::marginTop const): Deleted.
3053         (WebCore::Layout::BlockMarginCollapse::marginBottom const): Deleted.
3054         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const): Deleted.
3055         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const): Deleted.
3056         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const): Deleted.
3057         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const): Deleted.
3058         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const): Deleted.
3059         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const): Deleted.
3060         (WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const): Deleted.
3061         (WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const): Deleted.
3062         (WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const): Deleted.
3063         * layout/blockformatting/BlockMarginCollapse.h:
3064
3065 2018-05-08  Youenn Fablet  <youenn@apple.com>
3066
3067         Allow WebResourceLoader to cancel a load served from a service worker
3068         https://bugs.webkit.org/show_bug.cgi?id=185274
3069
3070         Reviewed by Chris Dumez.
3071
3072         Add support for cancelling a fetch from WebProcess to service worker process.
3073         Use FetchIdentifier instead of uint64_t.
3074
3075         * Modules/fetch/FetchIdentifier.h: Added.
3076         * WebCore.xcodeproj/project.pbxproj:
3077         * workers/service/context/ServiceWorkerFetch.h:
3078         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3079         (WebCore::ServiceWorkerThreadProxy::startFetch):
3080         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
3081         * workers/service/context/ServiceWorkerThreadProxy.h:
3082
3083 2018-05-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3084
3085         feTurbulence is not rendered correctly on Retina display
3086         https://bugs.webkit.org/show_bug.cgi?id=183798
3087
3088         Reviewed by Simon Fraser.
3089
3090         On 2x display the feTurbulence filter creates a scaled ImageBuffer but
3091         processes only the unscaled size. This is a remaining work of r168577 and
3092         is very similar to what was done for the feMorphology filter in r188271.
3093
3094         Test: fast/hidpi/filters-turbulence.html
3095
3096         * platform/graphics/filters/FETurbulence.cpp:
3097         (WebCore::FETurbulence::fillRegion const):
3098         (WebCore::FETurbulence::platformApplySoftware):
3099
3100 2018-05-07  Zalan Bujtas  <zalan@apple.com>
3101
3102         [LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation
3103         https://bugs.webkit.org/show_bug.cgi?id=185377
3104
3105         Reviewed by Antti Koivisto.
3106
3107         Also, remove FormattingContext's m_layoutContext member and pass it in to ::layout() instead.
3108         In theory LayoutContext is needed only during ::layout() call. 
3109
3110         * layout/FormattingContext.cpp:
3111         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
3112         * layout/FormattingContext.h:
3113         (WebCore::Layout::FormattingContext::layoutContext const):
3114         * layout/LayoutContext.cpp:
3115         (WebCore::Layout::LayoutContext::updateLayout):
3116         * layout/blockformatting/BlockFormattingContext.cpp:
3117         (WebCore::Layout::BlockFormattingContext::layout const):
3118         * layout/blockformatting/BlockFormattingContext.h:
3119         * layout/inlineformatting/InlineFormattingContext.cpp:
3120         (WebCore::Layout::InlineFormattingContext::layout const):
3121         * layout/inlineformatting/InlineFormattingContext.h:
3122
3123 2018-05-07  Daniel Bates  <dabates@apple.com>
3124
3125         Check X-Frame-Options and CSP frame-ancestors in network process
3126         https://bugs.webkit.org/show_bug.cgi?id=185410
3127         <rdar://problem/37733934>
3128
3129         Reviewed by Ryosuke Niwa.
3130
3131         * WebCore.xcodeproj/project.pbxproj: Make PingLoader.h a private header so that we can include it in WebKit.
3132         * loader/DocumentLoader.cpp:
3133         (WebCore::DocumentLoader::responseReceived): Only check CSP frame-ancestors and X-Frame-Options here if
3134         we are not checking them in the NetworkProcess and HTTP response access is restricted. I code is otherwise kept
3135         unchanged. There may be opportunities to clean this code up more and share more of it. We should look into this
3136         in subsequent bugs.
3137         * loader/DocumentLoader.h: Change visibility of stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() from
3138         private to public and export it so that we can call it from the WebKit.
3139         * loader/PingLoader.h:
3140         * page/Settings.yaml: Add a new setting called networkProcessCSPFrameAncestorsCheckingEnabled (defaults: false)
3141         and is hardcoded in WebPage.cpp to be enabled. This setting is used to determine if we will be using the NetworkProcess.
3142         Ideally we wouldn't have this setting and just key off RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().
3143         However RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess() is always enabled in WebKit Legacy
3144         at the time of writing (why?). And, strangely, RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
3145         is conditionally enabled in WebKit. For now, we add a new setting, networkProcessCSPFrameAncestorsCheckingEnabled,
3146         to determine if CSP checking should be performed in NetworkProcess. For checking to actually happen in NetworkProcess
3147         and not in DocumentLoader::responseReceived() RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
3148         will also need to be enabled.
3149         * page/csp/ContentSecurityPolicy.cpp:
3150         (WebCore::ContentSecurityPolicy::allowFrameAncestors const): Added a variant that takes a vector of ancestor origins.
3151         * page/csp/ContentSecurityPolicy.h:
3152         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
3153         (WebCore::checkFrameAncestors): Ditto.
3154         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrameAncestorOrigins const): Ditto.
3155         * page/csp/ContentSecurityPolicyDirectiveList.h: Export constructor so that we can invoke it from NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions().
3156         * page/csp/ContentSecurityPolicyResponseHeaders.h:
3157         * platform/network/HTTPParsers.h: Export XFrameOptionsDisposition() so that we can use in WebKit.
3158
3159 2018-05-07  Daniel Bates  <dabates@apple.com>
3160
3161         Abstract logic to log console messages and send CSP violation reports into a client
3162         https://bugs.webkit.org/show_bug.cgi?id=185393
3163         <rdar://problem/40036053>
3164
3165         Reviewed by Brent Fulgham.
3166
3167         First pass at adding infrastructure to supporting CSP reporting from NetworkProcess and workers.
3168         Replaces the existing ContentSecurityPolicy constructor that takes a Frame with one that
3169         takes a ContentSecurityPolicyClient to delegate to for logging and sending reports. We will look
3170         to remove ContentSecurityPolicy constructor that takes a ScriptExecutionContext in a follow up.
3171
3172         Standardize on instantiating a ContentSecurityPolicy with the full URL to resource that it protects
3173         instead of taking only the SecurityOrigin of this URL. By taking the full URL the ContentSecurityPolicy
3174         object is now capable of resolving a relative report URL without needing a Document/ScriptExecutionContext.
3175
3176         We are underutilizing the CSPInfo struct and ContentSecurityPolicyClient::willSendCSPViolationReport()
3177         delegate callback in this patch. We will make use of this functionality in a subsequent patch to
3178         support collecting script state (e.g. source line number) when reporting CSP violations in worker
3179         threads. We also no longer go through the unnecessary motions to try to collect script state for a
3180         frame-ancestors violation (since DocumentLoader extends ContentSecurityPolicyClient and does not
3181         implement ContentSecurityPolicyClient::willSendCSPViolationReport()). The frame-ancestors directive
3182         is checked before a document is parsed and executes script; => there will never be any script state
3183         to collect; => it is not necessary to try to collect it as we currently do.
3184
3185         * Sources.txt: Add file ContentSecurityPolicyClient.cpp. See the remarks for ContentSecurityPolicyClient.cpp
3186         below on why we have this file.
3187         * WebCore.xcodeproj/project.pbxproj: Add files ContentSecurityPolicyClient.{h, cpp}.
3188         * dom/Document.cpp:
3189         (WebCore::Document::initSecurityContext): Pass the URL of the protected document.
3190         * loader/DocumentLoader.cpp:
3191         (WebCore::DocumentLoader::responseReceived): Ditto.
3192         (WebCore::DocumentLoader::addConsoleMessage): Added.
3193         (WebCore::DocumentLoader::sendCSPViolationReport): Added.
3194         (WebCore::DocumentLoader::dispatchSecurityPolicyViolationEvent): Added.
3195         * loader/DocumentLoader.h:
3196         * loader/FrameLoaderClient.h: Fix typo in comment.
3197         * loader/WorkerThreadableLoader.cpp:
3198         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Pass the URL of the worker script.
3199         * page/csp/ContentSecurityPolicy.cpp:
3200         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Added overload that takes a URL&& and an optional
3201         ContentSecurityPolicyClient*.
3202         (WebCore::ContentSecurityPolicy::deprecatedURLForReporting const): Extracted and simplified stripURLForUseInReport()
3203         into this member function.
3204         (WebCore::ContentSecurityPolicy::reportViolation const): Modified to make use of the client, if we have
3205         one and removed code for handling a ContentSecurityPolicy that was instantiated with a Frame.
3206         (WebCore::ContentSecurityPolicy::logToConsole const): Ditto.
3207         (WebCore::stripURLForUseInReport): Deleted; incorporated into ContentSecurityPolicy::deprecatedURLForReporting().
3208         * page/csp/ContentSecurityPolicy.h:
3209         * page/csp/ContentSecurityPolicyClient.cpp: Added. This file exists so that we can define the virtual
3210         destructor out-of-line and export this abstract class so as to avoid the need for the vtable to be
3211         defined in the translation unit of each derived class.
3212         * page/csp/ContentSecurityPolicyClient.h: Added.
3213         * page/csp/ContentSecurityPolicySource.cpp:
3214         (WebCore::ContentSecurityPolicySource::operator SecurityOriginData const): Added.
3215         * page/csp/ContentSecurityPolicySource.h:
3216         * workers/WorkerGlobalScope.cpp:
3217         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Instantiate the ContentSecurityPolicy object with the
3218         URL of the worker script.
3219
3220 2018-05-07  Simon Fraser  <simon.fraser@apple.com>
3221
3222         CSS filters which reference SVG filters fail to respect the "color-interpolation-filters" of the filter
3223         https://bugs.webkit.org/show_bug.cgi?id=185343
3224
3225         Reviewed by Dean Jackson.
3226
3227         Test: css3/filters/color-interpolation-filters.html
3228         
3229         When applying CSS reference filters, apply the value of "color-interpolation-filters" for the
3230         referenced filter effect element, just as we do for SVG filters.
3231
3232         * rendering/FilterEffectRenderer.cpp:
3233         (WebCore::FilterEffectRenderer::buildReferenceFilter):
3234
3235 2018-05-07  Daniel Bates  <dabates@apple.com>
3236
3237         CSP status-code incorrect for document blocked due to violation of its frame-ancestors directive
3238         https://bugs.webkit.org/show_bug.cgi?id=185366
3239         <rdar://problem/40035116>
3240
3241         Reviewed by Brent Fulgham.
3242
3243         Fixes an issue where the status-code in the sent CSP report for an HTTP document blocked because
3244         its frame-ancestors directive was violated would be the status code of the previously loaded
3245         document in the frame. If the previously loaded document was about:blank then this would be 0.
3246
3247         Currently whenever we send a CSP report we ask the document's loader (Document::loader()) for the
3248         HTTP status code for the last response. Document::loader() returns the loader for the last committed
3249         document its frame. For a frame-ancestors violation, a CSP report is sent before the document
3250         that had the frame-ancestors directive has been committed and after it has been associate with a frame.
3251         As a result we are in are in a transient transition state for the frame and hence the last response
3252         for new document's loader (Document::loader()) is actually the last response of the previously loaded
3253         document in the frame. Instead we need to take care to tell CSP about the HTTP status code for the
3254         response associated with the document the CSP came from.
3255
3256         * dom/Document.cpp:
3257         (WebCore::Document::processHttpEquiv):
3258         (WebCore::Document::initSecurityContext):
3259         Pass the HTTP status code to CSP.
3260
3261         * page/csp/ContentSecurityPolicy.cpp:
3262         (WebCore::ContentSecurityPolicy::copyStateFrom):
3263         (WebCore::ContentSecurityPolicy::responseHeaders const):
3264         (WebCore::ContentSecurityPolicy::didReceiveHeaders):
3265         (WebCore::ContentSecurityPolicy::didReceiveHeader):
3266         (WebCore::ContentSecurityPolicy::reportViolation const):
3267         * page/csp/ContentSecurityPolicy.h:
3268         Modify existing functions to take the HTTP status code, store it in a instance variable,
3269         and reference this variable when reporting a violation.
3270
3271         * page/csp/ContentSecurityPolicyResponseHeaders.cpp:
3272         (WebCore::ContentSecurityPolicyResponseHeaders::ContentSecurityPolicyResponseHeaders):
3273         (WebCore::ContentSecurityPolicyResponseHeaders::isolatedCopy const):
3274         * page/csp/ContentSecurityPolicyResponseHeaders.h:
3275         (WebCore::ContentSecurityPolicyResponseHeaders::encode const):
3276         (WebCore::ContentSecurityPolicyResponseHeaders::decode):
3277         Store the HTTP status code along with the response headers.
3278
3279 2018-05-07  Daniel Bates  <dabates@apple.com>
3280
3281         CSP referrer incorrect for document blocked due to violation of its frame-ancestors directive
3282         https://bugs.webkit.org/show_bug.cgi?id=185380
3283
3284         Reviewed by Brent Fulgham.
3285
3286         Similar to <https://bugs.webkit.org/show_bug.cgi?id=185366>, fixes an issue where the referrer
3287         in the sent CSP report for an HTTP document blocked because its frame-ancestors directive was
3288         violated would be the referrer of the previously loaded document in the frame.
3289
3290         Currently whenever we send a CSP report we ask the document's loader (Document::loader()) for
3291         the referrer for the last request. Document::loader() returns the loader for the last committed
3292         document in its frame. For a frame-ancestors violation, a CSP report is sent before the document
3293         that had the frame-ancestors directive has been committed and after it has been associate with a
3294         frame. As a result we are in a transient transition state for the frame and hence the last request
3295         for the new document's loader (Document::loader()) is actually the last request of the previously
3296         loaded document in the frame. Instead we need to take care to tell CSP about the referrer for the
3297         request associated with the document the CSP came from.
3298
3299         * loader/DocumentLoader.cpp:
3300         (WebCore::DocumentLoader::responseReceived):
3301
3302 2018-05-07  Brent Fulgham  <bfulgham@apple.com>
3303
3304         Add experimental feature to prompt for Storage Access API use
3305         https://bugs.webkit.org/show_bug.cgi?id=185335
3306         <rdar://problem/39994649>
3307
3308         Reviewed by Alex Christensen and Youenn Fablet.
3309
3310         Create a new experimental feature that gates the ability of WebKit clients to prompt the user when
3311         Storage Access API is invoked.
3312
3313         Currently this feature doesn't have any user-visible impact.
3314
3315         * page/RuntimeEnabledFeatures.h:
3316         (WebCore::RuntimeEnabledFeatures::setStorageAccessPromptsEnabled):
3317         (WebCore::RuntimeEnabledFeatures::storageAccessPromptsEnabled const):
3318         * testing/InternalSettings.cpp:
3319         (WebCore::InternalSettings::Backup::Backup):
3320         (WebCore::InternalSettings::Backup::restoreTo):
3321         (WebCore::InternalSettings::setStorageAccessPromptsEnabled):
3322         * testing/InternalSettings.h:
3323         * testing/InternalSettings.idl:
3324
3325 2018-05-07  Chris Dumez  <cdumez@apple.com>
3326
3327         Stop using an iframe's id as fallback if its name attribute is not set
3328         https://bugs.webkit.org/show_bug.cgi?id=11388
3329
3330         Reviewed by Geoff Garen.
3331
3332         WebKit had logic to use an iframe's id as fallback name when its name
3333         content attribute is not set. This behavior was not standard and did not
3334         match other browsers:
3335         - https://html.spec.whatwg.org/#attr-iframe-name
3336
3337         Gecko / Trident never behaved this way. Blink was aligned with us until
3338         they started to match the specification in:
3339         - https://bugs.chromium.org/p/chromium/issues/detail?id=347169
3340
3341         This WebKit quirk was causing some Web-compatibility issues because it
3342         would affect the behavior of Window's name property getter when trying
3343         to look up an iframe by id. Because of Window's named property getter
3344         behavior [1], we would return the frame's contentWindow instead of the
3345         iframe element itself.
3346
3347         [1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
3348
3349         Test: fast/dom/Window/named-getter-frame-id.html
3350
3351         * html/HTMLFrameElementBase.cpp:
3352         (WebCore::HTMLFrameElementBase::openURL):
3353         (WebCore::HTMLFrameElementBase::parseAttribute):
3354         (WebCore::HTMLFrameElementBase::didFinishInsertingNode):
3355         * html/HTMLFrameElementBase.h:
3356
3357 2018-05-07  Chris Dumez  <cdumez@apple.com>
3358
3359         ASSERT(!childItemWithTarget(child->target())) is hit in HistoryItem::addChildItem()
3360         https://bugs.webkit.org/show_bug.cgi?id=185322
3361
3362         Reviewed by Geoff Garen.
3363
3364         We generate unique names for Frame to be used in HistoryItem. Those names not only
3365         need to be unique, they also need to be repeatable to avoid layout tests flakiness
3366         and for things like restoring form state from a HistoryItem.
3367
3368         The previously generated frame names were relying on the Frame's index among a
3369         parent Frame's children. The issue was that we could end up with duplicate names
3370         because one could insert a Frame *before* an existing one. This is because the code
3371         would not take care of updating existing Frames' unique name on frame tree mutation.
3372
3373         Updating frame tree names on mutation would be inefficient and is also not necessary.
3374         The approach chosen in this patch is to stop using the Frame's index and instead rely
3375         on an increasing counter stored on the top-frame's FrameTree. To make the names
3376         repeatable, we reset the counter on page navigation.
3377
3378         * page/Frame.cpp:
3379         (WebCore::Frame::setDocument):
3380         * page/FrameTree.cpp:
3381         (WebCore::FrameTree::uniqueChildName const):
3382         (WebCore::FrameTree::generateUniqueName const):
3383         * page/FrameTree.h:
3384         (WebCore::FrameTree::resetFrameIdentifiers):
3385
3386 2018-05-07  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3387
3388         [EME][GStreamer] Fix wrong subsample parsing on r227067
3389         https://bugs.webkit.org/show_bug.cgi?id=185382
3390
3391         Reviewed by Philippe Normand.
3392
3393         The initialization of sampleIndex should be moved outside of the loop.
3394         Without this patch we will have a bad log and the check of the subsample
3395         count will be useless.
3396
3397         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
3398         (webKitMediaClearKeyDecryptorDecrypt):
3399
3400 2018-05-07  Daniel Bates  <dabates@apple.com>
3401
3402         CSP should be passed the referrer
3403         https://bugs.webkit.org/show_bug.cgi?id=185367
3404
3405         Reviewed by Per Arne Vollan.
3406
3407         As a step towards formalizing a CSP delegate object and removing the dependencies
3408         on ScriptExecutionContext and Frame, we should pass the document's referrer directly
3409         instead of indirectly obtaining it from the ScriptExecutionContext or Frame used
3410         to instantiate the ContentSecurityPolicy object.
3411
3412         * dom/Document.cpp:
3413         (WebCore::Document::processHttpEquiv): Pass the document's referrer.
3414         (WebCore::Document::initSecurityContext): Ditto.
3415         (WebCore::Document::applyQuickLookSandbox): Ditto.
3416         * loader/DocumentLoader.cpp:
3417         (WebCore::DocumentLoader::responseReceived): Ditto.
3418         * loader/FrameLoader.cpp:
3419         (WebCore::FrameLoader::didBeginDocument): Ditto.
3420         * page/csp/ContentSecurityPolicy.cpp:
3421         (WebCore::ContentSecurityPolicy::copyStateFrom): We pass a null string for the referrer
3422         to didReceiveHeader() as a placeholder since it requires the referrer be given to it. We
3423         fix up the referrer (m_referrer) after copying all the policy headers.
3424         (WebCore::ContentSecurityPolicy::didReceiveHeaders): Ditto.
3425         (WebCore::ContentSecurityPolicy::didReceiveHeader): Modified to take a referrer and WTFMove()s
3426         it into an instance variable (m_referrer).
3427         (WebCore::ContentSecurityPolicy::reportViolation const): Modified to use the stored referrer.
3428         * page/csp/ContentSecurityPolicy.h:
3429         * workers/WorkerGlobalScope.cpp:
3430         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Pass a null string
3431         for the referrer as a worker does not have a referrer.
3432
3433 2018-05-07  Daniel Bates  <dabates@apple.com>
3434
3435         CSP should only notify Inspector to pause the debugger on the first policy to violate a directive
3436         https://bugs.webkit.org/show_bug.cgi?id=185364
3437
3438         Reviewed by Brent Fulgham.
3439
3440         Notify Web Inspector that a script was blocked on the first enforced CSP policy that it
3441         violates.
3442
3443         A page can have more than one enforced Content Security Policy. Currently for inline
3444         scripts, inline event handlers, JavaScript URLs, and eval() that are blocked by CSP
3445         we notify Web Inspector that it was blocked for each CSP policy that blocked it. When
3446         Web Inspector is notified it pauses script execution. It does not seem very meaningful
3447         to pause script execution on the same script for each CSP policy that blocked it.
3448         Therefore, only tell Web Inspector that a script was blocked for the first enforced CSP
3449         policy that blocked it.
3450
3451         * page/csp/ContentSecurityPolicy.cpp:
3452         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs const):
3453         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers const):
3454         (WebCore::ContentSecurityPolicy::allowInlineScript const):
3455         (WebCore::ContentSecurityPolicy::allowEval const):
3456
3457 2018-05-07  Daniel Bates  <dabates@apple.com>
3458
3459         Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty()
3460         https://bugs.webkit.org/show_bug.cgi?id=185170
3461
3462         Reviewed by Per Arne Vollan.
3463
3464         Rename CrossOriginPreflightResultCache::empty() to CrossOriginPreflightResultCache::clear() make
3465         it consistent with the terminology we use in WebKit to signify a function that clears a collection.
3466         A member function named "empty" is expected to return an instance of a class in its "empty state".
3467         For example, StringImpl::empty() returns a StringImpl instance that represents the empty string.
3468         However CrossOriginPreflightResultCache::empty() clears out the cache in-place. We should rename
3469         this function to better describe its purpose.
3470
3471         * loader/CrossOriginPreflightResultCache.cpp:
3472         (WebCore::CrossOriginPreflightResultCache::clear):
3473         (WebCore::CrossOriginPreflightResultCache::empty): Deleted.
3474         * loader/CrossOriginPreflightResultCache.h:
3475
3476 2018-05-06  Dean Jackson  <dino@apple.com>
3477
3478         WebGL: Reset simulated values after validation fails
3479         https://bugs.webkit.org/show_bug.cgi?id=185363
3480         <rdar://problem/39733417>
3481
3482         Reviewed by Anders Carlsson.
3483
3484         While fixing a previous bug, I forgot to reset some values
3485         when validation fails. This caused a bug where a subsequent
3486         invalid call might use those values and escape detection.
3487
3488         Test: fast/canvas/webgl/index-validation-with-subsequent-draws.html
3489
3490         * html/canvas/WebGLRenderingContextBase.cpp:
3491         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Reset the
3492         sizes when validation fails.
3493         * html/canvas/WebGLRenderingContextBase.h:
3494
3495 2018-05-07  Ms2ger  <Ms2ger@igalia.com>
3496
3497         Support negative sw/sh values in createImageBitmap().
3498         https://bugs.webkit.org/show_bug.cgi?id=184449
3499
3500         Reviewed by Dean Jackson.
3501
3502         Tests: LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
3503                LayoutTests/http/wpt/2dcontext/imagebitmap/createImageBitmap.html
3504
3505         * html/ImageBitmap.cpp:
3506         (WebCore::ImageBitmap::createPromise): handle negative values per spec.
3507
3508 2018-05-07  Brian Burg  <bburg@apple.com>
3509
3510         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
3511         https://bugs.webkit.org/show_bug.cgi?id=184861
3512         <rdar://problem/39153768>
3513
3514         Reviewed by Timothy Hatcher.
3515
3516         Notify the client of the current connection count whenever a frontend connects or disconnects.
3517
3518         Covered by new API test.
3519
3520         * inspector/InspectorClient.h:
3521         (WebCore::InspectorClient::frontendCountChanged):
3522         * inspector/InspectorController.cpp:
3523         (WebCore::InspectorController::connectFrontend):
3524         (WebCore::InspectorController::disconnectFrontend):
3525         (WebCore::InspectorController::disconnectAllFrontends):
3526         * inspector/InspectorController.h:
3527
3528 2018-05-07  Eric Carlson  <eric.carlson@apple.com>
3529
3530         Text track cue logging should include cue text
3531         https://bugs.webkit.org/show_bug.cgi?id=185353
3532         <rdar://problem/40003565>
3533
3534         Reviewed by Youenn Fablet.
3535
3536         No new tests, tested manually.
3537
3538         * html/track/VTTCue.cpp:
3539         (WebCore::VTTCue::toJSONString const): Use toJSON.
3540         (WebCore::VTTCue::toJSON const): New.
3541         * html/track/VTTCue.h:
3542
3543         * platform/graphics/InbandTextTrackPrivateClient.h:
3544         (WebCore::GenericCueData::toJSONString const): Log m_content.
3545
3546         * platform/graphics/iso/ISOVTTCue.cpp:
3547         (WebCore::ISOWebVTTCue::toJSONString const): Log m_cueText.
3548
3549 2018-05-06  Zalan Bujtas  <zalan@apple.com>
3550
3551         [LFC] Add assertions for stale Display::Box geometry
3552         https://bugs.webkit.org/show_bug.cgi?id=185357
3553
3554         Reviewed by Antti Koivisto.
3555
3556         Ensure that we don't access stale geometry of other boxes during layout.
3557         For example, in order to layout a block child we need the containing block's content box top/left and width (but not the height)
3558
3559         * layout/displaytree/DisplayBox.h:
3560         (WebCore::Display::Box::invalidateTop):
3561         (WebCore::Display::Box::invalidateLeft):
3562         (WebCore::Display::Box::invalidateWidth):
3563         (WebCore::Display::Box::invalidateHeight):
3564         (WebCore::Display::Box::hasValidPosition const):
3565         (WebCore::Display::Box::hasValidSize const):
3566         (WebCore::Display::Box::hasValidGeometry const):
3567         (WebCore::Display::Box::invalidatePosition):
3568         (WebCore::Display::Box::invalidateSize):
3569         (WebCore::Display::Box::setHasValidPosition):
3570         (WebCore::Display::Box::setHasValidSize):
3571         (WebCore::Display::Box::setHasValidGeometry):
3572         (WebCore::Display::Box::rect const):
3573         (WebCore::Display::Box::top const):
3574         (WebCore::Display::Box::left const):
3575         (WebCore::Display::Box::bottom const):
3576         (WebCore::Display::Box::right const):
3577         (WebCore::Display::Box::topLeft const):
3578         (WebCore::Display::Box::bottomRight const):
3579         (WebCore::Display::Box::size const):
3580         (WebCore::Display::Box::width const):
3581         (WebCore::Display::Box::height const):
3582         (WebCore::Display::Box::setRect):
3583         (WebCore::Display::Box::setTopLeft):
3584         (WebCore::Display::Box::setTop):
3585         (WebCore::Display::Box::setLeft):
3586         (WebCore::Display::Box::setSize):
3587         (WebCore::Display::Box::setWidth):
3588         (WebCore::Display::Box::setHeight):
3589
3590 2018-05-06  Zalan Bujtas  <zalan@apple.com>
3591
3592         [LFC] Add BlockFormattingContext::computeStaticPosition
3593         https://bugs.webkit.org/show_bug.cgi?id=185352
3594
3595         Reviewed by Antti Koivisto.
3596
3597         This is the core logic for positioning inflow boxes in a block formatting context (very naive though).
3598
3599         * layout/blockformatting/BlockFormattingContext.cpp:
3600         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
3601         * layout/displaytree/DisplayBox.h:
3602
3603 2018-05-05  Sam Weinig  <sam@webkit.org>
3604
3605         Cleanup XMLHttpRequestUpload a little
3606         https://bugs.webkit.org/show_bug.cgi?id=185344
3607
3608         Reviewed by Yusuke Suzuki.
3609
3610         * bindings/js/JSXMLHttpRequestCustom.cpp:
3611         (WebCore::JSXMLHttpRequest::visitAdditionalChildren):
3612         Use auto to reduce redundancy.
3613
3614         * xml/XMLHttpRequest.cpp:
3615         (WebCore::XMLHttpRequest::upload):
3616         * xml/XMLHttpRequest.h:
3617         Switch upload() to return a reference.
3618         
3619         * xml/XMLHttpRequestUpload.cpp:
3620         (WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
3621         (WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
3622         * xml/XMLHttpRequestUpload.h:
3623         Cleanup formatting, modernize and switch XMLHttpRequest member from a pointer
3624         to a reference.
3625
3626 2018-05-05  Dean Jackson  <dino@apple.com>
3627
3628         Draw a drop-shadow behind the system preview badge
3629         https://bugs.webkit.org/show_bug.cgi?id=185356
3630         <rdar://problem/40004936>
3631
3632         Reviewed by Wenson Hsieh.
3633
3634         Draw a very subtle drop-shadow under the system
3635         preview badge so that it is more visible on a pure
3636         white background.
3637
3638         I also moved some code around to make it more clear
3639         and improved comments.
3640
3641         * rendering/RenderThemeIOS.mm:
3642         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
3643
3644 2018-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
3645
3646         [iOS] Multiple links in Mail are dropped in a single line, and are difficult to tell apart
3647         https://bugs.webkit.org/show_bug.cgi?id=185289
3648         <rdar://problem/35756912>
3649
3650         Reviewed by Tim Horton and Darin Adler.
3651
3652         When inserting multiple URLs as individual items in a single drop, we currently separate each item with a space
3653         (see r217284). However, it still seems difficult to tell dropped links apart. This patch makes some slight
3654         tweaks to WebContentReader::readURL so that it inserts line breaks before dropped URLs, if the dropped URL isn't
3655         the first item to be inserted in the resulting document fragment.
3656
3657         Augments existing API tests in DataInteractionTests.
3658
3659         * editing/ios/WebContentReaderIOS.mm:
3660
3661         Additionally remove some extraneous header imports from this implementation file.
3662
3663         (WebCore::WebContentReader::readURL):
3664
3665 2018-05-02  Dean Jackson  <dino@apple.com>
3666
3667         Use IOSurfaces for CoreImage operations where possible
3668         https://bugs.webkit.org/show_bug.cgi?id=185230
3669         <rdar://problem/39926929>
3670
3671         Reviewed by Jon Lee.
3672
3673         On iOS hardware, we can use IOSurfaces as a rendering destination
3674         for CoreImage, which means we're keeping data on the GPU
3675         for rendering.
3676
3677         As a drive-by fix, I used a convenience method for Gaussian blurs.
3678
3679         * rendering/RenderThemeIOS.mm:
3680         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
3681
3682 2018-05-04  Tim Horton  <timothy_horton@apple.com>
3683
3684         Shift to a lower-level framework for simplifying URLs
3685         https://bugs.webkit.org/show_bug.cgi?id=185334
3686
3687         Reviewed by Dan Bernstein.
3688
3689         * Configurations/WebCore.xcconfig:
3690         * platform/mac/DragImageMac.mm:
3691         (WebCore::LinkImageLayout::LinkImageLayout):
3692
3693 2018-05-03  Ryosuke Niwa  <rniwa@webkit.org>
3694
3695         Release assert in ScriptController::canExecuteScripts via HTMLMediaElement::~HTMLMediaElement()
3696         https://bugs.webkit.org/show_bug.cgi?id=185288
3697
3698         Reviewed by Jer Noble.
3699
3700         The crash is caused by HTMLMediaElement::~HTMLMediaElement canceling the resource load via CachedResource
3701         which ends up calling FrameLoader::checkCompleted() and fire load event on the document synchronously.
3702         Speculatively fix the crash by scheduling the check instead.
3703
3704         In long term, ResourceLoader::cancel should never fire load event synchronously: webkit.org/b/185284.
3705
3706         Unfortunately, no new tests since I can't get MediaResource to get destructed at the right time.
3707
3708         * html/HTMLMediaElement.cpp:
3709         (WebCore::HTMLMediaElement::isRunningDestructor): Added to detect this specific case.
3710         (WebCore::HTMLMediaElementDestructorScope): Added.
3711         (WebCore::HTMLMediaElementDestructorScope::HTMLMediaElementDestructorScope): Added.
3712         (WebCore::HTMLMediaElementDestructorScope::~HTMLMediaElementDestructorScope): Added.
3713         (WebCore::HTMLMediaElement::~HTMLMediaElement): Instantiate HTMLMediaElement.
3714         * html/HTMLMediaElement.h:
3715         * loader/FrameLoader.cpp:
3716         (WebCore::FrameLoader::checkCompleted): Call scheduleCheckCompleted instead of synchronously calling
3717         checkCompleted if we're in the middle of destructing a HTMLMediaElement.
3718
3719 2018-05-04  Ryosuke Niwa  <rniwa@webkit.org>
3720
3721         Rename DocumentOrderedMap to TreeScopeOrderedMap
3722         https://bugs.webkit.org/show_bug.cgi?id=185290
3723
3724         Reviewed by Zalan Bujtas.
3725
3726         Renamed the class since it's almost always a mistake to use this class as a member variable of Document.
3727
3728         * Sources.txt:
3729         * WebCore.xcodeproj/project.pbxproj:
3730         * dom/MouseRelatedEvent.cpp: Include the forgotten DOMWindow.h. Unified build files bit us here.
3731         * dom/TreeScope.cpp:
3732         (WebCore::TreeScope::addElementById):
3733         (WebCore::TreeScope::addElementByName):
3734         (WebCore::TreeScope::addImageMap):
3735         (WebCore::TreeScope::addImageElementByUsemap):
3736         (WebCore::TreeScope::labelElementForId):
3737         * dom/TreeScope.h:
3738         * dom/TreeScopeOrderedMap.cpp: Renamed from DocumentOrderedMap.cpp
3739         * dom/TreeScopeOrderedMap.h: Renamed from DocumentOrderedMap.h
3740         * html/HTMLDocument.h:
3741
3742 2018-05-04  Don Olmstead  <don.olmstead@sony.com>
3743
3744         [Win][WebKit] Fix forwarding headers for Windows build
3745         https://bugs.webkit.org/show_bug.cgi?id=184412
3746
3747         Reviewed by Alex Christensen.
3748
3749         No new tests. No change in behavior.
3750
3751         * PlatformWin.cmake:
3752
3753 2018-05-04  Zalan Bujtas  <zalan@apple.com>
3754
3755         [Simple line layout] Add support for line layout box generation with multiple text renderers.
3756         https://bugs.webkit.org/show_bug.cgi?id=185276
3757
3758         Reviewed by Antti Koivisto.
3759
3760         Covered by existing tests.
3761
3762         * rendering/SimpleLineLayoutFunctions.cpp:
3763         (WebCore::SimpleLineLayout::canUseForLineBoxTree):
3764         (WebCore::SimpleLineLayout::generateLineBoxTree):
3765         * rendering/SimpleLineLayoutResolver.cpp:
3766         (WebCore::SimpleLineLayout::RunResolver::Run::renderer const):
3767         (WebCore::SimpleLineLayout::RunResolver::Run::localStart const):
3768         (WebCore::SimpleLineLayout::RunResolver::Run::localEnd const):
3769         * rendering/SimpleLineLayoutResolver.h:
3770
3771 2018-05-04  Timothy Hatcher  <timothy@apple.com>
3772
3773         Deprecate legacy WebView and friends
3774         https://bugs.webkit.org/show_bug.cgi?id=185279
3775         rdar://problem/33268700
3776
3777         Reviewed by Tim Horton.
3778
3779         * Configurations/WebCore.xcconfig:
3780         Added BUILDING_WEBKIT define to disable the deprecation macros.
3781         * bridge/objc/WebScriptObject.h:
3782         Added deprecation macros to WebScriptObject and WebUndefined.
3783         * platform/cocoa/WebKitAvailability.h:
3784         Added more macros and a way to disable deprecation warnings for
3785         WebKit build and in clients like Safari.
3786
3787 2018-05-04  Eric Carlson  <eric.carlson@apple.com>
3788
3789         Log media time range as JSON
3790         https://bugs.webkit.org/show_bug.cgi?id=185321
3791         <rdar://problem/39986746>
3792
3793         Reviewed by Youenn Fablet.
3794
3795         No new tests, tested manually.
3796
3797         * html/HTMLMediaElement.cpp:
3798         (WebCore::HTMLMediaElement::addPlayedRange): Log as time range.
3799         (WebCore::HTMLMediaElement::visibilityStateChanged): Cleanup.
3800
3801         * platform/graphics/MediaPlayer.h:
3802         (WTF::LogArgument<MediaTime>::toString):
3803         (WTF::LogArgument<MediaTimeRange>::toString):
3804
3805         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
3806         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Log error as time range.
3807
3808 2018-05-04  Zalan Bujtas  <zalan@apple.com>
3809
3810         Use the containing block to compute the pagination gap when the container is inline.
3811         https://bugs.webkit.org/show_bug.cgi?id=184724
3812         <rdar://problem/39521800>
3813
3814         Reviewed by Simon Fraser.
3815
3816         Test: fast/overflow/page-overflow-with-inline-body-crash.html
3817
3818         * page/FrameView.cpp:
3819         (WebCore::FrameView::applyPaginationToViewport):
3820
3821 2018-05-04  Tim Horton  <timothy_horton@apple.com>
3822
3823         Don't use GSFont* in minimal simulator mode
3824         https://bugs.webkit.org/show_bug.cgi?id=185320
3825         <rdar://problem/39734478>
3826
3827         Reviewed by Beth Dakin.
3828
3829         * page/cocoa/MemoryReleaseCocoa.mm:
3830         (WebCore::platformReleaseMemory):
3831
3832 2018-05-04  Chris Dumez  <cdumez@apple.com>
3833
3834         Unreviewed, rolling out r231331.
3835
3836         Caused a few tests to assert
3837
3838         Reverted changeset:
3839
3840         "Stop using an iframe's id as fallback if its name attribute
3841         is not set"
3842         https://bugs.webkit.org/show_bug.cgi?id=11388
3843         https://trac.webkit.org/changeset/231331
3844
3845 2018-05-04  Youenn Fablet  <youenn@apple.com>
3846
3847         Use more references in updateTracksOfType
3848         https://bugs.webkit.org/show_bug.cgi?id=185305
3849
3850         Reviewed by Eric Carlson.
3851
3852         No change of behavior.
3853
3854         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3855         (WebCore::updateTracksOfType):
3856         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
3857
3858 2018-05-04  Myles C. Maxfield  <mmaxfield@apple.com>
3859
3860         Text shaping in the simple path is flipped in the y direction
3861         https://bugs.webkit.org/show_bug.cgi?id=185062
3862         <rdar://problem/39778678>
3863
3864         Reviewed by Simon Fraser.
3865
3866         Shaping in our simple codepath occurs in an "increasing-y-goes-up" coordinate system, but our painting
3867         code uses an "increasing-y-goes-down" coordinate system. We weren't fixing up the coordinate systems
3868         because we never noticed. This is because the simple codepath is only designed for kerning and ligatures,
3869         neither of which move glyphs vertically in the common case.
3870
3871         Test: fast/text/vertical-displacement-simple-codepath.html
3872
3873         * platform/graphics/Font.cpp:
3874         (WebCore::Font::applyTransforms const):
3875         * platform/graphics/WidthIterator.cpp:
3876         (WebCore::WidthIterator::applyFontTransforms):
3877
3878 2018-05-04  Chris Nardi  <cnardi@chromium.org>
3879
3880         Serialize all URLs with double-quotes per CSSOM spec
3881         https://bugs.webkit.org/show_bug.cgi?id=184935
3882
3883         Reviewed by Antti Koivisto.
3884
3885         According to https://drafts.csswg.org/cssom/#serialize-a-url, all URLs should be serialized as strings,
3886         which means they should have double quotes around the text of the URL. Update our implementation to match
3887         this (and Firefox/Chrome). Also remove isCSSTokenizerURL() as this method is no longer needed.
3888
3889         Tests: Many LayoutTests updated to use double quotes.
3890
3891         * css/CSSMarkup.cpp:
3892         (WebCore::serializeString): Remove FIXME as this was already fixed in a previous patch.
3893         (WebCore::serializeURL): Remove FIXME and update implementation.
3894
3895 2018-05-04  Youenn Fablet  <youenn@apple.com>
3896
3897         LayoutTests/fast/mediastream/change-tracks-media-stream-being-played.html is crashing after r231304
3898         https://bugs.webkit.org/show_bug.cgi?id=185303
3899
3900         Reviewed by Eric Carlson.
3901
3902         We need to stop observing the audio track like we do for video track once we are no longer interested in it.
3903         Covered by test no longer crashing.
3904
3905         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3906         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
3907
3908 2018-05-04  Zalan Bujtas  <zalan@apple.com>
3909
3910         [LFC] Set the invalidation root as the result of style change.
3911         https://bugs.webkit.org/show_bug.cgi?id=185301
3912
3913         Reviewed by Antti Koivisto.
3914
3915         Compute/propagate the update type on the ancestor chain and return the invalidation root
3916         so that LayoutContext could use it as the entry point for the next layout frame.
3917
3918         * layout/LayoutContext.cpp:
3919         (WebCore::Layout::LayoutContext::updateLayout):
3920         (WebCore::Layout::LayoutContext::styleChanged):
3921         * layout/LayoutContext.h: order is not important.
3922         * layout/blockformatting/BlockInvalidation.cpp:
3923         (WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
3924         (WebCore::Layout::computeUpdateType):
3925         (WebCore::Layout::computeUpdateTypeForAncestor):
3926         (WebCore::Layout::BlockInvalidation::invalidate):
3927         * layout/blockformatting/BlockInvalidation.h:
3928         * layout/inlineformatting/InlineInvalidation.cpp:
3929         (WebCore::Layout::InlineInvalidation::invalidate):
3930         * layout/inlineformatting/InlineInvalidation.h:
3931
3932 2018-05-04  Youenn Fablet  <youenn@apple.com>
3933
3934         PeerConnection should have its connectionState closed even if doing gathering
3935         https://bugs.webkit.org/show_bug.cgi?id=185267
3936
3937         Reviewed by Darin Adler.
3938
3939         Test: webrtc/addICECandidate-closed.html
3940
3941         In case m_iceConnectionState is closed, m_connectionState should also be set to closed
3942         and RTCPeerConnection should be closed so as to reject any other call.
3943
3944         * Modules/mediastream/RTCPeerConnection.cpp:
3945         (WebCore::RTCPeerConnection::close):
3946         (WebCore::RTCPeerConnection::updateConnectionState):
3947
3948 2018-05-04  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3949
3950         [MSE][GStreamer] Delete properly the stream from the WebKitMediaSource
3951         https://bugs.webkit.org/show_bug.cgi?id=185242
3952
3953         Reviewed by Xabier Rodriguez-Calvar.
3954
3955         When the sourceBuffer is removed from mediasource, the appropriate stream is not
3956         properly deleted from WebKitMediaSource, because the appsrc and parser elements
3957         of the stream are not removed from the WebKitMediaSource bin.
3958
3959         This patch avoids the regression of r231089, see https://bugs.webkit.org/show_bug.cgi?id=185071
3960
3961         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
3962         (webKitMediaSrcFreeStream):
3963
3964 2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
3965
3966         [GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com
3967         https://bugs.webkit.org/show_bug.cgi?id=174730
3968
3969         Reviewed by Michael Catanzaro.
3970
3971         Export ResourceRequestBase::hasHTTPHeaderField().