WebKit-https.git
15 months ago[Web Animations] Expose Web Animations CSS integration as an experimental feature
graouts@webkit.org [Tue, 15 May 2018 11:01:46 +0000 (11:01 +0000)]
[Web Animations] Expose Web Animations CSS integration as an experimental feature
https://bugs.webkit.org/show_bug.cgi?id=185647

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Change the name of the Web Animations CSS integration flag so that tests can opt into this feature.

* css-animations/test_animation-cancel.html:
* css-animations/test_animation-computed-timing.html:
* css-animations/test_animation-currenttime.html:
* css-animations/test_animation-finish.html:
* css-animations/test_animation-finished.html:
* css-animations/test_animation-id.html:
* css-animations/test_animation-pausing.html:
* css-animations/test_animation-playstate.html:
* css-animations/test_animation-ready.html:
* css-animations/test_animation-reverse.html:
* css-animations/test_animation-starttime.html:
* css-animations/test_animations-dynamic-changes.html:
* css-animations/test_cssanimation-animationname.html:
* css-animations/test_document-get-animations.html:
* css-animations/test_effect-target.html:
* css-animations/test_element-get-animations.html:
* css-animations/test_event-dispatch.html:
* css-animations/test_event-order.html:
* css-animations/test_keyframeeffect-getkeyframes.html:
* css-animations/test_pseudoElement-get-animations.html:
* css-animations/test_setting-effect.html:
* css-transitions/test_animation-cancel.html:
* css-transitions/test_animation-computed-timing.html:
* css-transitions/test_animation-currenttime.html:
* css-transitions/test_animation-finished.html:
* css-transitions/test_animation-pausing.html:
* css-transitions/test_animation-ready.html:
* css-transitions/test_animation-starttime.html:
* css-transitions/test_csstransition-transitionproperty.html:
* css-transitions/test_document-get-animations.html:
* css-transitions/test_effect-target.html:
* css-transitions/test_element-get-animations.html:
* css-transitions/test_event-dispatch.html:
* css-transitions/test_keyframeeffect-getkeyframes.html:
* css-transitions/test_pseudoElement-get-animations.html:
* css-transitions/test_setting-effect.html:

LayoutTests/imported/w3c:

Change the name of the Web Animations CSS integration flag so that tests can opt into this feature.

* web-platform-tests/css-timing-1/frames-timing-functions-output.html:
* web-platform-tests/web-animations/interfaces/Animation/ready.html:
* web-platform-tests/web-animations/timing-model/animations/playing-an-animation.html:
* web-platform-tests/web-animations/timing-model/animations/reversing-an-animation.html:

Source/WebCore:

Make the Web Animations CSS integration flag an experimental feature, and only indicate that it is on if the Web Animations
experimental feature is also enabled.

* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::resume):
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* page/Frame.cpp:
(WebCore::Frame::clearTimers):
* page/FrameView.cpp:
(WebCore::FrameView::didDestroyRenderTree):
* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebAnimationsCSSIntegrationEnabled):
(WebCore::RuntimeEnabledFeatures::webAnimationsCSSIntegrationEnabled const):
(WebCore::RuntimeEnabledFeatures::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled const): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::webAnimationsCSSIntegrationEnabled):
(WebCore::InternalSettings::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::numberOfActiveAnimations const):
(WebCore::Internals::animationsAreSuspended const):
(WebCore::Internals::animationsInterval const):
(WebCore::Internals::suspendAnimations const):
(WebCore::Internals::resumeAnimations const):

Source/WebKit:

Rename the Web Animations CSS integration flag.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetWebAnimationsCSSIntegrationEnabled):
(WKPreferencesGetWebAnimationsCSSIntegrationEnabled):
(WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
(WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setWebAnimationsCSSIntegrationEnabled:]):
(-[WKPreferences _webAnimationsCSSIntegrationEnabled]):
(-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]): Deleted.
(-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
(WebKit::InjectedBundle::setWebAnimationsCSSIntegrationEnabled):
(WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
* WebProcess/InjectedBundle/InjectedBundle.h:

Source/WebKitLegacy/mac:

Rename the Web Animations CSS integration flag.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences webAnimationsCSSIntegrationEnabled]):
(-[WebPreferences setWebAnimationsCSSIntegrationEnabled:]):
(-[WebPreferences cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]): Deleted.
(-[WebPreferences setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

Rename the Web Animations CSS integration flag.

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::webAnimationsCSSIntegrationEnabled):
(WebPreferences::setWebAnimationsCSSIntegrationEnabled):
(WebPreferences::cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
(WebPreferences::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled): Deleted.
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

Rename the Web Animations CSS integration flag.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

Change the name of the Web Animations CSS integration flag so that tests can opt into this feature.

* animations/3d/matrix-transform-type-animation.html:
* animations/3d/replace-filling-transform.html:
* animations/3d/transform-origin-vs-functions.html:
* animations/3d/transform-perspective.html:
* animations/additive-transform-animations.html:
* animations/animation-border-overflow.html:
* animations/animation-callback-timestamp.html:
* animations/animation-controller-drt-api.html:
* animations/animation-direction-reverse-fill-mode-hardware.html:
* animations/animation-direction-reverse-hardware-opacity.html:
* animations/animation-direction-reverse-hardware.html:
* animations/animation-direction-reverse-non-hardware.html:
* animations/animation-direction-reverse-timing-functions-hardware.html:
* animations/animation-direction-reverse-timing-functions.html:
* animations/animation-direction.html:
* animations/animation-followed-by-transition.html:
* animations/animation-hit-test-transform.html:
* animations/animation-hit-test.html:
* animations/animation-offscreen-to-onscreen.html:
* animations/change-completed-animation-transform.html:
* animations/change-keyframes.html:
* animations/combo-transform-rotate+scale.html:
* animations/cross-fade-background-image.html:
* animations/cross-fade-border-image-source.html:
* animations/cross-fade-list-style-image.html:
* animations/cross-fade-webkit-mask-box-image.html:
* animations/duplicate-keys-expected.html:
* animations/duplicate-keys.html:
* animations/font-variations/font-stretch.html:
* animations/font-variations/font-style.html:
* animations/font-variations/font-variation-settings-order.html:
* animations/font-variations/font-variation-settings-unlike.html:
* animations/font-variations/font-variation-settings.html:
* animations/font-variations/font-weight.html:
* animations/generic-from-to.html:
* animations/import.html:
* animations/keyframe-multiple-timing-functions-transform.html:
* animations/keyframe-timing-functions-transform.html:
* animations/keyframe-timing-functions.html:
* animations/keyframe-timing-functions2.html:
* animations/keyframes-comma-separated.html:
* animations/keyframes-dynamic.html:
* animations/keyframes-infinite-iterations.html:
* animations/keyframes-invalid-keys.html:
* animations/keyframes-out-of-order.html:
* animations/keyframes.html:
* animations/lineheight-animation.html:
* animations/longhand-timing-function.html:
* animations/matrix-anim.html:
* animations/missing-from-to-transforms.html:
* animations/missing-from-to.html:
* animations/missing-keyframe-properties-repeating.html:
* animations/missing-keyframe-properties-timing-function.html:
* animations/missing-keyframe-properties.html:
* animations/missing-values-first-keyframe.html:
* animations/missing-values-last-keyframe.html:
* animations/multiple-animations-timing-function.html:
* animations/multiple-animations.html:
* animations/multiple-keyframes.html:
* animations/negative-delay.html:
* animations/pause-crash.html:
* animations/play-state-start-paused.html:
* animations/resources/animation-test-helpers.js:
(pauseAnimationAtTimeOnElement):
* animations/simultaneous-start-left.html:
* animations/simultaneous-start-transform.html:
* animations/spring-function.html:
* animations/stacking-context-unchanged-while-running.html:
* animations/timing-functions.html:
* animations/transition-and-animation-1.html:
* animations/transition-and-animation-2.html:
* animations/transition-and-animation-3.html:
* animations/unanimated-style.html:
* animations/unprefixed-keyframes.html:
* animations/width-using-ems.html:
* compositing/animation/animated-composited-inside-hidden.html:
* compositing/animation/computed-style-during-delay.html:
* compositing/animation/layer-for-filling-animation.html:
* compositing/backing/backface-visibility-flip.html:
* compositing/contents-scale/animating.html:
* compositing/layer-creation/animation-overlap-with-children.html:
* compositing/layer-creation/mismatched-rotated-transform-animation-overlap.html:
* compositing/layer-creation/multiple-keyframes-animation-overlap.html:
* compositing/layer-creation/overlap-animation-clipping.html:
* compositing/layer-creation/overlap-animation-container.html:
* compositing/layer-creation/overlap-animation.html:
* compositing/layer-creation/scale-rotation-animation-overlap.html:
* compositing/layer-creation/translate-animation-overlap.html:
* compositing/layer-creation/translate-scale-animation-overlap.html:
* compositing/overflow/overflow-positioning.html:
* compositing/reflections/animation-inside-reflection.html:
* compositing/reflections/nested-reflection-animated.html:
* compositing/reflections/nested-reflection-transition.html:
* compositing/transitions/scale-transition-no-start.html:
* compositing/transitions/singular-scale-transition.html:
* compositing/visible-rect/animated.html:
* css3/calc/transitions-dependent.html:
* css3/calc/transitions.html:
* css3/filters/backdrop/animation.html:
* css3/filters/composited-during-animation.html:
* css3/filters/filter-animation-from-none-hw.html:
* css3/filters/filter-animation-from-none-multi-hw.html:
* css3/filters/filter-animation-from-none-multi.html:
* css3/filters/filter-animation-from-none.html:
* css3/filters/filter-animation-hw.html:
* css3/filters/filter-animation-multi-hw.html:
* css3/filters/filter-animation-multi.html:
* css3/filters/filter-animation.html:
* css3/masking/clip-path-animation.html:
* fast/animation/css-animation-resuming-when-visible-with-style-change.html:
* fast/animation/css-animation-resuming-when-visible.html:
* fast/animation/css-animation-throttling-lowPowerMode.html:
* fast/css-generated-content/pseudo-animation.html:
* fast/filter-image/filter-image-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-shape-image-threshold-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-shape-margin-animation.html:
* imported/blink/transitions/unprefixed-transform.html:
* transitions/background-position-transitions.html:
* transitions/background-transitions.html:
* transitions/blendmode-transitions.html:
* transitions/border-radius-transition.html:
* transitions/clip-path-path-transitions.html:
* transitions/clip-path-transitions.html:
* transitions/clip-transition.html:
* transitions/color-transition-all.html:
* transitions/color-transition-premultiplied.html:
* transitions/color-transition-rounding.html:
* transitions/cross-fade-background-image.html:
* transitions/cross-fade-border-image.html:
* transitions/cubic-bezier-overflow-color.html:
* transitions/cubic-bezier-overflow-length.html:
* transitions/cubic-bezier-overflow-shadow.html:
* transitions/cubic-bezier-overflow-svg-length.html:
* transitions/cubic-bezier-overflow-transform.html:
* transitions/default-timing-function.html:
* transitions/delay.html:
* transitions/flex-transitions.html:
* transitions/font-family-during-transition.html:
* transitions/frames-timing-function.html:
* transitions/interrupted-all-transition.html:
* transitions/longhand-vs-shorthand-initial.html:
* transitions/mask-transitions.html:
* transitions/min-max-width-height-transitions.html:
* transitions/mismatched-shadow-styles.html:
* transitions/mismatched-shadow-transitions.html:
* transitions/mixed-type.html:
* transitions/move-after-transition.html:
* transitions/multiple-background-size-transitions.html:
* transitions/multiple-background-transitions.html:
* transitions/multiple-mask-transitions.html:
* transitions/multiple-shadow-transitions.html:
* transitions/negative-delay.html:
* transitions/opacity-transition-zindex.html:
* transitions/resources/transition-test-helpers.js:
* transitions/shape-outside-transitions.html:
* transitions/shorthand-border-transitions.html:
* transitions/shorthand-transitions.html:
* transitions/steps-timing-function.html:
* transitions/svg-layout-transition.html:
* transitions/svg-text-shadow-transition.html:
* transitions/svg-transitions.html:
* transitions/text-indent-transition.html:
* transitions/transform-op-list-match.html:
* transitions/transform-op-list-no-match.html:
* transitions/transition-end-event-rendering.html:
* transitions/transition-hit-test-transform.html:
* transitions/transition-hit-test.html:
* transitions/transition-in-delay-phase.html:
* transitions/transition-on-element-with-content.html:
* transitions/transition-shorthand-delay.html:
* transitions/transition-timing-function.html:
* transitions/transition-to-from-auto.html:
* transitions/transition-to-from-undefined.html:
* transitions/visited-link-color.html:
* transitions/zero-duration-in-list.html:
* transitions/zero-duration-with-non-zero-delay-start.html:
* webanimations/css-animations.html:
* webanimations/css-transitions.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231798 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoUpdate animation when presenting QuickLook
dino@apple.com [Tue, 15 May 2018 10:36:07 +0000 (10:36 +0000)]
Update animation when presenting QuickLook
https://bugs.webkit.org/show_bug.cgi?id=185648
<rdar://problem/39652624>

Reviewed by Antoine Quint.

Implement the QuickLook delegate on _WKPreviewControllerDelegate that
produces a zoom-like animation when the QLPreviewController appears.

* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
(-[_WKPreviewControllerDelegate previewController:frameForPreviewItem:inSourceView:]):
* UIProcess/SystemPreviewController.h: Add a reference back to the page, so that
the delegate implementation can access the presentingViewController.
(WebKit::SystemPreviewController::page):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231797 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoFix -Wreturn-std-move warnings in WebKit found by new clang compiler
ddkilzer@apple.com [Tue, 15 May 2018 10:24:24 +0000 (10:24 +0000)]
Fix -Wreturn-std-move warnings in WebKit found by new clang compiler
<https://webkit.org/b/185621>

Reviewed by Youenn Fablet.

Fix warnings like the following:

    In file included from DerivedSources/WebCore/unified-sources/UnifiedSource139.cpp:5:
    ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: error: local variable 'sdp' will be copied despite being returned by name [-Werror,-Wreturn-std-move]
            return sdp;
                   ^~~
    ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: note: call 'std::move' explicitly to avoid copying
            return sdp;
                   ^~~
                   std::move(sdp)
    1 error generated.

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::filterSDP const):
* accessibility/AccessibilityObject.cpp:
(WebCore::rangeClosestToRange):
* bindings/js/JSDOMConvertSequences.h:
(WebCore::Detail::GenericSequenceConverter::convert):
(WebCore::Detail::NumericSequenceConverter::convertArray):
* bindings/js/JSDOMConvertStrings.cpp:
(WebCore::stringToByteString):
(WebCore::stringToUSVString):
- Use WTFMove() in return statements to fix the warnings.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231796 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoDownload and present System Preview
dino@apple.com [Tue, 15 May 2018 09:50:07 +0000 (09:50 +0000)]
Download and present System Preview
https://bugs.webkit.org/show_bug.cgi?id=185459
<rdar://problem/40079228>

Reviewed by Tim Horton.

Source/WebCore:

If an <a> is a system preview, tell the resource request about it.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):

