WebKit-https.git
21 months ago[Conic Gradients] Add support for parsing conic gradients
weinig@apple.com [Sun, 29 Oct 2017 23:07:45 +0000 (23:07 +0000)]
[Conic Gradients] Add support for parsing conic gradients
https://bugs.webkit.org/show_bug.cgi?id=178987

Reviewed by Dean Jackson.

Source/WebCore:

Adds initial support, disabled by default, for parsing conic gradients as per
CSS 4 Images - https://www.w3.org/TR/css-images-4/#conic-gradients.

Test: fast/gradients/conic-gradient-parsing.html

* css/CSSGradientValue.cpp:
(WebCore::clone):
(WebCore::CSSGradientValue::isCacheable const):
(WebCore::CSSConicGradientValue::customCSSText const):
(WebCore::CSSConicGradientValue::createGradient):
(WebCore::CSSConicGradientValue::equals const):
* css/CSSGradientValue.h:

    Add CSSConicGradientValue as a subclass of CSSGradientValue and implement
    customCSSText() and equals(). Stub out createGradient() as painting is not
    yet implemented.

* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::image):
(WebCore::CSSImageGeneratorValue::isFixedSize const):
(WebCore::CSSImageGeneratorValue::fixedSize):
(WebCore::CSSImageGeneratorValue::isPending const):
(WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
(WebCore::CSSImageGeneratorValue::loadSubimages):
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):

    Dispatch to CSSConicGradientValue as needed.

* css/CSSValue.h:
(WebCore::CSSValue::isImageGeneratorValue const):
(WebCore::CSSValue::isGradientValue const):
(WebCore::CSSValue::isConicGradientValue const):

    Add conic gradient predicate support and update isImageGeneratorValue and
    isGradientValue to include conic gradient.

* css/CSSValueKeywords.in:

    Add conic-gradient and repeating-conic-gradient.

* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContextHash::hash):

    Add runtime flags to enable conic gradients.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):

    Helper, similar to consumeLengthOrPercent, for consumeGradientColorStops.
    Corresponds to https://drafts.csswg.org/css-values-4/#typedef-angle-percentage

(WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):

    Convert to take CSSGradientValue by reference.

(WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):

    Helper, similar to consumeGradientColorStops, but for angular color stops
    used in conic gradients. Corresponds to https://www.w3.org/TR/css-images-4/#typedef-angular-color-stop-list
    but does not yet support double position syntax.

(WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeLinearGradient):

    Pass CSSGradientValue by reference.

(WebCore::CSSPropertyParserHelpers::consumeConicGradient):

    Parse conic gradient.

(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):

    Dispatch to consumeConicGradient for repeating and non-repeating
    conic gradients.

(WebCore::CSSPropertyParserHelpers::isGeneratedImage):

    Put each value on its own line to make it more readable and add CSSValueConicGradient
    and CSSValueRepeatingConicGradient.

* page/Settings.yaml:

    Add a setting to enable conic gradients. Disabled by default.

* features.json:

    Move conic gradients to "In Development".

LayoutTests:

* http/wpt/css: Added.
* http/wpt/css/css-images-4: Added.
* http/wpt/css/css-images-4/conic-gradient-parsing-expected.txt: Added.
* http/wpt/css/css-images-4/conic-gradient-parsing.html: Added.

    Add tests for basic parsing of conic gradients.

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

21 months ago[Web Animations] Expose the currentTime property on Animation
graouts@webkit.org [Sun, 29 Oct 2017 21:08:46 +0000 (21:08 +0000)]
[Web Animations] Expose the currentTime property on Animation
https://bugs.webkit.org/show_bug.cgi?id=178988

Unreviewed.

Style fixes missed in previous patch.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setCurrentTime):

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

21 months ago[Web Animations] Expose the currentTime property on Animation
graouts@webkit.org [Sun, 29 Oct 2017 20:22:34 +0000 (20:22 +0000)]
[Web Animations] Expose the currentTime property on Animation
https://bugs.webkit.org/show_bug.cgi?id=178988

Reviewed by Dean Jackson.

Source/WebCore:

We now expose the currentTime property on Animation objects, our first
step in implementing the Web Animations timing model, specifically section
3.5.4. "The current time of an animation" and section 3.5.5. "Setting the
current time of an animation". Setting the startTime has implications on
currentTime and vice-versa.

Test: webanimations/animation-current-time.html

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setBindingsStartTime):
(WebCore::WebAnimation::startTime const):
(WebCore::WebAnimation::setStartTime):
(WebCore::WebAnimation::bindingsCurrentTime const):
(WebCore::WebAnimation::setBindingsCurrentTime):
(WebCore::WebAnimation::currentTime const):
(WebCore::WebAnimation::setCurrentTime):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:

LayoutTests:

Add a new test that checks that the currentTime property is set
correctly based on the startTime value and the document timeline
currentTime, and that setting the property may raise an exception
and otherwise update the animation startTime.

* webanimations/animation-current-time-expected.txt: Added.
* webanimations/animation-current-time.html: Added.

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

21 months agoAssert that no script is executed during style recalc
rniwa@webkit.org [Sun, 29 Oct 2017 10:15:55 +0000 (10:15 +0000)]
Assert that no script is executed during style recalc
https://bugs.webkit.org/show_bug.cgi?id=178845
<rdar://problem/35106129>

Reviewed by Antti Koivisto.

This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
to make sure we don't start mutating DOM in the middle of a style update.

Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
shadow tree since that happens while updating the style.

No new tests since there should be no behavioral change.

* dom/Document.cpp:
(WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
scripts which in turn trigger another (recursive) style recalc.
(WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
NoEventDispatchAssertion.
* dom/Element.cpp:
(WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
newly cloned element for SVG use element's shadow tree.
(WebCore::Element::cloneElementWithoutChildren): Ditto.
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
pushing or popoing the stack frame.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::clearShadowTree):
(WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
scripts, it's safe to mutate them during the style recalc even though it's not the best design.
(WebCore::SVGUseElement::cloneTarget const): Ditto.
(WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
(WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
(WebCore::SVGUseElement::transferEventListenersToShadowTree const):

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

21 months agocreateImageBitmap with HTMLCanvasElement
dino@apple.com [Sun, 29 Oct 2017 10:06:35 +0000 (10:06 +0000)]
createImageBitmap with HTMLCanvasElement
https://bugs.webkit.org/show_bug.cgi?id=178984
<rdar://problem/35238440>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Update the expected results.

* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-sizeOverflow-expected.txt:
* web-platform-tests/imagebitmap-renderingcontext/bitmaprenderer-as-imagesource-expected.txt:

Source/WebCore:

Implement createImageBitmap(HTMLCanvasElement).

While here, explicitly reject the promises for the
methods we haven't yet implemented. I was hoping this
would avoid a lengthy timeout in one of the imported
WPT tests but, alas, it doesn't. However, it's still
a good idea.

Extend internal WPT proposals to cover canvas creation.

* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise): Get the image from
the canvas and draw it into a new ImageBitmap buffer.

LayoutTests:

Exercise new creation method.

* http/wpt/2dcontext/imagebitmap/common.js:
(create9x9CanvasWithTargetImage):
* http/wpt/2dcontext/imagebitmap/createImageBitmap-expected.txt:
* http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing-expected.txt:
* http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html:
* http/wpt/2dcontext/imagebitmap/createImageBitmap.html:
* http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap-expected.txt:
* http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html:

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

21 months agoMake HTTPS WPT tests time out through testharness.js to get better error reports
commit-queue@webkit.org [Sun, 29 Oct 2017 05:31:44 +0000 (05:31 +0000)]
Make HTTPS WPT tests time out through testharness.js to get better error reports
https://bugs.webkit.org/show_bug.cgi?id=178982

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-28
Reviewed by Chris Dumez.

* resources/testharnessreport.js: extending to tests run over HTTPS WPT port 9443.

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

21 months agoRebase WPT tests up to a1c0107
commit-queue@webkit.org [Sun, 29 Oct 2017 03:02:28 +0000 (03:02 +0000)]
Rebase WPT tests up to a1c0107
https://bugs.webkit.org/show_bug.cgi?id=178589

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-28
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* resources/TestRepositories:
* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests: Updated.

LayoutTests:

* TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub-expected.txt: Added.

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

21 months ago[iOS] Unify Font::platformCharWidthInit() with macOS
mmaxfield@apple.com [Sun, 29 Oct 2017 02:45:27 +0000 (02:45 +0000)]
[iOS] Unify Font::platformCharWidthInit() with macOS
https://bugs.webkit.org/show_bug.cgi?id=178951
<rdar://problem/7848198>

Reviewed by Zalan Bujtas.

Source/WebCore:

The only reason these codepaths are different is because historically this codepath
didn't work with GS fonts (which we don't use anymore).

Tests: fast/forms/search-styled.html
       fast/forms/text-control-intrinsic-widths.html
       fast/forms/textarea-width.html

* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformCharWidthInit):

LayoutTests:

Updating expected results.

* platform/ios-wk2/fast/forms/search-styled-expected.txt: Removed.
* platform/ios-wk2/fast/forms/text-control-intrinsic-widths-expected.txt: Removed.
* platform/ios-wk2/fast/forms/textarea-width-expected.txt: Removed.
* platform/ios/fast/forms/search-styled-expected.txt:
* platform/ios/fast/forms/text-control-intrinsic-widths-expected.txt:
* platform/ios/fast/forms/textarea-width-expected.txt:

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

21 months ago[Settings] Generate more of the WebKit preferences code
weinig@apple.com [Sat, 28 Oct 2017 18:24:39 +0000 (18:24 +0000)]
[Settings] Generate more of the WebKit preferences code
https://bugs.webkit.org/show_bug.cgi?id=178945

Reviewed by Chris Dumez.

Generate WebPreferencesKeys.{h,cpp} and WebPreferencesStoreDefaultsMap.cpp

* CMakeLists.txt:
* DerivedSources.make:
* WebKit.xcodeproj/project.pbxproj:
* Scripts/GeneratePreferences.rb:

    Generate new files.

* Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:

    Update include.

* Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb: Added.
* Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb: Added.
* Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb: Added.

    Add template files for new generated files.

* Shared/WebPreferencesDefaultValues.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitionsBase.h.
* Shared/WebPreferencesDefinitionsBase.h:

    Renamed WebPreferencesDefinitionsBase.h to WebPreferencesDefaultValues.h to better indicate what it is.

* Shared/WebPreferencesKeys.cpp: Removed.
* Shared/WebPreferencesKeys.h: Removed.

    Replaced with generated versions.

* Shared/WebPreferencesStore.cpp:
(WebKit::defaults): Deleted.
* Shared/WebPreferencesStore.h:

    Replace macro driven defaults map with generated WebPreferencesStoreDefaultsMap.cpp.

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

21 months agoself.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service...
cdumez@apple.com [Sat, 28 Oct 2017 17:40:54 +0000 (17:40 +0000)]
self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
https://bugs.webkit.org/show_bug.cgi?id=178976

Reviewed by Sam Weinig.

Source/WebCore:

Test: http/tests/workers/service/ServiceWorkerGlobalScope-properties.html

* workers/service/ExtendableEvent.idl:
* workers/service/FetchEvent.idl:
Drop [Exposed=Worker] as there is already [Exposed=ServiceWorker] and
ServiceWorkerGlobalScope inherits from WorkerGlobalScope. This is redundant
and we would hit assertions and adding the global constructors at runtime
when the feature is enabled, because the property already exists.

Source/WebKit:

Actually enable the Service Worker RuntimeEnabledFeature in the Service Worker
WebProcess.

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::updatePreferences):

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/ServiceWorkerGlobalScope-properties-expected.txt: Added.
* http/tests/workers/service/ServiceWorkerGlobalScope-properties.html: Added.
* http/tests/workers/service/resources/ServiceWorkerGlobalScope-properties-worker.js: Added.

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

21 months agoUpdate testharness.js to work around our lack of support for MessagePort in service...
cdumez@apple.com [Sat, 28 Oct 2017 17:38:00 +0000 (17:38 +0000)]
Update testharness.js to work around our lack of support for MessagePort in service workers
https://bugs.webkit.org/show_bug.cgi?id=178977

Reviewed by Sam Weinig.

Update testharness.js to work around our lack of support for MessagePort in service workers, similarly
to what was already done for Edge.

* web-platform-tests/resources/testharness.js:

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

21 months ago[WPE] Build gst-plugins-base without pango support
mcatanzaro@igalia.com [Sat, 28 Oct 2017 17:18:46 +0000 (17:18 +0000)]
[WPE] Build gst-plugins-base without pango support
https://bugs.webkit.org/show_bug.cgi?id=178918

Reviewed by Carlos Garcia Campos.

We need to build gst-plugins-base without pango support for WPE. Let's use JHBuild
conditions so we can make platform-specific changes in the shared GStreamer moduleset.

* gstreamer/jhbuild.modules:
* gtk/jhbuildrc:
* wpe/jhbuildrc:

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

21 months ago[FrameView::layout cleanup] Move core layout logic to a separate class.
zalan@apple.com [Sat, 28 Oct 2017 15:24:58 +0000 (15:24 +0000)]
[FrameView::layout cleanup] Move core layout logic to a separate class.
https://bugs.webkit.org/show_bug.cgi?id=178771
<rdar://problem/35166542>

Reviewed by Simon Fraser.

Move layout code out from FrameView to LayoutContext.

Source/WebCore:

LayoutContext holds all the layout related logic (scheduling, needsLayout, handling layout states),
while scrolling, view sizing methods stay in FrameView.
Having a dedicated LayoutContext allows to structure the code better.

Covered by existing tests.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::rendererNeedsDeferredUpdate):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement const):
(WebCore::AccessibilityRenderObject::layoutCount const):
* dom/Document.cpp:
(WebCore::Document::setVisualUpdatesAllowed):
(WebCore::Document::resolveStyle):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayout):
(WebCore::Document::updateLayoutIfDimensionsOutOfDate):
(WebCore::Document::implicitClose):
(WebCore::Document::isLayoutTimerActive):
* dom/Element.cpp:
(WebCore::Element::absoluteEventHandlerBounds):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelection):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::didAttachRenderers):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::update):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopForUserCancel):
* page/Frame.cpp:
(WebCore::Frame::setView):
(WebCore::Frame::clearTimers):
(WebCore::Frame::setPageAndTextZoomFactors):
(WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::~FrameView):
(WebCore::FrameView::reset):
(WebCore::FrameView::resetScrollbars):
(WebCore::FrameView::didFirstLayout const):
(WebCore::FrameView::willDestroyRenderTree):
(WebCore::FrameView::didDestroyRenderTree):
(WebCore::FrameView::setContentsSize):
(WebCore::FrameView::calculateScrollbarModesForLayout):
(WebCore::FrameView::updateCompositingLayersAfterStyleChange):
(WebCore::FrameView::topContentInsetDidChange):
(WebCore::FrameView::forceLayoutParentViewIfNeeded):
(WebCore::FrameView::adjustScrollbarsForLayout):
(WebCore::FrameView::willDoLayout): This takes care of the view related task right before entering render tree layout.
(WebCore::FrameView::didLayout): post layout tasks.
(WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::maintainScrollPositionAtAnchor):
(WebCore::FrameView::updateLayerPositionsAfterScrolling):
(WebCore::FrameView::updateCompositingLayersAfterScrolling):
(WebCore::FrameView::availableContentSizeChanged):
(WebCore::FrameView::updateContentsSize):
(WebCore::FrameView::needsLayout const):
(WebCore::FrameView::setNeedsLayout):
(WebCore::FrameView::scheduleSelectionUpdate):
(WebCore::FrameView::updateEmbeddedObjects):
(WebCore::FrameView::flushAnyPendingPostLayoutTasks):
(WebCore::FrameView::flushPostLayoutTasksQueue):
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::sendResizeEventIfNeeded):
(WebCore::FrameView::autoSizeIfEnabled):
(WebCore::FrameView::paintControlTints):
(WebCore::FrameView::paintContents):
(WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
(WebCore::FrameView::enableAutoSizeMode):
(WebCore::FrameView::forceLayout):
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): Deleted.
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): Deleted.
(WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree): Deleted.
(): Deleted.
(WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker): Deleted.
(WebCore::applyTextSizingIfNeeded): Deleted.
(WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
(WebCore::FrameView::updateStyleForLayout): Deleted.
(WebCore::FrameView::canPerformLayout const): Deleted.
(WebCore::FrameView::layout): Deleted.
(WebCore::FrameView::runOrSchedulePostLayoutTasks): Deleted.
(WebCore::FrameView::convertSubtreeLayoutToFullLayout): Deleted.
(WebCore::FrameView::layoutTimerFired): Deleted.
(WebCore::FrameView::scheduleRelayout): Deleted.
(WebCore::isObjectAncestorContainerOf): Deleted.
(WebCore::FrameView::scheduleRelayoutOfSubtree): Deleted.
(WebCore::FrameView::layoutPending const): Deleted.
(WebCore::FrameView::unscheduleRelayout): Deleted.
(WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded): Deleted.
* page/FrameView.h:
* page/LayoutContext.cpp: Added.
(WebCore::isObjectAncestorContainerOf):
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
(WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
(WebCore::LayoutScope::LayoutScope):
(WebCore::LayoutScope::~LayoutScope):
(WebCore::LayoutContext::LayoutContext):
(WebCore::LayoutContext::layout):
(WebCore::LayoutContext::runOrScheduleAsynchronousTasks):
(WebCore::LayoutContext::runAsynchronousTasks):
(WebCore::LayoutContext::flushAsynchronousTasks):
(WebCore::LayoutContext::reset):
(WebCore::LayoutContext::needsLayout const):
(WebCore::LayoutContext::setNeedsLayout):
(WebCore::LayoutContext::enableSetNeedsLayout):
(WebCore::LayoutContext::disableSetNeedsLayout):
(WebCore::LayoutContext::scheduleLayout):
(WebCore::LayoutContext::unscheduleLayout):
(WebCore::LayoutContext::scheduleSubtreeLayout):
(WebCore::LayoutContext::layoutTimerFired):
(WebCore::LayoutContext::convertSubtreeLayoutToFullLayout):
(WebCore::LayoutContext::setSubtreeLayoutRoot):
(WebCore::LayoutContext::canPerformLayout const):
(WebCore::LayoutContext::applyTextSizingIfNeeded):
(WebCore::LayoutContext::updateStyleForLayout):
(WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
(WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded):
(WebCore::LayoutContext::frame const):
(WebCore::LayoutContext::view const):
(WebCore::LayoutContext::renderView const):
(WebCore::LayoutContext::document const):
* page/LayoutContext.h: Added.
(WebCore::LayoutContext::startDisallowingLayout):
(WebCore::LayoutContext::endDisallowingLayout):
(WebCore::LayoutContext::layoutPhase const):
(WebCore::LayoutContext::isLayoutNested const):
(WebCore::LayoutContext::layoutCount const):
(WebCore::LayoutContext::isLayoutPending const):
(WebCore::LayoutContext::isInLayout const):
(WebCore::LayoutContext::isInRenderTreeLayout const):
(WebCore::LayoutContext::inPaintableState const):
(WebCore::LayoutContext::subtreeLayoutRoot const):
(WebCore::LayoutContext::clearSubtreeLayoutRoot):
(WebCore::LayoutContext::resetFirstLayoutFlag):
(WebCore::LayoutContext::didFirstLayout const):
(WebCore::LayoutContext::setNeedsFullRepaint):
(WebCore::LayoutContext::needsFullRepaint const):
(WebCore::LayoutContext::layoutDisallowed const):
(WebCore::LayoutContext::isLayoutSchedulingEnabled const):
(WebCore::LayoutContext::inAsynchronousTasks const):
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::insertPositionedObject):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::imageChanged):
(WebCore::RenderBox::computeLogicalWidthInFragment const):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::clearSubtreeLayoutRootIfNeeded const):
(WebCore::RenderElement::checkForRepaintDuringLayout const):
* rendering/RenderFrameBase.cpp:
(WebCore::RenderFrameBase::performLayoutWithFlattening):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
* rendering/RenderObject.cpp:
(WebCore::scheduleRelayoutForSubtree):
* rendering/RenderTreeAsText.cpp:
(WebCore::write):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::updatePlayer):
* rendering/RenderView.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::updateWidgetPosition):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw):
* testing/Internals.cpp:
(WebCore::Internals::layoutCount const):

