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