Source/WebKit:

Extend DownloadClient so that it can handle the case where
the download was triggered by a System Preview. In this situation
the result (and progress) are piped into QuickLook via the SystemPreviewController.

The DownloadProxy class is also extended to handle the destination
filename and the size of the content.

Lastly, SystemPreviewController is updated to have a start(), show()
and cancel() interface, and no longer adjusts page navigation.

* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/DownloadClient.mm: Handle the SystemPreview case, which
doesn't have a download delegate, but instead needs to communicate with
the SystemPreviewController, if one exists.
(WebKit::DownloadClient::didStart):
(WebKit::DownloadClient::didReceiveResponse):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::didCreateDestination):
(WebKit::DownloadClient::processDidCrash):
(WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
(WebKit::DownloadClient::didFinish):
(WebKit::DownloadClient::didFail):
(WebKit::DownloadClient::didCancel):
(WebKit::DownloadClient::releaseActivityToken):

* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Implement the new API.
(-[_WKPreviewControllerDataSource initWithMIMEType:]):
(-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
(-[_WKPreviewControllerDataSource setProgress:]):
(-[_WKPreviewControllerDataSource finish:]):
(-[_WKPreviewControllerDelegate previewControllerDidDismiss:]):
(WebKit::SystemPreviewController::start):
(WebKit::SystemPreviewController::updateProgress):
(WebKit::SystemPreviewController::finish):
(WebKit::SystemPreviewController::cancel):
(-[_WKPreviewControllerDataSource initWithURL:]): Deleted.
(-[_WKPreviewControllerDelegate previewControllerWillDismiss:]): Deleted.
(WebKit::SystemPreviewController::canPreview const): Deleted.
(WebKit::SystemPreviewController::showPreview): Deleted.
* UIProcess/Downloads/DownloadProxy.h: Track the destination file by name
and size. Also expose a helper to identify system preview downloads.
(WebKit::DownloadProxy::destinationFilename const):
(WebKit::DownloadProxy::setDestinationFilename):
(WebKit::DownloadProxy::expectedContentLength const):
(WebKit::DownloadProxy::setExpectedContentLength):
(WebKit::DownloadProxy::bytesLoaded const):
(WebKit::DownloadProxy::setBytesLoaded):
(WebKit::DownloadProxy::isSystemPreviewDownload const):

* UIProcess/SystemPreviewController.cpp: New API.
(WebKit::SystemPreviewController::canPreview const):
(WebKit::SystemPreviewController::sendPageBack): Deleted.
(WebKit::SystemPreviewController::showPreview): Deleted.
* UIProcess/SystemPreviewController.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::m_configurationPreferenceValues):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231795 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoanimation-play-state: paused causes very high cpu load because of style invalidation...
antti@apple.com [Tue, 15 May 2018 08:59:53 +0000 (08:59 +0000)]
animation-play-state: paused causes very high cpu load because of style invalidation loop
https://bugs.webkit.org/show_bug.cgi?id=182436
<rdar://problem/37182562>

Reviewed by Dean Jackson.

Source/WebCore:

Test: animations/animation-playstate-paused-style-resolution.html

If the style of an element with 'animation-play-state: paused' is recomputed so it stays
paused we would enter zero-duration animation timer loop.

* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::updateStateMachine):

Don't move to AnimationState::PausedWaitResponse unless we get AnimationStateInput::StyleAvailable
(matching the comments). Otherwise just stay in the existing paused state.

Remove AnimationStateInput::StartAnimation from assertion as the case can't happen.

LayoutTests:

* animations/animation-playstate-paused-style-resolution-expected.txt: Added.
* animations/animation-playstate-paused-style-resolution.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231794 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoreadableStreamDefaultControllerError should return early if stream is not readable
youenn@apple.com [Tue, 15 May 2018 05:35:25 +0000 (05:35 +0000)]
readableStreamDefaultControllerError should return early if stream is not readable
https://bugs.webkit.org/show_bug.cgi?id=185602

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/streams/readable-streams/bad-underlying-sources-expected.txt:
* web-platform-tests/streams/readable-streams/bad-underlying-sources.dedicatedworker-expected.txt:
* web-platform-tests/streams/readable-streams/bad-underlying-sources.serviceworker.https-expected.txt:
* web-platform-tests/streams/readable-streams/garbage-collection-expected.txt:
* web-platform-tests/streams/readable-streams/garbage-collection.dedicatedworker-expected.txt:
* web-platform-tests/streams/readable-streams/garbage-collection.serviceworker.https-expected.txt:
* web-platform-tests/streams/readable-streams/tee-expected.txt:

Source/WebCore:

Return early if stream is not readable in @readableStreamDefaultControllerError.
Update call sites to no longer check for ReadableStream state.
Covered by unflaked and rebased tests.

* Modules/streams/ReadableStreamDefaultController.js:
(error):
* Modules/streams/ReadableStreamInternals.js:
(readableStreamDefaultControllerError):
(readableStreamDefaultControllerCallPullIfNeeded):

LayoutTests:

* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231789 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoimported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-6.html...
youenn@apple.com [Tue, 15 May 2018 05:31:49 +0000 (05:31 +0000)]
imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-6.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=185549

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Catch any potential rejected promise.

* web-platform-tests/fetch/api/response/response-stream-disturbed-6.html:

LayoutTests:

* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231788 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoRemove butterflyMask from DFGAbstractHeap
keith_miller@apple.com [Tue, 15 May 2018 05:27:29 +0000 (05:27 +0000)]
Remove butterflyMask from DFGAbstractHeap
https://bugs.webkit.org/show_bug.cgi?id=185640

Reviewed by Saam Barati.

We don't have a butterfly indexing mask anymore so we don't need
the abstract heap information for it anymore.

* dfg/DFGAbstractHeap.h:
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231787 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[LFC] Implement width computation for non-replaced block level inflow elements.
zalan@apple.com [Tue, 15 May 2018 05:23:28 +0000 (05:23 +0000)]
[LFC] Implement width computation for non-replaced block level inflow elements.
https://bugs.webkit.org/show_bug.cgi?id=185641

Reviewed by Sam Weinig.

Block level inflow elements participate in block formatting context.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeWidth const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
* layout/inlineformatting/InlineFormattingContext.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231786 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoAdd an API test to guard against regressions while re-entering setDefersLoading:.
beidson@apple.com [Tue, 15 May 2018 03:09:19 +0000 (03:09 +0000)]
Add an API test to guard against regressions while re-entering setDefersLoading:.
<rdar://problem/37033737> and https://bugs.webkit.org/show_bug.cgi?id=185630

Reviewed by Chris Dumez.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setDefersLoadingForTesting:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setDefersLoadingForTesting):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/DoubleDefersLoading.mm: Added.
(-[DoubleDefersNavigationDelegate _webView:navigation:didSameDocumentNavigation:]):
(-[DoubleDefersNavigationDelegate webView:didFinishNavigation:]):
(-[DefersScheme initWithBytes:]):
(-[DefersScheme webView:startURLSchemeTask:]):
(-[DefersScheme webView:stopURLSchemeTask:]):
* TestWebKitAPI/Tests/WebKitCocoa/DoubleDefersLoadingPlugin.mm: Added.
(-[DoubleDefersLoadingPlugIn webProcessPlugIn:didCreateBrowserContextController:]):
(-[DoubleDefersLoadingPlugIn webProcessPlugInBrowserContextController:didSameDocumentNavigation:forFrame:]):
(-[DoubleDefersLoadingPlugIn dealloc]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231785 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoUnreviewed, fix the iOS build after r231779
wenson_hsieh@apple.com [Tue, 15 May 2018 03:00:27 +0000 (03:00 +0000)]
Unreviewed, fix the iOS build after r231779

Also address a minor in-person review comment by returning "extrazoom" instead of the empty string.

* page/DisabledAdaptations.cpp:
(WebCore::extraZoomModeAdaptationName):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231784 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoUse the system font by default in extra zoom mode
timothy_horton@apple.com [Tue, 15 May 2018 02:24:59 +0000 (02:24 +0000)]
Use the system font by default in extra zoom mode
https://bugs.webkit.org/show_bug.cgi?id=185638
<rdar://problem/40230277>

Reviewed by Wenson Hsieh.

* Shared/WebPreferencesDefaultValues.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231783 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoWeb Inspector: Canvas: Remove unused --value-visual-highlight CSS variable
nvasilyev@apple.com [Tue, 15 May 2018 01:52:26 +0000 (01:52 +0000)]
Web Inspector: Canvas: Remove unused --value-visual-highlight CSS variable
https://bugs.webkit.org/show_bug.cgi?id=185636

Reviewed by Matt Baker.

* UserInterface/Views/Variables.css:
(:root):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231782 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoUnreviewed, rolling out r231755.
mcatanzaro@igalia.com [Tue, 15 May 2018 01:44:26 +0000 (01:44 +0000)]
Unreviewed, rolling out r231755.

Change is not correct

Reverted changeset:

"-Wmemset-elt-size warning in LibWebRTCSocket constructor"
https://bugs.webkit.org/show_bug.cgi?id=185555
https://trac.webkit.org/changeset/231755

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231781 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[LFC] FormattingContext:computeOutOfFlowNonReplacedHeight/Width should use the comput...
zalan@apple.com [Tue, 15 May 2018 01:31:21 +0000 (01:31 +0000)]
[LFC] FormattingContext:computeOutOfFlowNonReplacedHeight/Width should use the computed margins/paddings/borders
https://bugs.webkit.org/show_bug.cgi?id=185633

Reviewed by Sam Weinig.

By the time we start computing height and width, DisplayBox should already have the computed values for margin/padding/border.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::paddingTop const):
(WebCore::Display::Box::paddingLeft const):
(WebCore::Display::Box::paddingBottom const):
(WebCore::Display::Box::paddingRight const):
(WebCore::Display::Box::borderTop const):
(WebCore::Display::Box::borderLeft const):
(WebCore::Display::Box::borderBottom const):
(WebCore::Display::Box::borderRight const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231780 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[Extra zoom mode] Google search results are excessively zoomed in
wenson_hsieh@apple.com [Tue, 15 May 2018 01:07:36 +0000 (01:07 +0000)]
[Extra zoom mode] Google search results are excessively zoomed in
https://bugs.webkit.org/show_bug.cgi?id=185347
<rdar://problem/39999778>

Reviewed by Tim Horton.

Source/WebCore:

It turns out that basing minimum layout size and shrink-to-fit behaviors off of the `shrink-to-fit` viewport
argument poses compatibility risks with web pages that already specify `shrink-to-fit` to opt out of default
viewport shrinking behaviors in 1/3 multitasking mode on iPad.

One way to resolve this is to introduce a new viewport meta content attribute to disable viewport heuristics in
extra zoom mode. However, combined shrink-to-fit and minimum device width behaviors are difficult to describe
using a single backwards-compatible viewport meta content attribute, and the need to suppress the default
behavior of `shrink-to-fit=no` if such an attribute is not disabled further muddles our viewport story.

After some internal deliberation, we’ve decided to experiment with a new meta tag named "disabled-adaptations".
The content of this meta tag is a comma-separated list of adaptation names; if an adaptation name matches a
known adaptation type (for instance, extra zoom mode), we disable the class of behaviors used to adapt web
content. The first and only known adaptation type is extra zoom mode, which affects `shrink-to-fit` and layout
size adjustments.

See per-method changes below for more details.

Test: fast/viewport/extrazoom/viewport-disable-extra-zoom-adaptations.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::processDisabledAdaptations):
* dom/Document.h:
(WebCore::Document::disabledAdaptations const):

Add disabled adaptations to Document. Changes to disabled adaptations are not propagated if the parsed disabled
adaptation types don't change; upon changing adaptation types, notify the client to adjust for the new disabled
adaptations (currently, this only affects the viewport configuration).

* dom/ViewportArguments.h:
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):

Restore the set of disabled adaptations when restoring a page from the cache.

* page/Chrome.cpp:
(WebCore::Chrome::dispatchDisabledAdaptationsDidChange const):
* page/Chrome.h:
* page/ChromeClient.h:

Add plumbing for changes to the set of disabled adaptations.

* page/DisabledAdaptations.cpp: Added.
(WebCore::extraZoomModeAdaptationName):
* page/DisabledAdaptations.h: Added.

Introduce a header containing a new enum for the extra zoom mode adaptation, as well as a helper function to
return the extra zoom mode adaptation name.

* page/Page.cpp:
(WebCore::Page::disabledAdaptations const):

Returns the mainframe's set of adaptations to disable.

* page/Page.h:
* page/RemoteFrame.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setDisabledAdaptationsMetaTagEnabled):
(WebCore::RuntimeEnabledFeatures::disabledAdaptationsMetaTagEnabled const):

Add a new runtime feature to gate handling the "disabled-adaptations" meta tag.

* page/ViewportConfiguration.cpp:
(WebCore::shouldOverrideShrinkToFitArgument):
(WebCore::needsUpdateAfterChangingDisabledAdaptations):
(WebCore::ViewportConfiguration::setDisabledAdaptations):
(WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):

Consult whether or not extra zoom mode adaptations are disabled, instead of the shrink-to-fit attribute value.

(WebCore::ViewportConfiguration::updateConfiguration):
* page/ViewportConfiguration.h:

Add an OptionSet of disabled adaptation types to ViewportConfiguration. Updates to the adaptation type are
propagated to the ViewportConfiguration from Document, through the ChromeClient and the client layer (refer to
changes in WebKit). Once the OptionSet is changed, we recompute the viewport configuration only if needed by the
platform.

(WebCore::ViewportConfiguration::viewLayoutSize const):
(WebCore::ViewportConfiguration::disabledAdaptations const):
* page/WindowFeatures.cpp:
(WebCore::parseDisabledAdaptations):
* page/WindowFeatures.h:

Add a new helper to parse the meta content of a "disabled-adaptations" tag as an OptionSet of disabled
adaptation types. The string is parsed by first splitting on the comma character, and then iterating over lower
case, whitespace-stripped tokens to look for known adaptation names. So far, only extra zoom mode is supported.

* testing/Internals.cpp:
(WebCore::Internals::extraZoomModeAdaptationName const):
* testing/Internals.h:
* testing/Internals.idl:

Expose the extra zoom mode adaptation name to the DOM, only when running layout tests.

Source/WebKit:

Adds a new experimental feature for the "disabled-adaptations" meta tag, and adds plumbing in WebKit to
propagate disabled adaptation changes to the ViewportConfiguration. The experimental feature is on by default in
extra zoom mode.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::dispatchDisabledAdaptationsDidChange const):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::disabledAdaptationsDidChange):
* WebProcess/WebPage/WebPage.h:

Source/WebKitLegacy/ios:

Adds a WebKitLegacy method stub for disabled adaptation plumbing.

* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::dispatchDisabledAdaptationsDidChange const):

LayoutTests:

Refactor an existing layout test to exercise disabled adaptations in extra zoom mode.