Source/WebKitLegacy/mac:

* WebView/WebClipView.mm:
(-[WebClipView _immediateScrollToPoint:]):
* WebView/WebFrame.mm:
(-[WebFrame layoutCount]):

Source/WebKitLegacy/win:

* WebFrame.cpp:
(WebFrame::layout):

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

21 months agoMake postprocess-framework-headers.sh a little easier to read
commit-queue@webkit.org [Sat, 28 Oct 2017 14:51:30 +0000 (14:51 +0000)]
Make postprocess-framework-headers.sh a little easier to read
https://bugs.webkit.org/show_bug.cgi?id=178971

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-28
Reviewed by Sam Weinig.

* mac/postprocess-framework-headers.sh:

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

21 months agoCleanup PageDebuggable
commit-queue@webkit.org [Sat, 28 Oct 2017 14:36:21 +0000 (14:36 +0000)]
Cleanup PageDebuggable
https://bugs.webkit.org/show_bug.cgi?id=178972

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-28
Reviewed by Sam Weinig.

* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::PageDebuggable):
* page/PageDebuggable.h:

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

21 months agoExtract a WorkerDebuggerProxy interface out of WorkerReportingProxy
commit-queue@webkit.org [Sat, 28 Oct 2017 14:35:48 +0000 (14:35 +0000)]
Extract a WorkerDebuggerProxy interface out of WorkerReportingProxy
https://bugs.webkit.org/show_bug.cgi?id=178975

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-28
Reviewed by Sam Weinig.

No new tests, just refactoring.

* workers/WorkerDebuggerProxy.h:
* workers/WorkerReportingProxy.h:
* WebCore.xcodeproj/project.pbxproj:
Extract a method from WorkerReportingProxy to WorkerDebuggerProxy and
rename it to be more general.

* inspector/WorkerToPageFrontendChannel.h:
(WebCore::WorkerToPageFrontendChannel::sendMessageToFrontend):
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
* workers/DedicatedWorkerThread.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
(WebCore::WorkerMessagingProxy::postMessageToDebugger):
(WebCore::WorkerMessagingProxy::postMessageToPageInspector): Deleted.
* workers/WorkerMessagingProxy.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::WorkerThread):
* workers/WorkerThread.h:
(WebCore::WorkerThread::workerDebuggerProxy const):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::create):
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
Include a WorkerDebuggerProxy alongside the other proxies.
Use the renamed debugger proxy method.

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

21 months agoStyle::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor...
rniwa@webkit.org [Sat, 28 Oct 2017 09:17:59 +0000 (09:17 +0000)]
Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
https://bugs.webkit.org/show_bug.cgi?id=178715
<rdar://problem/35144665>

Reviewed by Brent Fulgham.

Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
instead of in the middle of collecting a list of stylesheets.

* dom/Document.cpp:
(WebCore::Document::Document): Initialize the newly added timer.
(WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
handlers may be expecting to see the document after XSLT had been applied.
(WebCore::Document::scheduleToApplyXSLTransforms): Added.
(WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
(WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
(WebCore::Document::applyXSLTransform): Deleted.
(WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
inline XSLT and it happens much earlier than implicitClose.
(WebCore::Document::suspendScheduledTasks): Suspend the XSLT timer.
(WebCore::Document::resumeScheduledTasks): Reschedule the XSLT timer if m_hasPendingXSLTransforms is set.
* dom/Document.h:
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
function can be called from a non-script-resilient call stack.
(WebCore::ProcessingInstruction::sheetLoaded): Ditto.
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectXSLTransforms): Added.
(WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
* style/StyleScope.h:
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.

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

21 months ago[Win] Detect Visual Studio 2017 location
commit-queue@webkit.org [Sat, 28 Oct 2017 03:49:10 +0000 (03:49 +0000)]
[Win] Detect Visual Studio 2017 location
https://bugs.webkit.org/show_bug.cgi?id=175275

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2017-10-27
Reviewed by Per Arne Vollan.

* Scripts/build-jsc:
* Scripts/build-webkit:
* Scripts/update-vswhere.py: Added.
* Scripts/webkitdirs.pm:
(pickCurrentVisualStudioInstallation):
(pickLegacyVisualStudioInstallation):
(visualStudioInstallDir):
(visualStudioInstallDirVSWhere):
(visualStudioInstallDirLegacy):
(visualStudioInstallDirFallback):
(msBuildInstallDir):
(visualStudioVersion):
(visualStudioVersionFromInstallDir):
(generateBuildSystemFromCMakeProject):

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

21 months agoWeb Inspector: Canvas Tab: no way to see backtrace of where a canvas context was...
webkit@devinrousso.com [Sat, 28 Oct 2017 01:58:52 +0000 (01:58 +0000)]
Web Inspector: Canvas Tab: no way to see backtrace of where a canvas context was created
https://bugs.webkit.org/show_bug.cgi?id=178799
<rdar://problem/35175805>

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/protocol/Canvas.json:
Add optional `backtrace` to Canvas type that is an array of Console.CallFrame.

Source/WebCore:

No new tests, updated existing tests.

* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(iterateCallFrames):
(WebCore::InspectorCanvas::buildObjectForCanvas):
(WebCore::InspectorCanvas::buildAction):

* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
If the Canvas agent is enabled, generate a backtrace and send it to the frontend with the canvas.
We do not do this for canvases created before the agent is enabled for performance reasons.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Models/Canvas.js:
(WI.Canvas.fromPayload):
(WI.Canvas.prototype.get backtrace):

* UserInterface/Views/CanvasDetailsSidebarPanel.css:
(.sidebar > .panel.details.canvas .details-section.canvas-backtrace .call-frame):

* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
(WI.CanvasDetailsSidebarPanel.prototype.layout):
(WI.CanvasDetailsSidebarPanel.prototype._refreshBacktraceSection):

* UserInterface/Views/ResourceIcons.css:
(.canvas > .icon):
(.canvas .icon): Deleted.

LayoutTests:

* inspector/canvas/create-context-2d-expected.txt:
* inspector/canvas/create-context-webgl-expected.txt:
* inspector/canvas/create-context-webgl2-expected.txt:
* inspector/canvas/create-context-webgpu-expected.txt:
* inspector/canvas/resources/create-context-utilities.js:
(TestPage.registerInitializer.sanitizeURL):
(TestPage.registerInitializer.awaitCanvasAdded):
Pretty-print backtrace when canvases are added to the page.

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

21 months ago[JSC] Tweak ES6 generator function to allow inlining
utatane.tea@gmail.com [Sat, 28 Oct 2017 01:48:53 +0000 (01:48 +0000)]
[JSC] Tweak ES6 generator function to allow inlining
https://bugs.webkit.org/show_bug.cgi?id=178935

Reviewed by Saam Barati.

We optimize builtins' generator helper functions to allow them inlined in the caller side.
This patch adjust the layer between @generatorResume, next(), throw(), and return() to allow
them inlined in DFG.

                               baseline                  patched

spread-generator.es6      301.2637+-11.1011    ^    260.5905+-14.2258       ^ definitely 1.1561x faster
generator.es6             269.6030+-13.2435    ^    148.8840+-6.7614        ^ definitely 1.8108x faster

* builtins/GeneratorPrototype.js:
(globalPrivate.generatorResume):
(next):
(return):
(throw):

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

21 months agoCreate watchlist for files related WebInspector Recording
webkit@devinrousso.com [Sat, 28 Oct 2017 01:39:12 +0000 (01:39 +0000)]
Create watchlist for files related WebInspector Recording
https://bugs.webkit.org/show_bug.cgi?id=178965

Reviewed by Joseph Pecoraro.

* Scripts/webkitpy/common/config/watchlist:

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

21 months agoSkip test http/tests/security/mixedContent/insecure-download-redirects-to-basic-auth...
dbates@webkit.org [Sat, 28 Oct 2017 01:05:37 +0000 (01:05 +0000)]
Skip test http/tests/security/mixedContent/insecure-download-redirects-to-basic-auth-secure-download.https.html on OS X El Capitan

For now skip this test that was added in r224134 on OS X El Capitan. OS X El Capitan uses the
legacy NSURLDownload code path for downloads. This code path is not happy with the self-signed
certificate we use when running HTTPS tests. See <https://bugs.webkit.org/show_bug.cgi?id=155132>
for more details.

* platform/mac-elcapitan/TestExpectations:

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

21 months agoBytecode liveness should live on UnlinkedCodeBlock so it can be shared amongst CodeBlocks
sbarati@apple.com [Sat, 28 Oct 2017 01:03:22 +0000 (01:03 +0000)]
Bytecode liveness should live on UnlinkedCodeBlock so it can be shared amongst CodeBlocks
https://bugs.webkit.org/show_bug.cgi?id=178949

Reviewed by Keith Miller.

This patch stores BytecodeLiveness on UnlinkedCodeBlock instead of CodeBlock
so that we don't need to recompute liveness for the same UnlinkedCodeBlock
more than once. To do this, this patch solidifies the invariant that CodeBlock
linking can't do anything that would change the result of liveness. For example,
it can't introduce new locals. This invariant was met my JSC before, because we
didn't do anything in bytecode linking that would change liveness. However, it is
now a correctness requirement that we don't do anything that would change the
result of running liveness. To support this change, I've refactored BytecodeGraph
to not be tied to a CodeBlockType*. Things that perform liveness will pass in
CodeBlockType* and the instruction stream as needed. This means that we may
compute liveness with one CodeBlock*'s instruction stream, and then perform
queries on that analysis with a different CodeBlock*'s instruction stream.

This seems to be a 2% JSBench progression.

* bytecode/BytecodeGeneratorification.cpp:
(JSC::BytecodeGeneratorification::BytecodeGeneratorification):
(JSC::BytecodeGeneratorification::graph):
(JSC::BytecodeGeneratorification::storageForGeneratorLocal):
(JSC::GeneratorLivenessAnalysis::run):
(JSC::BytecodeGeneratorification::run):
* bytecode/BytecodeGraph.h:
(JSC::BytecodeGraph::BytecodeGraph):
(JSC::BytecodeGraph::codeBlock const): Deleted.
(JSC::BytecodeGraph::instructions): Deleted.
(JSC::BytecodeGraph<Block>::BytecodeGraph): Deleted.
* bytecode/BytecodeLivenessAnalysis.cpp:
(JSC::BytecodeLivenessAnalysis::BytecodeLivenessAnalysis):
(JSC::BytecodeLivenessAnalysis::getLivenessInfoAtBytecodeOffset):
(JSC::BytecodeLivenessAnalysis::computeFullLiveness):
(JSC::BytecodeLivenessAnalysis::computeKills):
(JSC::BytecodeLivenessAnalysis::dumpResults):
(JSC::BytecodeLivenessAnalysis::operandIsLiveAtBytecodeOffset): Deleted.
(JSC::BytecodeLivenessAnalysis::compute): Deleted.
* bytecode/BytecodeLivenessAnalysis.h:
* bytecode/BytecodeLivenessAnalysisInlines.h:
(JSC::BytecodeLivenessPropagation::stepOverInstruction):
(JSC::BytecodeLivenessPropagation::computeLocalLivenessForBytecodeOffset):
(JSC::BytecodeLivenessPropagation::computeLocalLivenessForBlock):
(JSC::BytecodeLivenessPropagation::getLivenessInfoAtBytecodeOffset):
(JSC::BytecodeLivenessPropagation::runLivenessFixpoint):
* bytecode/BytecodeRewriter.cpp:
(JSC::BytecodeRewriter::applyModification):
(JSC::BytecodeRewriter::execute):
(JSC::BytecodeRewriter::adjustJumpTargetsInFragment):
* bytecode/BytecodeRewriter.h:
(JSC::BytecodeRewriter::BytecodeRewriter):
(JSC::BytecodeRewriter::removeBytecode):
(JSC::BytecodeRewriter::graph):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffsetSlow):
(JSC::CodeBlock::validate):
(JSC::CodeBlock::livenessAnalysisSlow): Deleted.
* bytecode/CodeBlock.h:
(JSC::CodeBlock::livenessAnalysis):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::applyModification):
(JSC::UnlinkedCodeBlock::livenessAnalysisSlow):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::livenessAnalysis):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::livenessFor):
(JSC::DFG::Graph::killsFor):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::cleanMustHandleValuesIfNecessary):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):

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

21 months ago[WinCairo] Add WTF files for wincairo webkit
commit-queue@webkit.org [Sat, 28 Oct 2017 00:09:47 +0000 (00:09 +0000)]
[WinCairo] Add WTF files for wincairo webkit
https://bugs.webkit.org/show_bug.cgi?id=176894

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2017-10-27
Reviewed by Alex Christensen.

* wtf/PlatformWin.cmake:
* wtf/WorkQueue.cpp:
* wtf/WorkQueue.h:
* wtf/win/Win32Handle.h:
* wtf/win/WorkItemContext.cpp: Added.
(WTF::WorkItemContext::WorkItemContext):
(WTF::WorkItemContext::create):
(WTF::WorkItemContext::~WorkItemContext):
* wtf/win/WorkItemContext.h: Added.
(WTF::WorkItemContext::handle):
(WTF::WorkItemContext::waitHandle):
(WTF::WorkItemContext::Function<void):
(WTF::WorkItemContext::queue const):
* wtf/win/WorkQueueWin.cpp:
(WTF::WorkQueue::handleCallback):
(WTF::WorkQueue::registerHandle):
(WTF::WorkQueue::unregisterAndCloseHandle):
(WTF::WorkQueue::unregisterWaitAndDestroyItemSoon):
(WTF::WorkQueue::unregisterWaitAndDestroyItemCallback):

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

21 months agoAdd unified source list files and build scripts to Xcode project navigator
keith_miller@apple.com [Fri, 27 Oct 2017 23:45:07 +0000 (23:45 +0000)]
Add unified source list files and build scripts to Xcode project navigator
https://bugs.webkit.org/show_bug.cgi?id=178959

Reviewed by Andy Estes.

Source/JavaScriptCore:

Also, Add some extra source files for so new .cpp/.mm files don't cause the build
to fail right away. We already do this in WebCore.

* JavaScriptCore.xcodeproj/project.pbxproj:
* PlatformMac.cmake:
* SourcesCocoa.txt: Renamed from Source/JavaScriptCore/SourcesMac.txt.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:

Source/WTF:

* WTF.xcodeproj/project.pbxproj:

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

21 months agoAttempt to fix the Apple El Capitan build following <https://trac.webkit.org/changese...
dbates@webkit.org [Fri, 27 Oct 2017 23:40:45 +0000 (23:40 +0000)]
Attempt to fix the Apple El Capitan build following <https://trac.webkit.org/changeset/224134>
(https://bugs.webkit.org/show_bug.cgi?id=178919)

Move definition of NetworkLoad::isAllowedToAskUserForCredentials() outside of USE(NETWORK_SESSION)-guarded section.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::isAllowedToAskUserForCredentials const):

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

21 months agoOnly allow non-mixed content protected subresources to ask for credentials
dbates@webkit.org [Fri, 27 Oct 2017 22:31:14 +0000 (22:31 +0000)]
Only allow non-mixed content protected subresources to ask for credentials
https://bugs.webkit.org/show_bug.cgi?id=178919
<rdar://problem/35015245>

Reviewed by Alex Christensen.

Source/WebCore:

Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
to allow protected mixed-content subresources to ask for credentials.