* fast/viewport/extrazoom/viewport-change-min-device-width.html: Removed.
* fast/viewport/extrazoom/viewport-disable-extra-zoom-adaptations.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231779 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoAX: Listbox and Combobox roles embedded in labels should participate in name calculation
jdiggs@igalia.com [Tue, 15 May 2018 00:32:06 +0000 (00:32 +0000)]
AX: Listbox and Combobox roles embedded in labels should participate in name calculation
https://bugs.webkit.org/show_bug.cgi?id=185521

Reviewed by Chris Fleizach.

Source/WebCore:

Take selected children into account when computing the name in accessibleNameForNode.
Add ListBox to the roles for which accessibleNameDerivesFromContent returns false so
that native select elements with size > 1 are treated the same way as ARIA listbox.
Also add ListBox to the roles which are treated as controls when used in ARIA. Finally,
prevent labels which contain unrelated controls from being used as an AXTitleUIElement.
This causes us to build a string from the label and its descendants, ensuring the latter
participate in the name calculation.

Test: accessibility/text-alternative-calculation-from-listbox.html

* accessibility/AccessibilityLabel.cpp:
(WebCore::childrenContainUnrelatedControls):
(WebCore::AccessibilityLabel::containsUnrelatedControls const):
* accessibility/AccessibilityLabel.h:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::accessibleNameForNode):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
(WebCore::AccessibilityObject::isARIAControl):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::exposesTitleUIElement const):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):

LayoutTests:

* accessibility/label-with-pseudo-elements-expected.txt: Updated for new behavior.
* accessibility/text-alternative-calculation-from-listbox-expected.txt: Added.
* accessibility/text-alternative-calculation-from-listbox.html: Added.
* platform/mac/accessibility/label-with-pseudo-elements-expected.txt: Updated for new behavior.
* platform/win/accessibility/label-with-pseudo-elements-expected.txt: Updated for new behavior.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231778 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoFix the Apple Internal build
dbates@webkit.org [Mon, 14 May 2018 23:34:06 +0000 (23:34 +0000)]
Fix the Apple Internal build

See <rdar://problem/40237873> for more details.

* WebView/WebFullScreenController.mm:
(-[WebFullScreenController enterFullScreen:]):
(-[WebFullScreenController finishedEnterFullScreenAnimation:]):
(-[WebFullScreenController exitFullScreen]):
(-[WebFullScreenController finishedExitFullScreenAnimation:]):
(-[WebFullScreenController _startEnterFullScreenAnimationWithDuration:]):
(-[WebFullScreenController _startExitFullScreenAnimationWithDuration:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231777 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[iOS] Add a test to ensure that setTimeout() does not fire more than expected when...
dbates@webkit.org [Mon, 14 May 2018 23:19:29 +0000 (23:19 +0000)]
[iOS] Add a test to ensure that setTimeout() does not fire more than expected when using UIWebView
https://bugs.webkit.org/show_bug.cgi?id=185599
<rdar://problem/22493890>

Reviewed by Simon Fraser.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/ios/SetTimeoutFunction.mm: Added.
(-[SetTimeoutFunctionWebViewDelegate webViewDidFinishLoad:]):
(-[SetTimeoutFunctionWebViewDelegate webView:didFailLoadWithError:]):
(-[SetTimeoutFunctionWebViewDelegate webView:shouldStartLoadWithRequest:navigationType:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/set-timeout-function.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231776 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agotest262/Runner.pm: small bugs in CLI and error codes
commit-queue@webkit.org [Mon, 14 May 2018 23:18:17 +0000 (23:18 +0000)]
test262/Runner.pm: small bugs in CLI and error codes
https://bugs.webkit.org/show_bug.cgi?id=185629

Patch by Valerie R Young <valerie@bocoup.com> on 2018-05-14
Reviewed by Michael Saboff.

Fix two commandline args with use '-f', correct
error code of failures.

* Scripts/test262/Runner.pm:
(processCLI):
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231775 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoDisable API tests that time out after pointer poisioning was disabled.
ryanhaddad@apple.com [Mon, 14 May 2018 23:16:05 +0000 (23:16 +0000)]
Disable API tests that time out after pointer poisioning was disabled.
https://bugs.webkit.org/show_bug.cgi?id=185586

Unreviewed test gardening.

* TestWebKitAPI/Tests/WTF/Poisoned.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/PoisonedUniquePtr.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/PoisonedUniquePtrForNonTriviallyDestructibleArrays.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/PoisonedUniquePtrForTriviallyDestructibleArrays.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231774 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoWeb Inspector: Canvas tab: don't automatically select a recording when viewing a...
webkit@devinrousso.com [Mon, 14 May 2018 23:01:25 +0000 (23:01 +0000)]
Web Inspector: Canvas tab: don't automatically select a recording when viewing a canvas
https://bugs.webkit.org/show_bug.cgi?id=182950

Reviewed by Matt Baker.

* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel):
(WI.CanvasSidebarPanel.prototype._currentRepresentedObjectsDidChange):
(WI.CanvasSidebarPanel.prototype._treeOutlineSelectionDidChange):
(WI.CanvasSidebarPanel.prototype._canvasChanged):
(WI.CanvasSidebarPanel.prototype._recordingChanged):
(WI.CanvasSidebarPanel.prototype._updateRecordingScopeBar):
Add a "dummy" ScopeBarItem to the recording ScopeBar that is selected whenever a TreeElement
that doesn't correspond to a Recording is selected. This way, the Recording ScopeBar will
become deselected, and the list of actions will disappear. Clicking on the Recording ScopeBar
will show the previously selected Recording.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231773 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[INTL] Handle error in defineProperty for supported locales length
commit-queue@webkit.org [Mon, 14 May 2018 22:38:26 +0000 (22:38 +0000)]
[INTL] Handle error in defineProperty for supported locales length
https://bugs.webkit.org/show_bug.cgi?id=185623

Patch by Andy VanWagoner <andy@vanwagoner.family> on 2018-05-14
Reviewed by Saam Barati.

Adds the missing RETURN_IF_EXCEPTION after defineOwnProperty for the
length of the supported locales array.

* runtime/IntlObject.cpp:
(JSC::supportedLocales):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231772 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoOverly aggressive timer throttling in service workers
cdumez@apple.com [Mon, 14 May 2018 22:31:40 +0000 (22:31 +0000)]
Overly aggressive timer throttling in service workers
https://bugs.webkit.org/show_bug.cgi?id=185575
<rdar://problem/40219038>

Reviewed by Geoff Garen.

After ~30 seconds, the system would put the service worker process in "App Nap",
causing its timers to get aggressively throttled. This happens because the
service worker processes are WebProcesses that have no visible WebPages.

To address the issue, we now disable process suppression for all service worker
processes. This causes those processes to construct a UserActivity which prevents
App Nap.

This patch also refactors the code a bit to avoid duplication. The ProcessSuppression
suppression logic in now all on ChildProcessProxy / ChildProcess.

* NetworkProcess/NetworkProcess.messages.in:
* PluginProcess/PluginProcess.messages.in:
* Shared/ChildProcess.messages.in:
* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::setProcessSuppressionEnabled):
* UIProcess/ChildProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/mac/NetworkProcessProxyMac.mm: Removed.
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::didFinishLaunching):
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/WebProcessProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231771 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[Wi-Fi Assertions] Allow clients to specify a context identifier
aestes@apple.com [Mon, 14 May 2018 22:14:40 +0000 (22:14 +0000)]
[Wi-Fi Assertions] Allow clients to specify a context identifier
https://bugs.webkit.org/show_bug.cgi?id=185620
<rdar://problem/39915196>

Reviewed by Brady Eidson.

Added an SPI on _WKProcessPoolConfiguration that allows clients to specify a
context identifier.

* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration wirelessContextIdentifier]):
(-[_WKProcessPoolConfiguration setWirelessContextIdentifier:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231770 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoWeb Automation: Automation.getBrowsingContext returns window origin that differs...
bburg@apple.com [Mon, 14 May 2018 21:26:51 +0000 (21:26 +0000)]
Web Automation: Automation.getBrowsingContext returns window origin that differs from window.screenX/Y
https://bugs.webkit.org/show_bug.cgi?id=185571
<rdar://problem/40180785>

Reviewed by Timothy Hatcher.

This code path was refactored to use completion handlers. It seems that the window.screenX/Y
code path converts back to user coordinates but the WebDriver code path does not. Make them
consistent since that is how it is spec'd and tested.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getWindowFrameWithCallback):
Convert the window frame to user coordinate space so it's the same as window.screenY.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231769 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoTest262-Runner: Fix RegExp for capturing tests metadata"
commit-queue@webkit.org [Mon, 14 May 2018 21:19:28 +0000 (21:19 +0000)]
Test262-Runner: Fix RegExp for capturing tests metadata"
https://bugs.webkit.org/show_bug.cgi?id=185622

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-05-14
Reviewed by Michael Saboff.

This patch fixes the RegExp used to capture each test metadata regarding their EOL characters for
both LF and CRLF forms.

The fix also allows the runner to capture the proper results from two specific files using CR and
CRLF line terminators. They are updated in the expectations file.
* Scripts/test262/Runner.pm:
(parseData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231768 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoWebDriver: W3C test case actions/key.py::test_lone_keyup_sends_no_events is failing
bburg@apple.com [Mon, 14 May 2018 19:09:12 +0000 (19:09 +0000)]
WebDriver: W3C test case actions/key.py::test_lone_keyup_sends_no_events is failing
https://bugs.webkit.org/show_bug.cgi?id=185577
<rdar://problem/40185478>

Reviewed by Timothy Hatcher.

This test is failing because it expects Release Actions to not emit any
events if nothing has changed from the initial state. Because the two code paths
for creating empty states don't actually produce the same empty state, a difference
in location was detected between the two empty states. This generates a mousemove.

To fix this, unify the code that creates an empty state. For mouse input sources, always
initialize the location to (0, 0) so that the mouse input source always has
a location that is valid to click at.

* UIProcess/Automation/SimulatedInputDispatcher.h:
Extract the type enum out of the class to avoid circular definitions of
SimulatedInputSource and SimulatedInputSourceState.

* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputSourceState::emptyStateForSourceType):
Take the input source type when generating an empty state. We always want location
set for a mouse input source, but not set it for other input sources like keys.

(WebKit::SimulatedInputKeyFrame::keyFrameToResetInputSources):
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
(WebKit::SimulatedInputSource::create):
(WebKit::SimulatedInputSource::SimulatedInputSource):
(WebKit::SimulatedInputSourceState::emptyState): Deleted.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::WebAutomationSession):
(WebKit::WebAutomationSession::inputSourceForType const):
(WebKit::simulatedInputSourceTypeFromProtocolSourceType):
(WebKit::WebAutomationSession::performInteractionSequence):
* UIProcess/Automation/WebAutomationSession.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231767 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[Web Animations] Tests using the new animation engine may crash under WebCore::FrameV...
graouts@webkit.org [Mon, 14 May 2018 18:19:30 +0000 (18:19 +0000)]
[Web Animations] Tests using the new animation engine may crash under WebCore::FrameView::didDestroyRenderTree when using internals methods
https://bugs.webkit.org/show_bug.cgi?id=185612
<rdar://problem/39579344>

Reviewed by Dean Jackson.

Source/WebCore:

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
internals.pauseTransitionAtTimeOnPseudoElement() and internals.pauseAnimationAtTimeOnPseudoElement() for Web Animations testing.

* testing/Internals.cpp:
(WebCore::Internals::pseudoElement):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Some tests that were opting into the new animation engine were using internals methods (pauseAnimationAtTimeOnElement, pauseTransitionAtTimeOnElement, etc.)
that enforce the creation of animations in the old animation engine. Meanwhile, the code that toggles the animation engine used based on HTML comments is run
prior to teardown of the previous test and so a test running with the new engine would run with the legacy engine during teardown. These two factors would
cause `ASSERT(!frame().animation().hasAnimations())` to fail under FrameView::didDestroyRenderTree().

We update tests that use these internals method to use the Web Animations API instead and opt into the new animation engine if they didn't already do that.

* animations/animation-hit-test-transform.html:
* animations/keyframes-dynamic-expected.txt:
* animations/keyframes-dynamic.html:
* animations/missing-from-to-expected.txt:
* animations/missing-from-to-transforms-expected.txt:
* animations/missing-from-to-transforms.html:
* animations/missing-from-to.html:
* fast/css-generated-content/pseudo-animation.html:
* transitions/transition-hit-test-transform.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231766 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoREGRESSION (r230574): Interrupted hardware transitions don't behave correctly
graouts@webkit.org [Mon, 14 May 2018 18:15:57 +0000 (18:15 +0000)]
REGRESSION (r230574): Interrupted hardware transitions don't behave correctly
https://bugs.webkit.org/show_bug.cgi?id=185299
<rdar://problem/39630230>

Reviewed by Simon Fraser.

Source/WebCore:

In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first
process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause
or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation
running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since
the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a
newly-uncommitted animation.

Test: transitions/interrupted-transition-hardware.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):

LayoutTests:

Add a new test where we interrupt a transition and check that upon returning to the original value,
an animated value is still used and not the initial value. This test fails prior to this patch.

* transitions/interrupted-transition-hardware-expected.html: Added.
* transitions/interrupted-transition-hardware.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231765 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoFix a legacy CRLF eol from Test262
commit-queue@webkit.org [Mon, 14 May 2018 17:39:16 +0000 (17:39 +0000)]
Fix a legacy CRLF eol from Test262
https://bugs.webkit.org/show_bug.cgi?id=185565

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-05-14
Reviewed by Yusuke Suzuki.

* test262/config.yaml:
* test262/test/built-ins/Math/cbrt/prop-desc.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231764 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoNSEvent event trackers don't work from WebKitTestRunner
commit-queue@webkit.org [Mon, 14 May 2018 17:26:25 +0000 (17:26 +0000)]
NSEvent event trackers don't work from WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=185383
rdar://problem/40025045

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-05-14
Reviewed by Simon Fraser.

Tools:

Post simulated wheel events to _sendEventToObservers: so they can be handled by NSEvent observers.
NSEvent swipe tracking is used for webkit swipe navigation.

* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases):

LayoutTests:

This test initiates back navigation with wheel events.

* swipe/wheel-event-initiated-back-navigation-expected.txt: Added.
* swipe/wheel-event-initiated-back-navigation.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231763 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[JSC] timeClip(-0) should produce +0
utatane.tea@gmail.com [Mon, 14 May 2018 17:18:05 +0000 (17:18 +0000)]
[JSC] timeClip(-0) should produce +0
https://bugs.webkit.org/show_bug.cgi?id=185589

Reviewed by Saam Barati.

JSTests:

Fix several test262 failures.

* stress/date-negative-zero.js: Added.
(shouldBe):
* test262/expectations.yaml:

Source/WTF:

According to the spec[1], timeClip(-0) should produce +0.
We achieve this by adding 0.0 to the result of trunc(t).

[1]: https://tc39.github.io/ecma262/#sec-timeclip

* wtf/DateMath.cpp:
(WTF::timeClip):

LayoutTests:

* sputnik/Implementation_Diagnostics/S15.9.1.14_D1-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231762 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[JSC] Tweak LiteralParser to improve lexing performance
utatane.tea@gmail.com [Mon, 14 May 2018 16:47:35 +0000 (16:47 +0000)]
[JSC] Tweak LiteralParser to improve lexing performance
https://bugs.webkit.org/show_bug.cgi?id=185541

Reviewed by Saam Barati.

This patch attemps to improve LiteralParser performance.

This patch improves Kraken/json-parse-financial by roughly ~10%.
                                   baseline                  patched

    json-parse-financial        65.810+-1.591      ^      59.943+-1.784         ^ definitely 1.0979x faster

* parser/Lexer.cpp:
(JSC::Lexer<T>::Lexer):
* runtime/ArgList.h:
(JSC::MarkedArgumentBuffer::takeLast):
Add takeLast() for idiomatic last() + removeLast() calls.

* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::Lexer::lex):
Do not have mode in its template parameter. While lex function is large, this mode is not used in a critical path.
We should not include this mode in its template parameter to reduce the code size.
And we do not use template parameter for a terminator since duplicating ' and " code for lexString is not good.
Also, we construct TokenType table to remove bunch of unnecessary switch cases.

(JSC::LiteralParser<CharType>::Lexer::next):
(JSC::isSafeStringCharacter):
Take mode in its template parameter. But do not take terminator character in its template parameter.

(JSC::LiteralParser<CharType>::Lexer::lexString):
(JSC::LiteralParser<CharType>::Lexer::lexStringSlow):
Duplicate while statements manually since this is a critical path.

(JSC::LiteralParser<CharType>::parse):
Use takeLast().

* runtime/LiteralParser.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231761 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoSimplified Mach exception handling
ggaren@apple.com [Mon, 14 May 2018 16:45:09 +0000 (16:45 +0000)]
Simplified Mach exception handling
https://bugs.webkit.org/show_bug.cgi?id=185595

Reviewed by Keith Miller.

* wtf/threads/Signals.cpp:
(WTF::startMachExceptionHandlerThread): Use mach_msg_server_once instead
of duplicating its functionality. Separate error handling logic from
program logic to help program logic stand out. Use
DISPATCH_TARGET_QUEUE_* instead of explicitly fetching a queue.

Also, we don't need the high priority queue. The kernel donates a
priority voucher from the exception thread to the receiver thread, and
mach_msg_server_once takes care to forward that voucher.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231760 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[GStreamer] Fix style issue in MediaPlayerPrivateGStreamerBase
commit-queue@webkit.org [Mon, 14 May 2018 16:18:36 +0000 (16:18 +0000)]
[GStreamer] Fix style issue in MediaPlayerPrivateGStreamerBase
https://bugs.webkit.org/show_bug.cgi?id=185510

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-05-14
Reviewed by Philippe Normand.

ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:629:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:684:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:807:  More than one command on the same line  [whitespace/newline] [4]

Indentation and style issue fixed only.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231759 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[LFC] Implement height computation for non-replaced out of flow elements.
zalan@apple.com [Mon, 14 May 2018 15:59:56 +0000 (15:59 +0000)]
[LFC] Implement height computation for non-replaced out of flow elements.
https://bugs.webkit.org/show_bug.cgi?id=185585

Reviewed by Antti Koivisto.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeHeight const):
(WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
(WebCore::Layout::FormattingContext::computeHeightForBlockFormattingContextRootWithAutoHeight const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.h:
* layout/displaytree/DisplayBox.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231758 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoRenaming of overrides in LayoutBox
rego@igalia.com [Mon, 14 May 2018 15:20:47 +0000 (15:20 +0000)]
Renaming of overrides in LayoutBox
https://bugs.webkit.org/show_bug.cgi?id=185609

Reviewed by Javier Fernandez.

The names of the methods for the overrides were not consistent,
this patch fixes it by using the same structure in all the cases.

No new tests, no change of behavior.

* rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::hasOverrideContainingBlockContentSizeForChild):
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeChildPreferredLogicalWidths const):
(WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateRubyForJustifiedText):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::willBeDestroyed):
(WebCore::RenderBox::hasOverrideContentLogicalHeight const):
(WebCore::RenderBox::hasOverrideContentLogicalWidth const):
(WebCore::RenderBox::setOverrideContentLogicalHeight):
(WebCore::RenderBox::setOverrideContentLogicalWidth):
(WebCore::RenderBox::clearOverrideContentLogicalHeight):
(WebCore::RenderBox::clearOverrideContentLogicalWidth):
(WebCore::RenderBox::clearOverrideContentSize):
(WebCore::RenderBox::overrideContentLogicalWidth const):
(WebCore::RenderBox::overrideContentLogicalHeight const):
(WebCore::RenderBox::overrideContainingBlockContentLogicalWidth const):
(WebCore::RenderBox::overrideContainingBlockContentLogicalHeight const):
(WebCore::RenderBox::hasOverrideContainingBlockContentLogicalWidth const):
(WebCore::RenderBox::hasOverrideContainingBlockContentLogicalHeight const):
(WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth):
(WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight):
(WebCore::RenderBox::clearOverrideContainingBlockContentSize):
(WebCore::RenderBox::clearOverrideContainingBlockContentLogicalHeight):
(WebCore::RenderBox::containingBlockLogicalWidthForContent const):
(WebCore::RenderBox::containingBlockLogicalHeightForContent const):
(WebCore::RenderBox::perpendicularContainingBlockLogicalHeight const):
(WebCore::RenderBox::computeLogicalWidthInFragment const):
(WebCore::RenderBox::computeLogicalHeight const):
(WebCore::RenderBox::computePercentageLogicalHeight const):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
(WebCore::RenderBox::availableLogicalHeightUsing const):
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::contentWidthForChild):
(WebCore::contentHeightForChild):
(WebCore::gatherFlexChildrenInfo):
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
(WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
(WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
(WebCore::RenderFlexibleBox::mainSizeForPercentageResolution):
(WebCore::RenderFlexibleBox::constructFlexItem):
(WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild):
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::adjustInlineDirectionLineBounds const):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::setOverrideContentLogicalHeightFromRowHeight):
* rendering/RenderTableCell.h:
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::relayoutCellIfFlexed):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231757 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[LFC] Implement width computation for non-replaced out of flow elements.
zalan@apple.com [Mon, 14 May 2018 14:52:50 +0000 (14:52 +0000)]
[LFC] Implement width computation for non-replaced out of flow elements.
https://bugs.webkit.org/show_bug.cgi?id=185598

Reviewed by Antti Koivisto.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeWidth const):
(WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
(WebCore::Layout::FormattingContext::shrinkToFitWidth const):
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/displaytree/DisplayBox.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231756 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago-Wmemset-elt-size warning in LibWebRTCSocket constructor
mcatanzaro@igalia.com [Mon, 14 May 2018 14:39:18 +0000 (14:39 +0000)]
-Wmemset-elt-size warning in LibWebRTCSocket constructor
https://bugs.webkit.org/show_bug.cgi?id=185555

Reviewed by Youenn Fablet.

Add missing multiplication.

* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::LibWebRTCSocket::LibWebRTCSocket):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231755 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoDrop the m_compositorTexture member variable in TextureMapperGC3DPlatformLayer.
zandobersek@gmail.com [Mon, 14 May 2018 12:57:56 +0000 (12:57 +0000)]
Drop the m_compositorTexture member variable in TextureMapperGC3DPlatformLayer.
It's not used at all inside the class or outside it.

Rubber-stamped by Michael Catanzaro.

* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231754 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[GTK] REGRESSION(r231170) Build broken with Clang 5.0
zandobersek@gmail.com [Mon, 14 May 2018 12:52:25 +0000 (12:52 +0000)]
[GTK] REGRESSION(r231170) Build broken with Clang 5.0
https://bugs.webkit.org/show_bug.cgi?id=185198

Reviewed by Michael Catanzaro.

.:

* Source/cmake/WebKitCompilerFlags.cmake: Fall back to the -std=c++1z
compiler flag if -std=c++17 is not supported. If that flag is not
supported either, bail with an error message.

Source/WebCore:

Avoid gperf files using the register keyword which has been made
reserved and as such unusable in C++17.

* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/makeSelectorPseudoElementsMap.py:
* css/makeprop.pl:
* css/makevalues.pl:
* platform/ColorData.gperf:
* platform/ReferrerPolicy.h: With std::optional forward declaration
gone, explicitly include the WTF Optional.h header.
* platform/Theme.h: Ditto.
* platform/network/create-http-header-name-table:

Source/WebKit:

* Shared/RTCNetwork.h: With std::optional forward declaration gone,
explicitly include the WTF Optional.h header.

Source/WTF:

* wtf/Compiler.h:
* wtf/Forward.h: Delete the std::optional forward declaration that is
potentially incompatible with definition provided by the standard library.
* wtf/Hasher.h:
* wtf/StdLibExtras.h: In addition to the remaining C++14 configurations,
also use custom std::in_place_t implementation when compiling with
libstdc++ 6.x, which doesn't provide its own.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231753 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoEnable service-worker/navigation-redirect-body.https.html and service-worker/postmess...
youenn@apple.com [Mon, 14 May 2018 10:41:07 +0000 (10:41 +0000)]
Enable service-worker/navigation-redirect-body.https.html and service-worker/postmessage.https.html
https://bugs.webkit.org/show_bug.cgi?id=185605

Unreviewed.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/postmessage.https-expected.txt:

LayoutTests:

* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231752 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[MIPS] Use btpz to compare against 0 instead of bpeq
commit-queue@webkit.org [Mon, 14 May 2018 10:20:24 +0000 (10:20 +0000)]
[MIPS] Use btpz to compare against 0 instead of bpeq
https://bugs.webkit.org/show_bug.cgi?id=185607

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-05-14
Reviewed by Yusuke Suzuki.

Fixes build on MIPS since MIPS doesn't have an instruction to
compare a register against an immediate. Since the immediate is just 0
in this case the simplest solution is just to use btpz instead of bpeq
to compare to 0.

* llint/LowLevelInterpreter.asm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231751 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoMark imported/w3c/web-platform-tests/service-workers/service-worker/redirected-respon...
youenn@apple.com [Mon, 14 May 2018 08:32:43 +0000 (08:32 +0000)]
Mark imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https.html as slow in debug
https://bugs.webkit.org/show_bug.cgi?id=185604

Unreviewed.

* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231750 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoUnreviewed, rolling out r219515.
commit-queue@webkit.org [Mon, 14 May 2018 07:33:55 +0000 (07:33 +0000)]
Unreviewed, rolling out r219515.
https://bugs.webkit.org/show_bug.cgi?id=185603

It sometimes makes AudioUnitInitialize call to fail in
CoreAudioCaptureSource (Requested by youenn on #webkit).

Reverted changeset:

"Remove CoreAudioCaptureSource speaker configuration"
https://bugs.webkit.org/show_bug.cgi?id=174512
https://trac.webkit.org/changeset/219515

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231749 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoWebKit2_Sim-7606.1.17.4 introduced dep cycle
dino@apple.com [Sun, 13 May 2018 19:29:38 +0000 (19:29 +0000)]
WebKit2_Sim-7606.1.17.4 introduced dep cycle
https://bugs.webkit.org/show_bug.cgi?id=185588
<rdar://problem/40196581>

Reviewed by Tim Horton.

Soft link AssetViewer.framework to avoid a dependency cycle.

* Configurations/WebKit.xcconfig:
* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231744 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoDisable pointer poisoning
fpizlo@apple.com [Sun, 13 May 2018 18:57:03 +0000 (18:57 +0000)]
Disable pointer poisoning
https://bugs.webkit.org/show_bug.cgi?id=185586

Reviewed by Yusuke Suzuki.

This seems like a 0.3% speed-up on microbenchmarks. It seems like it may be a small speed-up on
other tests, too.

* wtf/Platform.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231743 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[BigInt] stress/big-int-spec-to-primitive.js test is failing
ticaiolima@gmail.com [Sun, 13 May 2018 18:16:20 +0000 (18:16 +0000)]
[BigInt] stress/big-int-spec-to-primitive.js test is failing
https://bugs.webkit.org/show_bug.cgi?id=185582

Reviewed by Yusuke Suzuki.

This patch is removing the use of ```numberOfDFGCompiles``` from
stress/big-int-spec-to-primitive.js because it makes this est fail
sometimes.

* stress/big-int-spec-to-primitive.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231742 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoCachedCall::call() should be faster
fpizlo@apple.com [Sun, 13 May 2018 16:54:55 +0000 (16:54 +0000)]
CachedCall::call() should be faster
https://bugs.webkit.org/show_bug.cgi?id=185583

Reviewed by Yusuke Suzuki.

CachedCall is an optimization for String.prototype.replace(r, f) where f is a function.
Unfortunately, because of a combination of abstraction and assertions, this code path had a
lot of overhead. This patch reduces this overhead by:

- Turning off some assertions. These assertions don't look to have security value; they're
  mostly for sanity. I turned off stack alignment checks and VM state checks having to do
  with whether the JSLock is held. The JSLock checks are not relevant when doing a cached
  call, considering that the caller would have already been strongly assuming that the JSLock
  is held.

- Making more things inlineable.

This looks like a small (4% ish) speed-up on SunSpider/string-unpack-code.

* JavaScriptCore.xcodeproj/project.pbxproj:
* interpreter/CachedCall.h:
(JSC::CachedCall::call):
* interpreter/Interpreter.cpp:
(JSC::checkedReturn): Deleted.
* interpreter/Interpreter.h:
(JSC::Interpreter::checkedReturn):
* interpreter/InterpreterInlines.h:
(JSC::Interpreter::execute):
* jit/JITCode.cpp:
(JSC::JITCode::execute): Deleted.
* jit/JITCodeInlines.h: Added.
(JSC::JITCode::execute):
* llint/LowLevelInterpreter.asm:
* runtime/StringPrototype.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231741 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[INTL] Improve spec & test262 compliance for Intl APIs
commit-queue@webkit.org [Sun, 13 May 2018 14:28:39 +0000 (14:28 +0000)]
[INTL] Improve spec & test262 compliance for Intl APIs
https://bugs.webkit.org/show_bug.cgi?id=185578

Patch by Andy VanWagoner <andy@vanwagoner.family> on 2018-05-13
Reviewed by Yusuke Suzuki.

JSTests:

Remove intl402 failures that have been fixed.

* test262/expectations.yaml:
* stress/regress-178385.js: toStringTag is configurable, but not writable.

Source/JavaScriptCore:

Use putDirectIndex over push for lists to arrays.
Update default options to construct with a null prototype.
Define constructor and toStringTag on prototypes.
Add proper time clipping.
Remove some outdated comment spec text, use url instead.

* runtime/IntlCollator.cpp:
(JSC::IntlCollator::initializeCollator):
* runtime/IntlCollatorConstructor.cpp:
(JSC::IntlCollatorConstructor::finishCreation):
* runtime/IntlCollatorPrototype.cpp:
(JSC::IntlCollatorPrototype::finishCreation):
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::IntlDateTimeFormatConstructor::finishCreation):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototype::finishCreation):
(JSC::IntlDateTimeFormatFuncFormatDateTime):
(JSC::IntlDateTimeFormatPrototypeFuncFormatToParts):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::initializeNumberFormat):
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::IntlNumberFormatConstructor::finishCreation):
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatPrototype::finishCreation):
* runtime/IntlObject.cpp:
(JSC::lookupSupportedLocales):
(JSC::supportedLocales):
(JSC::intlObjectFuncGetCanonicalLocales):
* runtime/IntlPluralRules.cpp:
(JSC::IntlPluralRules::resolvedOptions):
* runtime/IntlPluralRulesConstructor.cpp:
(JSC::IntlPluralRulesConstructor::finishCreation):