Tests: http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image.html
       http/tests/security/mixedContent/insecure-script-redirects-to-basic-auth-secure-script.html
       http/tests/security/mixedContent/insecure-stylesheet-redirects-to-basic-auth-secure-stylesheet.html
       http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https.html
       http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html
       http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::ResourceLoader): Initialize m_canAskClientForCredentials based on the
specified resource loader options.
(WebCore::ResourceLoader::init): Update m_canAskClientForCredentials based on the URL of the initial
request.
(WebCore::ResourceLoader::isMixedContent const): Helper function to check if the specified URL
represents a mixed content resource.
(WebCore::ResourceLoader::willSendRequestInternal): If the original request or the redirect request
is mixed content then update state such that we will disallow asking for credentials.
(WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Modified to use m_canAskClientForCredentials
when determining whether the request is allowed to ask for credentials.
* loader/ResourceLoader.h:

Source/WebKit:

Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
to allow protected mixed-content subresources to ask for credentials.

* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::PendingDownload): Initialize m_isAllowedToAskUserForCredentials based on
the specified resource load parameters or NetworkLoad object.
* NetworkProcess/Downloads/PendingDownload.h: Add override for NetworkLoadClient::isAllowedToAskUserForCredentials().
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::isAllowedToAskUserForCredentials const): Added.
(WebKit::NetworkLoad::completeAuthenticationChallenge): Ask NetworkLoadClient whether the load is
allowed to prompt for credentials.
(WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Ditto.
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize m_isAllowedToAskUserForCredentials
based on the specified resource load parameters.
(WebKit::NetworkResourceLoader::willSendRedirectedRequest): We do not support prompting for credentials
for synchronous loads.
(WebKit::NetworkResourceLoader::continueWillSendRequest): Modified to take an argument as to whether the
load is allowed to ask the user for credentials and updates state.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/NetworkResourceLoader.messages.in: Modified message ContinueWillSendRequest to take a
boolean as to whether the load is allowed to ask the user for credentials.
* NetworkProcess/PreconnectTask.h: Override NetworkLoadClient::isAllowedToAskUserForCredentials()
such that we never ask for credentials. This matches our current behavior.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto.
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::willSendRequest): Query ResourceLoader as to whether the load is allowed to
ask the user for credentials and pass this state to NetworkResourceLoader.

LayoutTests:

* http/tests/security/mixedContent/insecure-download-redirects-to-basic-auth-secure-download.https-expected.txt: Added.
* http/tests/security/mixedContent/insecure-download-redirects-to-basic-auth-secure-download.https.html: Added.
* http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image-expected.txt: Added.
* http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image.html: Added.
* http/tests/security/mixedContent/insecure-script-redirects-to-basic-auth-secure-script-expected.https.txt: Added.
* http/tests/security/mixedContent/insecure-script-redirects-to-basic-auth-secure-script-expected.txt: Added.
* http/tests/security/mixedContent/insecure-script-redirects-to-basic-auth-secure-script.html: Added.
* http/tests/security/mixedContent/insecure-stylesheet-redirects-to-basic-auth-secure-stylesheet-expected.txt: Added.
* http/tests/security/mixedContent/insecure-stylesheet-redirects-to-basic-auth-secure-stylesheet.html: Added.
* http/tests/security/mixedContent/resources/frame-with-insecure-image-redirects-to-basic-auth-secure-image.html: Added.
* http/tests/security/mixedContent/resources/frame-with-insecure-script-redirects-to-basic-auth-secure-script.html: Added.
* http/tests/security/mixedContent/resources/frame-with-insecure-stylesheet-redirects-to-basic-auth-secure-stylesheet.html: Added.
* http/tests/security/mixedContent/resources/frame-with-programmatically-added-insecure-image-redirects-to-basic-auth-secure-image.html: Added.
* http/tests/security/mixedContent/resources/subresource/protected-image.php: Added.
* http/tests/security/mixedContent/resources/subresource/protected-pdf.php: Added.
* http/tests/security/mixedContent/resources/subresource/protected-script.php: Added.
* http/tests/security/mixedContent/resources/subresource/protected-stylesheet.php: Added.
* http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https-expected.txt: Added.
* http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https.html: Added.
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https-expected.txt: Added.
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html: Added.
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https-expected.txt: Added.
* http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html: Added.
* platform/ios-wk1/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https-expected.txt: Added.
* platform/mac-wk1/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https-expected.txt: Added.
* platform/win/http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https-expected.txt: Added.

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

21 months agoAdd tests for automatic decompression of gzip-compressed subresources
dbates@webkit.org [Fri, 27 Oct 2017 22:28:37 +0000 (22:28 +0000)]
Add tests for automatic decompression of gzip-compressed subresources
https://bugs.webkit.org/show_bug.cgi?id=178941
<rdar://problem/35230090>

Reviewed by Alex Christensen.

Although automatic decompression of gzip-compressed subresources is handled by CFNetwork
(<rdar://problem/5418646>) we should add tests to ensure that WebKit does not inadvertently
opt out of such functionality and to catch a regression in CFNetwork.

* TestExpectations: Skip the tests on all platforms. We will unskip on Cocoa platforms and Apple Windows.
* http/tests/gzip-content-encoding/gzip-encoded-script-expected.txt: Added.
* http/tests/gzip-content-encoding/gzip-encoded-script.html: Added.
* http/tests/gzip-content-encoding/gzip-encoded-script2-expected.txt: Added.
* http/tests/gzip-content-encoding/gzip-encoded-script2.html: Added.
* http/tests/gzip-content-encoding/gzip-encoded-stylesheet-expected.html: Added.
* http/tests/gzip-content-encoding/gzip-encoded-stylesheet.html: Added.
* http/tests/gzip-content-encoding/gzip-encoded-stylesheet2-expected.html: Added.
* http/tests/gzip-content-encoding/gzip-encoded-stylesheet2.html: Added.
* http/tests/gzip-content-encoding/resources/echo-data-encoding-with-gzip.php: Added.
* http/tests/gzip-content-encoding/resources/script.js.gz: Added.
* http/tests/gzip-content-encoding/resources/stylesheet.css.gz: Added.
* platform/ios/TestExpectations: Unskip tests.
* platform/mac/TestExpectations: Ditto.
* platform/win/TestExpectations: Ditto.

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

21 months agoUnskip more Service Workers tests
cdumez@apple.com [Fri, 27 Oct 2017 21:43:43 +0000 (21:43 +0000)]
Unskip more Service Workers tests
https://bugs.webkit.org/show_bug.cgi?id=178944

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Land expected results for tests that have been unskipped.

* web-platform-tests/service-workers/cache-storage/serviceworker/credentials.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/postmessage.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/registration-attribute.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/service-worker-error-event.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/unregister.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/update.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/activate-event-after-install-state-change.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/activation-after-registration.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/activation.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/active.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/appcache-ordering-main.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/claim-affect-other-registration.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/claim-fetch.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/claim-not-using-registration.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/claim-shared-worker-fetch.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/claim-using-registration.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/claim-with-redirect.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/claim-worker-fetch.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/client-id.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/client-navigate.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/clients-get-client-types.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/clients-get-cross-origin.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/clients-get.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/clients-matchall-client-types.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/clients-matchall-exact-controller.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/clients-matchall-include-uncontrolled.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/clients-matchall-order.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/clients-matchall.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/controller-on-disconnect.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/controller-on-load.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/controller-on-reload.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/extendable-event-async-waituntil.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/extendable-event-waituntil.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-csp.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-after-navigation-within-page.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-async-respond-with.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-network-error.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-redirect.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-referrer-policy.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-argument.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-readable-stream.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-response-body-with-invalid-chunk.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-stops-propagation.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-throws-after-respond-with.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-within-sw-manual.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-frame-resource.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-header-visibility.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-request-css-base-url.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-request-css-cross-origin-mime-check.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-request-css-images.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-request-fallback.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-request-html-imports.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-request-no-freshness-headers.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-request-redirect.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-request-resources.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-request-xhr-sync.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-request-xhr.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-response-xhr.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/foreign-fetch-cors.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/getregistration.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/getregistrations.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/immutable-prototype-serviceworker.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/import-scripts-resource-map.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/import-scripts-updated-flag.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/install-event-type.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/installing.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/interfaces-window.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/invalid-blobtype.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/invalid-header.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/iso-latin1-header.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/multi-globals/url-parsing.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/multiple-register.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/multiple-update.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/navigate-window.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/navigation-preload/broken-chunked-encoding.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/navigation-preload/chunked-encoding.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/navigation-preload/empty-preload-response-body.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/navigation-preload/get-state.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/navigation-preload/redirect.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/navigation-preload/request-headers.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/navigation-preload/resource-timing.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/navigation-redirect-body.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/onactivate-script-error.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/oninstall-script-error.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/opaque-response-preloaded.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/postmessage-blob-url.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/postmessage-from-waiting-serviceworker.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/postmessage-msgport-to-client.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/postmessage-to-client.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/postmessage.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/ready.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/referer.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/referrer-policy-header.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/register-closed-window.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/register-default-scope.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/register-link-header.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/register-wait-forever-in-install-worker.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/registration-basic.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/registration-end-to-end.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/registration-events.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/registration-iframe.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/registration-mime-types.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/registration-scope.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/registration-script-url.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/registration-script.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/registration-service-worker-attributes.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/registration-updateviacache.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/rejections.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/request-body-blob.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/request-end-to-end.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/resource-timing.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/serviceworker-message-event-historical.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/serviceworkerobject-scripturl.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/shared-worker-controlled.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/skip-waiting-installed.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/skip-waiting-using-registration.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/skip-waiting-without-using-registration.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/skip-waiting.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/state.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/synced-state.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/uncontrolled-page.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/unregister-controller.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/unregister-then-register.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/unregister.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/update-after-oneday.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/update-recovery.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/update.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/websocket.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/windowclient-navigate.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/xhr.https-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.1-service-worker-obj-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.1.1-service-worker-scope-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.1.2-service-worker-url-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.1.3-service-worker-state-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.1.4-service-worker-on-state-change-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2-navigator-service-worker-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.1-navigator-service-worker-installing-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.10-navigator-service-worker-oncontrollerchange-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.11-navigator-service-worker-onreloadpage-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.12-navigator-service-worker-onerror-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.2-navigator-service-worker-waiting-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.3-navigator-service-worker-active-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.4-navigator-service-worker-controller-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.5-navigator-service-worker-ready-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.6-navigator-service-worker-getAll-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.7-navigator-service-worker-register-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.8-navigator-service-worker-unregister-expected.txt: Added.
* web-platform-tests/service-workers/stub-3.2.9-navigator-service-worker-onupdatefound-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.1-service-worker-global-scope-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.1.1-service-worker-global-scope-caches-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.1.2-service-worker-global-scope-clients-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.1.3-service-worker-global-scope-scope-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.1.4-service-worker-global-scope-fetch-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.1.5-service-worker-global-scope-update-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.1.6-service-worker-global-scope-unregister-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.1.7-service-worker-global-scope-onmessage-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.2-client-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.3-service-worker-clients-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.3.1-get-serviced-method-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.3.2-reloadall-method-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.4-request-objects-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.5-response-objects-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.5.2-response-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.5.4-opaque-response-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.6-cache-objects-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.6.1-cache-lifetimes-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.7.1-install-phase-event-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.7.1.1-wait-until-method-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.7.2-install-event-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.7.2.1-install-event-section-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.7.2.2-replace-method-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.7.3-activate-event-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.7.4.1-fetch-event-section-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.7.4.2-respond-with-method-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.7.4.3-default-method-expected.txt: Added.
* web-platform-tests/service-workers/stub-4.7.4.4-is-reload-attribute-expected.txt: Added.
* web-platform-tests/service-workers/stub-5.1-origin-relativity-expected.txt: Added.
* web-platform-tests/service-workers/stub-5.2-cross-origin-resources-expected.txt: Added.

Source/WebCore:

Drop bad assertion that was causing the Service Worker WebProcess to crash and causing
tests to fail as a result.

* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::registration):
* workers/service/ServiceWorkerGlobalScope.h:

LayoutTests:

Unskip all Service Workers tests except for the 39 that are timing out.

* TestExpectations:

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

21 months agoUnreviewed, rolling out r224011.
ryanhaddad@apple.com [Fri, 27 Oct 2017 21:35:14 +0000 (21:35 +0000)]
Unreviewed, rolling out r224011.

xsl LayoutTests hit an assertion added with this change since
r223999 was rolled out.

Reverted changeset:

"Assert that no script is executed during style recalc"
https://bugs.webkit.org/show_bug.cgi?id=178845
https://trac.webkit.org/changeset/224011

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

21 months agoAdjusted expectations for fast/scrolling/arrow-key-scroll-in-rtl-document.html.
jlewis3@apple.com [Fri, 27 Oct 2017 21:30:23 +0000 (21:30 +0000)]
Adjusted expectations for fast/scrolling/arrow-key-scroll-in-rtl-document.html.
https://bugs.webkit.org/show_bug.cgi?id=173779

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

21 months agoAdjusted expectations for multiple media/ Layout Tests.
jlewis3@apple.com [Fri, 27 Oct 2017 20:48:33 +0000 (20:48 +0000)]
Adjusted expectations for multiple media/ Layout Tests.
https://bugs.webkit.org/show_bug.cgi?id=176054

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

21 months ago[Web Animations] Expose the currentTime property on AnimationTimeline
graouts@webkit.org [Fri, 27 Oct 2017 20:29:59 +0000 (20:29 +0000)]
[Web Animations] Expose the currentTime property on AnimationTimeline
https://bugs.webkit.org/show_bug.cgi?id=178928

Reviewed by Dean Jackson.

Source/WebCore:

We add the currentTime property on AnimationTimeline and add an internals method
to set it in a test which will allow us to validate the timing model state for
a given time.

Test: webanimations/timeline-current-time.html

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::bindingsCurrentTime const):
(WebCore::AnimationTimeline::setCurrentTime):
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::currentTime const):
* animation/AnimationTimeline.idl:
* testing/Internals.cpp:
(WebCore::Internals::setTimelineCurrentTime):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Add a new test that checks we can read the document's timeline currentTime
property and set it via the internals method.

* webanimations/timeline-current-time-expected.txt: Added.
* webanimations/timeline-current-time.html: Added.

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

21 months ago[Web Animations] Use Seconds vs. MonotonicTime to represent times
graouts@webkit.org [Fri, 27 Oct 2017 20:17:53 +0000 (20:17 +0000)]
[Web Animations] Use Seconds vs. MonotonicTime to represent times
https://bugs.webkit.org/show_bug.cgi?id=178950

Reviewed by Dean Jackson.

Animation start times, all expressed in seconds, in the Web Animations API are relative to the timeline
originTime, itself relative to the page's nagigation time (Performance.navigationTime), so it makes more
sense to use Seconds to represent them as opposed to a MonotonicTime.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::bindingsStartTime const):
(WebCore::WebAnimation::setBindingsStartTime):
* animation/WebAnimation.h:

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

21 months agoSkip two tests that are flaky crashes.
ryanhaddad@apple.com [Fri, 27 Oct 2017 20:09:34 +0000 (20:09 +0000)]
Skip two tests that are flaky crashes.
https://bugs.webkit.org/show_bug.cgi?id=177828

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

21 months agoDOMWindow::dispatchEvent() does not reset the event's dispatch flag
cdumez@apple.com [Fri, 27 Oct 2017 19:56:04 +0000 (19:56 +0000)]
DOMWindow::dispatchEvent() does not reset the event's dispatch flag
https://bugs.webkit.org/show_bug.cgi?id=178897

Reviewed by Darin Adler.

Source/WebCore:

Make sure we reset the currentTarget, dispatch flag, phase and propagation flags
after dispatching an event on a Window, as per:
- https://dom.spec.whatwg.org/#concept-event-dispatch

This behavior is consistent with Firefox.

Test: fast/events/window-load-initEvent.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchEvent):

LayoutTests:

Add layout test coverage. I have verified that this test is passing in Firefox.

* fast/events/window-load-initEvent-expected.txt: Added.
* fast/events/window-load-initEvent.html: Added.

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

21 months agoWindows and WebViews are retained after re-configure
jbedard@apple.com [Fri, 27 Oct 2017 19:10:24 +0000 (19:10 +0000)]
Windows and WebViews are retained after re-configure
https://bugs.webkit.org/show_bug.cgi?id=178902
<rdar://problem/35211518>

Reviewed by Alexey Proskuryakov.

The test runner effectively leaks windows every time a test changes configuration.
We give each test it's own AutoreleasePool to fix this problem.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::runTest): Add an AutoRelease pool scoping a test run
so that when a configuration changes, the old window and WebView are released.

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

21 months agoMove iOS specific sources to unified sources
keith_miller@apple.com [Fri, 27 Oct 2017 18:56:11 +0000 (18:56 +0000)]
Move iOS specific sources to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178915

Rubber-stamped by Tim Horton.

Source/WebCore:

* SourcesCocoa.txt:
* SourcesIOS.txt:
* SourcesMac.txt:
* WebCore.xcodeproj/project.pbxproj:

Source/WebCore/PAL:

* pal/spi/cocoa/QuartzCoreSPI.h: Add missing pragma once.

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

21 months agoWebAssembly: update arbitrary limits to what browsers use
jfbastien@apple.com [Fri, 27 Oct 2017 18:42:27 +0000 (18:42 +0000)]
WebAssembly: update arbitrary limits to what browsers use
https://bugs.webkit.org/show_bug.cgi?id=178946
<rdar://problem/34257412>
<rdar://problem/34501154>

Reviewed by Saam Barati.

https://github.com/WebAssembly/design/issues/1138 discusses the
arbitrary function size limit, which it turns out Chrome and
Firefox didn't enforce. We didn't use it because it was
ridiculously low and actual programs ran into that limit (bummer
for Edge which just shipped it...). Now that we agree on a high
arbitrary program limit, let's update it! While I'm doing this
there are a few other spots that I polished to use Checked or
better check limits overall.

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addLocal):
* wasm/WasmFormat.cpp:
(JSC::Wasm::Segment::create):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parse):
* wasm/WasmInstance.cpp:
* wasm/WasmLimits.h:
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseGlobal):
(JSC::Wasm::ModuleParser::parseCode):
(JSC::Wasm::ModuleParser::parseData):
* wasm/WasmSignature.h:
(JSC::Wasm::Signature::allocatedSize):
* wasm/WasmTable.cpp:
(JSC::Wasm::Table::Table):
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::grow):

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

21 months agoNowPlayingInfo should contain a unique identifier
eric.carlson@apple.com [Fri, 27 Oct 2017 18:38:43 +0000 (18:38 +0000)]
NowPlayingInfo should contain a unique identifier
https://bugs.webkit.org/show_bug.cgi?id=178872
<rdar://problem/34924012>

Unreviewed, build fix.

* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Call string.impl().hash() instead of
string.existingHash() because the later will assert in a debug build if the hash hasn't
been calculated yet.
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto.

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

21 months agoMove TestExpectation for imported/w3c/web-platform-tests/XMLHttpRequest/open-url...
ryanhaddad@apple.com [Fri, 27 Oct 2017 17:48:15 +0000 (17:48 +0000)]
Move TestExpectation for imported/w3c/web-platform-tests/XMLHttpRequest/open-url-worker-origin.htm.
https://bugs.webkit.org/show_bug.cgi?id=178190

Unreviewed test gardening.

* TestExpectations:
* platform/mac/TestExpectations:

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

21 months agoFix accessibility/mac/aria-label-on-label-element.html after r224074
achristensen@apple.com [Fri, 27 Oct 2017 17:39:16 +0000 (17:39 +0000)]
Fix accessibility/mac/aria-label-on-label-element.html after r224074
https://bugs.webkit.org/show_bug.cgi?id=178892

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::titleElementText const):
(WebCore::AccessibilityNodeObject::ariaLabeledByText const):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityText::AccessibilityText):
Turns out my null checks changed behavior.  This undoes them.

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

21 months ago[GTK][CMake] Incorrect conditional check when adding build dir to GIR runtime library...
aperez@igalia.com [Fri, 27 Oct 2017 17:33:54 +0000 (17:33 +0000)]
[GTK][CMake] Incorrect conditional check when adding build dir to GIR runtime library path
https://bugs.webkit.org/show_bug.cgi?id=178936

Reviewed by Michael Catanzaro.

* PlatformGTK.cmake: Fix spelling of variable used in conditional.

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

21 months agoNowPlayingInfo should contain a unique identifier
eric.carlson@apple.com [Fri, 27 Oct 2017 17:16:46 +0000 (17:16 +0000)]
NowPlayingInfo should contain a unique identifier
https://bugs.webkit.org/show_bug.cgi?id=178872
<rdar://problem/34924012>

Unreviewed, fix a flakey test.

* TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm:
(-[NowPlayingTestWebView hasActiveNowPlayingSession]): Update _lastUpdatedElapsedTime.
(-[NowPlayingTestWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]): Deleted.

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

21 months agoUnreviewed, rolling out r223999.
ryanhaddad@apple.com [Fri, 27 Oct 2017 17:06:17 +0000 (17:06 +0000)]
Unreviewed, rolling out r223999.

Caused xsl LayoutTest flakiness.

Reverted changeset:

"Style::Scope::flushPendingUpdate() can replace the entire
document in XSLTProcessor::createDocumentFromSource"
https://bugs.webkit.org/show_bug.cgi?id=178715
https://trac.webkit.org/changeset/223999

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

21 months agoAudit init*Event() method to make sure they reset internal data members
cdumez@apple.com [Fri, 27 Oct 2017 16:49:56 +0000 (16:49 +0000)]
Audit init*Event() method to make sure they reset internal data members
https://bugs.webkit.org/show_bug.cgi?id=178886

Reviewed by Ryosuke Niwa.

Audit init*Event() method to make sure they reset internal data members.

* dom/Event.cpp:
(WebCore::Event::initEvent):
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::initKeyboardEvent):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::initMessageEvent):
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::initMouseEvent):
* dom/MouseRelatedEvent.h:
(WebCore::MouseRelatedEvent::setIsSimulated):
* dom/TextEvent.cpp:
(WebCore::TextEvent::initTextEvent):
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::initWheelEvent):

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

21 months agoautoinstall can't download from http://pypi.python.org
ryanhaddad@apple.com [Fri, 27 Oct 2017 16:38:36 +0000 (16:38 +0000)]
autoinstall can't download from pypi.python.org
https://bugs.webkit.org/show_bug.cgi?id=178925

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-27
Reviewed by Ryosuke Niwa.

The web server pypi.python.org rejects non secure http.

* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook._install_mechanize): Use https instead of http.
(AutoinstallImportHook._install_pep8): Ditto.
(AutoinstallImportHook._install_pylint): Ditto.
(AutoinstallImportHook._install_buildbot): Ditto.
(AutoinstallImportHook._install_coverage): Ditto.

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

21 months agoAdd initial support for serviceWorkerClient.postMessage()
cdumez@apple.com [Fri, 27 Oct 2017 16:35:45 +0000 (16:35 +0000)]
Add initial support for serviceWorkerClient.postMessage()
https://bugs.webkit.org/show_bug.cgi?id=178794

Reviewed by Youenn Fablet.

Source/WebCore:

Add initial support for serviceWorkerClient.postMessage():
- https://w3c.github.io/ServiceWorker/#client-postmessage

It is now possible to do bi-directional communication with a service worker
via postMessage().

No new tests, updated existing test.

* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::generateDocumentIdentifier):
(WebCore::Document::allDocumentsMap):
(WebCore::Document::allDocuments):
(WebCore::m_identifier):
(WebCore::Document::~Document):
* dom/Document.h:
(WebCore::Document::identifier const):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::serviceWorkerContainer):
* dom/ScriptExecutionContext.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::ServiceWorkerClient):
(WebCore::ServiceWorkerClient::~ServiceWorkerClient):
(WebCore::ServiceWorkerClient::id const):
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/ServiceWorkerClient.h:
(WebCore::ServiceWorkerClient::create):
* workers/service/ServiceWorkerClient.idl:
* workers/service/ServiceWorkerClientIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
(WebCore::ServiceWorkerClientIdentifier::toString const):
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::unregister):
* workers/service/ServiceWorkerWindowClient.cpp:
(WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
* workers/service/ServiceWorkerWindowClient.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
* workers/service/context/SWContextManager.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::postMessageToServiceWorkerClient):
* workers/service/server/SWClientConnection.h:

Source/WebKit:

Add initial support for serviceWorkerClient.postMessage():
- https://w3c.github.io/ServiceWorker/#client-postmessage

It is now possible to do bi-directional communication with a service worker
via postMessage().

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ServiceWorkerClientIdentifier>::encode):
(IPC::ArgumentCoder<ServiceWorkerClientIdentifier>::decode):
* Shared/WebCoreArgumentCoders.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::postMessageToServiceWorkerClient):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
(WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/basic-ServiceWorker-postMessage.https-expected.txt:
* http/tests/workers/service/resources/basic-ServiceWorker-postMessage-worker.js:
* http/tests/workers/service/resources/basic-ServiceWorker-postMessage.js:
(then):

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

21 months agoSkip failing service worker tests that were missed in r224066.
ryanhaddad@apple.com [Fri, 27 Oct 2017 16:09:02 +0000 (16:09 +0000)]
Skip failing service worker tests that were missed in r224066.
https://trac.webkit.org/changeset/224066/webkit

Unreviewed test gardening.

* TestExpectations:

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

21 months agoUse auto for some variables in RenderLayerCompositor/Backing
fred.wang@free.fr [Fri, 27 Oct 2017 14:38:41 +0000 (14:38 +0000)]
Use auto for some variables in RenderLayerCompositor/Backing
https://bugs.webkit.org/show_bug.cgi?id=178570

Patch by Frederic Wang <fwang@igalia.com> on 2017-10-27
Reviewed by Darin Adler.

No new tests, behavior unchanged.

* rendering/RenderLayerBacking.cpp:
(WebCore::canvasCompositingStrategy):
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::computePageTiledBackingCoverage):
(WebCore::RenderLayerBacking::layerWillBeDestroyed):
(WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
(WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
(WebCore::RenderLayerBacking::updateCompositedBounds):
(WebCore::RenderLayerBacking::updateAfterWidgetResize):
(WebCore::RenderLayerBacking::updateAfterLayout):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const):
(WebCore::RenderLayerBacking::compositingOpacity const):
(WebCore::isRestartedPlugin):
(WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
(WebCore::RenderLayerBacking::updateImageContents):
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
(WebCore::RenderLayerBacking::getCurrentTransform const):
(WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::compositedBoundsIncludingMargin const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes):
(WebCore::updateScrollingLayerWithClient):
(WebCore::RenderLayerCompositor::didFlushChangesForLayer):
(WebCore::RenderLayerCompositor::didPaintBacking):
(WebCore::RenderLayerCompositor::didChangeVisibleRect):
(WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::logLayerInfo):
(WebCore::checkIfDescendantClippingContextNeedsUpdate):
(WebCore::styleChangeRequiresLayerRebuild):
(WebCore::RenderLayerCompositor::canCompositeClipPath):
(WebCore::rendererForCompositingTests):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::repaintOnCompositingChange):
(WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
(WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
(WebCore::RenderLayerCompositor::setCompositingParent):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::hasCoordinatedScrolling const):
(WebCore::RenderLayerCompositor::updateScrollLayerPosition):
(WebCore::RenderLayerCompositor::positionForClipLayer const):
(WebCore::RenderLayerCompositor::frameViewDidLayout):
(WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged):
(WebCore::RenderLayerCompositor::scrollingLayerDidChange):
(WebCore::RenderLayerCompositor::frameContentsCompositor):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
(WebCore::RenderLayerCompositor::clippedByAncestor const):
(WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
(WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
(WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
(WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
(WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
(WebCore::RenderLayerCompositor::requiresScrollLayer const):
(WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing const):
(WebCore::RenderLayerCompositor::fixedRootBackgroundLayer const):
(WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
(WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const):
(WebCore::RenderLayerCompositor::documentUsesTiledBacking const):
(WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::destroyRootLayer):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
(WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
(WebCore::RenderLayerCompositor::deviceOrPageScaleFactorChanged):
(WebCore::RenderLayerCompositor::computeFixedViewportConstraints const):
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
(WebCore::enclosingScrollingNodeID):
(WebCore::scrollCoordinatedAncestorInParentOfFrame):
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
(WebCore::RenderLayerCompositor::didAddScrollingLayer):
(WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView):

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

21 months ago[GStreamer][MSE] Trim space between codecs
commit-queue@webkit.org [Fri, 27 Oct 2017 09:35:53 +0000 (09:35 +0000)]
[GStreamer][MSE] Trim space between codecs
https://bugs.webkit.org/show_bug.cgi?id=178160

Patch by Alicia Boya García <aboya@igalia.com> on 2017-10-27
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Modify supportsCodecs() to accept a Vector<String> instead of
receiving a string and parsing itself.

This improves passrate for `mediasource-is-type-supported` as it
ensures that whitespace between codecs is now trimmed and codec
strings such as `video/webm;codecs="opus, vp9"` are matched as a valid
type, as required by the spec.

This patch also renames supportCodecs() to supportAllCodecs() and adds
a new variant, supportCodec(), that checks for support of an
individual codec.

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodec):
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsAllCodecs):
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:

LayoutTests:

Update expected test output.

* platform/gtk/imported/w3c/web-platform-tests/media-source/mediasource-is-type-supported-expected.txt:

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

21 months agoREGRESSION (r224077): DeprecatedGlobalSettings::setAVKitEnabled() not protected by...
ddkilzer@apple.com [Fri, 27 Oct 2017 08:36:58 +0000 (08:36 +0000)]
REGRESSION (r224077): DeprecatedGlobalSettings::setAVKitEnabled() not protected by HAVE(AVKIT)

Unreviewed build fix.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Fix build.

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

21 months agoSkip some copy & paste tests I wrote on GTK since they're are known to timeout/slow.
rniwa@webkit.org [Fri, 27 Oct 2017 07:41:30 +0000 (07:41 +0000)]
Skip some copy & paste tests I wrote on GTK since they're are known to timeout/slow.

* platform/gtk/TestExpectations:

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

21 months agoWebDriver: unknown capabilities should produce an InvalidArgument error when validati...
carlosgc@webkit.org [Fri, 27 Oct 2017 07:13:11 +0000 (07:13 +0000)]
WebDriver: unknown capabilities should produce an InvalidArgument error when validating capabilities
https://bugs.webkit.org/show_bug.cgi?id=178868

Reviewed by Brian Burg.

7.2 Processing Capabilities
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-validate-capabilities

Fixes: imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_extensions

* WebDriverService.cpp:
(WebDriver::WebDriverService::validatedCapabilities const):

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

21 months agoWebDriver: deserializeTimeouts should fail if the value is not integer
carlosgc@webkit.org [Fri, 27 Oct 2017 07:11:56 +0000 (07:11 +0000)]
WebDriver: deserializeTimeouts should fail if the value is not integer
https://bugs.webkit.org/show_bug.cgi?id=178866

Reviewed by Brian Burg.

If value is not an integer, or it is less than 0 or greater than 2^64 – 1, return error with error code invalid
argument.
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-deserialize-as-a-timeout

Fixes: imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_values[timeouts-value59-body0]
       imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py::test_invalid_values[timeouts-value59-body1]

* WebDriverService.cpp:
(WebDriver::deserializeTimeouts):

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

21 months agoWebDriver: failing to process capabilities should produce InvalidArgument error not...
carlosgc@webkit.org [Fri, 27 Oct 2017 07:10:55 +0000 (07:10 +0000)]
WebDriver: failing to process capabilities should produce InvalidArgument error not SessionNotCreated
https://bugs.webkit.org/show_bug.cgi?id=178864

Reviewed by Brian Burg.

Fixes most of the tests in imported/w3c/webdriver/tests/sessions/new_session/invalid_capabilities.py.

7.2 Processing Capabilities
https://w3c.github.io/webdriver/webdriver-spec.html#processing-capabilities

* WebDriverService.cpp:
(WebDriver::WebDriverService::processCapabilities const):

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

21 months ago[GTK] Crash in WebCore::SelectionRangeData::apply
mcatanzaro@igalia.com [Fri, 27 Oct 2017 07:04:51 +0000 (07:04 +0000)]
[GTK] Crash in WebCore::SelectionRangeData::apply
https://bugs.webkit.org/show_bug.cgi?id=177808

Reviewed by Carlos Garcia Campos.

The problem appears to be a name collision between WebCore::SelectionData and
WebCore::SelectionData. Yes, those are the same names. It seems the destructor for a
Source/WebCore/platform/gtk/SelectionData.h SelectionData is being called on a
Source/WebCore/rendering/SelectionRangeData.cpp SelectionData. Yikes. Can you forgive the
poor linker for not being magic?

This fixes crashes in approximately one bajillion tests.

* rendering/SelectionRangeData.cpp: Move SelectionData into an anonymous namespace.

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

21 months ago[WinCairo] Fix build after WebCore moves to unified source.
commit-queue@webkit.org [Fri, 27 Oct 2017 06:18:45 +0000 (06:18 +0000)]
[WinCairo] Fix build after WebCore moves to unified source.
https://bugs.webkit.org/show_bug.cgi?id=178920

Added empty implementations to fix link error.

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-10-26
Reviewed by Ryosuke Niwa.

* platform/network/curl/DNSCurl.cpp:
(WebCore::DNSResolveQueue::updateIsUsingProxy):
(WebCore::DNSResolveQueue::platformResolve):

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

21 months agoImplement seek tolerance methods in WebAVPlayerController.
commit-queue@webkit.org [Fri, 27 Oct 2017 06:06:38 +0000 (06:06 +0000)]
Implement seek tolerance methods in WebAVPlayerController.
https://bugs.webkit.org/show_bug.cgi?id=178838
rdar://problem/33781777

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-10-26
Reviewed by Eric Carlson.

Source/WebCore:

No new tests because this doesn't change any behavior in the page, but exposes seek tolerance to fullscreen platform UI.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setCurrentTimeWithTolerance):
* html/HTMLMediaElement.h:
* platform/cocoa/PlaybackSessionModel.h:
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::seekToTime):
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController seekToTime:]):
(-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebAVPlayerController seekByTimeInterval:]):
(-[WebAVPlayerController seekByTimeInterval:toleranceBefore:toleranceAfter:]):
(-[WebAVPlayerController seekToBeginning:]):
(-[WebAVPlayerController seekToEnd:]):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::seekToTime):

Source/WebKit:

This implementes additional methods on WebAVPlayerController that allows AVKit more control over seeking.

* UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionModelContext::seekToTime):
(WebKit::PlaybackSessionManagerProxy::seekToTime):
* WebProcess/cocoa/PlaybackSessionManager.h:
* WebProcess/cocoa/PlaybackSessionManager.messages.in:
* WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionManager::seekToTime):

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

21 months ago[GTK][WPE] install-dependencies can't find libapache2-mod-php7.0 on Ubuntu 17.10
commit-queue@webkit.org [Fri, 27 Oct 2017 04:04:18 +0000 (04:04 +0000)]
[GTK][WPE] install-dependencies can't find libapache2-mod-php7.0 on Ubuntu 17.10
https://bugs.webkit.org/show_bug.cgi?id=178854

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-26
Reviewed by Michael Catanzaro.

Tools:

* Scripts/webkitpy/port/base.py:
(Port._debian_php_version): Return "-php7.1" if libphp7.1.so found.
(Port._is_debian_php_version_7): Deleted.
* gtk/install-dependencies: Install libapache2-mod-php instead of libapache2-mod-php7.0.
* wpe/install-dependencies: Ditto.

LayoutTests:

* http/conf/debian-httpd-2.2.conf: Removed.
* http/conf/debian-httpd-2.4-php7.0.conf: Renamed from LayoutTests/http/conf/debian-httpd-2.4-php7.conf.
* http/conf/debian-httpd-2.4-php7.1.conf: Copied from LayoutTests/http/conf/debian-httpd-2.4-php7.conf.

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

21 months agoFix Windows build
achristensen@apple.com [Fri, 27 Oct 2017 02:44:20 +0000 (02:44 +0000)]
Fix Windows build
https://bugs.webkit.org/show_bug.cgi?id=178892

* AccessibleBase.cpp:
(MSAARole):

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

21 months agoWeb Automation: denying user permission for getUserMedia doesn't work
bburg@apple.com [Fri, 27 Oct 2017 02:32:03 +0000 (02:32 +0000)]
Web Automation: denying user permission for getUserMedia doesn't work
https://bugs.webkit.org/show_bug.cgi?id=178895

Reviewed by Youenn Fablet.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
The ordering of special cases is incorrect. Safari configures its automation views to
allow mock devices and never prompt for them. These checks were before the check for
the automation session's getUserMedia permission. Switch these checks.

Also change the deny reason so that subsequent requests are also denied. This matches
behavior when a user denies a permission request on a real dialog. With this change,
the DOM error changes from SecurityError to NotAllowedError, which makes more sense.

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

21 months agoWeb Inspector: Canvas Tab: canvas path components from old page stick around when...
webkit@devinrousso.com [Fri, 27 Oct 2017 02:20:05 +0000 (02:20 +0000)]
Web Inspector: Canvas Tab: canvas path components from old page stick around when page is reloaded
https://bugs.webkit.org/show_bug.cgi?id=178806
<rdar://problem/35176360>

Reviewed by Brian Burg.

Source/WebInspectorUI:

Before this change, the CanvasCollection was regenerated each time the Canvas tab was
attached. This also caused the invisible TreeOutline, used for the path components and to
manage selection, to be reset as well. Whenever the page refreshed, however, the old
canvases, and associated recordings, were not removed. This patch reworks all of this logic
to create the CanvasCollection on construction of the tab and add/remove canvases as needed.

* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.canvasAdded):
(WI.CanvasManager.prototype.canvasRemoved):
(WI.CanvasManager.prototype._removeCanvas):
(WI.CanvasManager.prototype._mainResourceDidChange):
Replaced the "Cleared" event by instead firing "CanvasRemoved" for every tracked canvas. This
massively simplifies the logic for when the page navigates, as everything goes through a
single event listener.
Drive-by: changed existing event names to remove unnecessary words.
* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView):
(WI.CanvasTabContentView.prototype.attached):
(WI.CanvasTabContentView.prototype.detached):
(WI.CanvasTabContentView.prototype._addCanvas):
(WI.CanvasTabContentView.prototype._removeCanvas):
(WI.CanvasTabContentView.prototype._handleCanvasAdded):
(WI.CanvasTabContentView.prototype._handleCanvasRemoved):
(WI.CanvasTabContentView.prototype._canvasAdded): Deleted.
(WI.CanvasTabContentView.prototype._canvasRemoved): Deleted.
(WI.CanvasTabContentView.prototype._mainResourceDidChange): Deleted.
Rework logic for the way that the CanvasCollection is maintained. It is no longer
created/destroyed each time the view is attached/detached, and instead a diff is calculated
for the added/existing/removed canvases and the content views are added/removed as such.

* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._selectionPathComponentsChanged):
Drive-by: if an imported recording is selected on the Canvas Overview view, we should show it.
LayoutTests:

* inspector/canvas/context-attributes.html:
* inspector/canvas/resources/create-context-utilities.js:
(destroyCanvases):
(TestPage.registerInitializer.awaitCanvasAdded):
(TestPage.registerInitializer):
* inspector/canvas/resources/shaderProgram-utilities.js:
(deleteContext):
(TestPage.registerInitializer.window.addParentCanvasRemovedTestCase):
(TestPage.registerInitializer):

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

21 months agoUnreviewed, fix GCC warning spam after r224077
mcatanzaro@igalia.com [Fri, 27 Oct 2017 02:19:34 +0000 (02:19 +0000)]
Unreviewed, fix GCC warning spam after r224077
https://bugs.webkit.org/show_bug.cgi?id=178823

Need to leave a blank line at the bottom of the file.

* Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:

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

21 months agoUnreviewed, fix WPE build after r224074
mcatanzaro@igalia.com [Fri, 27 Oct 2017 02:02:35 +0000 (02:02 +0000)]
Unreviewed, fix WPE build after r224074
https://bugs.webkit.org/show_bug.cgi?id=178892

* accessibility/wpe/AccessibilityObjectWPE.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):

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

21 months agoWhen navigating back to a page, compositing layers may not use accelerated drawing
simon.fraser@apple.com [Fri, 27 Oct 2017 01:57:42 +0000 (01:57 +0000)]
When navigating back to a page, compositing layers may not use accelerated drawing
https://bugs.webkit.org/show_bug.cgi?id=178749
rdar://problem/35158946

Reviewed by Dean Jackson.
Source/WebCore:

There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
occurred on back navigation, related to the ordering of style recalcs and layout.

First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
its cacheAcceleratedCompositingFlags(), so any layers created during style update
didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().

Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
the TileController.

Test: compositing/accelerated-layers-after-back.html

* page/FrameView.cpp:
(WebCore::FrameView::updateCompositingLayersAfterLayout):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::willRecalcStyle):
(WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
* rendering/RenderLayerCompositor.h:

Source/WebKit:

Avoid assertions when a test enables accelerated drawing (which we can't support
in the iOS simulator).

* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::ensureBackingStore):

Tools:

Fix WTR and DRT to parse "useAcceleratedDrawing" out of "webkit-test-runner" options
and use it to set the state of the web view.

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

LayoutTests:

Moved iframes/resources/page-cache-helper.html up to compositing/resources/go-back.html.

* compositing/accelerated-layers-after-back-expected.txt: Added.
* compositing/accelerated-layers-after-back.html: Added.
* compositing/iframes/page-cache-layer-tree.html:
* compositing/page-cache-back-crash.html:
* compositing/resources/go-back.html: Renamed from LayoutTests/compositing/iframes/resources/page-cache-helper.html.
* platform/ios/compositing/accelerated-layers-after-back-expected.txt: Added.

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

21 months ago[Settings] Generate the bulk of WebPage::updatePreferences(...)
commit-queue@webkit.org [Fri, 27 Oct 2017 01:45:28 +0000 (01:45 +0000)]
[Settings] Generate the bulk of WebPage::updatePreferences(...)
https://bugs.webkit.org/show_bug.cgi?id=178823

Patch by Sam Weinig <sam@webkit.org> on 2017-10-26
Reviewed by Tim Horton.

* CMakeLists.txt:
* DerivedSources.make:
* WebKit.xcodeproj/project.pbxproj:

    Add new file generation.

* Scripts/GeneratePreferences.rb:

    Replace 'webkitOnly' boolean option with a new 'webcoreBinding' option.
    'webcoreBinding' supports the following values:
        - none (same as webkit only)
        - custom (means that you do bind to a webcore concept, but currently it must
          be done in a custom manner)
        - DeprecatedGlobalSettings (binds to a DeprecatedGlobalSettings setting)
        - RuntimeEnabledFeatures (binds to a RuntimeEnabledFeatures setting)
    If 'webcoreBinding' is not provided, the preference binds to WebCore Setting
    of either the same name or the override name provided by the new 'webcoreName'
    option (we should try to remove the need for 'webcoreName' by unifying with
    WebCore on preference/setting naming).

    A 'condition' option was also added to indicate that the preference is only available
    when that macro condition is true.

    Since we are generating most of WebPage::updatePreferences, we can simplify the
    macros in WebPreferencesDefinitions.h to only have normal/debug/experimental variants
    and remove the need for per-type macros, which were only used in WebPage::updatePreferences.

* Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb: Added.

    Generates bindings from WebPreferences to WebCore::Settings/DeprecatedGlobalSettings/RuntimeEnabledFeatures.
    Does not generate a binding if the 'webcoreBinding' option is set to either 'none' or 'custom'.

* Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:

    Simplify down to just normal/debug/experimental macros.

* Shared/WebPreferences.yaml:

    Annotate perferences with new optional 'webcoreBinding', 'webcoreName', and 'condition'
    options.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

    Replace a ton of hand written preference to settings bindings with a call to updatePreferencesGenerated().

* WebProcess/WebPage/WebPage.h:

    Add declaration of updatePreferencesGenerated, remove platformPreferencesDidChange.

* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformPreferencesDidChange): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformPreferencesDidChange): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformPreferencesDidChange): Deleted.
* WebProcess/WebPage/win/WebPageWin.cpp:
(WebKit::WebPage::platformPreferencesDidChange): Deleted.
* WebProcess/WebPage/wpe/WebPageWPE.cpp:
(WebKit::WebPage::platformPreferencesDidChange): Deleted.

    Remove all the empty platformPreferencesDidChange functions.

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

21 months agoFix Windows build
achristensen@apple.com [Fri, 27 Oct 2017 01:14:25 +0000 (01:14 +0000)]
Fix Windows build
https://bugs.webkit.org/show_bug.cgi?id=178892

* AccessibleBase.cpp:
(AccessibleBase::state const):
(MSAARole):

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

21 months agoFix Windows build
achristensen@apple.com [Fri, 27 Oct 2017 00:54:23 +0000 (00:54 +0000)]
Fix Windows build
https://bugs.webkit.org/show_bug.cgi?id=178892

* accessibility/win/AccessibilityObjectWin.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):

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

21 months agoModernize AccessibilityObject.h
achristensen@apple.com [Fri, 27 Oct 2017 00:37:06 +0000 (00:37 +0000)]
Modernize AccessibilityObject.h
https://bugs.webkit.org/show_bug.cgi?id=178892

Reviewed by Tim Horton.

The enums in AccessibilityObject.h are causing naming collisions with unified builds.
This is what enum classes are for.
HashMaps of enum classes still need a few casts to/from int.

I also made some RefPtr's Ref's, use some initializer lists instead of values in the constructor implementation, and indentation fixing.

No change in behavior.