LayoutTests:

Update Intl tests for prototype changes.

* js/intl-collator-expected.txt:
* js/intl-datetimeformat-expected.txt:
* js/intl-numberformat-expected.txt:
* js/script-tests/intl-collator.js:
* js/script-tests/intl-datetimeformat.js:
* js/script-tests/intl-numberformat.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231740 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoImplement SVGGeometryElement's isPointInFill and isPointInStroke
krit@webkit.org [Sun, 13 May 2018 09:25:44 +0000 (09:25 +0000)]
Implement SVGGeometryElement's isPointInFill and isPointInStroke
https://bugs.webkit.org/show_bug.cgi?id=185580

Reviewed by Antti Koivisto.

Implement isPointInFill and isPointInStroke methods for
SVGGeometryElement interface from SVG2.

https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement

Source/WebCore:

Tests: svg/dom/SVGGeometry-isPointInFill.xhtml
       svg/dom/SVGGeometry-isPointInStroke.xhtml

* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::shapeDependentStrokeContains): Flag
        to switch between local and "global" coordinate space for hit testing.
* rendering/svg/RenderSVGEllipse.h:
* rendering/svg/RenderSVGPath.cpp:
(WebCore::RenderSVGPath::shapeDependentStrokeContains): Flag
        to switch between local and "global" coordinate space for hit testing.
* rendering/svg/RenderSVGPath.h:
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::shapeDependentStrokeContains): Flag
        to switch between local and "global" coordinate space for hit testing.
* rendering/svg/RenderSVGRect.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::shapeDependentStrokeContains): Flag
        to switch between local and "global" coordinate space for hit testing.
(WebCore::RenderSVGShape::isPointInFill): Take the winding rule given by
        `fill-rule` to test if a given point is in the fill area of a path.
(WebCore::RenderSVGShape::isPointInStroke): Take stroke properties into
        account to check if a point is on top of the stroke area.
* rendering/svg/RenderSVGShape.h:
* svg/SVGGeometryElement.cpp:
(WebCore::SVGGeometryElement::isPointInFill):
(WebCore::SVGGeometryElement::isPointInStroke):
(WebCore::SVGGeometryElement::createElementRenderer): Deleted. This is getting implemented
        by inheriting classes. No need to create RenderSVGPath here.
* svg/SVGGeometryElement.h:
* svg/SVGGeometryElement.idl:

LayoutTests:

* svg/dom/SVGGeometry-isPointInFill-expected.txt: Added.
* svg/dom/SVGGeometry-isPointInFill.xhtml: Added.
* svg/dom/SVGGeometry-isPointInStroke-expected.txt: Added.
* svg/dom/SVGGeometry-isPointInStroke.xhtml: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231739 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoUnreviewed, rebaseline a layout test after r231717
wenson_hsieh@apple.com [Sun, 13 May 2018 00:03:28 +0000 (00:03 +0000)]
Unreviewed, rebaseline a layout test after r231717

* fast/events/extrazoom/change-focus-during-change-event-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231737 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoUse WeakPtr for m_enclosingPaginationLayer in RenderLayer
zalan@apple.com [Sat, 12 May 2018 17:10:30 +0000 (17:10 +0000)]
Use WeakPtr for m_enclosingPaginationLayer in RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=185566
<rdar://problem/36486052>

Reviewed by Simon Fraser.

Since RenderLayer does not own the enclosing pagination layout, it should
construct a weak pointer instead of holding on to a raw pointer.

Unable to create a reliably reproducible test case.

* page/mac/EventHandlerMac.mm:
(WebCore::scrollableAreaForEventTarget):
(WebCore::scrollableAreaForContainerNode):
(WebCore::EventHandler::platformPrepareForWheelEvents):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::weakPtrFactory const):
(WebCore::ScrollableArea::createWeakPtr): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::updatePagination):
* rendering/RenderLayer.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231735 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[ESNext][BigInt] Implement support for "*" operation
ticaiolima@gmail.com [Sat, 12 May 2018 04:32:12 +0000 (04:32 +0000)]
[ESNext][BigInt] Implement support for "*" operation
https://bugs.webkit.org/show_bug.cgi?id=183721

Reviewed by Yusuke Suzuki.

JSTests:

* bigIntTests.yaml:
* stress/big-int-mul-jit.js: Added.
* stress/big-int-mul-to-primitive-precedence.js: Added.
* stress/big-int-mul-to-primitive.js: Added.
* stress/big-int-mul-type-error.js: Added.
* stress/big-int-mul-wrapped-value.js: Added.
* stress/big-int-multiplication.js: Added.
* stress/big-int-multiply-memory-stress.js: Added.

Source/JavaScriptCore:

Added BigInt support into times binary operator into LLInt and on
JITOperations profiledMul and unprofiledMul. We are also replacing all
uses of int to unsigned when there is no negative values for
variables.

* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* jit/JITOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSBigInt.cpp:
(JSC::JSBigInt::JSBigInt):
(JSC::JSBigInt::allocationSize):
(JSC::JSBigInt::createWithLength):
(JSC::JSBigInt::toString):
(JSC::JSBigInt::multiply):
(JSC::JSBigInt::digitDiv):
(JSC::JSBigInt::internalMultiplyAdd):
(JSC::JSBigInt::multiplyAccumulate):
(JSC::JSBigInt::equals):
(JSC::JSBigInt::absoluteDivSmall):
(JSC::JSBigInt::calculateMaximumCharactersRequired):
(JSC::JSBigInt::toStringGeneric):
(JSC::JSBigInt::rightTrim):
(JSC::JSBigInt::allocateFor):
(JSC::JSBigInt::parseInt):
(JSC::JSBigInt::digit):
(JSC::JSBigInt::setDigit):
* runtime/JSBigInt.h:
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::toNumeric const):
* runtime/Operations.h:
(JSC::jsMul):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231733 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoFollow-up build fix to r231721.
mitz@apple.com [Sat, 12 May 2018 04:19:10 +0000 (04:19 +0000)]
Follow-up build fix to r231721.

* pal/cf/CoreMediaSoftLink.cpp:
* pal/cf/CoreMediaSoftLink.h:
  Unify the conditions between the header and the implementation files, and have watchOS and
  tvOS keyed off iOS.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231731 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoX-Frame-Options: SAMEORIGIN needs to check all ancestor frames
dbates@webkit.org [Sat, 12 May 2018 04:11:16 +0000 (04:11 +0000)]
X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
https://bugs.webkit.org/show_bug.cgi?id=185567
<rdar://problem/40175008>

Reviewed by Brent Fulgham.

Source/WebCore:

Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
are same-origin with the document that delivered this header. This prevents an intermediary
malicious frame from clickjacking a child frame whose document is same-origin with the top-
level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.

Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
with the top-level frame's document in order to be displayed. This prevents clickjacking by
a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
document same origin with the victim page. We should protect against such attacks.

Tests: http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-allow.html
       http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-deny.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):

Source/WebKit:

Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
are same-origin with the document that delivered this header. This prevents an intermediary
malicious frame from clickjacking a child frame whose document is same-origin with the top-
level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.

Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
with the top-level frame's document in order to be displayed. This prevents clickjacking by
a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
document same origin with the victim page. We should protect against such attacks.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions):

LayoutTests:

Add tests to ensure that "X-Frame-Options: SAMEORIGIN" checks ancestor frames.

* http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html:
* http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html:
* http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html:
* http/tests/resources/echo-iframe-src.php: Copied from LayoutTests/http/tests/cookies/same-site/resources/echo-iframe-src.php.
* http/tests/security/XFrameOptions/resources/x-frame-options-ancestors-same-origin-deny.html: Added.
* http/tests/security/XFrameOptions/resources/x-frame-options-frame-ancestors-same-origin-allow.cgi: Added.
* http/tests/security/XFrameOptions/resources/x-frame-options-frame-ancestors-same-origin-deny.cgi: Added.
* http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-allow-expected.txt: Added.
* http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-allow.html: Added.
* http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-deny-expected.txt: Added.
* http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-deny.html: Renamed from LayoutTests/http/tests/cookies/same-site/resources/echo-iframe-src.php.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231730 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoWKWebViewContentProvider should know what MIME type it was created to handle
dino@apple.com [Sat, 12 May 2018 02:11:05 +0000 (02:11 +0000)]
WKWebViewContentProvider should know what MIME type it was created to handle
https://bugs.webkit.org/show_bug.cgi?id=185574
<rdar://problem/40183049>

Reviewed by Tim Horton.