* accessibility/AXObjectCache.cpp:
(WebCore::AXComputedObjectAttributeCache::getIgnored const):
(WebCore::AXObjectCache::~AXObjectCache):
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::notificationPostTimerFired):
* accessibility/AXObjectCache.h:
(WebCore::AXComputedObjectAttributeCache::CachedAXObjectAttributes::CachedAXObjectAttributes):
(WebCore::AXComputedObjectAttributeCache::getIgnored const):
* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addChildren):
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::parentRowGroup const):
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::headerObject):
* accessibility/AccessibilityAttachment.cpp:
(WebCore::AccessibilityAttachment::accessibilityText):
* accessibility/AccessibilityAttachment.h:
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::roleValue const):
(WebCore::AccessibilityImageMapLink::accessibilityText):
* accessibility/AccessibilityLabel.cpp:
(WebCore::childrenContainOnlyStaticText):
* accessibility/AccessibilityLabel.h:
* accessibility/AccessibilityList.cpp:
(WebCore::AccessibilityList::isUnorderedList const):
(WebCore::AccessibilityList::isOrderedList const):
(WebCore::AccessibilityList::determineAccessibilityRole):
(WebCore::AccessibilityList::roleValue const):
* accessibility/AccessibilityListBox.cpp:
(WebCore::AccessibilityListBox::setSelectedChildren):
(WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject const):
* accessibility/AccessibilityListBox.h:
* accessibility/AccessibilityListBoxOption.h:
* accessibility/AccessibilityMathMLElement.cpp:
(WebCore::AccessibilityMathMLElement::determineAccessibilityRole):
(WebCore::AccessibilityMathMLElement::isMathScriptObject const):
(WebCore::AccessibilityMathMLElement::isMathMultiscriptObject const):
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::accessibilityText):
(WebCore::AccessibilityMediaControl::roleValue const):
* accessibility/AccessibilityMediaControls.h:
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::addChildren):
* accessibility/AccessibilityMenuList.h:
* accessibility/AccessibilityMenuListOption.h:
* accessibility/AccessibilityMenuListPopup.cpp:
(WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject const):
* accessibility/AccessibilityMenuListPopup.h:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
(WebCore::AccessibilityNodeObject::determineAccessibilityRole):
(WebCore::AccessibilityNodeObject::canHaveChildren const):
(WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored const):
(WebCore::AccessibilityNodeObject::isSearchField const):
(WebCore::AccessibilityNodeObject::isImage const):
(WebCore::AccessibilityNodeObject::isPasswordField const):
(WebCore::AccessibilityNodeObject::isInputImage const):
(WebCore::AccessibilityNodeObject::isProgressIndicator const):
(WebCore::AccessibilityNodeObject::isSlider const):
(WebCore::AccessibilityNodeObject::isMenuRelated const):
(WebCore::AccessibilityNodeObject::isMenu const):
(WebCore::AccessibilityNodeObject::isMenuBar const):
(WebCore::AccessibilityNodeObject::isMenuButton const):
(WebCore::AccessibilityNodeObject::isMenuItem const):
(WebCore::AccessibilityNodeObject::isEnabled const):
(WebCore::AccessibilityNodeObject::isChecked const):
(WebCore::AccessibilityNodeObject::supportsRequiredAttribute const):
(WebCore::AccessibilityNodeObject::headingLevel const):
(WebCore::AccessibilityNodeObject::isHeading const):
(WebCore::AccessibilityNodeObject::isLink const):
(WebCore::AccessibilityNodeObject::isGroup const):
(WebCore::AccessibilityNodeObject::selectedRadioButton):
(WebCore::AccessibilityNodeObject::checkboxOrRadioValue const):
(WebCore::AccessibilityNodeObject::actionElement const):
(WebCore::AccessibilityNodeObject::alterSliderValue):
(WebCore::AccessibilityNodeObject::isGenericFocusableElement const):
(WebCore::AccessibilityNodeObject::menuElementForMenuButton const):
(WebCore::AccessibilityNodeObject::menuItemElementForMenu const):
(WebCore::AccessibilityNodeObject::titleElementText const):
(WebCore::AccessibilityNodeObject::alternativeText const):
(WebCore::AccessibilityNodeObject::visibleText const):
(WebCore::AccessibilityNodeObject::helpText const):
(WebCore::AccessibilityNodeObject::accessibilityText):
(WebCore::AccessibilityNodeObject::ariaLabeledByText const):
(WebCore::AccessibilityNodeObject::accessibilityDescription const):
(WebCore::AccessibilityNodeObject::roleIgnoresTitle const):
(WebCore::AccessibilityNodeObject::hierarchicalLevel const):
(WebCore::AccessibilityNodeObject::title const):
(WebCore::AccessibilityNodeObject::text const):
(WebCore::AccessibilityNodeObject::stringValue const):
(WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
(WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent const):
(WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::detach):
(WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
(WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
(WebCore::AccessibilityObject::isBlockquote const):
(WebCore::AccessibilityObject::isTextControl const):
(WebCore::AccessibilityObject::isARIATextControl const):
(WebCore::AccessibilityObject::isLandmark const):
(WebCore::AccessibilityObject::findMatchingObjects):
(WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
(WebCore::AccessibilityObject::selectText):
(WebCore::AccessibilityObject::isARIAInput):
(WebCore::AccessibilityObject::isARIAControl):
(WebCore::AccessibilityObject::isRangeControl const):
(WebCore::AccessibilityObject::visiblePositionForBounds const):
(WebCore::AccessibilityObject::supportsARIAReadOnly const):
(WebCore::AccessibilityObject::ariaReadOnlyValue const):
(WebCore::AccessibilityObject::headingElementForNode):
(WebCore::AccessibilityObject::ariaTreeRows):
(WebCore::AccessibilityObject::ariaTreeItemContent):
(WebCore::AccessibilityObject::ariaTreeItemDisclosedRows):
(WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
(WebCore::AccessibilityObject::actionVerb const):
(WebCore::AccessibilityObject::ariaCurrentState const):
(WebCore::AccessibilityObject::ariaCurrentValue const):
(WebCore::AccessibilityObject::orientation const):
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::ariaRoleToWebCoreRole):
(WebCore::AccessibilityObject::computedRoleString const):
(WebCore::AccessibilityObject::supportsPressAction const):
(WebCore::AccessibilityObject::sortDirection const):
(WebCore::AccessibilityObject::supportsExpanded const):
(WebCore::AccessibilityObject::isExpanded const):
(WebCore::AccessibilityObject::supportsChecked const):
(WebCore::AccessibilityObject::checkboxOrRadioValue const):
(WebCore::AccessibilityObject::scrollByPage const):
(WebCore::AccessibilityObject::lastKnownIsIgnoredValue):
(WebCore::AccessibilityObject::setLastKnownIsIgnoredValue):
(WebCore::AccessibilityObject::buttonRoleType const):
(WebCore::AccessibilityObject::isButton const):
(WebCore::AccessibilityObject::accessibilityIsIgnoredByDefault const):
(WebCore::AccessibilityObject::defaultObjectInclusion const):
(WebCore::AccessibilityObject::accessibilityIsIgnored const):
(WebCore::AccessibilityObject::isContainedByPasswordField const):
(WebCore::AccessibilityObject::AccessibilityObject): Deleted.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityText::AccessibilityText):
(WebCore::AccessibilityIsIgnoredFromParentData::AccessibilityIsIgnoredFromParentData):
(WebCore::AccessibilityObject::isImageMap const):
(WebCore::AccessibilityObject::isWebArea const):
(WebCore::AccessibilityObject::isCheckbox const):
(WebCore::AccessibilityObject::isRadioButton const):
(WebCore::AccessibilityObject::isListBox const):
(WebCore::AccessibilityObject::isSpinButton const):
(WebCore::AccessibilityObject::isSwitch const):
(WebCore::AccessibilityObject::isToggleButton const):
(WebCore::AccessibilityObject::isTabList const):
(WebCore::AccessibilityObject::isTabItem const):
(WebCore::AccessibilityObject::isRadioGroup const):
(WebCore::AccessibilityObject::isComboBox const):
(WebCore::AccessibilityObject::isTree const):
(WebCore::AccessibilityObject::isTreeGrid const):
(WebCore::AccessibilityObject::isTreeItem const):
(WebCore::AccessibilityObject::isScrollbar const):
(WebCore::AccessibilityObject::isListItem const):
(WebCore::AccessibilityObject::isScrollView const):
(WebCore::AccessibilityObject::isCanvas const):
(WebCore::AccessibilityObject::isPopUpButton const):
(WebCore::AccessibilityObject::isColorWell const):
(WebCore::AccessibilityObject::isSplitter const):
(WebCore::AccessibilityObject::isToolbar const):
(WebCore::AccessibilityObject::isSummary const):
(WebCore::AccessibilityObject::isStaticText const):
(WebCore::AccessibilityObject::ariaRoleAttribute const):
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
* accessibility/AccessibilityProgressIndicator.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::parentObject const):
(WebCore::AccessibilityRenderObject::isAttachment const):
(WebCore::AccessibilityRenderObject::helpText const):
(WebCore::AccessibilityRenderObject::stringValue const):
(WebCore::AccessibilityRenderObject::addRadioButtonGroupChildren const):
(WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers const):
(WebCore::AccessibilityRenderObject::linkedUIElements const):
(WebCore::AccessibilityRenderObject::isAllowedChildOfTree const):
(WebCore::objectInclusionFromAltText):
(WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
(WebCore::AccessibilityRenderObject::selectedTextRange const):
(WebCore::AccessibilityRenderObject::isTabItemSelected const):
(WebCore::AccessibilityRenderObject::isFocused const):
(WebCore::AccessibilityRenderObject::setSelectedRows):
(WebCore::AccessibilityRenderObject::getDocumentLinks):
(WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
(WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
(WebCore::AccessibilityRenderObject::supportsExpandedTextValue const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::orientation const):
(WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
(WebCore::AccessibilityRenderObject::ariaRoleHasPresentationalChildren const):
(WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
(WebCore::AccessibilityRenderObject::addImageMapChildren):
(WebCore::AccessibilityRenderObject::addTextFieldChildren):
(WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
(WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic const):
(WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
(WebCore::AccessibilityRenderObject::ariaListboxSelectedChildren):
(WebCore::AccessibilityRenderObject::selectedChildren):
(WebCore::AccessibilityRenderObject::visibleChildren):
(WebCore::AccessibilityRenderObject::tabChildren):
(WebCore::AccessibilityRenderObject::actionVerb const):
(WebCore::msaaRoleForRenderer):
(WebCore::AccessibilityRenderObject::roleValueForMSAA const):
* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::accessibilityText):
(WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
(WebCore::AccessibilitySVGElement::inheritsPresentationalRole const):
(WebCore::AccessibilitySVGElement::determineAriaRoleAttribute const):
(WebCore::AccessibilitySVGElement::determineAccessibilityRole):
* accessibility/AccessibilitySVGRoot.h:
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::scrollBar):
* accessibility/AccessibilityScrollView.h:
* accessibility/AccessibilityScrollbar.cpp:
(WebCore::AccessibilityScrollbar::orientation const):
* accessibility/AccessibilityScrollbar.h:
* accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::orientation const):
(WebCore::AccessibilitySlider::addChildren):
* accessibility/AccessibilitySlider.h:
* accessibility/AccessibilitySpinButton.cpp:
(WebCore::AccessibilitySpinButton::addChildren):
* accessibility/AccessibilitySpinButton.h:
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::hasARIARole const):
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::headerContainer):
(WebCore::AccessibilityTable::roleValue const):
(WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
(WebCore::AccessibilityTable::titleElementText const):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored const):
(WebCore::AccessibilityTableCell::determineAccessibilityRole):
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::headerObject):
* accessibility/AccessibilityTableColumn.h:
* accessibility/AccessibilityTableHeaderContainer.h:
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::determineAccessibilityRole):
(WebCore::AccessibilityTableRow::computeAccessibilityIsIgnored const):
* accessibility/AccessibilityTree.cpp:
(WebCore::AccessibilityTree::determineAccessibilityRole):
* accessibility/ios/AccessibilityObjectIOS.mm:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
(WebCore::AccessibilityObject::isInputTypePopupButton const):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
(-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
(-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
(-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
(-[WebAccessibilityObjectWrapper _accessibilityTextEntryTraits]):
(-[WebAccessibilityObjectWrapper accessibilityTraits]):
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
(-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
(-[WebAccessibilityObjectWrapper accessibilityLabel]):
(-[WebAccessibilityObjectWrapper accessibilityValue]):
(-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):
(-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
(-[WebAccessibilityObjectWrapper accessibilityLinkedElement]):
(-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
(-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
(-[WebAccessibilityObjectWrapper accessibilitySortDirection]):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
(-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
(createAccessibilitySearchKeyMap):
(accessibilitySearchKeyForString):
(accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute):
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(createAccessibilityRoleMap):
(roleValueToNSString):
(-[WebAccessibilityObjectWrapper role]):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper roleDescription]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

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

21 months ago[iOS] Update expected results for writing-mode tests
mmaxfield@apple.com [Fri, 27 Oct 2017 00:34:23 +0000 (00:34 +0000)]
[iOS] Update expected results for writing-mode tests
https://bugs.webkit.org/show_bug.cgi?id=178916
<rdar://problem/33250084>

Unreviewed.

* platform/ios/TestExpectations:
* platform/ios/fast/writing-mode/border-vertical-lr-expected.txt:
* platform/ios/fast/writing-mode/japanese-lr-text-expected.txt:
* platform/ios/fast/writing-mode/japanese-rl-text-expected.txt:
* platform/ios/fast/writing-mode/japanese-ruby-horizontal-bt-expected.txt:
* platform/ios/fast/writing-mode/japanese-ruby-vertical-lr-expected.txt:
* platform/ios/fast/writing-mode/japanese-ruby-vertical-rl-expected.txt:
* platform/ios/fast/writing-mode/vertical-align-table-baseline-expected.txt:
* platform/ios/fast/writing-mode/vertical-baseline-alignment-expected.txt:

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

21 months agoREGRESSION(r222601): We fail to properly backtrack into a sub pattern of a parenthesi...
msaboff@apple.com [Fri, 27 Oct 2017 00:31:50 +0000 (00:31 +0000)]
REGRESSION(r222601): We fail to properly backtrack into a sub pattern of a parenthesis with non-zero minimum
https://bugs.webkit.org/show_bug.cgi?id=178890

Reviewed by Keith Miller.

JSTests:

New regression test.

* stress/regress-178890.js: Added.

Source/JavaScriptCore:

We need to let a contained subpattern backtrack before declaring that the containing
parenthesis doesn't match.  If the subpattern fails to match backtracking, then we
can check to see if we trying to backtrack below the minimum match count.

* yarr/YarrInterpreter.cpp:
(JSC::Yarr::Interpreter::backtrackParentheses):

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

21 months agoMove WKWebViewConfiguration validation to WKWebView construction
achristensen@apple.com [Thu, 26 Oct 2017 23:59:59 +0000 (23:59 +0000)]
Move WKWebViewConfiguration validation to WKWebView construction
https://bugs.webkit.org/show_bug.cgi?id=178840

Reviewed by Tim Horton.
Source/WebKit:

I'm trying to remove WKWebViewConfigurationInternal methods so I can make WKWebViewConfiguration
a wrapper around an APIObject like all the other API objects.  A small step towards making this easier
is to remove the unnecessary method _validate and move its logic to its one callsite.  I added an API test
that ensures no change in behavior.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _validate]): Deleted.
* UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewConfiguration.mm: Added.
(TEST):

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

21 months agoimportScripts in service worker should use ServiceWorkersMode::None
commit-queue@webkit.org [Thu, 26 Oct 2017 23:50:35 +0000 (23:50 +0000)]
importScripts in service worker should use ServiceWorkersMode::None
https://bugs.webkit.org/show_bug.cgi?id=178888

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-26
Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/workers/service/service-worker-importScript.html

Made sure ServiceWorkersMode::None is used for loading scripts in service workers as we do not support foreign fetch.

* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):

LayoutTests:

* http/tests/workers/service/resources/service-worker-importScript-worker.js: Added.
* http/tests/workers/service/resources/service-worker-importScript.js: Added.
* http/tests/workers/service/service-worker-importScript-expected.txt: Added.
* http/tests/workers/service/service-worker-importScript.html: Added.

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

21 months agoUnreviewed, cleanup changelogs.
keith_miller@apple.com [Thu, 26 Oct 2017 23:44:27 +0000 (23:44 +0000)]
Unreviewed, cleanup changelogs.

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

21 months agoRemove unneeded block selection calculation code
megan_gardner@apple.com [Thu, 26 Oct 2017 23:42:37 +0000 (23:42 +0000)]
Remove unneeded block selection calculation code
https://bugs.webkit.org/show_bug.cgi?id=178889

Reviewed by Tim Horton.

Removing more block selection code. Much of this should have been removed
before, as the only things that were using these functions were removed in the
last patch. Also remove the code decided if you should move to block mode or not,
as the answer now is always NO.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateSelectionWithTouches):
(WebKit::WebPage::rangeForBlockAtPoint): Deleted.
(WebKit::distanceBetweenRectsForPosition): Deleted.
(WebKit::rectsEssentiallyTheSame): Deleted.
(WebKit::unionDOMRanges): Deleted.
(WebKit::computeEdgeCenter): Deleted.
(WebKit::WebPage::expandedRangeFromHandle): Deleted.
(WebKit::WebPage::contractedRangeFromHandle): Deleted.
(WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted.
(WebKit::WebPage::switchToBlockSelectionAtPoint): Deleted.
(WebKit::WebPage::shouldSwitchToBlockModeForHandle): Deleted.

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

21 months agoWeb Inspector: Canvas Tab: canvases overview should support navigation via keyboard
webkit@devinrousso.com [Thu, 26 Oct 2017 23:41:23 +0000 (23:41 +0000)]
Web Inspector: Canvas Tab: canvases overview should support navigation via keyboard
https://bugs.webkit.org/show_bug.cgi?id=178800
<rdar://problem/35175856>

Reviewed by Brian Burg.

Create a KeyboardShorcut for each of the following:
 - Up: selects the previous canvas in the selected column
 - Down: selects the next canvas in the selected column
 - Right: selects the next canvas in the selected row
 - Left: selects the previous canvas in the selected row
 - Space: toggle recording of the selected canvas
 - Shift+Space: toggle single-frame recording of the selected canvas

The calculation for selected row/colum is based on the `offsetWidth` of the parent element
and the selected item's content view element. Since this view uses a flexbox, all of the
items are expected to have the same dimensions, meaning that this value is uniform. The
intended functionality is that of a spreadsheet, where pressing pressing left/right will
never change the selected row and up/down will never change the selected column.

* UserInterface/Views/CanvasOverviewContentView.css:
(.content-view.canvas-overview):
(.content-view.canvas-overview .content-view.canvas):
Move margin value to a CSS variable so that it can be easily retrieved via JavaScript.

* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView):
(WI.CanvasOverviewContentView.prototype.contentViewAdded):
(WI.CanvasOverviewContentView.prototype.contentViewRemoved):
(WI.CanvasOverviewContentView.prototype.attached):
(WI.CanvasOverviewContentView.prototype.detached):
(WI.CanvasOverviewContentView.prototype.get _itemMargin):
(WI.CanvasOverviewContentView.prototype._changeSelectedItemVertically):
(WI.CanvasOverviewContentView.prototype._changeSelectedItemHorizontally):
(WI.CanvasOverviewContentView.prototype._updateNavigationItems):
(WI.CanvasOverviewContentView.prototype._handleUp):
(WI.CanvasOverviewContentView.prototype._handleRight):
(WI.CanvasOverviewContentView.prototype._handleDown):
(WI.CanvasOverviewContentView.prototype._handleLeft):
(WI.CanvasOverviewContentView.prototype._handleSpace):
(WI.CanvasOverviewContentView.prototype._supplementalRepresentedObjectsDidChange):
Drive-by: call `_updateNavigationItems` whenever an item is added/removed so that if there
are no items the navigation items cannot be clicked.

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

21 months agoImplement ServiceWorkerContainer getRegistration
commit-queue@webkit.org [Thu, 26 Oct 2017 23:37:32 +0000 (23:37 +0000)]
Implement ServiceWorkerContainer getRegistration
https://bugs.webkit.org/show_bug.cgi?id=178882

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-26

* TestExpectations: Skipping service worker tests until they can produce results.

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

21 months agoDemonstrate a possible structure of the WebGPU API
mmaxfield@apple.com [Thu, 26 Oct 2017 23:32:10 +0000 (23:32 +0000)]
Demonstrate a possible structure of the WebGPU API
https://bugs.webkit.org/show_bug.cgi?id=178874

Reviewed by Dean Jackson.

Over the past few weeks, we've been putting together an example showing that a WebGPU API
which has implicit barriers can work on all three low-level graphics APIs. We've implemented
it on top of Vulkan first, because this is the API which has the strictest requirements and
is most difficult to use.

With this API, this is a valid WebGPU snippet:

auto device = WebGPU::Device::create(hInstance, hWnd);
auto& commandQueue = device->getCommandQueue();
auto& renderState = device->getRenderState(vertexShader, "main", fragmentShader, "main", { }, { }, { }, nullptr);

… later, in the draw() function …

auto renderPass = commandQueue->createRenderPass(nullptr);
renderPass->setRenderState(renderState);
renderPass->setViewport(0, 0, width, height);
renderPass->setScissorRect(0, 0, width, height);
renderPass->draw(3);
commandQueue->commitRenderPass(std::move(renderPass));
commandQueue->present();

This snippet doesn’t hook up any vertex attributes or resources, which means the vertex
shader has to say something like ({vec4(…), vec4(…), vec4(…)})[gl_VertexIndex]. It also
passes in “nullptr” when creating the render pass, which means “render to the screen, rather
than to a frame buffer.” You can also see that it doesn’t attach any resources to the draw
call.

In Direct3D 12 and Vulkan, resources are bound in sets, rather than individually. For
example, a set might contain two uniform buffers, a texture, and another uniform buffer. At
draw time, you swap in whole sets of resources with a single call. A shader invocation can
access a collection of sets. Because all shader resource accesses are indirected through
these sets, the shape of these sets needs to be supplied at the time you compile the render
state. Here is a snippet which bounds a single set which contains a uniform buffer and a
texture:

auto buffer = device->getBuffer(bufferInitialContents);
auto texture = device->getTexture(buffer width, height, WebGPU::PixelFormat::RGBA8, textureInitialContents);
// One resource set, which holds a single uniform buffer object and a single texture
auto& renderState = device->getRenderState(vertexShader, "main", fragmentShader, "main", { }, { }, { { WebGPU::ResourceType::UniformBufferObject, WebGPU::ResourceType::Texture } }, nullptr);

… later, in the draw() function …

auto renderPass = commandQueue->createRenderPass(nullptr);
renderPass->setRenderState(renderState);
renderPass->setResources(0, { WebGPU::UniformBufferObjectReference(buffer.get()), WebGPU::TextureReference(texture.get()) });

renderPass->draw(3);
commandQueue->commitRenderPass(std::move(renderPass));
commandQueue->present();

The first argument to the setResources() call identifies which set to populate with the supplied resources.

One tenant of the low-level graphics APIs is that, if you’ve enabled double buffering (or
triple buffering), the GPU is executing one frame at the same time you are recording the
next frame. This often means that you need duplicate resources so the CPU and GPU don’t step
on each other’s toes. However, platforms have platform-specific requirements about whether
or not they can be double / triple buffered, and we don’t want to expose this to the Web for
fear of badly-authored programs.

To solve this, resources are reference counted, and the return type of getBuffer() is an
RAII type called BufferHolder which increments and decrements the reference count
automatically. The reference count is also incremented and decremented when the GPU is using
the resource in a Pass. When the reference count reaches 0, the resource isn’t destroyed;
instead, it’s simply moved to a “free list” which getBuffer() may pull from. Therefore,
applications don’t need to know whether the frame buffer is double buffered or triple
buffered; they can just getBuffer() each frame, and the correct number of buffers will be
created and recycled.

{
    auto buffer = device->getBuffer(bufferSize); // These get recycled
    … populate the buffer …
    auto renderPass = commandQueue->createRenderPass(nullptr);
    renderPass->setRenderState(renderState);
    renderPass->setResources(0, { WebGPU::UniformBufferObjectReference(buffer.get()) });
    …
    renderPass->draw(…);
    commandQueue->commitRenderPass(std::move(renderPass));
}
commandQueue->present();

In Direct3D and Vulkan, vertex buffers and index buffers are not part of the resource sets
mentioned above. Instead, you tell the render state about the shape of the vertex and index
buffers, and you swap them out independently in the draw loop. Metal and Vulkan have almost
identical API to specify this shape of the vertex buffers, so I’ve mostly copied it. In this
example, we have two vertex attributes, a vec2 and a vec3, which both come from the same
buffer:

// { Attribute format, offset within stride, buffer to pull from }
std::vector<WebGPU::RenderState::VertexAttribute> vertexAttributes = { {WebGPU::RenderState::VertexFormat::Float2, 0, 0}, {WebGPU::RenderState::VertexFormat::Float3, sizeof(float) * 2, 0} };
// A single vertex buffer, with a stride of 5 floats
auto& renderState = device->getRenderState(vertexShader, "main", fragmentShader, "main", { sizeof(float) * 5 }, vertexAttributes, resourceTypes, nullptr);

… later, in the draw() function …

auto renderPass = commandQueue->createRenderPass(nullptr);
renderPass->setRenderState(renderState);
renderPass->setVertexAttributeBuffers({ vertexBuffer.get() }); // The one vertex buffer which both attributes pull from
renderPass->setResources(…);

renderPass->draw(…);
commandQueue->commitRenderPass(std::move(renderPass));
commandQueue->present();

You can also tell the RenderState about how many render targets you have and their formats,
and then when you create the RenderPass, you specify the specific textures you want to
render into.

std::vector<WebGPU::PixelFormat> colorPixelFormats = { WebGPU::PixelFormat::RGBA8, WebGPU::PixelFormat::RGBA8 }; // Two render targets, with these formats
auto& renderState = device->getRenderState(vertexShader, "main", fragmentShader, "main", vertexBufferStrides, vertexAttributes, resourceTypes, &colorPixelFormats);

… later, in the draw() function …

std::vector<std::reference_wrapper<WebGPU::Texture>> destinationTextures = { texture1->get(), texture2->get() };
auto renderPass = commandQueue->createRenderPass(&destinationTextures);
renderPass->setRenderState(renderState);

renderPass->draw(…);
commandQueue->commitRenderPass(std::move(renderPass));

// Now, draw one of the textures to the screen. Note that no synchronization is necessary here!
auto renderPass = commandQueue->createRenderPass(nullptr);
renderPass->setRenderState(renderState2);
renderPass->setResources(0, { WebGPU:: TextureReference(texture1.get()) });

renderPass->draw(…);
commandQueue->commitRenderPass(std::move(renderPass));
commandQueue->present();

Just like how in Metal has Render Encoders and Compute Encoders, WebGPU has RenderPasses
and ComputePasses.

auto& computeState = device->getComputeState(computeShader, "main", resourceTypes);

auto computePass = commandQueue->createComputePass();
computePass->setComputeState(computeState);
computePass->setResources(0, resources);
computePass->dispatch(width, height, depth);
commandQueue->commitComputePass(std::move(computePass));

// Now, draw the resources we just computed. Note that no synchronization is necessary here!
auto renderPass = commandQueue->createRenderPass(nullptr);
renderPass->setRenderState(renderState);
renderPass->setResources(0, resources });

renderPass->draw(…);
commandQueue->commitRenderPass(std::move(renderPass));
commandQueue->present();

There are also two other types of passes: one that corresponds to a Metal blit encoder, and
one that allows the CPU to change the contents of GPU buffers and textures. This last kind
of pass is a little interesting: you can’t just change the contents of a buffer at any time
you feel like it, because that resource might be in use by the GPU. Therefore, we need to do
the same kind of synchronization that we already do at render pass boundaries.

In addition, both Vulkan and Direct3D have a concept of a memory heap. A resource might
exist inside a heap which is fast, but invisible from the CPU, or in a heap which is slow,
but visible by the CPU. Certain operations are not possible from some types of images (e.g.
non-tiled textures may not be able to be sampled from). The usual way to get around this
problem is to have two resources: a slow staging resource which the CPU can see, and a fast
resource which the CPU can’t see. Uploading data is a two-pass algorithm, where the CPU
memcpy()s into the slow staging resource, and then a blit command is enqueued on the GPU to
copy the contents of the staging resource to the real resource. This requires that the
upload have access to the commandQueue so it can possibly enqueue a blit between the staging
and real resources. Therefore, a pass is the right level of abstraction for these facilities.

std::queue<boost::unique_future<std::vector<uint8_t>>> futureQueue; // Promises for data downloads from the GPU

… later, in the draw() function …

// See if any of the previously-enqueued downloads are finished
while (!futureQueue.empty() && futureQueue.front(). has_value()) {
    std::vector<uint8_t>& data = futureQueue.front().get();
    // Use the downloaded data
    futureQueue.pop();
}

auto hostAccessPass = commandQueue->createHostAccessPass();
hostAccessPass->overwriteBuffer(buffer->get(), bufferContents); // Upload data to a resource

futureQueue.emplace(hostAccessPass->getBufferContents(buffer->get()));
commandQueue->commitHostAccessPass(std::move(hostAccessPass));

You can also issue copy commands between resources entirely on the GPU:

auto blitPass = commandQueue->createBlitPass();
blitPass->copyTexture(source->get(), destination->get(), sourceX, sourceY, destinationX, destinationY, width, height);
commandQueue->commitBlitPass(std::move(blitPass));

* Scripts/webkitpy/style/checker.py:
* WebGPUAPIStructure/Example/Example.cpp: Added.
(readFile):
(drawWebGPU):
(wWinMain):
(MyRegisterClass):
(InitInstance):
(WndProc):
* WebGPUAPIStructure/Example/Example.h: Added.
* WebGPUAPIStructure/Example/Example.ico: Added.
* WebGPUAPIStructure/Example/Example.rc: Added.
* WebGPUAPIStructure/Example/Example.vcxproj: Added.
* WebGPUAPIStructure/Example/Example.vcxproj.filters: Added.
* WebGPUAPIStructure/Example/Example.vcxproj.user: Added.
* WebGPUAPIStructure/Example/resource.h: Added.
* WebGPUAPIStructure/Example/small.ico: Added.
* WebGPUAPIStructure/Example/stdafx.cpp: Added.
* WebGPUAPIStructure/Example/stdafx.h: Added.
* WebGPUAPIStructure/Example/targetver.h: Added.
* WebGPUAPIStructure/WebGPU-Common/WebGPU-Common.vcxproj: Added.
* WebGPUAPIStructure/WebGPU-Common/WebGPU-Common.vcxproj.filters: Added.
* WebGPUAPIStructure/WebGPU-Common/WebGPU.cpp: Added.
(WebGPU::BufferHolder::BufferHolder):
(WebGPU::BufferHolder::~BufferHolder):
(WebGPU::TextureHolder::TextureHolder):
(WebGPU::TextureHolder::~TextureHolder):
(WebGPU::SamplerHolder::SamplerHolder):
(WebGPU::SamplerHolder::~SamplerHolder):
* WebGPUAPIStructure/WebGPU-Common/WebGPU.h: Added.
(WebGPU::Queue::~Queue):
(WebGPU::RenderState::~RenderState):
(WebGPU::ComputeState::~ComputeState):
(WebGPU::Buffer::~Buffer):
(WebGPU::Texture::~Texture):
(WebGPU::Sampler::~Sampler):
(WebGPU::TextureReference::TextureReference):
(WebGPU::TextureReference::get const):
(WebGPU::SamplerReference::SamplerReference):
(WebGPU::SamplerReference::get const):
(WebGPU::UniformBufferObjectReference::UniformBufferObjectReference):
(WebGPU::UniformBufferObjectReference::get const):
(WebGPU::ShaderStorageBufferObjectReference::ShaderStorageBufferObjectReference):
(WebGPU::ShaderStorageBufferObjectReference::get const):
(WebGPU::RenderPass::~RenderPass):
(WebGPU::ComputePass::~ComputePass):
(WebGPU::BlitPass::~BlitPass):
(WebGPU::HostAccessPass::~HostAccessPass):
(WebGPU::BufferHolder::get):
(WebGPU::TextureHolder::get):
(WebGPU::SamplerHolder::get):
(WebGPU::Device::~Device):
* WebGPUAPIStructure/WebGPU-Vulkan/BlitPassImpl.cpp: Added.
(WebGPU::BlitPassImpl::BlitPassImpl):
(WebGPU::BlitPassImpl::copyTexture):
* WebGPUAPIStructure/WebGPU-Vulkan/BlitPassImpl.h: Added.
* WebGPUAPIStructure/WebGPU-Vulkan/BufferImpl.cpp: Added.
(WebGPU::BufferImpl::BufferImpl):
(WebGPU::BufferImpl::decrementReferenceCount):
* WebGPUAPIStructure/WebGPU-Vulkan/BufferImpl.h: Added.
(WebGPU::BufferImpl::getBuffer const):
(WebGPU::BufferImpl::getDeviceMemory const):
(WebGPU::BufferImpl::incrementReferenceCount):
(WebGPU::BufferImpl::getLength const):
* WebGPUAPIStructure/WebGPU-Vulkan/ComputePassImpl.cpp: Added.
(WebGPU::ComputePassImpl::ComputePassImpl):
(WebGPU::ComputePassImpl::setComputeState):
(WebGPU::ComputePassImpl::setResources):
(WebGPU::ComputePassImpl::dispatch):
* WebGPUAPIStructure/WebGPU-Vulkan/ComputePassImpl.h: Added.
* WebGPUAPIStructure/WebGPU-Vulkan/ComputeStateImpl.cpp: Added.
(WebGPU::ComputeStateImpl::ComputeStateImpl):
* WebGPUAPIStructure/WebGPU-Vulkan/ComputeStateImpl.h: Added.
(WebGPU::ComputeStateImpl::getPipeline const):
(WebGPU::ComputeStateImpl::getPipelineLayout const):
(WebGPU::ComputeStateImpl::getDescriptorSetLayouts const):
* WebGPUAPIStructure/WebGPU-Vulkan/DeviceImpl.cpp: Added.
(WebGPU::Device::create):
(WebGPU::convertPixelFormat):
(WebGPU::convertFormat):
(WebGPU::debugReport):
(WebGPU::DeviceImpl::DeviceImpl):
(WebGPU::DeviceImpl::getCommandQueue):
(WebGPU::DeviceImpl::prepareShader):
(WebGPU::DeviceImpl::createPipelineLayout):
(WebGPU::DeviceImpl::createCompatibleRenderPass):
(WebGPU::convertVertexFormat):
(WebGPU::DeviceImpl::getRenderState):
(WebGPU::DeviceImpl::getComputeState):
(WebGPU::DeviceImpl::getBuffer):
(WebGPU::DeviceImpl::returnBuffer):
(WebGPU::DeviceImpl::getTexture):
(WebGPU::DeviceImpl::returnTexture):
(WebGPU::DeviceImpl::getSampler):
(WebGPU::DeviceImpl::returnSampler):
(WebGPU::DeviceImpl::~DeviceImpl):
* WebGPUAPIStructure/WebGPU-Vulkan/DeviceImpl.h: Added.
(WebGPU::DeviceImpl::UniqueDebugReportCallbackEXT::UniqueDebugReportCallbackEXT):
(WebGPU::DeviceImpl::UniqueDebugReportCallbackEXT::operator=):
(WebGPU::DeviceImpl::UniqueDebugReportCallbackEXT::~UniqueDebugReportCallbackEXT):
(WebGPU::DeviceImpl::UniqueDebugReportCallbackEXT::destroy):
(WebGPU::DeviceImpl::TextureParameters::operator== const):
(WebGPU::DeviceImpl::TextureParametersHash::operator() const):
* WebGPUAPIStructure/WebGPU-Vulkan/HostAccessPassImpl.cpp: Added.
(WebGPU::HostAccessPassImpl::HostAccessPassImpl):
(WebGPU::HostAccessPassImpl::overwriteBuffer):
(WebGPU::HostAccessPassImpl::getBufferContents):
(WebGPU::HostAccessPassImpl::execute):
* WebGPUAPIStructure/WebGPU-Vulkan/HostAccessPassImpl.h: Added.
(WebGPU::HostAccessPassImpl::getFinishedEvent const):
* WebGPUAPIStructure/WebGPU-Vulkan/PassImpl.cpp: Added.
(WebGPU::PassImpl::PassImpl):
(WebGPU::ResourceVisitor::operator()):
(WebGPU::ResourceVisitor::getBindings const):
(WebGPU::ResourceVisitor::releaseWriteDescriptorSets):
(WebGPU::ResourceVisitor::getDescriptorImageInfos const):
(WebGPU::ResourceVisitor::getDescriptorBufferInfos const):
(WebGPU::ResourceVisitor::getBuffers const):
(WebGPU::ResourceVisitor::getTextures const):
(WebGPU::ResourceVisitor::getSamplers const):
(WebGPU::ResourceVisitor::getImageCount const):
(WebGPU::ResourceVisitor::getSamplerCount const):
(WebGPU::ResourceVisitor::getUniformBufferCount const):
(WebGPU::ResourceVisitor::getStorageBufferCount const):
(WebGPU::PassImpl::setResources):
(WebGPU::PassImpl::insertBuffer):
(WebGPU::PassImpl::insertTexture):
(WebGPU::PassImpl::insertSampler):
* WebGPUAPIStructure/WebGPU-Vulkan/PassImpl.h: Added.
(WebGPU::PassImpl::getCommandBuffer const):
(WebGPU::PassImpl::iterateBuffers):
(WebGPU::PassImpl::iterateTextures):
(WebGPU::PassImpl::ResourceReference::ResourceReference):
(WebGPU::PassImpl::ResourceReference::~ResourceReference):
(WebGPU::PassImpl::ResourceReference::operator=):
(WebGPU::PassImpl::ResourceReference::operator== const):
(WebGPU::PassImpl::ResourceReference::get const):
(WebGPU::PassImpl::ResourceReference::release):
(WebGPU::PassImpl::ResourceReferenceHash::operator() const):
* WebGPUAPIStructure/WebGPU-Vulkan/QueueImpl.cpp: Added.
(WebGPU::QueueImpl::QueueImpl):
(WebGPU::QueueImpl::prepareCurrentFrame):
(WebGPU::QueueImpl::createSpecificRenderPass):
(WebGPU::QueueImpl::createFramebuffer):
(WebGPU::QueueImpl::createRenderPass):
(WebGPU::QueueImpl::commitRenderPass):
(WebGPU::QueueImpl::createComputePass):
(WebGPU::QueueImpl::commitComputePass):
(WebGPU::QueueImpl::createBlitPass):
(WebGPU::QueueImpl::commitBlitPass):
(WebGPU::QueueImpl::createHostAccessPass):
(WebGPU::QueueImpl::commitHostAccessPass):
(WebGPU::QueueImpl::present):
(WebGPU::QueueImpl::commitPass):
(WebGPU::QueueImpl::synchronizeResources):
(WebGPU::QueueImpl::~QueueImpl):
* WebGPUAPIStructure/WebGPU-Vulkan/QueueImpl.h: Added.
* WebGPUAPIStructure/WebGPU-Vulkan/RenderPassImpl.cpp: Added.
(WebGPU::RenderPassImpl::RenderPassImpl):
(WebGPU::RenderPassImpl::setRenderState):
(WebGPU::RenderPassImpl::setVertexAttributeBuffers):
(WebGPU::RenderPassImpl::setResources):
(WebGPU::RenderPassImpl::setViewport):
(WebGPU::RenderPassImpl::setScissorRect):
(WebGPU::RenderPassImpl::draw):
* WebGPUAPIStructure/WebGPU-Vulkan/RenderPassImpl.h: Added.
* WebGPUAPIStructure/WebGPU-Vulkan/RenderStateImpl.cpp: Added.
(WebGPU::RenderStateImpl::RenderStateImpl):
* WebGPUAPIStructure/WebGPU-Vulkan/RenderStateImpl.h: Added.
(WebGPU::RenderStateImpl::getPipeline const):
(WebGPU::RenderStateImpl::getPipelineLayout const):
(WebGPU::RenderStateImpl::getDescriptorSetLayouts const):
* WebGPUAPIStructure/WebGPU-Vulkan/SamplerImpl.cpp: Added.
(WebGPU::SamplerImpl::SamplerImpl):
(WebGPU::SamplerImpl::decrementReferenceCount):
* WebGPUAPIStructure/WebGPU-Vulkan/SamplerImpl.h: Added.
(WebGPU::SamplerImpl::getSampler):
(WebGPU::SamplerImpl::incrementReferenceCount):
(WebGPU::SamplerImpl::getFilter):
(WebGPU::SamplerImpl::getMipmapMode):
(WebGPU::SamplerImpl::getAddressMode):
* WebGPUAPIStructure/WebGPU-Vulkan/TextureImpl.cpp: Added.
(WebGPU::TextureImpl::TextureImpl):
(WebGPU::TextureImpl::decrementReferenceCount):
* WebGPUAPIStructure/WebGPU-Vulkan/TextureImpl.h: Added.
(WebGPU::TextureImpl::getImage const):
(WebGPU::TextureImpl::getImageView const):
(WebGPU::TextureImpl::getFormat const):
(WebGPU::TextureImpl::incrementReferenceCount):
(WebGPU::TextureImpl::getWidth const):
(WebGPU::TextureImpl::getHeight const):
(WebGPU::TextureImpl::getTransferredToGPU const):
(WebGPU::TextureImpl::setTransferredToGPU):
* WebGPUAPIStructure/WebGPU-Vulkan/WebGPU-Vulkan.vcxproj: Added.
* WebGPUAPIStructure/WebGPU-Vulkan/WebGPU-Vulkan.vcxproj.filters: Added.
* WebGPUAPIStructure/WebGPU.sln: Added.

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

21 months agoWeb Inspector: Styles Redesign: Make "Style Attribute" text darker and non-focusable
nvasilyev@apple.com [Thu, 26 Oct 2017 23:32:04 +0000 (23:32 +0000)]
Web Inspector: Styles Redesign: Make "Style Attribute" text darker and non-focusable
https://bugs.webkit.org/show_bug.cgi?id=178837

Reviewed by Brian Burg.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration .selector.style-attribute):
Use the same shade of gray as in the "Inherited from" sections.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
Only editable selectors should be focusable.

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

21 months agoCall setFullscreenClient on iOS.
commit-queue@webkit.org [Thu, 26 Oct 2017 23:30:00 +0000 (23:30 +0000)]
Call setFullscreenClient on iOS.
https://bugs.webkit.org/show_bug.cgi?id=178089

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-10-26
Reviewed by Simon Fraser.

This was only being set for MacOS.

* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):

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

21 months ago[Payment Request] Restrict API use to secure, same-origin frames
keith_miller@apple.com [Thu, 26 Oct 2017 23:28:31 +0000 (23:28 +0000)]
[Payment Request] Restrict API use to secure, same-origin frames
https://bugs.webkit.org/show_bug.cgi?id=178887

Patch by Andy Estes <aestes@apple.com> on 2017-10-26
Reviewed by Tim Horton.

Reuse the access checks from Apple Pay to restrict PaymentRequest API usage to secure frames
in the same origin as the main frame.

Progresses active-document-cross-origin.https.sub.html and
active-document-same-origin.https.html from web-platform-tests. Regresses basic.https.html
since the allowpaymentrequest <iframe> attribute is not yet implemented.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create):
(WebCore::ApplePaySession::supportsVersion):
(WebCore::ApplePaySession::canMakePayments):
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
(WebCore::ApplePaySession::openPaymentSetup):
(WebCore::isSecure): Deleted.
(WebCore::canCallApplePaySessionAPIs): Deleted.
* Modules/applepay/PaymentSession.cpp: Added.
(WebCore::isSecure):
(WebCore::PaymentSession::canCreateSession):
* Modules/applepay/PaymentSession.h:
* Modules/paymentrequest/PaymentHandler.cpp:
(WebCore::PaymentHandler::canCreateSession):
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::create):
* WebCore.xcodeproj/project.pbxproj:

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

21 months ago[Payment Request] Restrict API use to secure, same-origin frames
aestes@apple.com [Thu, 26 Oct 2017 23:25:41 +0000 (23:25 +0000)]
[Payment Request] Restrict API use to secure, same-origin frames
https://bugs.webkit.org/show_bug.cgi?id=178887

Reviewed by Tim Horton.

LayoutTests/imported/w3c:

The allowpaymentrequest <iframe> attribute is not yet implemented, so the regression in basic.https.html is expected.

* web-platform-tests/payment-request/allowpaymentrequest/active-document-cross-origin.https.sub-expected.txt:
* web-platform-tests/payment-request/allowpaymentrequest/active-document-same-origin.https-expected.txt:
* web-platform-tests/payment-request/allowpaymentrequest/basic.https-expected.txt:

Source/WebCore:

Reuse the access checks from Apple Pay to restrict PaymentRequest API usage to secure frames
in the same origin as the main frame.

Progresses active-document-cross-origin.https.sub.html and
active-document-same-origin.https.html from web-platform-tests. Regresses basic.https.html
since the allowpaymentrequest <iframe> attribute is not yet implemented.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create):
(WebCore::ApplePaySession::supportsVersion):
(WebCore::ApplePaySession::canMakePayments):
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
(WebCore::ApplePaySession::openPaymentSetup):
(WebCore::isSecure): Deleted.
(WebCore::canCallApplePaySessionAPIs): Deleted.
* Modules/applepay/PaymentSession.cpp: Added.
(WebCore::isSecure):
(WebCore::PaymentSession::canCreateSession):
* Modules/applepay/PaymentSession.h:
* Modules/paymentrequest/PaymentHandler.cpp:
(WebCore::PaymentHandler::canCreateSession):
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::create):
* WebCore.xcodeproj/project.pbxproj:

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