Pass the MIME type of the downloaded asset into the WKWebViewContentProvider's
init method, so it can choose to do something based on that information. The
PDF and LegacyPDF views don't care because they, clearly, only handle PDF. But
a WKSystemPreviewView can handle multiple types.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setHasCustomContentView:loadedMIMEType:]): Send the MIME type on
to the WKWebViewContentProvider.
* UIProcess/Cocoa/WKWebViewContentProvider.h: Add a new parameter to web_initWithFrame.
* UIProcess/ios/WKLegacyPDFView.mm:
(-[WKLegacyPDFView web_initWithFrame:webView:mimeType:]):
(-[WKLegacyPDFView web_initWithFrame:webView:]): Deleted.
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_initWithFrame:webView:mimeType:]):
(-[WKPDFView web_initWithFrame:webView:]): Deleted.
* UIProcess/ios/WKSystemPreviewView.mm:
(-[WKSystemPreviewView web_initWithFrame:webView:mimeType:]):
(-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): Actually use
the MIME type to tell QuickLook what it will be getting, rather than basing it on
the file extension.
(-[WKSystemPreviewView web_initWithFrame:webView:]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231729 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoAllow the WebContent process to read global ViewBridge preferences
bfulgham@apple.com [Sat, 12 May 2018 00:39:09 +0000 (00:39 +0000)]
Allow the WebContent process to read global ViewBridge preferences
https://bugs.webkit.org/show_bug.cgi?id=185569
<rdar://problem/40164339>

Reviewed by Eric Carlson.

Allow reads of the global /Library/Preferences/com.apple.ViewBridge.plist preference file.

* WebProcess/com.apple.WebProcess.sb.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231728 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoUnreviewed. Update W3C WebDriver imported tests.
bburg@apple.com [Fri, 11 May 2018 23:03:36 +0000 (23:03 +0000)]
Unreviewed. Update W3C WebDriver imported tests.

This includes upstream PR #10968, which has a fix for XSSAuditor
blocking scripts loaded via inline.py. Test expectations for
webkitgtkdriver may need to be updated with progressions and new tests.

* imported/w3c/importer.json:
* imported/w3c/tools/webdriver/webdriver/client.py:
* imported/w3c/tools/wptrunner/requirements_chrome.txt:
* imported/w3c/tools/wptrunner/requirements_chrome_android.txt: Copied from WebDriverTests/imported/w3c/tools/wptrunner/requirements_opera.txt.
* imported/w3c/tools/wptrunner/requirements_edge.txt:
* imported/w3c/tools/wptrunner/requirements_firefox.txt:
* imported/w3c/tools/wptrunner/requirements_ie.txt:
* imported/w3c/tools/wptrunner/requirements_opera.txt:
* imported/w3c/tools/wptrunner/requirements_safari.txt:
* imported/w3c/tools/wptrunner/requirements_sauce.txt:
* imported/w3c/tools/wptrunner/wptrunner/browsers/firefox.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/sauce.py:
* imported/w3c/tools/wptrunner/wptrunner/environment.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/base.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/executormarionette.py:
* imported/w3c/tools/wptrunner/wptrunner/formatters.py:
* imported/w3c/tools/wptrunner/wptrunner/reduce.py:
* imported/w3c/tools/wptrunner/wptrunner/testrunner.py:
* imported/w3c/tools/wptrunner/wptrunner/tests/browsers/test_sauce.py: Added.
* imported/w3c/tools/wptrunner/wptrunner/tests/test_products.py:
* imported/w3c/tools/wptrunner/wptrunner/wptcommandline.py:
* imported/w3c/tools/wptrunner/wptrunner/wptrunner.py:
* imported/w3c/tools/wptrunner/wptrunner/wpttest.py:
* imported/w3c/webdriver/tests/accept_alert/__init__.py: Added.
* imported/w3c/webdriver/tests/accept_alert/accept.py: Added.
* imported/w3c/webdriver/tests/add_cookie/__init__.py: Added.
* imported/w3c/webdriver/tests/add_cookie/add.py: Added.
* imported/w3c/webdriver/tests/close_window/__init__.py: Added.
* imported/w3c/webdriver/tests/close_window/close.py: Added.
* imported/w3c/webdriver/tests/close_window/user_prompts.py: Added.
* imported/w3c/webdriver/tests/delete_cookie/__init__.py: Added.
* imported/w3c/webdriver/tests/delete_cookie/delete.py: Added.
* imported/w3c/webdriver/tests/delete_cookie/user_prompts.py: Added.
* imported/w3c/webdriver/tests/dismiss_alert/__init__.py: Added.
* imported/w3c/webdriver/tests/dismiss_alert/dismiss.py: Added.
* imported/w3c/webdriver/tests/element_clear/__init__.py: Added.
* imported/w3c/webdriver/tests/element_clear/clear.py: Added.
* imported/w3c/webdriver/tests/element_click/bubbling.py:
* imported/w3c/webdriver/tests/element_click/stale.py:
* imported/w3c/webdriver/tests/element_send_keys/content_editable.py: Added.
* imported/w3c/webdriver/tests/element_send_keys/form_controls.py:
* imported/w3c/webdriver/tests/element_send_keys/interactability.py:
* imported/w3c/webdriver/tests/element_send_keys/scroll_into_view.py:
* imported/w3c/webdriver/tests/execute_async_script/collections.py:
* imported/w3c/webdriver/tests/execute_async_script/user_prompts.py:
* imported/w3c/webdriver/tests/execute_script/collections.py:
* imported/w3c/webdriver/tests/execute_script/cyclic.py:
* imported/w3c/webdriver/tests/execute_script/json_serialize_windowproxy.py: Added.
* imported/w3c/webdriver/tests/execute_script/user_prompts.py:
* imported/w3c/webdriver/tests/find_element/__init__.py: Added.
* imported/w3c/webdriver/tests/find_element/find.py: Added.
* imported/w3c/webdriver/tests/find_element_from_element/__init__.py: Added.
* imported/w3c/webdriver/tests/find_element_from_element/find.py: Added.
* imported/w3c/webdriver/tests/find_elements/__init__.py: Added.
* imported/w3c/webdriver/tests/find_elements/find.py: Added.
* imported/w3c/webdriver/tests/find_elements_from_element/__init__.py: Added.
* imported/w3c/webdriver/tests/find_elements_from_element/find.py: Added.
* imported/w3c/webdriver/tests/fullscreen_window/__init__.py: Added.
* imported/w3c/webdriver/tests/fullscreen_window/fullscreen.py: Added.
* imported/w3c/webdriver/tests/fullscreen_window/user_prompts.py: Added.
* imported/w3c/webdriver/tests/get_active_element/__init__.py: Added.
* imported/w3c/webdriver/tests/get_active_element/get.py: Added.
* imported/w3c/webdriver/tests/get_alert_text/__init__.py: Added.
* imported/w3c/webdriver/tests/get_alert_text/get.py: Added.
* imported/w3c/webdriver/tests/get_current_url/__init__.py: Added.
* imported/w3c/webdriver/tests/get_current_url/get.py: Added.
* imported/w3c/webdriver/tests/get_current_url/user_prompts.py: Added.
* imported/w3c/webdriver/tests/get_element_attribute/get.py: Added.
* imported/w3c/webdriver/tests/get_element_property/__init__.py: Added.
* imported/w3c/webdriver/tests/get_element_property/get.py: Added.
* imported/w3c/webdriver/tests/get_element_property/user_prompts.py: Added.
* imported/w3c/webdriver/tests/get_element_tag_name/__init__.py: Added.
* imported/w3c/webdriver/tests/get_element_tag_name/get.py: Added.
* imported/w3c/webdriver/tests/get_element_tag_name/user_prompts.py: Added.
* imported/w3c/webdriver/tests/get_element_text/__init__.py: Added.
* imported/w3c/webdriver/tests/get_element_text/get.py: Added.
* imported/w3c/webdriver/tests/get_named_cookie/__init__.py: Added.
* imported/w3c/webdriver/tests/get_named_cookie/get.py: Added.
* imported/w3c/webdriver/tests/get_timeouts/__init__.py: Added.
* imported/w3c/webdriver/tests/get_timeouts/get.py: Added.
* imported/w3c/webdriver/tests/get_title/__init__.py: Added.
* imported/w3c/webdriver/tests/get_title/get.py: Added.
* imported/w3c/webdriver/tests/get_title/user_prompts.py: Added.
* imported/w3c/webdriver/tests/get_window_rect/__init__.py: Added.
* imported/w3c/webdriver/tests/get_window_rect/get.py: Added.
* imported/w3c/webdriver/tests/get_window_rect/user_prompts.py: Added.
* imported/w3c/webdriver/tests/is_element_selected/__init__.py: Added.
* imported/w3c/webdriver/tests/is_element_selected/selected.py: Added.
* imported/w3c/webdriver/tests/is_element_selected/user_prompts.py: Added.
* imported/w3c/webdriver/tests/maximize_window/__init__.py: Added.
* imported/w3c/webdriver/tests/maximize_window/maximize.py: Added.
* imported/w3c/webdriver/tests/maximize_window/user_prompts.py: Added.
* imported/w3c/webdriver/tests/minimize_window/__init__.py: Added.
* imported/w3c/webdriver/tests/minimize_window/minimize.py: Added.
* imported/w3c/webdriver/tests/minimize_window/user_prompts.py: Added.
* imported/w3c/webdriver/tests/new_session/__init__.py: Added.
* imported/w3c/webdriver/tests/new_session/conftest.py: Added.
* imported/w3c/webdriver/tests/new_session/create_alwaysMatch.py: Added.
* imported/w3c/webdriver/tests/new_session/create_firstMatch.py: Added.
* imported/w3c/webdriver/tests/new_session/default_values.py: Added.
* imported/w3c/webdriver/tests/new_session/invalid_capabilities.py: Added.
* imported/w3c/webdriver/tests/new_session/merge.py: Added.
* imported/w3c/webdriver/tests/new_session/response.py: Added.
* imported/w3c/webdriver/tests/new_session/support/__init__.py: Added.
* imported/w3c/webdriver/tests/new_session/support/create.py: Added.
* imported/w3c/webdriver/tests/page_source/__init__.py: Added.
* imported/w3c/webdriver/tests/page_source/source.py: Added.
* imported/w3c/webdriver/tests/send_alert_text/__init__.py: Added.
* imported/w3c/webdriver/tests/send_alert_text/send.py: Added.
* imported/w3c/webdriver/tests/set_window_rect/__init__.py: Added.
* imported/w3c/webdriver/tests/set_window_rect/resizing_and_positioning.py: Added.
* imported/w3c/webdriver/tests/set_window_rect/set.py: Added.
* imported/w3c/webdriver/tests/set_window_rect/user_prompts.py: Added.
* imported/w3c/webdriver/tests/status/__init__.py: Added.
* imported/w3c/webdriver/tests/status/status.py: Added.
* imported/w3c/webdriver/tests/support/fixtures.py:
* imported/w3c/webdriver/tests/support/inline.py:
* imported/w3c/webdriver/tests/switch_to_parent_frame/__init__.py: Added.
* imported/w3c/webdriver/tests/switch_to_parent_frame/switch.py: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231727 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoCleanup canPerformActionForWebView in relation to the webSelectionAssistant being...
megan_gardner@apple.com [Fri, 11 May 2018 23:03:00 +0000 (23:03 +0000)]
Cleanup canPerformActionForWebView in relation to the webSelectionAssistant being removed
https://bugs.webkit.org/show_bug.cgi?id=185536

Reviewed by Tim Horton.

The _webSelectionAssistant is now always nil, therefor many of these checks are unnecessary.
Remove the check for a webSelection and clean up the logic surrounding those checks.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231726 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[iOS] Text decoration of dragged content does not paint with opacity
dbates@webkit.org [Fri, 11 May 2018 23:01:37 +0000 (23:01 +0000)]
[iOS] Text decoration of dragged content does not paint with opacity
https://bugs.webkit.org/show_bug.cgi?id=185551
<rdar://problem/40166867>

Reviewed by Wenson Hsieh.

Respect alpha when painting the text decoration for dragged content.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual): Consider alpha when
comparing decoration styles for equality so that we do not coalesce styles with differing alpha.
(WebCore::InlineTextBox::paintMarkedTextDecoration): Respect alpha when painting dragged content.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231725 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoFollowup to: Make sure history navigations reuse the existing process when necessary.
beidson@apple.com [Fri, 11 May 2018 22:30:45 +0000 (22:30 +0000)]
Followup to: Make sure history navigations reuse the existing process when necessary.
https://bugs.webkit.org/show_bug.cgi?id=185532

Reviewed by Andy Estes.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal): When re-using the same process,
  don't change the policy action.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231723 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoTest262 Runner should search for the Debug JSC by default
commit-queue@webkit.org [Fri, 11 May 2018 22:19:03 +0000 (22:19 +0000)]
Test262 Runner should search for the Debug JSC by default
https://bugs.webkit.org/show_bug.cgi?id=185562

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-05-11
Reviewed by Michael Saboff.

The Test262 Runner is now searching for the Debug build of JSC by
default, not the Release build.

This fix allows a similar call from the previous runner, making
it compatible with the current build bot configuration parameters.

This patch also adds some minor improvements the verbose mode output.

* Scripts/test262/Runner.pm:
(processCLI):
(main):
(getBuildPath):
(processResult):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231722 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoAdd CF_NOESCAPE decorators for tvOS and watchOS
jer.noble@apple.com [Fri, 11 May 2018 22:03:06 +0000 (22:03 +0000)]
Add CF_NOESCAPE decorators for tvOS and watchOS
https://bugs.webkit.org/show_bug.cgi?id=185560

Reviewed by Dan Bernstein.

* pal/cf/CoreMediaSoftLink.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231721 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoAX: In role=dialog elements with aria-modal=true VoiceOver iOS/macOS can't manually...
n_wang@apple.com [Fri, 11 May 2018 21:58:19 +0000 (21:58 +0000)]
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.
https://bugs.webkit.org/show_bug.cgi?id=185219
<rdar://problem/39920009>

Reviewed by Chris Fleizach.

Source/WebCore:

The text node descendants of a modal dialog are ignored. Fixed it by using AccessibilityObject's
node() to determine if it's the descendant of the modal dialog node.

Test: accessibility/aria-modal-text-descendants.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isModalDescendant const):

LayoutTests:

* accessibility/aria-modal-text-descendants-expected.txt: Added.
* accessibility/aria-modal-text-descendants.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231720 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoUnreviewed, rolling out r231316 and r231332.
commit-queue@webkit.org [Fri, 11 May 2018 21:16:05 +0000 (21:16 +0000)]
Unreviewed, rolling out r231316 and r231332.
https://bugs.webkit.org/show_bug.cgi?id=185564

Appears to be a Speedometer2/MotionMark regression (Requested
by keith_miller on #webkit).

Reverted changesets:

"Remove the prototype caching for get_by_id in the LLInt"
https://bugs.webkit.org/show_bug.cgi?id=185226
https://trac.webkit.org/changeset/231316

"Unreviewed, fix 32-bit profile offset for change in bytecode"
https://trac.webkit.org/changeset/231332

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231719 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoWebHTMLView is not setting aside subviews when drawing.
timothy@apple.com [Fri, 11 May 2018 20:59:54 +0000 (20:59 +0000)]
WebHTMLView is not setting aside subviews when drawing.

https://bugs.webkit.org/show_bug.cgi?id=185561
rdar://problem/40172894

Reviewed by Simon Fraser.

Use the new method signature for _recursive:displayRectIgnoringOpacity:shouldChangeFontReferenceColor:.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:]): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231718 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoTapping after CSS-based table casues an infinite loop in wordRangeFromPosition
rniwa@webkit.org [Fri, 11 May 2018 20:39:30 +0000 (20:39 +0000)]
Tapping after CSS-based table casues an infinite loop in wordRangeFromPosition
https://bugs.webkit.org/show_bug.cgi?id=185465
<rdar://problem/35263057>

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaselined the tests. h2

* web-platform-tests/dom/nodes/getElementsByClassName-30-expected.txt: table is generating a new line as expected.
* web-platform-tests/html/syntax/parsing/html5lib_menuitem-element-expected.txt: h2 is generating an extra line
to emulate its margin as expected.
* web-platform-tests/html/syntax/parsing/html5lib_tests11-expected.txt: Ditto.
* web-platform-tests/html/syntax/parsing/html5lib_tests21-expected.txt: Ditto.
* web-platform-tests/html/syntax/parsing/html5lib_tests25-expected.txt: Ditto.
* web-platform-tests/html/syntax/parsing/html5lib_webkit02-expected.txt: Ditto.

Source/WebCore:

The bug was caused by TextIterator not emitting a line break when exiting a CSS-based table when an element
with `display: table-row` has an invisible text node. Specifically, TextIterator::exitNode is never called on
an element with `table-cell: row` when m_node is a text node with whitespaces which appears after an element
with `display: table-cell`.

For example, for a tree structure like:
table-row (R)
  table-cell (C)
    "text" (1)
  " " (2)
Getting out of (C) would result in moving onto (2) without generating a line break for (R).

When this happens in nextBoundary as it tries to find the end of the last word in the table cell, we end up
finding the end of the document as the end of the word. As a result, nextWordBoundaryInDirection, the caller
of nextBoundary, ends up infinite looping between the positon at the end of the document and the position
immediately before the last word in the last table cell when it traverses words backwards.

This patch fixes the hang by addressing this root cause in TextIterator. Namely, TextIterator now generates
a line break when exiting a block while walking up ancestors in TextIterator::advance().

Tests: editing/selection/tapping-in-table-at-end-of-document.html
       editing/text-iterator/table-at-end-of-document.html

* editing/TextIterator.cpp:
(WebCore::TextIterator::advance): Fixed the bug.
(WebCore::shouldEmitNewlineAfterNode): Do generate a new line at the end of a document when we're trying to
generate every visible poitions even there are no renderers beyond this point. e.g. a position inside the
last cell of a table at the end of a document hits this condition.
(WebCore::shouldEmitExtraNewlineForNode): Don't emit a line break when the render box's height is 0px
to avoid generating many empty lines for empty paragraph and header elements (this function is used to generate
a blank line between p's and h1/h2/...'s).
(WebCore::TextIterator::exitNode):

LayoutTests:

Rebaselined the tests. Most of these are due to new extra line breaks being generated after table and
header elements as expected. See inline comments for some newly discovered bugs and rebaselines due to
other non-obvious reasons.

* accessibility/internal-link-anchors2-expected.txt: This test now demonstrates a bug that WebKit doesn't
generate an extra line break before h3 when it has a large margin-top since an extra line break is only
generated after a node at the moment.
* accessibility/mac/mathml-elements-expected.txt:
* accessibility/table-headers-expected.txt:
* compositing/layer-creation/overlap-transformed-preserved-3d-expected.txt:
* css3/flexbox/box-orient-button-expected.txt:
* css3/flexbox/flexitem-expected.txt:
* editing/execCommand/19087-expected.txt: The second blockquote which has the height of 0px no longer
generates an extra new line.
* editing/inserting/insert-list-in-table-cell-08-expected.txt: Selection is now being restored properly
using TextIterator in InsertListCommand.
* editing/selection/tapping-in-table-at-end-of-document-expected.txt: Added.
* editing/selection/tapping-in-table-at-end-of-document.html: Added.
* editing/text-iterator/table-at-end-of-document-expected.txt: Added.
* editing/text-iterator/table-at-end-of-document.html: Added.
* fast/block/positioning/insert-positioned-in-anonymous-crash-expected.txt:
* fast/css/css3-ch-unit-expected.txt: Line breaks are generated between block & inline-block elements
as expected.
* fast/css/percent-min-width-img-src-change-expected.txt:
* fast/css/percent-width-img-src-change-expected.txt:
* fast/css/pseudo-empty-display-none-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-crash-expected.txt:
* fast/dom/HTMLDivElement/align/getset-expected.txt:
* fast/dom/HTMLSelectElement/listbox-select-reset-expected.txt:
* fast/dom/HTMLTableElement/table-with-invalid-border-expected.txt:
* fast/forms/option-mouseevents-expected.txt:
* fast/history/multiple-classes-visited-expected.txt:
* fast/history/self-is-visited-expected.txt:
* fast/html/marquee-reparent-check-expected.txt:
* fast/inline-block/anonymous-block-crash-expected.txt: This test now demonstrates a bug that we're not
generating an empty line before a block in some cases.
* fast/inline/inline-position-top-align-expected.txt:
* fast/invalid/test-case-tr-th-td-should-not-close-dl-list-expected.txt:
* fast/overflow/scrollbar-click-retains-focus-expected.txt:
* fast/parser/comments-expected.txt:
* fast/parser/fragment-parser-doctype-expected.txt:
* fast/ruby/ruby-base-merge-block-children-crash-2-expected.txt:
* fast/spatial-navigation/snav-radio-group-expected.txt: A line break is generated after a nested table.
* fast/sub-pixel/table-cells-have-stable-width-expected.txt:
* fast/table/table-row-oveflow-crash-expected.txt: A line break is generated after a table as expected,
which is followed by a BR which creates a blank line.
* fast/table/table-with-borderattr-null-expected.txt:
* fast/table/table-with-borderattr-set-to-null-expected.txt:
* fast/text/international/dynamic-text-combine-crash-expected.txt:
* fast/xsl/mozilla-tests-expected.txt:
* http/tests/misc/large-js-program-expected.txt:
* imported/blink/plugins/empty-per-context-data-expected.txt:
* inspector/console/js-isLikelyStackTrace-expected.txt:
* inspector/console/js-source-locations-expected.txt:
* mathml/out-of-flow-in-token-crash-expected.txt:
* mathml/presentation/stretchy-depth-height-expected.txt:
* platform/mac/accessibility/table-cells-roles-expected.txt: Line breaks are generated after a block
followed by two two consecutive BRs.
* platform/mac/accessibility/table-roles-hierarchy-expected.txt: Ditto.
* svg/foreignObject/fO-fixed-position-crash-expected.txt:
* tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic-expected.txt:
* transforms/3d/hit-testing/coplanar-with-camera-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231717 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoSystem preview badge doesn't show on <picture> elements
dino@apple.com [Fri, 11 May 2018 20:18:27 +0000 (20:18 +0000)]
System preview badge doesn't show on <picture> elements
https://bugs.webkit.org/show_bug.cgi?id=185559
<rdar://problem/40150066>