21 months agoAdd service worker handle fetch support for all subresource requests
commit-queue@webkit.org [Thu, 26 Oct 2017 22:57:29 +0000 (22:57 +0000)]
Add service worker handle fetch support for all subresource requests
https://bugs.webkit.org/show_bug.cgi?id=178769

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-26
Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/workers/service/image-fetch.html

Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
Setting the selected service worker identifier for subresource only at the moment.

Testing is limited to images, future wpt tests should cover other subresource cases.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::prepareFetch):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
* loader/cache/CachedResourceRequest.h:

LayoutTests:

* http/tests/workers/service/image-fetch-expected.txt: Added.
* http/tests/workers/service/image-fetch.html: Added.
* http/tests/workers/service/resources/image-fetch-worker.js: Added.
(event.event.request.url.indexOf):
(event.event.request.url.endsWith):
* http/tests/workers/service/resources/image-fetch.js: Added.
(done):
(async.loadedImage):
(async.erroredImage):
(async.logStatus):
(async.test):

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

21 months agoNowPlayingInfo should contain a unique identifier
eric.carlson@apple.com [Thu, 26 Oct 2017 22:44:18 +0000 (22:44 +0000)]
NowPlayingInfo should contain a unique identifier
https://bugs.webkit.org/show_bug.cgi?id=178872