Reviewed by Tim Horton.

We should also identify <img>s that are the child of a <picture>
contained inside the appropriate <a> element.

Tested internally, since the badge is platform specific.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::isSystemPreviewImage const): Add logic
to look for <picture> parents.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231716 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoCommitLogViewer._preceedingCommit should not always be null
dewei_zhu@apple.com [Fri, 11 May 2018 20:15:08 +0000 (20:15 +0000)]
CommitLogViewer._preceedingCommit should not always be null
https://bugs.webkit.org/show_bug.cgi?id=185540

Reviewed by Ryosuke Niwa.

Fix the bug introduced in r227746 that CommitLogViewer._preceedingCommit is always null.

* browser-tests/index.html: Fix expected measurement-set url.
* public/v3/components/commit-log-viewer.js:
(CommitLogViewer.prototype._fetchCommitLogs): CommitLogViewer._preceedingCommit should be set
when fetching for preceeding revision succeeds.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231715 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoREGRESSION (async policy delegate): Revoking an object URL immediately after triggeri...
cdumez@apple.com [Fri, 11 May 2018 19:22:34 +0000 (19:22 +0000)]
REGRESSION (async policy delegate): Revoking an object URL immediately after triggering download breaks file download
https://bugs.webkit.org/show_bug.cgi?id=185531
<rdar://problem/39909589>

Reviewed by Geoffrey Garen.

Source/WebCore:

Whenever we start an asynchronous navigation policy decision for a blob URL, create a temporary
blob URL pointing to the same data, and update the request's URL. This way, if the page's JS revokes
the URL during the policy decision, the load will still succeed.

Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-then-revoke.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadPostRequest):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
(WebCore::PolicyChecker::checkNavigationPolicy):
(WebCore::PolicyChecker::checkNewWindowPolicy):
* loader/PolicyChecker.h:

Source/WTF:

Add a default constructor for CompletionHandlerCallingScope, for convenience.

* wtf/CompletionHandler.h:

LayoutTests:

* fast/dom/HTMLAnchorElement/anchor-file-blob-download-then-revoke-expected.txt: Added.
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-then-revoke.html: Added.
Add layout test coverage.

* platform/ios-wk1/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
Skip new test on platforms that do not support the download attribute.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231714 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoLinkLoader fails to remove CachedResourceClient in some cases
antti@apple.com [Fri, 11 May 2018 19:05:36 +0000 (19:05 +0000)]
LinkLoader fails to remove CachedResourceClient in some cases
https://bugs.webkit.org/show_bug.cgi?id=185553
<rdar://problem/36879656>

Reviewed by Geoffrey Garen.

Source/WebCore:

Test: http/tests/preload/link-preload-client-remove.html

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):

If there is a link preload already in progress, we fail to clear the client for the ongoing load.
This may leave the CachedResource client map in a bad state.

LayoutTests:

* http/tests/preload/link-preload-client-remove-expected.txt: Added.
* http/tests/preload/link-preload-client-remove.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231713 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[DFG] Compiler uses incorrect output register for NumberIsInteger operation
msaboff@apple.com [Fri, 11 May 2018 18:39:06 +0000 (18:39 +0000)]
[DFG] Compiler uses incorrect output register for NumberIsInteger operation
https://bugs.webkit.org/show_bug.cgi?id=185328

Reviewed by Keith Miller.

JSTests:

New regression test.

* stress/isInteger-doesnt-overwrite-argument.js: Added.
(testIsInteger):

Source/JavaScriptCore:

Fixed a typo from when this code was added in r228968 where resultGPR
was assigned the input register instead of the result.gpr().

* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231710 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoRuntime feature flag for Server-Timing
commit-queue@webkit.org [Fri, 11 May 2018 18:33:43 +0000 (18:33 +0000)]
Runtime feature flag for Server-Timing
https://bugs.webkit.org/show_bug.cgi?id=184758

Patch by Charles Vazac <cvazac@gmail.com> on 2018-05-11
Reviewed by Youenn Fablet.

Source/WebCore:

* Source/WebCore/CMakeLists.txt: Added reference to PerformanceServerTiming.idl.
* Source/WebCore/DerivedSources.make: Added reference to PerformanceServerTiming.idl.
* Source/WebCore/Sources.txt: Added reference to PerformanceServerTiming.cpp and JSPerformanceServerTiming.cpp.
* Source/WebCore/WebCore.xcodeproj/project.pbxproj: Added references to PerformanceServerTiming.cpp, PerformanceServerTiming.h, and PerformanceServerTiming.idl.
* Source/WebCore/bindings/js/WebCoreBuiltinNames.h: Added PerformanceServerTiming.
* Source/WebCore/page/PerformanceResourceTiming.h: Added serverTiming member.
* Source/WebCore/page/PerformanceResourceTiming.idl: Added serverTiming attribute.
* Source/WebCore/page/PerformanceServerTiming.cpp: Added.
* Source/WebCore/page/PerformanceServerTiming.h: Added.
* Source/WebCore/page/PerformanceServerTiming.idl: Added.

Source/WebKit:

* Shared/WebPreferences.yaml: Added ServerTimingEnabled.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesGetServerTimingEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h: WK_EXPORT for WKPreferencesSetServerTimingEnabled.
* WebProcess/Storage/WebSWContextManagerConnection.cpp: Call setServerTimingEnabled.

Source/WebKitLegacy:

* mac/WebView/WebPreferenceKeysPrivate.h: Added server-timing preference.
* mac/WebView/WebPreferences.mm:
(WebKit::WebPreferences::serverTimingEnabled):
(WebKit::WebPreferences::setServerTimingEnabled):
* mac/WebView/WebPreferencesPrivate.h:
(WebKit::WebPreferences::setServerTimingEnabled):
(WebKit::WebPreferences::serverTimingEnabled):
* mac/WebView/WebView.mm: Set runtime enabled feature based on preference.
* win/Interfaces/IWebPreferencesPrivate.idl: define serverTimingEnabled and setServerTimingEnabled.
* win/WebPreferenceKeysPrivate.h: Added server-timing preference.
* win/WebPreferences.cpp: Initialize server-timing as false and define setter and getter.
(WebKit::WebPreferences::serverTimingEnabled):
(WebKit::WebPreferences::setServerTimingEnabled):
* win/WebPreferences.h: Define serverTimingEnabled and setServerTimingEnabled.
* win/WebView.cpp: Set runtime enabled feature based on preference.

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: added ENABLE_SERVER_TIMING.
* DumpRenderTree/win/DumpRenderTree.cpp: enable Server Timing

LayoutTests:

* imported/w3c/resources/import-expectations.json: Import server-timing tests.
* imported/w3c/web-platform-tests/server-timing/resource_timing_idl.html: Added.
* imported/w3c/web-platform-tests/server-timing/resource_timing_idl-expected.txt: Added.
* platform/ios-wk1/TestExpectations: Skip service-worker test.
* platform/mac-wk1/TestExpectations: Skip service-worker test.
* platform/win/TestExpectations: Skip service-worker test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231709 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoNetwork process should not stat() all cache files on startup to find their sizes
antti@apple.com [Fri, 11 May 2018 18:11:21 +0000 (18:11 +0000)]
Network process should not stat() all cache files on startup to find their sizes
https://bugs.webkit.org/show_bug.cgi?id=185542
<rdar://problem/40092953>

Reviewed by Chris Dumez.

This is done to compute how much disk space a cache is using. While the operation happens
in a background priority thread it is still quite a bit of work.

Large bodies are saved in separate blob files so record file sizes are capped. We can avoid work by
estimating their size instead of counting it exactly.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::estimateRecordsSize):
(WebKit::NetworkCache::Storage::synchronize):

    Use size estimation if blob storage is in use.
    Remove the code that would delete empty files. Normal cache shrinking handles this.

(WebKit::NetworkCache::Storage::shouldStoreBodyAsBlob):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231708 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[Win][MiniBrowser] Move WK1 related code into MiniBrowser
Hironori.Fujii@sony.com [Fri, 11 May 2018 17:37:04 +0000 (17:37 +0000)]
[Win][MiniBrowser] Move WK1 related code into MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=185418

Reviewed by Alex Christensen.

All WK1 related code should be moved into MiniBrowser for the preparation
of Bug 184770.

This change moves the initilization code of MiniBrowse into MiniBrowser::init().

* MiniBrowser/win/Common.cpp:
(getAppDataFolder): Removed `static` keyword to be called from MiniBrowser.cpp.
(setCacheFolder): This is only for WK1. Moved into MiniBrowser.cpp.
* MiniBrowser/win/Common.h: Added.
* MiniBrowser/win/MiniBrowser.cpp:
(MiniBrowser::init): Moved the initilization code from wWinMain.
(MiniBrowser::setCacheFolder): Moved from Common.cpp and made it a method.
* MiniBrowser/win/MiniBrowser.h:
(MiniBrowser::setCacheFolder): Changed to a private method.
(MiniBrowser::subclassForLayeredWindow): Changed to a private method.
* MiniBrowser/win/WinMain.cpp:
(wWinMain): Moved MiniBrowse initilization code into MiniBrowser.cpp.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231707 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoLayout Test webrtc/addICECandidate-closed.html is a flaky failure
youenn@apple.com [Fri, 11 May 2018 17:29:42 +0000 (17:29 +0000)]
Layout Test webrtc/addICECandidate-closed.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=185384
<rdar://problem/40035167>

Reviewed by Eric Carlson.

* webrtc/addICECandidate-closed.html: Move more pc calls inside the try/catch.
This ensures that the test will be consistent as the pc might be closed sooner for some runs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231706 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoMake sure history navigations reuse the existing process when necessary.
beidson@apple.com [Fri, 11 May 2018 16:12:11 +0000 (16:12 +0000)]
Make sure history navigations reuse the existing process when necessary.
<rdar://problem/39746516> and https://bugs.webkit.org/show_bug.cgi?id=185532

Reviewed by Ryosuke Niwa.

Source/WebCore:

Covered by new API tests.

In WebCore-land, make sure *all* NavigationActions to a back/forward item are tagged with
the item identifier.

* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::logString const):
* history/HistoryItem.h:

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadDifferentDocumentItem):

* loader/NavigationAction.cpp:
(WebCore::NavigationAction::setTargetBackForwardItem):

* loader/NavigationAction.h:
(WebCore::NavigationAction::targetBackForwardItemIdentifier const):

Source/WebKit:

If a view navigates to either a data: or blob: URL, it reuses the existing process.

In such cases we need to also ensure that history navigations back will also reuse the existing process.

* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:

* UIProcess/API/APINavigation.h:
(API::Navigation::setTargetItem):

* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration pageCacheEnabled]):
(-[_WKProcessPoolConfiguration setPageCacheEnabled:]):

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal): If the current and target back/forward items both
  came from the same process, then reuse the existing process.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231704 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoDon't use inferred types when the JIT is disabled
sbarati@apple.com [Fri, 11 May 2018 16:08:42 +0000 (16:08 +0000)]
Don't use inferred types when the JIT is disabled
https://bugs.webkit.org/show_bug.cgi?id=185539

Reviewed by Yusuke Suzuki.

There are many JSC API clients that run with the JIT disabled. They were
all allocating and tracking inferred types for no benefit. Inferred types
only benefit programs when they make it to the DFG/FTL. I was seeing cases
where the inferred type machinery used ~0.5MB. This patch makes is so we
don't allocate that machinery when the JIT is disabled.

* runtime/Structure.cpp:
(JSC::Structure::willStoreValueSlow):
* runtime/Structure.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231703 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoREGRESSION(r231057): Encrypted media content playback failures
bfulgham@apple.com [Fri, 11 May 2018 16:01:30 +0000 (16:01 +0000)]
REGRESSION(r231057): Encrypted media content playback failures
https://bugs.webkit.org/show_bug.cgi?id=185537
<rdar://problem/40038478>

Reviewed by Eric Carlson.

Put access to the SecurityServer back in the sandbox so we can validate the
signatures of media encoder/decoders.

* WebProcess/com.apple.WebProcess.sb.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231702 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[GTK][a11y] Newly added accessibility/scroll-to-make-visible-iframe-offscreen.html...
csaavedra@igalia.com [Fri, 11 May 2018 13:09:27 +0000 (13:09 +0000)]
[GTK][a11y] Newly added accessibility/scroll-to-make-visible-iframe-offscreen.html fails

Unreviewed gardening. Added the failure.
* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231701 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[GTK] media/video-playbackrate.html intermittently crashing
csaavedra@igalia.com [Fri, 11 May 2018 11:38:25 +0000 (11:38 +0000)]
[GTK] media/video-playbackrate.html intermittently crashing
https://bugs.webkit.org/show_bug.cgi?id=185546

Mark thet test, unreviewed gardening.
* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231700 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[EME][GStreamer] Handle the protection event in MediaPlayerPrivate
commit-queue@webkit.org [Fri, 11 May 2018 10:50:37 +0000 (10:50 +0000)]
[EME][GStreamer] Handle the protection event in MediaPlayerPrivate
https://bugs.webkit.org/show_bug.cgi?id=185535

Patch by Yacine Bandou <yacine.bandou_ext@softathome.com> on 2018-05-11
Reviewed by Xabier Rodriguez-Calvar.

This patch is based on this calvaris's commit
https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/d966168b0d2b65f9ca9415426e26d3752c78b03e

It adds a handler for the protection event in MediaPalyerPrivateGStreamerBase, it extracts the InitData from the event
and sends the encrypted event to JS via HTMLMediaElement.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: Add a new type InitData.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231699 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoRebase some fetch API tests
youenn@apple.com [Fri, 11 May 2018 10:15:19 +0000 (10:15 +0000)]
Rebase some fetch API tests
https://bugs.webkit.org/show_bug.cgi?id=185544