Reviewed by Jer Noble.

Source/WebCore:

Updated TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm.

* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const): New.

* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Ditto.

* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto. Don't leak CFString.

* platform/mac/MediaRemoteSoftLink.cpp: Softlink kMRMediaRemoteNowPlayingInfoUniqueIdentifier.
* platform/mac/MediaRemoteSoftLink.h:

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestActiveNowPlayingSessionInfo:]): Take a completion handler.
(-[WKWebView _requestActiveNowPlayingSessionInfo]): Deleted.
(-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageClient.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo): Ditto.
(WebKit::WebPageProxy::nowPlayingInfoCallback): Lookup and call completion handler.
(WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse const): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted.

* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted.

* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::requestActiveNowPlayingSessionInfo): Take callback ID. Pass unique ID.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm:
(-[NowPlayingTestWebView hasActiveNowPlayingSession]): Use completion handler.
(TestWebKitAPI::TEST): Cleanup tests. Use new API.
(-[NowPlayingTestWebView waitForNowPlayingInfoToChange]): Deleted.

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

21 months agoUnreviewed, iOS build fix.
keith_miller@apple.com [Thu, 26 Oct 2017 22:42:41 +0000 (22:42 +0000)]
Unreviewed, iOS build fix.

* SourcesMac.txt:
* WebCore.xcodeproj/project.pbxproj:

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

21 months agoJSRopeString::RopeBuilder::append() should check for overflows.
mark.lam@apple.com [Thu, 26 Oct 2017 22:36:04 +0000 (22:36 +0000)]
JSRopeString::RopeBuilder::append() should check for overflows.
https://bugs.webkit.org/show_bug.cgi?id=178385
<rdar://problem/35027468>

Reviewed by Saam Barati.

JSTests:

* stress/regress-178385.js: Added.

Source/JavaScriptCore:

1. Made RopeString check for overflow like the Checked class does.
2. Added a missing overflow check in objectProtoFuncToString().

* runtime/JSString.cpp:
(JSC::JSRopeString::RopeBuilder<RecordOverflow>::expand):
(JSC::JSRopeString::RopeBuilder::expand): Deleted.
* runtime/JSString.h:
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncToString):
* runtime/Operations.h:
(JSC::jsStringFromRegisterArray):
(JSC::jsStringFromArguments):

Source/WTF:

* wtf/CheckedArithmetic.h:

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

21 months agoMove Mac specific files to unified sources
keith_miller@apple.com [Thu, 26 Oct 2017 22:25:06 +0000 (22:25 +0000)]
Move Mac specific files to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178883

Rubber-stamped by Tim Horton.

* SourcesCocoa.txt:
* SourcesMac.txt:
* WebCore.xcodeproj/project.pbxproj:

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

21 months agoDidMoveToNewDocumentAssertionScope shouldn't be necessary
rniwa@webkit.org [Thu, 26 Oct 2017 22:02:38 +0000 (22:02 +0000)]
DidMoveToNewDocumentAssertionScope shouldn't be necessary
https://bugs.webkit.org/show_bug.cgi?id=178836
<rdar://problem/35008876>

Reviewed by Antti Koivisto.

DidMoveToNewDocumentAssertionScope was introduced in r217972 to replace an existing assertion to make sure
Node::didMoveToNewDocument is always called by its overrides in Node's subclasses. However, we can ensure
better Node::didMoveToNewDocument is always called if we called it directly in Node::moveTreeToNewScope.

Because only subclasses of Element and ShadowRoot override Node::didMoveToNewDocument and we already have
a specialized code path to adopt a ShadowRoot to a new document, this refactoring eliminates the need for
having a virtual function on Node at all.

Hence this patch names Node::didMoveToNewDocument to Node::moveToNewDocument and makes it non-virtual,
splits ShadowRoot::didMoveToNewDocument into moveShadowRootToNewParentScope and moveShadowRootToNewDocument,
and removes DidMoveToNewDocumentAssertionScope completely.

No new tests since there should be no behavioral change.

* dom/Document.cpp:
(WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Renamed from moveNodeIteratorsToNewDocument.
* dom/Document.h:
(WebCore::Document::moveNodeIteratorsToNewDocument): Inlined the check for emptiness of m_nodeIterators to
avoid keep calling moveNodeIteratorsToNewDocumentSlowCase on every single node getting moved.
* dom/Element.cpp:
(WebCore::Element::didMoveToNewDocument): Removed the call to Node::didMoveToNewDocument since this is the
base virtual function now.
* dom/Element.h:
* dom/Node.cpp:
(WebCore::DidMoveToNewDocumentAssertionScope::DidMoveToNewDocumentAssertionScope): Deleted.
(WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope): Deleted.
(WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall): Deleted.
(WebCore::moveNodeToNewDocument): Deleted.
(WebCore::Node::moveShadowTreeToNewDocument): Made this a member function of Node since it needs to call
moveNodeToNewDocument, which is private to Node.
(WebCore::Node::moveTreeToNewScope): Removed the release assert for the root node since  the same check
exists inside traverseSubtreeToUpdateTreeScope. Also removed the release assertion for checking that
node's old document matches the old document since document() simply calls treeScope().documentScope()
and we're already release-asserting that the old scope of a node matches the old scope we know of.
We release-assert that the old tree scope's document didn't change after the traversal instead. Finally,
replaced a bunch of RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
(WebCore::Node::moveNodeToNewDocument): Renamed from didMoveToNewDocument. Moved the code related to
mutation observers inside hasRareData() check, and moved the the code to move event listeners inside
eventTargetData() check both for clarity, and avoid doing the work for every single node being moved.
Finally, call the old didMoveToNewDocument when "this" is an Element.
* dom/Node.h:
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::moveShadowRootToNewParentScope): Added. Extracted from didMoveToNewDocument.
(WebCore::ShadowRoot::moveShadowRootToNewDocument): Renamed from didMoveToNewDocument. We now
release-assert that parent tree scope's document matches the new document if any.
* dom/ShadowRoot.h:

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

21 months agoLayoutTest http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across...
rniwa@webkit.org [Thu, 26 Oct 2017 22:00:17 +0000 (22:00 +0000)]
LayoutTest http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=178828

Reviewed by Wenson Hsieh.

When the pasted content's iframe's body isn't available, wait for load event.

* http/tests/security/clipboard/resources/content-to-copy.html: Always wait for load event before notifying
the parent page that it had finish loading.
* http/tests/security/clipboard/resources/subdirectory/paste-html.html:

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

21 months agoImplement ServiceWorkerContainer getRegistration
commit-queue@webkit.org [Thu, 26 Oct 2017 21:41:19 +0000 (21:41 +0000)]
Implement ServiceWorkerContainer getRegistration
https://bugs.webkit.org/show_bug.cgi?id=178882

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-26
Reviewed by Chris Dumez.

Replace rejection promise by resolving the promise with a null value.
This helps in running WPT tests as WPT tests usually check for registered service workers before running tests.
For WTR, there should be no registered service worker anyway.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::getRegistration):
* workers/service/ServiceWorkerContainer.h:

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

21 months ago[iOS] Update expected results for platform/ios/ios/fast/text/opticalFontWith*.html
mmaxfield@apple.com [Thu, 26 Oct 2017 21:36:36 +0000 (21:36 +0000)]
[iOS] Update expected results for platform/ios/ios/fast/text/opticalFontWith*.html
https://bugs.webkit.org/show_bug.cgi?id=178885

Unreviewed.

* platform/ios/TestExpectations:
* platform/ios/platform/ios/ios/fast/text/opticalFontWithTextStyle-expected.txt:
* platform/ios/platform/ios/ios/fast/text/opticalFontWithWeight-expected.txt:

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

21 months ago[iOS] Update expected results for fast/text/international/complex-character-based...
mmaxfield@apple.com [Thu, 26 Oct 2017 21:24:33 +0000 (21:24 +0000)]
[iOS] Update expected results for fast/text/international/complex-character-based-fallback.html
https://bugs.webkit.org/show_bug.cgi?id=178884
<rdar://problem/33602192>

Unreviewed.

Test gardening.

* platform/ios/TestExpectations:
* platform/ios/fast/text/international/complex-character-based-fallback-expected.png: Added.
* platform/ios/fast/text/international/complex-character-based-fallback-expected.txt:

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

21 months agoAccount for Mail’s WebMessageDocument class being renamed
mitz@apple.com [Thu, 26 Oct 2017 21:07:01 +0000 (21:07 +0000)]
Account for Mail’s WebMessageDocument class being renamed
https://bugs.webkit.org/show_bug.cgi?id=178881

Reviewed by Sam Weinig.

* editing/cocoa/HTMLConverter.mm:
(_WebMessageDocumentClass): Look up the class by its new name. No longer look it up by the
  old old name, because TOT WebKit isn’t going to be used by versions of Mail that have that name.

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

21 months ago[WPE] Use proper shared object versioning for libWPEWebKit.so
aperez@igalia.com [Thu, 26 Oct 2017 20:57:08 +0000 (20:57 +0000)]
[WPE] Use proper shared object versioning for libWPEWebKit.so
https://bugs.webkit.org/show_bug.cgi?id=178878

Reviewed by Michael Catanzaro.

Move the CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE() to a new CMake include file,
and use it both for the GTK+ and WPE ports. Also add a SET_PROJECT_VERSION() macro to
unify setting the PROJECT_VERSION* family of variables.

* Source/cmake/OptionsGTK.cmake: Use the common macros imported from VersioningUtils.cmake.
* Source/cmake/OptionsWPE.cmake: Properly assign a shared object version to libWPEWebKit.so,
using the common macros from VersioningUtils.cmake.
* Source/cmake/VersioningUtils.cmake: Added.

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

21 months agoRemove FrameView::serviceScriptedAnimations and Document::serviceScriptedAnimations
commit-queue@webkit.org [Thu, 26 Oct 2017 20:22:39 +0000 (20:22 +0000)]
Remove FrameView::serviceScriptedAnimations and Document::serviceScriptedAnimations
https://bugs.webkit.org/show_bug.cgi?id=178879

Patch by Antoine Quint <graouts@apple.com> on 2017-10-26
Reviewed by Dean Jackson.

There are no call sites for FrameView::serviceScriptedAnimations() and that method is the
only call site for Document::serviceScriptedAnimations(), so both can go.

* dom/Document.cpp:
(WebCore::Document::serviceScriptedAnimations): Deleted.
* dom/Document.h:
* page/FrameView.cpp:
(WebCore::FrameView::serviceScriptedAnimations): Deleted.
* page/FrameView.h:

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

21 months ago[MediaStream] Clear cached gUM prompt state
ryanhaddad@apple.com [Thu, 26 Oct 2017 20:22:13 +0000 (20:22 +0000)]
[MediaStream] Clear cached gUM prompt state
https://bugs.webkit.org/show_bug.cgi?id=178754
<rdar://problem/32742356>

Unreviewed, fix a flakey test.

Patch by Eric Carlson <eric.carlson@apple.com> on 2017-10-26

* TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm:
(-[GetUserMediaRepromptTestView haveStream:]): New, check several times for expected state.
(TestWebKitAPI::TEST): Don't assume stream state changes in the page immediately.

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

21 months ago[Payment Request] Enable Payment Request whenever Apple Pay is enabled
aestes@apple.com [Thu, 26 Oct 2017 20:20:42 +0000 (20:20 +0000)]
[Payment Request] Enable Payment Request whenever Apple Pay is enabled
https://bugs.webkit.org/show_bug.cgi?id=178880

Reviewed by Tim Horton.

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPaymentRequestEnabled): Deleted.
(WKPreferencesGetPaymentRequestEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

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

21 months agohttp/tests/workers/service/service-worker-cache-api.https.html is flaky
commit-queue@webkit.org [Thu, 26 Oct 2017 20:17:36 +0000 (20:17 +0000)]
http/tests/workers/service/service-worker-cache-api.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=178877

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-26
Reviewed by Alex Christensen.

Marking test as PASS/FAIL.
Changing test to finish after 10 seconds.
Beefing up logging to help identifiying flakiness reason.

* TestExpectations:
* http/tests/workers/service/resources/service-worker-cache-api-worker.js:
(event.event.respondWith.promise.then):
* http/tests/workers/service/resources/service-worker-cache-api.js:
(async.test):
* http/tests/workers/service/service-worker-cache-api.https-expected.txt:

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

21 months agoBring back SWContextManager abstraction in WebCore
cdumez@apple.com [Thu, 26 Oct 2017 20:14:40 +0000 (20:14 +0000)]
Bring back SWContextManager abstraction in WebCore
https://bugs.webkit.org/show_bug.cgi?id=178876

Reviewed by Geoffrey Garen.

Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
is actually useful when the ServiceWorker wants to message the storage process.

Source/WebCore:

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/context/SWContextManager.cpp: Added.
(WebCore::SWContextManager::singleton):
(WebCore::SWContextManager::setConnection):
(WebCore::SWContextManager::connection const):
(WebCore::SWContextManager::registerServiceWorkerThread):
(WebCore::SWContextManager::serviceWorkerThreadProxy const):
(WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
* workers/service/context/SWContextManager.h: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
(WebCore::SWContextManager::Connection::~Connection):

Source/WebKit:

* CMakeLists.txt:
* DerivedSources.make:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startServiceWorkerContext):
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/WebSWContextManagerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.cpp.
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
(WebKit::WebSWContextManagerConnection::updatePreferences):
(WebKit::WebSWContextManagerConnection::startServiceWorker):
(WebKit::WebSWContextManagerConnection::startFetch):
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
* WebProcess/Storage/WebSWContextManagerConnection.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
* WebProcess/Storage/WebSWContextManagerConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.messages.in.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage):
(WebKit::WebProcess::getWorkerContextConnection):
* WebProcess/WebProcess.h:

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