Unreviewed.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/integrity-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt:
* web-platform-tests/fetch/api/request/request-cache-only-if-cached-expected.txt:
* web-platform-tests/fetch/http-cache/partial-expected.txt:

LayoutTests:

* http/tests/fetch/fetching-same-resource-with-different-options-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any.worker-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231698 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoSkip http/tests/appcache/load-from-appcache-defer-resume-crash.html for iOS sim WK2
youenn@apple.com [Fri, 11 May 2018 08:55:38 +0000 (08:55 +0000)]
Skip http/tests/appcache/load-from-appcache-defer-resume-crash.html for iOS sim WK2
https://bugs.webkit.org/show_bug.cgi?id=185430
<rdar://problem/40065118>

Unreviewed.

* platform/ios-wk2/TestExpectations: Precising the WK1 testRunner API used by the test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231697 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[Curl] Make the cipher suites, the signing algorithms and the curve lists configurable.
commit-queue@webkit.org [Fri, 11 May 2018 08:31:48 +0000 (08:31 +0000)]
[Curl] Make the cipher suites, the signing algorithms and the curve lists configurable.
https://bugs.webkit.org/show_bug.cgi?id=185139

Add interface to configure the cipher suites, the signing algorithms and the curve lists
used by OpenSSL and libcurl to exchange, to sign or to verify keys.

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-05-11
Reviewed by Youenn Fablet.

No new tests in public. Have tested internally.

* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::setSslCipherList):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::willSetupSslCtx):
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::getCACertPathEnv):
* platform/network/curl/CurlSSLHandle.h:
(WebCore::CurlSSLHandle::getCipherList const):
(WebCore::CurlSSLHandle::getSignatureAlgorithmsList const):
(WebCore::CurlSSLHandle::getCurvesList const):
(WebCore::CurlSSLHandle::setCipherList):
(WebCore::CurlSSLHandle::setSignatureAlgorithmsList):
(WebCore::CurlSSLHandle::setCurvesList):
(WebCore::CurlSSLHandle::getCACertPath const):
(WebCore::CurlSSLHandle::setCACertPath):
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231696 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoDon't allocate value profiles when the JIT is disabled
sbarati@apple.com [Fri, 11 May 2018 07:57:21 +0000 (07:57 +0000)]
Don't allocate value profiles when the JIT is disabled
https://bugs.webkit.org/show_bug.cgi?id=185525

Reviewed by Michael Saboff.

Source/JavaScriptCore:

There are many JSC API clients that run with the JIT disabled. We were
still allocating a ton of value profiles in this use case even though
these clients get no benefit from doing value profiling. This patch makes
it so that we don't allocate value profiles or argument value profiles
when we're not using the JIT. We now just make all value profiles in
the instruction stream point to a global value profile that the VM owns.
And we make the argument value profile array have zero length and teach
the LLInt how to handle that. Heap clears the global value profile on each GC.

In an app that I'm testing this against, this saves ~1MB of memory.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::setNumParameters):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::numberOfArgumentValueProfiles):
(JSC::CodeBlock::valueProfileForArgument):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitProfiledOpcode):
* heap/Heap.cpp:
(JSC::Heap::runEndPhase):
* llint/LowLevelInterpreter.asm:
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

Source/WTF:

* wtf/RefCountedArray.h:
(WTF::RefCountedArray::RefCountedArray):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231695 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoNetworkCORSPreflightChecker should proceed when having a ProtectionSpaceAuthenticatio...
youenn@apple.com [Fri, 11 May 2018 07:22:12 +0000 (07:22 +0000)]
NetworkCORSPreflightChecker should proceed when having a ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested challenge
https://bugs.webkit.org/show_bug.cgi?id=185522
<rdar://problem/39987152>

Reviewed by Brent Fulgham.

In case of such challenge, refuse to proceed with authentication since preflight is not using credentials.
Previously, we were failing right away which is not right in case preflight is the request triggering the connection.

Manually tested.

* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231694 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[JSC][GLIB] Add introspectable alternatives to functions using vargars
carlosgc@webkit.org [Fri, 11 May 2018 06:56:57 +0000 (06:56 +0000)]
[JSC][GLIB] Add introspectable alternatives to functions using vargars
https://bugs.webkit.org/show_bug.cgi?id=185508

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

* API/glib/JSCClass.cpp:
(jscClassCreateConstructor):
(jsc_class_add_constructor):
(jsc_class_add_constructorv):
(jscClassAddMethod):
(jsc_class_add_method):
(jsc_class_add_methodv):
* API/glib/JSCClass.h:
* API/glib/JSCValue.cpp:
(jsObjectCall):
(jscValueCallFunction):
(jsc_value_object_invoke_methodv):
(jscValueFunctionCreate):
(jsc_value_new_function):
(jsc_value_new_functionv):
(jsc_value_function_callv):
(jsc_value_constructor_callv):
* API/glib/JSCValue.h:
* API/glib/docs/jsc-glib-4.0-sections.txt:

Tools:

Add test cases for the new API.

* TestWebKitAPI/Tests/JavaScriptCore/glib/TestJSC.cpp:
(testJSCFunction):
(testJSCObject):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231693 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoUse PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP...
dbates@webkit.org [Fri, 11 May 2018 05:34:20 +0000 (05:34 +0000)]
Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options
https://bugs.webkit.org/show_bug.cgi?id=185412

Reviewed by Ryosuke Niwa.

Source/WebCore:

Consolidate the knowledge on how to determine whether security checks were performed on a ResourceResponse
into LoaderStrategy::havePerformedSecurityChecks() (default implementation returns false) and query it
to determine whether CSP frame-ancestors and X-Frame-Options need to be checked for a ResourceResponse.

Additionally, rename LoaderStrategy::isDoingLoadingSecurityChecks() to shouldPerformSecurityChecks()
for consistency with havePerformedSecurityChecks(). Querying shouldPerformSecurityChecks() answers the
question of whether the loader strategy is responsible for performing security checks when building up
a ResourceRequest to have the loader strategy load. And LoaderStrategy::havePerformedSecurityChecks()
is used to determine whether the loader strategy performed these security checks for a given ResourceResponse.

* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didReceiveResponse):
(WebCore::InspectorNetworkAgent::didFinishLoading):
(WebCore::isResponseProbablyComingFromNetworkProcess): Deleted.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* loader/DocumentThreadableLoader.cpp:
(WebCore::shouldPerformSecurityChecks):
(WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
(WebCore::DocumentThreadableLoader::redirectReceived):
(WebCore::DocumentThreadableLoader::didFail):
(WebCore::DocumentThreadableLoader::loadRequest):
(WebCore::isDoingSecurityChecksInNetworkProcess): Deleted.
(WebCore::isResponseComingFromNetworkProcess): Deleted.
* loader/LoaderStrategy.cpp:
* loader/LoaderStrategy.h:
* page/Settings.yaml: Remove setting networkProcessCSPFrameAncestorsCheckingEnabled as we now make
use of the loader strategy to determine whether to perform CSP frame-ancestors and X-Frame-Options
checking in DocumentLoader.
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::setSource): Added an ASSERT to catch the programming error of setting
source to ResourceResponse::Source::Unknown. This source type represents an uninitialized ResourceResponse.

Source/WebKit:

Update code for renaming and write in terms of WebLoaderStrategy::shouldPerformSecurityChecks()
instead of explicitly querying RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
(WebKit::WebLoaderStrategy::startPingLoad):
(WebKit::WebLoaderStrategy::preconnectTo):
(WebKit::WebLoaderStrategy::shouldPerformSecurityChecks const):
(WebKit::WebLoaderStrategy::havePerformedSecurityChecks const):
(WebKit::WebLoaderStrategy::isDoingLoadingSecurityChecks const): Deleted.
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/WebPage/WebPage.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231692 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoLookup sometimes shows a second yellow highlight on top of WebKit's TextIndicator
timothy_horton@apple.com [Fri, 11 May 2018 05:30:43 +0000 (05:30 +0000)]
Lookup sometimes shows a second yellow highlight on top of WebKit's TextIndicator
https://bugs.webkit.org/show_bug.cgi?id=185538
<rdar://problem/38817825>

Reviewed by Sam Weinig.

* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
Options can be nil, in which case we can't mutableCopy it and add
LUTermOptionDisableSearchTermIndicator. Instead, create a new dictionary,
and add the items from options, if it's not nil.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231691 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoREGRESSION(r227983): fast/dom/adopt-node-crash-2.html is flaky
rniwa@webkit.org [Fri, 11 May 2018 05:00:23 +0000 (05:00 +0000)]
REGRESSION(r227983): fast/dom/adopt-node-crash-2.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182589

Reviewed by Wenson Hsieh.

This is a speculative fix for the test since I can't reproduce the flakiness locally. Because r227983 makes
the layout update async, I suspect the focus change which occurs to the keygen having autofocus attribute
isn't updating the layout in time for notifyDone call. Manually update the layout before/after the test.

Also wait for the load event to figure before starting the test since layout, etc... may not be updated
immediately after DOMContentLoaded.

* fast/dom/adopt-node-crash-2.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231690 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoFix the build after r231393
timothy_horton@apple.com [Fri, 11 May 2018 04:41:24 +0000 (04:41 +0000)]
Fix the build after r231393
​https://bugs.webkit.org/show_bug.cgi?id=185519
<rdar://problem/40131741>

* Configurations/WebKit.xcconfig:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231689 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[JSC] Make return types of construction functions tight
utatane.tea@gmail.com [Fri, 11 May 2018 04:38:56 +0000 (04:38 +0000)]
[JSC] Make return types of construction functions tight
https://bugs.webkit.org/show_bug.cgi?id=185509

Reviewed by Saam Barati.

Array and Object construction functions should return strict types instead of returning JSObject*/JSValue.

* runtime/ArrayConstructor.cpp:
(JSC::constructArrayWithSizeQuirk):
* runtime/ArrayConstructor.h:
* runtime/ObjectConstructor.h:
(JSC::constructEmptyObject):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231688 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[JSC] Object.assign for final objects should be faster
utatane.tea@gmail.com [Fri, 11 May 2018 03:38:10 +0000 (03:38 +0000)]
[JSC] Object.assign for final objects should be faster
https://bugs.webkit.org/show_bug.cgi?id=185348

Reviewed by Saam Barati.

JSTests:

* stress/object-assign-fast-path.js: Added.
(shouldBe):
(checkProperty):

Source/JavaScriptCore:

Object.assign is so heavily used to clone an object. For example, speedometer react-redux can be significantly
improved if Object.assign becomes fast. It is worth adding a complex fast path to accelerate the major use cases.

If enumerating properties of source objects and putting properties to target object are non observable,
we can avoid hash table looking up of source object properties. We can enumerate object property entries,
and put them to target object. This patch adds this fast path to Object.assign implementation.

When enumerating properties, we need to ensure that the given |source| object does not include "__proto__"
property since we cannot perform fast [[Put]] for the |target| object. We add a new flag
"HasUnderscoreProtoPropertyExcludingOriginalProto" to Structure to track this state.

This improves object-assign.es6 by 1.85x.

                                baseline                  patched

    object-assign.es6      368.6132+-8.3508     ^    198.8775+-4.9042        ^ definitely 1.8535x faster

And Speedometer2.0 React-Redux-TodoMVC's total time is improved from 490ms to 431ms.

* runtime/JSObject.h:
* runtime/JSObjectInlines.h:
(JSC::JSObject::canPerformFastPutInlineExcludingProto):
(JSC::JSObject::canPerformFastPutInline):
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorAssign):
* runtime/Structure.cpp:
(JSC::Structure::Structure):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::forEachProperty):
(JSC::Structure::add):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231687 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months ago[Build Bot] Restore configuration options to the Test262 Runner
commit-queue@webkit.org [Fri, 11 May 2018 02:07:25 +0000 (02:07 +0000)]
[Build Bot] Restore configuration options to the Test262 Runner

During the switch from the previous Test262 runner to the new one,
a call for an extra configurations options got removed.

This call is important to inform the script to find the debug or
release build of JSC. It's being restored in this patch.

https://bugs.webkit.org/show_bug.cgi?id=185513

Patch by Leo Balter <leonardo.balter@gmail.com> on 2018-05-10
Reviewed by Yusuke Suzuki.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunTest262Tests):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231686 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoStorage Access API: Extend lifetime of cookies on successful user approval
wilander@apple.com [Fri, 11 May 2018 01:59:24 +0000 (01:59 +0000)]
Storage Access API: Extend lifetime of cookies on successful user approval
https://bugs.webkit.org/show_bug.cgi?id=185534
<rdar://problem/40064547>

Reviewed by Brent Fulgham.

* UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
(WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
    Picks up the experimental feature flag.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::grantStorageAccessInternal):
    Now updates the domain's user interaction timestamp if the user was
    prompted for this access.
* UIProcess/WebResourceLoadStatisticsStore.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231684 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agoREGRESSION (r230998): Cannot stream API test output
jbedard@apple.com [Fri, 11 May 2018 00:42:03 +0000 (00:42 +0000)]
REGRESSION (r230998): Cannot stream API test output
https://bugs.webkit.org/show_bug.cgi?id=185090

Reviewed by Ryosuke Niwa.

Change run-api-tests so that the stdout and stderr of a test will be printed
before it's result. If -v is passed, the output of single test runs will be
streamed.

* Scripts/webkitpy/api_tests/run_api_tests.py:
(run): Use print_timestamps flag.
(parse_args): Add timestamps option to print timestamps in the log.
* Scripts/webkitpy/api_tests/runner.py:
(Runner): Add running status.
(Runner.__init__): Add number of workers and a flag to detect if a newline
is needed at the beginning of a log line.
(Runner.run): Turn off most logging coming from server process since it is
not constructive for API tests.
(Runner.handle): Add new log message to stream stdout and stderr instead of
caching values until the test run finished.
(_Worker._run_single_test): Log stdout and stderr in real time.
(_Worker._run_shard_with_binary): Log stderr and stdout buffer before ending
the test.
(_Worker.post): Provide a post with explicitly enumerated argument names.
* Scripts/webkitpy/layout_tests/views/metered_stream.py:
(MeteredStream.__init__): Differentiate verbose logging and logging with timestamps.
(MeteredStream.write): Allow for verbose logging without timestamps.
* Scripts/webkitpy/layout_tests/views/metered_stream_unittest.py:
(RegularTest): Add print_timestamps flag.
(RegularTest.setUp):
(RegularTest.test_logging_not_included):
(VerboseTest.test_log_args):
(VerboseWithOutTimestamp):
(VerboseWithOutTimestamp.test_basic): Add test for verbose logging without timestamps.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231679 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 months agobuild-webkit can erroneously warn about Xcode being too old
rniwa@webkit.org [Fri, 11 May 2018 00:06:32 +0000 (00:06 +0000)]
build-webkit can erroneously warn about Xcode being too old
https://bugs.webkit.org/show_bug.cgi?id=185533

Reviewed by Dan Bernstein.

Don't assume the version number is always a single digit.

* Scripts/webkitdirs.pm:
(determineXcodeVersion):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231677 268f45cc-cd09-0410-ab3c-d52691b4dbfc