WebKit-https.git
21 months agoMarked multiple imported/w3c/web-platform-tests/service-workers/ test as flaky
jlewis3@apple.com [Thu, 18 Jan 2018 18:12:58 +0000 (18:12 +0000)]
Marked multiple imported/w3c/web-platform-tests/service-workers/ test as flaky
https://bugs.webkit.org/show_bug.cgi?id=181750

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

21 months agoREGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
antti@apple.com [Thu, 18 Jan 2018 17:50:00 +0000 (17:50 +0000)]
REGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
https://bugs.webkit.org/show_bug.cgi?id=181460
<rdar://problem/36379776>

Reviewed by Ryosuke Niwa.

* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):

Don't do the expensive security origin test if the supplied sheet base URL is null. This
is true for rules coming from the same document.

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

21 months agoREGRESSION(r225858): Sandbox violations due to blocked access to Spotlight search...
bfulgham@apple.com [Thu, 18 Jan 2018 17:49:44 +0000 (17:49 +0000)]
REGRESSION(r225858): Sandbox violations due to blocked access to Spotlight search preferences
https://bugs.webkit.org/show_bug.cgi?id=181797
<rdar://problem/36546412>

Reviewed by Eric Carlson.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add the read permission for
'com.apple.lookup.shared' to support DataDetectors.

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

21 months agoREGRESSION (r223604): Setting :before/after pseudo element on <noscript> asserts
antti@apple.com [Thu, 18 Jan 2018 17:37:28 +0000 (17:37 +0000)]
REGRESSION (r223604): Setting :before/after pseudo element on <noscript> asserts
https://bugs.webkit.org/show_bug.cgi?id=181795
<rdar://problem/36334524>

Reviewed by David Kilzer.

Source/WebCore:

<noscript> disallows renderer generation outside CSS mechanisms, however we would still construct
PseudoElements for them during style resolution. These were never removed properly because the
pseudo element removal was tied to render tree teardown. Without proper removal the associated
animations were also not canceled.

Test: fast/css-generated-content/noscript-pseudo-anim-crash.html

* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):

Take care to get rid of PseudoElements when the element is removed from the tree.
This also cancels any associated animations.

LayoutTests:

* fast/css-generated-content/noscript-pseudo-anim-crash-expected.txt: Added.
* fast/css-generated-content/noscript-pseudo-anim-crash.html: Added.

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

21 months agoAX: Aria-activedescendant not supported
cfleizach@apple.com [Thu, 18 Jan 2018 17:26:23 +0000 (17:26 +0000)]
AX: Aria-activedescendant not supported
https://bugs.webkit.org/show_bug.cgi?id=161734
<rdar://problem/28202679>

Reviewed by Joanmarie Diggs.

Source/WebCore:

When a combo-box owns/controls a list/listbox/grid/tree, the owned element needs to check the active-descendant of the combobox when
checking if it has selected children.
The target of the selection change notification should also be the owned element in these cases.

Test: accessibility/aria-combobox-controlling-list.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectedListItem):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
(WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
(WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
(WebCore::AccessibilityRenderObject::selectedChildren):
* accessibility/AccessibilityRenderObject.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):

LayoutTests:

* accessibility/aria-combobox-control-owns-elements-expected.txt: Added.
* accessibility/aria-combobox-control-owns-elements.html: Added.

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

21 months agoMark fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html as faili...
pvollan@apple.com [Thu, 18 Jan 2018 16:52:35 +0000 (16:52 +0000)]
Mark fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=181662

Unreviewed test gardening.

* platform/win/TestExpectations:

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

21 months ago[Xcode] Shared schemes in the WebKit workspace still have build pre-actions that...
mitz@apple.com [Thu, 18 Jan 2018 16:46:12 +0000 (16:46 +0000)]
[Xcode] Shared schemes in the WebKit workspace still have build pre-actions that invoke copy-webkitlibraries-to-product-directory
https://bugs.webkit.org/show_bug.cgi?id=181784

Reviewed by Anders Carlsson.

* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme: Remove the build pre-action.
* WebKit.xcworkspace/xcshareddata/xcschemes/All Tools.xcscheme: Ditto.

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

21 months agoREGRESSION (r224780): Text stroke not applied to video captions.
pvollan@apple.com [Thu, 18 Jan 2018 16:13:16 +0000 (16:13 +0000)]
REGRESSION (r224780): Text stroke not applied to video captions.
https://bugs.webkit.org/show_bug.cgi?id=181743
<rdar://problem/35874338>

Reviewed by Simon Fraser.

Source/WebCore:

Tests: media/track/track-css-visible-stroke-expected.html
       media/track/track-css-visible-stroke.html

After r224780, it is no longer possible to mix text stroke styles with webkit
legacy text stroke styles.

* css/StyleResolver.cpp:
(WebCore::isValidCueStyleProperty):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS const):

LayoutTests:

* media/track/track-css-stroke-cues-expected.txt:
* media/track/track-css-stroke-cues.html:
* media/track/track-css-visible-stroke-expected.html: Added.
* media/track/track-css-visible-stroke.html: Added.

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

21 months ago[Payment Request] Support a default shipping address for Apple Pay
aestes@apple.com [Thu, 18 Jan 2018 15:42:08 +0000 (15:42 +0000)]
[Payment Request] Support a default shipping address for Apple Pay
https://bugs.webkit.org/show_bug.cgi?id=181754
<rdar://problem/36009733>

Reviewed by Brady Eidson.

Source/WebCore:

Move shippingContact from ApplePayPaymentRequest to ApplePayRequestBase. This allows
merchants to specify a default shipping address when using Apple Pay with Payment Request.

This also fixes a bug found during testing where
+[NSPersonNameComponentsFormatter localizedStringFromPersonNameComponents:style:options:]
would throw an exception when passed a nil NSPersonNameComponents.

Test: http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html

* Modules/applepay/ApplePayPaymentRequest.h:
* Modules/applepay/ApplePayPaymentRequest.idl:
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePayRequestBase.h:
* Modules/applepay/ApplePayRequestBase.idl:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePaySessionPaymentRequest.h:
(WebCore::ApplePaySessionPaymentRequest::version const):
(WebCore::ApplePaySessionPaymentRequest::setVersion):
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert):
* Modules/applepay/paymentrequest/ApplePayRequest.idl:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::completeMerchantValidation):
* testing/MockPaymentCoordinator.h:

LayoutTests:

* http/tests/ssl/applepay/ApplePayRequestShippingContact.https-expected.txt: Added.
* http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html: Added.

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

21 months agoimported/w3c/web-platform-tests/viewport/viewport-resize-event-on-load-overflowing...
commit-queue@webkit.org [Thu, 18 Jan 2018 14:33:32 +0000 (14:33 +0000)]
imported/w3c/web-platform-tests/viewport/viewport-resize-event-on-load-overflowing-page.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=181435

Patch by Ali Juma <ajuma@chromium.org> on 2018-01-18
Reviewed by Frédéric Wang.

Test gardening. The flakiness was fixed by r227054, so remove the test expectation.

* TestExpectations:

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

21 months agoUnreviewed. Update Selenium WebDriver imported tests.
carlosgc@webkit.org [Thu, 18 Jan 2018 10:11:12 +0000 (10:11 +0000)]
Unreviewed. Update Selenium WebDriver imported tests.

* imported/selenium/importer.json:
* imported/selenium/py/test/selenium/webdriver/common/executing_async_javascript_tests.py:
(reset_timeouts):

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

21 months agoLayout Test http/tests/images/image-supports-video.html is flaky
jer.noble@apple.com [Thu, 18 Jan 2018 08:33:14 +0000 (08:33 +0000)]
Layout Test http/tests/images/image-supports-video.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=181008
<rdar://problem/36143943>

Reviewed by Youenn Fablet.

Send a "Cache-control: nocache" header from the HTTP server when the image resource is
requested.

* http/tests/resources/redirect-to-video-if-accepted.php:
* platform/mac-wk1/TestExpectations:

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

21 months agoUnreviewed, rolling out r227096.
commit-queue@webkit.org [Thu, 18 Jan 2018 08:27:27 +0000 (08:27 +0000)]
Unreviewed, rolling out r227096.
https://bugs.webkit.org/show_bug.cgi?id=181788

"it caused a 15% octane regression" (Requested by saamyjoon on
#webkit).

Reverted changeset:

"Support MultiGetByOffset in the DFG"
https://bugs.webkit.org/show_bug.cgi?id=181466
https://trac.webkit.org/changeset/227096

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

21 months ago[iOS] Specify -[NSURL _title] for the associated URL when copying an image element
wenson_hsieh@apple.com [Thu, 18 Jan 2018 08:24:46 +0000 (08:24 +0000)]
[iOS] Specify -[NSURL _title] for the associated URL when copying an image element
https://bugs.webkit.org/show_bug.cgi?id=181783
<rdar://problem/35785445>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Always specify the -[NSURL _title] to be either the title specified in a PasteboardImage's inner PasteboardURL,
or if no title is specified, fall back to the user-visible URL string. This is because at least one internal
client always tries to use the -_title property to determine the title of a pasted URL, or if none is specified,
the -suggestedName. Since we need to set suggestedName to the preferred file name of the copied image and we
don't want the suggested name to become the title of the link, we need to explicitly set the link title.

In doing so, this patch also fixes a bug wherein we forget to set the _title of the NSURL we're registering to
an NSItemProvider.

Tests:  ActionSheetTests.CopyImageElementWithHREFAndTitle (new)
        ActionSheetTests.CopyImageElementWithHREF (modified)

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):

Tools:

Augments an existing API test and adds a new test to make sure that the resulting NSItemProvider's NSURL when
copying an image contains a relevant title.

* TestWebKitAPI/Tests/ios/ActionSheetTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/DataInteractionSimulator.mm:
* TestWebKitAPI/ios/UIKitSPI.h:

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

21 months agoTemporarily skip Speedometer until we fix the metrics.
rniwa@webkit.org [Thu, 18 Jan 2018 07:30:51 +0000 (07:30 +0000)]
Temporarily skip Speedometer until we fix the metrics.

* Skipped:

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

21 months agoRename config.json to config.json.sample
rniwa@webkit.org [Thu, 18 Jan 2018 07:24:43 +0000 (07:24 +0000)]
Rename config.json to config.json.sample
https://bugs.webkit.org/show_bug.cgi?id=181785

Reviewed by Wenson Hsieh.

* .gitignore: Added config.json.
* ReadMe.md: Updated the instruction.
* config.json.sample: Renamed from config.json.

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

21 months agoWebDriver: ignore the driver in selenium test names when getting expectations
carlosgc@webkit.org [Thu, 18 Jan 2018 06:51:30 +0000 (06:51 +0000)]
WebDriver: ignore the driver in selenium test names when getting expectations
https://bugs.webkit.org/show_bug.cgi?id=181738

Reviewed by Carlos Alberto Lopez Perez.

Tools:

In selenium tests, the driver is added as a parameter to every test which results in tests names like
foo[DriverName] or foo[DriverName-param2] in case of tests using more parameters. We don't want to include the
driver name in the test expectations file, so we need to remove it when querying the expectations.

* Scripts/webkitpy/webdriver_tests/pytest_runner.py:
(TestExpectationsMarker.__init__): Save the param to ignore.
(TestExpectationsMarker._item_name): Return the name of the test without the para to ignore.
(TestExpectationsMarker.pytest_collection_modifyitems): Use _item_name().
(run): Pass param to ignore to TestExpectationsMarker().
* Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py:
(WebDriverSeleniumExecutor.__init__): Save the driver name.
(WebDriverSeleniumExecutor.run): Pass the driver name as param to ignore.

WebDriverTests:

Add some expectations for selenium tests.

* TestExpectations.json:

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

21 months ago[GTK][WPE] Show unit tests unexpectedly passing in the bots
carlosgc@webkit.org [Thu, 18 Jan 2018 06:50:12 +0000 (06:50 +0000)]
[GTK][WPE] Show unit tests unexpectedly passing in the bots
https://bugs.webkit.org/show_bug.cgi?id=181726

Reviewed by Michael Catanzaro.

Now that we have the info, let's show it also in the bots.

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

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

21 months agoUnreviewed build fixes in TestGroupResultsViewer.
rniwa@webkit.org [Thu, 18 Jan 2018 06:45:31 +0000 (06:45 +0000)]
Unreviewed build fixes in TestGroupResultsViewer.

* public/v3/components/test-group-results-viewer.js:
(TestGroupResultsViewer.prototype.render): _renderCurrentMetricsLazily was never called.
(TestGroupResultsViewer.prototype._buildRowForMetric): Don't try to render null or NaN.

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

21 months agoFix perf dashboard tests for node v8
rniwa@webkit.org [Thu, 18 Jan 2018 06:06:50 +0000 (06:06 +0000)]
Fix perf dashboard tests for node v8
https://bugs.webkit.org/show_bug.cgi?id=181782

Reviewed by Wenson Hsieh.

Fixed the various tests for node.js v8, which is the latest LTS version.

* server-tests/api-manifest-tests.js: Replaced the missing Triggerable.acceptsTest by Triggerable.acceptedTests
after r226836.
* server-tests/api-measurement-set-tests.js: Added "Z" to the end timestamps to force UTF timezone now that Date
in node.js parses using the local timezone by default.
* server-tests/resources/test-server.js:
(TestServer.prototype._restoreDataDirectory): Fixed the bug that this function was erroneously using the async
function to rename a directory per new warnings. This code was racy, and it used to cause a test error occasionally.
* server-tests/tools-os-build-fetcher-tests.js: Fixed the assertions to make it work in the latest node.js.
* unit-tests/measurement-set-tests.js:
(waitForMeasurementSet): Wait for setTimeout to cycle through all microtasks instead of just two microtask cycles.

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

21 months agoWebVTT served via HLS never results in cues
jer.noble@apple.com [Thu, 18 Jan 2018 05:55:55 +0000 (05:55 +0000)]
WebVTT served via HLS never results in cues
https://bugs.webkit.org/show_bug.cgi?id=181773

Reviewed by Eric Carlson.

Source/WebCore:

Test: http/tests/media/hls/hls-webvtt-tracks.html

Three independant errors conspired to keep in-band WebVTT samples from parsing:

- The definition of ISOWebVTTCue::boxTypeName() was incorrect.
- ISOWebVTTCue::parse() didn't call it's superclass's parse() method (leading to an incorrect size and offset).
- Use String::fromUTF8() rather than String.adopt(StringVector&&).

* platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::parse):
* platform/graphics/iso/ISOVTTCue.h:
(WebCore::ISOWebVTTCue::boxTypeName):

LayoutTests:

* http/tests/media/hls/hls-webvtt-tracks-expected.txt: Added.
* http/tests/media/hls/hls-webvtt-tracks.html: Added.
* http/tests/media/resources/hls/subtitles/fileSequence0.webvtt: Added.
* http/tests/media/resources/hls/subtitles/prog_index.m3u8: Added.
* http/tests/media/resources/hls/test-webvtt.m3u8: Added.

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

21 months agoWeb Inspector: clicking on a path component that has no siblings should select it
webkit@devinrousso.com [Thu, 18 Jan 2018 05:03:26 +0000 (05:03 +0000)]
Web Inspector: clicking on a path component that has no siblings should select it
https://bugs.webkit.org/show_bug.cgi?id=181772

Reviewed by Joseph Pecoraro.

* UserInterface/Views/HierarchicalPathComponent.js:
(WI.HierarchicalPathComponent.prototype._updateSelectElement):
(WI.HierarchicalPathComponent.prototype._selectElementMouseDown):

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

21 months ago[DFG][FTL] Introduce PhantomNewRegexp and RegExpExecNonGlobalOrSticky
utatane.tea@gmail.com [Thu, 18 Jan 2018 04:17:32 +0000 (04:17 +0000)]
[DFG][FTL] Introduce PhantomNewRegexp and RegExpExecNonGlobalOrSticky
https://bugs.webkit.org/show_bug.cgi?id=181535

Reviewed by Saam Barati.

JSTests:

* stress/inserted-recovery-with-set-last-index.js: Added.
(shouldBe):
(foo):
* stress/materialize-regexp-at-osr-exit.js: Added.
(shouldBe):
(test):
* stress/materialize-regexp-cyclic-regexp-at-osr-exit.js: Added.
(shouldBe):
(test):
* stress/materialize-regexp-cyclic-regexp.js: Added.
(shouldBe):
(test):
(i.switch):
* stress/materialize-regexp-cyclic.js: Added.
(shouldBe):
(test):
(i.switch):
* stress/materialize-regexp-referenced-from-phantom-regexp-cyclic.js: Added.
(bar):
(foo):
(test):
* stress/materialize-regexp-referenced-from-phantom-regexp.js: Added.
(bar):
(foo):
(test):
* stress/materialize-regexp.js: Added.
(shouldBe):
(test):
* stress/phantom-regexp-regexp-exec.js: Added.
(shouldBe):
(test):
* stress/phantom-regexp-string-match.js: Added.
(shouldBe):
(test):
* stress/regexp-last-index-sinking.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

When executing the code like `string.match(/regexp/)`, `/regexp/` object is created every time we execute this code.
However, user rarely cares about this `/regexp/` object. Typically, it is soon discarded even if it has `lastIndex`
information. So we should not create RegExpObject for this typical case.

This patch introduces PhantomNewRegexp. We convert NewRegexp node to PhantomNewRegexp in Object Allocation Sinking (OAS)
phase. We should do this analysis in OAS phase since we track modifications to `lastIndex` in the OAS phase. Even if
`lastIndex` is modified, it may not be read by users. So we have a chance to drop this NewRegexp beacause we carefully model
SetRegExpObjectLastIndex and GetRegExpObjectLastIndex in OAS phase.

This patch is a first attempt to drop NewRegexp. So we start optimizing it with the simple step: we first drop RegExp with
non-global and non-sticky one. We can later extend this optimization for RegExp with global flag. But this is not included
in this patch.

We convert RegExpExec to RegExpExecNonGlobalOrSticky if we find that the given RegExpObject's RegExp is not global/sticky
flagged. Since we do not need to touch `lastIndex` property in this case, RegExpExecNonGlobalOrSticky just takes RegExp
instead of RegExpObject. This offers the chance to make NewRegExp unused.

We also convert RegExpMatchFast to RegExpExecNonGlobalOrSticky if its RegExpObject's RegExp is non-global and non-sticky,
since they are the same behavior.

The above optimization completely removes NewRegexp in SixSpeed's regexp-u.{es5,es6}. The resulted execution time is
somewhat pure execution time of our Yarr implementation.

                             baseline                  patched

    regex-u.es5          34.8557+-0.5963     ^      6.1507+-0.5526        ^ definitely 5.6670x faster
    regex-u.es6          89.1919+-3.3851     ^     32.0917+-0.4260        ^ definitely 2.7793x faster

This patch does not change Octane/RegExp so much since it heavily uses String.prototype.replace, which is not handled in
this patch right now. We should support StringReplace node in subsequent patches.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGClobbersExitState.cpp:
(JSC::DFG::clobbersExitState):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGMayExit.cpp:
* dfg/DFGNode.cpp:
(JSC::DFG::Node::convertToRegExpExecNonGlobalOrSticky):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToPhantomNewRegexp):
(JSC::DFG::Node::convertToSetRegExpObjectLastIndex):
(JSC::DFG::Node::hasHeapPrediction):
(JSC::DFG::Node::hasCellOperand):
(JSC::DFG::Node::isPhantomAllocation):
(JSC::DFG::Node::hasIgnoreLastIndexIsWritable):
(JSC::DFG::Node::ignoreLastIndexIsWritable):
* dfg/DFGNodeType.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGPromotedHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGPromotedHeapLocation.h:
(JSC::DFG::PromotedLocationDescriptor::neededForMaterialization const):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileNewRegexp):
(JSC::DFG::SpeculativeJIT::compileSetRegExpObjectLastIndex):
(JSC::DFG::SpeculativeJIT::compileRegExpExecNonGlobalOrSticky):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileRegExpExecNonGlobalOrSticky):
(JSC::FTL::DFG::LowerDFGToB3::compileNewRegexp):
(JSC::FTL::DFG::LowerDFGToB3::compileSetRegExpObjectLastIndex):
* ftl/FTLOperations.cpp:
(JSC::FTL::operationPopulateObjectInOSR):
(JSC::FTL::operationMaterializeObjectInOSR):
* jit/JITOperations.h:
* runtime/RegExpObject.h:
(JSC::RegExpObject::create):

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

21 months ago[FTL] Remove unused helper functions to convert node to PutHint
utatane.tea@gmail.com [Thu, 18 Jan 2018 03:15:26 +0000 (03:15 +0000)]
[FTL] Remove unused helper functions to convert node to PutHint
https://bugs.webkit.org/show_bug.cgi?id=181775

Reviewed by Saam Barati.

We are using PromotedHeapLocation::createHint. So they are not necessary.

* dfg/DFGNode.cpp:
(JSC::DFG::Node::convertToPutHint): Deleted.
(JSC::DFG::Node::convertToPutStructureHint): Deleted.
(JSC::DFG::Node::convertToPutByOffsetHint): Deleted.
(JSC::DFG::Node::convertToPutClosureVarHint): Deleted.
* dfg/DFGNode.h:

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

21 months agoUnreviewed, suppress warnings on GCC
utatane.tea@gmail.com [Thu, 18 Jan 2018 02:45:46 +0000 (02:45 +0000)]
Unreviewed, suppress warnings on GCC

Since `length` and `p` are always positive or zero,
static_cast<unsigned>() does what we want.

* runtime/JSBigInt.cpp:
(JSC::JSBigInt::parseInt):

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

21 months agoDisable Atomics when SharedArrayBuffer isn’t enabled
sbarati@apple.com [Thu, 18 Jan 2018 01:58:25 +0000 (01:58 +0000)]
Disable Atomics when SharedArrayBuffer isn’t enabled
https://bugs.webkit.org/show_bug.cgi?id=181572
<rdar://problem/36553206>

Reviewed by Michael Saboff.

JSTests:

* stress/isLockFree.js:

Source/JavaScriptCore:

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::createAtomicsProperty): Deleted.

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

21 months agoResource Load Statistics: Block cookies for prevalent resources without user interaction
wilander@apple.com [Thu, 18 Jan 2018 01:58:05 +0000 (01:58 +0000)]
Resource Load Statistics: Block cookies for prevalent resources without user interaction
https://bugs.webkit.org/show_bug.cgi?id=177394
<rdar://problem/34613960>

Reviewed by Alex Christensen.

Source/WebCore:

Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
       http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
       http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
       http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html

* platform/network/NetworkStorageSession.h:
    Now exports NetworkStorageSession::nsCookieStorage().
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
    Fixes the FIXME.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
    Declaration of _initWithIdentifier() on NSHTTPCookieStorage.

Source/WebKit:

* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
    Now has m_hasBeenSetToUseStatelessCookieStorage to handle
    cookie blocking.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
    Returns singleton empty, deny-all cookie storage for cookie blocking.
    The ugly pragma instructions for clang are because the NSString
    parameter for _initWithIdentifier was not marked nullable pre-Sierra.
(WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
    Instead of just decision making, this now applies the policy.
(WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
    New method.
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
    Now blocks cookies for domains where cookies will be purged anyway.
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
    Now blocks cookies for domains where cookies will be purged anyway.
(WebKit::shouldChangePartition): Deleted.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
    Now downgrades for blocked cookies instead of partitioned cookies.
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
    Now downgrades for blocked cookies instead of partitioned cookies.

LayoutTests:

* http/tests/resourceLoadStatistics/add-blocking-to-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/add-blocking-to-redirect.html: Added.
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html:
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html: Added.
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html: Added.
* http/tests/resourceLoadStatistics/remove-partitioning-from-redirect-expected.txt: Removed.
* http/tests/resourceLoadStatistics/remove-partitioning-from-redirect.html: Removed.
    Test case reworked and is now remove-partitioning-in-redirect.html.
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html: Added.
* platform/ios/TestExpectations:
    New tests marked as [ Pass ] for iOS.
* platform/mac-wk2/TestExpectations:
    New tests marked as [ Pass ] for High Sierra+.
* platform/wk2/TestExpectations:
    New tests skipped for WK2 in general.

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

21 months agoRemove linked-on test for Snow Leopard
dino@apple.com [Thu, 18 Jan 2018 01:47:44 +0000 (01:47 +0000)]
Remove linked-on test for Snow Leopard
https://bugs.webkit.org/show_bug.cgi?id=181770

Reviewed by Eric Carlson.

Source/WebCore:

Remove a very old linked-on-or-after test.

* platform/graphics/ca/GraphicsLayerCA.cpp:

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

21 months agoUnreviewed, rolling out r227098.
jlewis3@apple.com [Thu, 18 Jan 2018 01:31:36 +0000 (01:31 +0000)]
Unreviewed, rolling out r227098.

This broke the build.

Reverted changeset:

"Remove linked-on test for Snow Leopard"
https://bugs.webkit.org/show_bug.cgi?id=181770
https://trac.webkit.org/changeset/227098

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

21 months agoVersioning.
jmarcell@apple.com [Thu, 18 Jan 2018 00:59:26 +0000 (00:59 +0000)]
Versioning.

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

21 months agoRemove linked-on test for Snow Leopard
dino@apple.com [Thu, 18 Jan 2018 00:40:53 +0000 (00:40 +0000)]
Remove linked-on test for Snow Leopard
https://bugs.webkit.org/show_bug.cgi?id=181770

Reviewed by Eric Carlson.

Source/WebCore:

Remove a very old linked-on-or-after test.

* platform/graphics/ca/GraphicsLayerCA.cpp:

Source/WebCore/PAL:

No need for _CFExecutableLinkedOnOrAfter any more.

* pal/spi/cf/CFUtilitiesSPI.h:

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

21 months agoUnreviewed GTK+ gardening
aboya@igalia.com [Thu, 18 Jan 2018 00:39:05 +0000 (00:39 +0000)]
Unreviewed GTK+ gardening

* platform/gtk/TestExpectations:

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

21 months agoSupport MultiGetByOffset in the DFG
sbarati@apple.com [Thu, 18 Jan 2018 00:34:16 +0000 (00:34 +0000)]
Support MultiGetByOffset in the DFG
https://bugs.webkit.org/show_bug.cgi?id=181466

Reviewed by Keith Miller.

This seems to benefit Speedometer in my local testing. It seems like this
might be around a 0.5% improvement.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetById):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::supportsMultiGetByOffset):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

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

21 months ago[Curl] Use ResourceRequest::encodeWithPlatformData()
commit-queue@webkit.org [Thu, 18 Jan 2018 00:26:31 +0000 (00:26 +0000)]
[Curl] Use ResourceRequest::encodeWithPlatformData()
https://bugs.webkit.org/show_bug.cgi?id=181768

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2018-01-17
Reviewed by Alex Christensen.

Source/WebCore:

No new tests, assertion hit in downstream port, should be covered by
existing tests.

* platform/network/curl/ResourceRequest.h:
(WebCore::ResourceRequest::encodeWithPlatformData const):
(WebCore::ResourceRequest::decodeWithPlatformData):

Source/WebKit:

* Shared/curl/WebCoreArgumentCodersCurl.cpp:
(IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):

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

21 months agoUse existing RGB colorspace instead of creating a new one
eric.carlson@apple.com [Thu, 18 Jan 2018 00:04:49 +0000 (00:04 +0000)]
Use existing RGB colorspace instead of creating a new one
https://bugs.webkit.org/show_bug.cgi?id=181765
<rdar://problem/36595753>

Reviewed by Dean Jackson.

* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Use sRGBColorSpaceRef instead
of creating a new static colorspace.

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

21 months agoUnreviewed, rolling out r227076.
jlewis3@apple.com [Wed, 17 Jan 2018 23:49:45 +0000 (23:49 +0000)]
Unreviewed, rolling out r227076.

This breaks internal builds

Reverted changeset:

"Resource Load Statistics: Block cookies for prevalent
resources without user interaction"
https://bugs.webkit.org/show_bug.cgi?id=177394
https://trac.webkit.org/changeset/227076

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

21 months agoinput and textarea elements should reveal selection in setSelection when focused
rniwa@webkit.org [Wed, 17 Jan 2018 23:19:45 +0000 (23:19 +0000)]
input and textarea elements should reveal selection in setSelection when focused
https://bugs.webkit.org/show_bug.cgi?id=181715
<rdar://problem/36570546>

Reviewed by Zalan Bujtas.

Made input and textarea elements reveal selection in FrameSelection::setSelection instead of by directly
invoking FrameSelection::revealSelection in their respective updateFocusAppearance to unify code paths.

Also added options to reveal selection up to the main frame to SetSelectionOption to be used in iOS.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::moveWithoutValidationTo): Takes SelectionRevealMode as an argument and converts
sets appropriate selection options.
(WebCore::FrameSelection::setSelection): Reconstruct SelectionRevealMode out of selection option sets.
(WebCore::FrameSelection::updateAndRevealSelection):
* editing/FrameSelection.h:
(WebCore::FrameSelection): Added RevealSelectionUpToMainFrame as a SelectionRevealMode and replaced
m_shouldRevealSelection by m_selectionRevealMode.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateFocusAppearance): Pass SelectionRevealMode to HTMLTextFormControlElement's
select and restoreCachedSelection instead of directly invoking FrameSelection::revealSelection.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::updateFocusAppearance): Ditto.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::select):
(WebCore::HTMLTextFormControlElement::setSelectionRange):
(WebCore::HTMLTextFormControlElement::restoreCachedSelection):
* html/HTMLTextFormControlElement.h:

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

21 months agoFix broken unittest after r227048
lingcherd_ho@apple.com [Wed, 17 Jan 2018 23:19:05 +0000 (23:19 +0000)]
Fix broken unittest after r227048
https://bugs.webkit.org/show_bug.cgi?id=181760

Reviewed by Aakash Jain.

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

21 months agoWEBKIT_FRAMEWORK should not modify file-global include directories
mcatanzaro@igalia.com [Wed, 17 Jan 2018 23:18:17 +0000 (23:18 +0000)]
WEBKIT_FRAMEWORK should not modify file-global include directories
https://bugs.webkit.org/show_bug.cgi?id=181656

Reviewed by Konstantin Tokarev.

.:

Only modify the system include directories of the target passed to WEBKIT_FRAMEWORK.

* Source/cmake/WebKitMacros.cmake:

Source/WebCore:

* CMakeLists.txt:
* PlatformWPE.cmake:

Source/WebKit:

* PlatformGTK.cmake:
* PlatformWPE.cmake:

Tools:

* TestWebKitAPI/PlatformWPE.cmake:
* TestWebKitAPI/glib/CMakeLists.txt:

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

21 months ago[GTK] Try even harder not to static link WTF into libwebkit2gtk
mcatanzaro@igalia.com [Wed, 17 Jan 2018 23:16:28 +0000 (23:16 +0000)]
[GTK] Try even harder not to static link WTF into libwebkit2gtk
https://bugs.webkit.org/show_bug.cgi?id=181751

Reviewed by Alex Christensen.

We don't want two copies of WTF. It should only be in libjavascriptcoregtk.

* PlatformGTK.cmake:

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

21 months agoMarked http/wpt/resource-timing/rt-resources-per-worker.html as flaky on High Sierra.
jlewis3@apple.com [Wed, 17 Jan 2018 22:49:34 +0000 (22:49 +0000)]
Marked http/wpt/resource-timing/rt-resources-per-worker.html as flaky on High Sierra.
https://bugs.webkit.org/show_bug.cgi?id=180260

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

21 months agoMulticol: RenderMultiColumnFlow should not inherit the flow state
zalan@apple.com [Wed, 17 Jan 2018 22:37:23 +0000 (22:37 +0000)]
Multicol: RenderMultiColumnFlow should not inherit the flow state
https://bugs.webkit.org/show_bug.cgi?id=181762
<rdar://problem/35448565>

Reviewed by Simon Fraser.

Source/WebCore:

Do not compute the inherited flow state flag for RenderMultiColumnFlow.
It is (by definition) always inside a fragmented flow.

Test: fast/multicol/crash-when-out-of-flow-positioned-becomes-in-flow.html

* rendering/RenderObject.cpp:
(WebCore::RenderObject::computedFragmentedFlowState):

LayoutTests:

* fast/multicol/crash-when-out-of-flow-positioned-becomes-in-flow-expected.txt: Added.
* fast/multicol/crash-when-out-of-flow-positioned-becomes-in-flow.html: Added.

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

21 months agoDeprecate Application Cache
achristensen@apple.com [Wed, 17 Jan 2018 22:34:16 +0000 (22:34 +0000)]
Deprecate Application Cache
https://bugs.webkit.org/show_bug.cgi?id=181764

Reviewed by Geoffrey Garen.

* features.json:

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

21 months ago[iOS] Re-enable LayoutTests in the storage/indexeddb directory
ryanhaddad@apple.com [Wed, 17 Jan 2018 22:25:05 +0000 (22:25 +0000)]
[iOS] Re-enable LayoutTests in the storage/indexeddb directory
https://bugs.webkit.org/show_bug.cgi?id=180958

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

21 months ago[iOS simulator] API test WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage...
wenson_hsieh@apple.com [Wed, 17 Jan 2018 22:16:03 +0000 (22:16 +0000)]
[iOS simulator] API test WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage is failing
https://bugs.webkit.org/show_bug.cgi?id=181758

Reviewed by Tim Horton.

This test is failing because Editor::clientReplacementURLForResource expects a MIME type, but on iOS, the type
paramter passed into WebContentReader::readImage is a UTI; subsequently, the bundle editing delegate receives
a MIME type that's actually a UTI, which is incorrect. To address this, ensure that a MIME type is passed to
bundle SPI by converting the type in WebContentReader::readImage to a MIME type.

* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readImage):

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

21 months agoMark Alicia as committer in contributors.json
aboya@igalia.com [Wed, 17 Jan 2018 22:01:31 +0000 (22:01 +0000)]
Mark Alicia as committer in contributors.json

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

21 months agoREGRESSION (r226385?): Crash in com.apple.WebCore: WebCore::MediaQueryEvaluator:...
antti@apple.com [Wed, 17 Jan 2018 21:53:26 +0000 (21:53 +0000)]
REGRESSION (r226385?): Crash in com.apple.WebCore: WebCore::MediaQueryEvaluator::evaluate const + 32
https://bugs.webkit.org/show_bug.cgi?id=181742
<rdar://problem/36334726>

Reviewed by David Kilzer.

Source/WebCore:

Test: fast/media/mediaqueryevaluator-crash.html

* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::MediaQueryEvaluator):

Use WeakPtr<Document> instead of a plain Frame pointer.

(WebCore::MediaQueryEvaluator::evaluate const):

Get the frame via document.

* css/MediaQueryEvaluator.h:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):

Take care to clear style resolver.

LayoutTests:

* fast/media/mediaqueryevaluator-crash-expected.txt: Added.
* fast/media/mediaqueryevaluator-crash.html: Added.

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

21 months agoMarked inspector/worker/worker-recover-if-inspector-close.html as flaky on macOS
jlewis3@apple.com [Wed, 17 Jan 2018 21:37:47 +0000 (21:37 +0000)]
Marked inspector/worker/worker-recover-if-inspector-close.html as flaky on macOS
https://bugs.webkit.org/show_bug.cgi?id=181100

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

21 months agoREGRESSION (r226902): fast/events/ios/rotation/layout-viewport-during-rotation.html...
simon.fraser@apple.com [Wed, 17 Jan 2018 21:27:12 +0000 (21:27 +0000)]
REGRESSION (r226902): fast/events/ios/rotation/layout-viewport-during-rotation.html and fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html are timing out
<rdar://problem/36589755>

The first argument to a load event listener is an event, which meant that passing scriptCompleteCallback
didn't work as expected.

* fast/events/ios/rotation/layout-viewport-during-rotation.html:
* fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html:

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

21 months agoSource/WebCore:
commit-queue@webkit.org [Wed, 17 Jan 2018 21:06:48 +0000 (21:06 +0000)]
Source/WebCore:
Put fetch request keepAlive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-17
Reviewed by Chris Dumez.

No change of behavior.

* Modules/fetch/FetchRequest.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::fetchAPIKeepAliveEnabled const):
(WebCore::RuntimeEnabledFeatures::setFetchAPIKeepAliveEnabled):

Source/WebKit:
Put fetch request keepAlive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-17
Reviewed by Chris Dumez.

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetFetchAPIKeepAliveEnabled):
(WKPreferencesGetFetchAPIKeepAliveEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:
Put fetch Request.keepalive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-17
Reviewed by Chris Dumez.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences fetchAPIKeepAliveEnabled]):
(-[WebPreferences setFetchAPIKeepAliveEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:
Put fetch Request.keepalive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-17
Reviewed by Chris Dumez.

* WebPreferences.cpp:
(WebPreferences::fetchAPIKeepAliveEnabled):
(WebPreferences::setFetchAPIKeepAliveEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:
Put fetch Request.keepalive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-17
Reviewed by Chris Dumez.

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

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

21 months agoWeb Inspector: Add back localized strings for Styles sidebar panels
commit-queue@webkit.org [Wed, 17 Jan 2018 20:25:02 +0000 (20:25 +0000)]
Web Inspector: Add back localized strings for Styles sidebar panels
https://bugs.webkit.org/show_bug.cgi?id=181748
<rdar://problem/36583184>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-01-17
Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
(WI.ComputedStyleDetailsSidebarPanel):
* UserInterface/Views/RulesStyleDetailsSidebarPanel.js:
(WI.RulesStyleDetailsSidebarPanel):
* UserInterface/Views/VisualStyleDetailsSidebarPanel.js:
(WI.VisualStyleDetailsSidebarPanel):
Add back localized strings for panel titles lost in r225547.

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

21 months ago[Win] Use switch when converting from ResourceRequestCachePolicy to platform cache...
pvollan@apple.com [Wed, 17 Jan 2018 19:35:21 +0000 (19:35 +0000)]
[Win] Use switch when converting from ResourceRequestCachePolicy to platform cache policy.
https://bugs.webkit.org/show_bug.cgi?id=181686

Reviewed by Alex Christensen.

No new tests, covered by existing tests.

A switch will make the function easier on the eyes. Also, use the function in places where the ResourceRequestCachePolicy
is just casted to a platform cache policy.

* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::toPlatformRequestCachePolicy):

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

21 months agoResource Load Statistics: Block cookies for prevalent resources without user interaction
wilander@apple.com [Wed, 17 Jan 2018 19:16:23 +0000 (19:16 +0000)]
Resource Load Statistics: Block cookies for prevalent resources without user interaction
https://bugs.webkit.org/show_bug.cgi?id=177394
<rdar://problem/34613960>

Reviewed by Alex Christensen.

Source/WebCore:

Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
       http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
       http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
       http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html

* platform/network/NetworkStorageSession.h:
    Now exports NetworkStorageSession::nsCookieStorage().
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
    Fixes the FIXME.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
    Declaration of _initWithIdentifier() on NSHTTPCookieStorage.

Source/WebKit:

* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
    Now has m_hasBeenSetToUseStatelessCookieStorage to handle
    cookie blocking.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
    Returns singleton empty, deny-all cookie storage for cookie blocking.
(WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
    Instead of just decision making, this now applies the policy.
(WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
    New method.
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
    Now blocks cookies for domains where cookies will be purged anyway.
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
    Now blocks cookies for domains where cookies will be purged anyway.
(WebKit::shouldChangePartition): Deleted.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
    Now downgrades for blocked cookies instead of partitioned cookies.
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
    Now downgrades for blocked cookies instead of partitioned cookies.

LayoutTests:

* http/tests/resourceLoadStatistics/add-blocking-to-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/add-blocking-to-redirect.html: Added.
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html:
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html: Added.
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html: Added.
* http/tests/resourceLoadStatistics/remove-partitioning-from-redirect-expected.txt: Removed.
* http/tests/resourceLoadStatistics/remove-partitioning-from-redirect.html: Removed.
    Test case reworked and is now remove-partitioning-in-redirect.html.
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html: Added.
* platform/ios/TestExpectations:
    New tests marked as [ Pass ] for iOS.
* platform/mac-wk2/TestExpectations:
    New tests marked as [ Pass ] for High Sierra+.
* platform/wk2/TestExpectations:
    New tests skipped for WK2 in general.

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

21 months agoREGRESSION (r222795): Cardiogram never signs in
dbates@webkit.org [Wed, 17 Jan 2018 19:09:21 +0000 (19:09 +0000)]
REGRESSION (r222795): Cardiogram never signs in
https://bugs.webkit.org/show_bug.cgi?id=181693
<rdar://problem/36286293>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Exempt Cardiogram from the XHR header restrictions in r222795.

Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
However Cardiogram also depends on such functionality.

Test: fast/xmlhttprequest/set-dangerous-headers-from-file-when-setting-enabled.html

* page/Settings.yaml:
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isCardiogram):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setRequestHeader):

Source/WebKit:

Exempt Cardiogram from the XHR header restrictions in r222795.

Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
However Cardiogram also depends on such functionality.

* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKWebView.mm:
(shouldAllowSettingAnyXHRHeaderFromFileURLs):
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/Cocoa/VersionChecks.h:

Source/WTF:

Add macro define for future iOS.

* wtf/spi/darwin/dyldSPI.h:

LayoutTests:

Adds a test to ensure that a file URL can set forbidden XHR headers when the setting
allowSettingAnyXHRHeaderFromFileURLs is enabled.

* fast/xmlhttprequest/set-dangerous-headers-from-file-when-setting-enabled-expected.txt: Added.
* fast/xmlhttprequest/set-dangerous-headers-from-file-when-setting-enabled.html: Added.

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

21 months agoASSERTION FAILED: !m_completionHandler in PingHandle::~PingHandle()
dbates@webkit.org [Wed, 17 Jan 2018 19:01:41 +0000 (19:01 +0000)]
ASSERTION FAILED: !m_completionHandler in PingHandle::~PingHandle()
https://bugs.webkit.org/show_bug.cgi?id=181746
<rdar://problem/36586248>

Reviewed by Chris Dumez.

Source/WebCore:

Call PingHandle::pingLoadComplete() with an error when NSURLConnection queries
whether the ping is able to respond to an authentication request. (Pings do not
respond to authenticate requests.) It will call the completion handler, nullify
the completion handler, and deallocate the PingHandle. Nullifying the completion
handler is necessary to avoid the assertion failure in ~PingHandle().

Test: http/tests/misc/before-unload-load-image.html

* platform/network/PingHandle.h:

LayoutTests:

Adds a test to ensure that loading a protected image from a beforeunload handler
does not cause an assertion failure.

* http/tests/misc/before-unload-load-image-expected.txt: Added.
* http/tests/misc/before-unload-load-image.html: Added.
* http/tests/misc/resources/before-unload-in-subframe-child.html: Added.
* http/tests/misc/resources/protected/protected-image.php: Added.

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

21 months agoWebCoreResourceHandleAsOperationQueueDelegate/ResourceHandleCFURLConnectionDelegateWi...
dbates@webkit.org [Wed, 17 Jan 2018 18:57:11 +0000 (18:57 +0000)]
WebCoreResourceHandleAsOperationQueueDelegate/ResourceHandleCFURLConnectionDelegateWithOperationQueue may
be deleted in main thread callback
https://bugs.webkit.org/show_bug.cgi?id=181747
<rdar://problem/36588120>

Reviewed by Alex Christensen.

Retain the delegate (e.g. WebCoreResourceHandleAsOperationQueueDelegate) before scheduling
a main thread callback and blocking on a semaphore for its reply because the main thread
callback can do anything, including deleting the delegate, before the non-main thread
has a chance to execute. For instance, a PingHandle will delete itself (and hence delete
its resource handle delegate) in most of the code paths invoked by the delegate.

* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

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

21 months agoWeb Inspector: Super long URL string causes bad wrapping in Resources detail sidebar
commit-queue@webkit.org [Wed, 17 Jan 2018 18:41:56 +0000 (18:41 +0000)]
Web Inspector: Super long URL string causes bad wrapping in Resources detail sidebar
https://bugs.webkit.org/show_bug.cgi?id=181617

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-01-17
Reviewed by Brian Burg.

* UserInterface/Views/DetailsSection.css:
(.details-section > .content > .group > .row.simple > .value):
Set the break to all characters.

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

21 months ago[Win] Compile error: 'wtf/text/icu/TextBreakIteratorICU.h' not found.
pvollan@apple.com [Wed, 17 Jan 2018 18:26:56 +0000 (18:26 +0000)]
[Win] Compile error: 'wtf/text/icu/TextBreakIteratorICU.h' not found.
https://bugs.webkit.org/show_bug.cgi?id=181744
<rdar://problem/36582562>

Reviewed by Alex Christensen.

Add WTF folders to forwarding headers directories.

* wtf/PlatformWin.cmake:

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

21 months ago'fetch' event may be sent to a service worker before its state is set to 'activated'
cdumez@apple.com [Wed, 17 Jan 2018 18:07:32 +0000 (18:07 +0000)]
'fetch' event may be sent to a service worker before its state is set to 'activated'
https://bugs.webkit.org/show_bug.cgi?id=181698
<rdar://problem/36554856>

Reviewed by Youenn Fablet.

'fetch' event may be sent to a service worker before its state is set to 'activated'.
When the registration's active worker needs to intercept a load, and its state is 'activating',
we queue the request to send the fetch event in SWServerWorker::m_whenActivatedHandlers.
Once the SWServerWorker::setState() is called with 'activated' state, we then call the
handlers in m_whenActivatedHandlers to make send the fetch event now that the worker is
activated. The issue is that even though the worker is activated and its state was set to
'activated' on Storage process side, we had not yet notified the ServiceWorker process
of the service worker's new state yet.

To address the issue, we now make sure that SWServerWorker::m_whenActivatedHandlers are
called *after* we've sent the IPC to the ServiceWorker process to update the worker's
state to 'activated'. Also, we now call ServiceWorkerFetch::dispatchFetchEvent()
asynchronously in a postTask() as the service worker's state is also updated asynchronously
in a postTask. This is as per specification [1], which says to "queue a task" to fire
the fetch event.

[1] https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)

No new tests, covered by imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html
which hits the new assertion without the fix.

* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
Add assertions to make sure that we dispatch the fetch event on the right worker and
that the worker is in 'activated' state.

* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postFetchTask):
Queue a task to fire the fetch event as per:
- https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)
We need to match the specification exactly here or things will happen in the wrong
order. In particular, things like "update registration state" and "update worker state"
might happen *after* firing the fetch event, even though the IPC for "update registration/worker
state" was sent before the "fire fetch event" one, because the code for updating a registration/
worker state already queues a task, as per the specification.

* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::updateWorkerState):
* workers/service/server/SWServerRegistration.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::setState):
Move code to send the IPC to the Service Worker process whenever the service worker's state
needs to be updated from SWServerRegistration::updateWorkerState() to SWServerWorker::setState().
This way, we can make sure the IPC is sent *before* we call the m_whenActivatedHandlers handlers,
as they may also send IPC to the Service Worker process, and we need to make sure this IPC happens
after so that the service worker is in the right state.

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

21 months agoPage.cpp only sees forward declaration of ApplicationStateChangeListener when ENABLE...
commit-queue@webkit.org [Wed, 17 Jan 2018 17:36:19 +0000 (17:36 +0000)]
Page.cpp only sees forward declaration of ApplicationStateChangeListener when ENABLE(VIDEO) is off
https://bugs.webkit.org/show_bug.cgi?id=181713

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2018-01-17
Reviewed by Darin Adler.

No new tests (build fix).

* page/Page.cpp: Add include for ApplicationStateChangeListener

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

21 months agoAdd injected bundle SPI to replace subresource URLs when dropping or pasting rich...
wenson_hsieh@apple.com [Wed, 17 Jan 2018 17:07:43 +0000 (17:07 +0000)]
Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
https://bugs.webkit.org/show_bug.cgi?id=181637
<rdar://problem/36508471>

Reviewed by Tim Horton.

Source/WebCore:

Before carrying out blob URL conversion for pasted or dropped rich content, let the editor client replace
subresource URLs in WebKit2 by calling out to new injected bundle SPI. See comments below for more detail.

Tests:  WKAttachmentTests.InjectedBundleReplaceURLsWhenPastingAttributedString
        WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage

* editing/Editor.cpp:
(WebCore::Editor::clientReplacementURLForResource):
* editing/Editor.h:

Add a new helper to call out to the editor client for a URL string to replace a given ArchiveResource. In
WebKit2, this calls out to the injected bundle's new `replacementURLForResource` SPI hook.

* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::shouldReplaceSubresourceURL):
(WebCore::replaceRichContentWithAttachments):
(WebCore::replaceSubresourceURLsWithURLsFromClient):

Add a new static helper to replace subresource URLs in the given DocumentFragment with URLs supplied by the
editor client. Additionally builds a list of ArchiveResources that have not been replaced, for use at call sites
so that we don't unnecessarily create more Blobs for ArchiveResources that have already been replaced.

(WebCore::createFragmentAndAddResources):
(WebCore::sanitizeMarkupWithArchive):

Tweak web content reading codepaths to first replace subresource URLs with editor-client-supplied URLs.

(WebCore::WebContentReader::readImage):
(WebCore::shouldConvertToBlob): Deleted.

Rename this helper to shouldReplaceSubresourceURL, blob URL replacement is no longer the only scenario in which
we replace resource URLs, but in both cases, we still want to ignore `http:`-family and `data:` URLs.

* loader/EmptyClients.cpp:
* page/EditorClient.h:

Source/WebKit:

Add new injected bundle SPI, replacementURLForResource, which clients may use to provide a replacement URL to
represent an archive resource, given the resource's data and MIME type.

* WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
(API::InjectedBundle::EditorClient::replacementURLForResource):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:

Add replacementURLForResource, and also bump the current injected bundle editor client version to 2.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
(WebKit::InjectedBundlePageEditorClient::replacementURLForResource):
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::replacementURLForResource):
* WebProcess/WebCoreSupport/WebEditorClient.h:

Source/WebKitLegacy/mac:

Add a stub implementation of replacementURLForResource. See WebCore and WebKit ChangeLogs for more detail.

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::replacementURLForResource):

Source/WebKitLegacy/win:

Add a stub implementation of replacementURLForResource. See WebCore and WebKit ChangeLogs for more detail.

* WebCoreSupport/WebEditorClient.cpp:
(WebEditorClient::replacementURLForResource):
* WebCoreSupport/WebEditorClient.h:

Tools:

Add 2 new API tests to exercise injected bundle SPI for supplying replacement URLs when pasting an image, and an
attributed string containing multiple NSTextAttachments. See WebKit and WebCore ChangeLogs for more detail.

* TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegatePlugIn.mm:
(-[BundleEditingDelegatePlugIn webProcessPlugIn:didCreateBrowserContextController:]):
(-[BundleEditingDelegatePlugIn _webProcessPlugInBrowserContextController:replacementURLForResource:mimeType:]):

Implement the new Objective-C bundle SPI to look up the incoming MIME type in the dictionary supplied via the
"MIMETypeToReplacementURLMap" bundle initialization parameter, and return it.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(webViewForTestingAttachments):
(-[TestWKWebView tagsInBody]):
(-[TestWKWebView expectElementTagsInOrder:]):
(-[TestWKWebView expectElementTag:toComeBefore:]):

Add a test helper to check that the given list of element tags appears in the document body. Also, reimplement
the existing -expectElementTag:toComeBefore: as a special case of -expectElementTagsInOrder:.

(TestWebKitAPI::TEST):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):

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

21 months ago[EME][GStreamer] Add the full-sample encryption support in the GStreamer ClearKey...
commit-queue@webkit.org [Wed, 17 Jan 2018 17:00:07 +0000 (17:00 +0000)]
[EME][GStreamer] Add the full-sample encryption support in the GStreamer ClearKey decryptor
https://bugs.webkit.org/show_bug.cgi?id=180080

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

Source/WebCore:

Currently the GStreamer clearKey decryptor doesn't support the full-sample encryption,
where the buffer is entirely encrypted, it supports only the sub-sample encryption.

Test: media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html

* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt):

LayoutTests:

* platform/wpe/TestExpectations:
This patch fixes the crash of the test clearKey-cenc-audio-playback-mse.

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

21 months agoUnreviewed follow-up to r227051.
zandobersek@gmail.com [Wed, 17 Jan 2018 14:30:58 +0000 (14:30 +0000)]
Unreviewed follow-up to r227051.

* platform/graphics/cairo/CairoOperations.h: Fix declaration of the
fillRoundedRect() function by removing the bool parameter that's not
used at all in the definition. This went unspotted due to the unified
source build including the implementation file before fillRoundedRect()
usage in GrapihcsContextCairo.cpp, leaving the declaration undefined
and instead using the definition directly.

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

21 months ago[Cairo] Don't mirror global alpha and image interpolation quality state values in...
zandobersek@gmail.com [Wed, 17 Jan 2018 13:06:01 +0000 (13:06 +0000)]
[Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
https://bugs.webkit.org/show_bug.cgi?id=181725

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Don't duplicate global alpha and image interpolation quality state
values on the PlatformContextCairo. Instead, retrieve them from
the managing GraphicsContextState when necessary.

For Cairo operations, the FillSource and StrokeSource containers now
store the global alpha value, using it during the operation executions.
For drawNativeImage(), the global alpha and interpolation quality values
are passed through arguments.

In PlatformContextCairo, the two values are no longer stored on the
internally-managed stack, and the getter-setter pairs for the two values
are removed. In drawSurfaceToContext(), the two values are now expected
to be passed through the method arguments.

No new tests -- no change in behavior.

* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::prepareForFilling):
(WebCore::Cairo::prepareForStroking):
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::fillCurrentCairoPath):
(WebCore::Cairo::FillSource::FillSource):
(WebCore::Cairo::StrokeSource::StrokeSource):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::State::setGlobalAlpha): Deleted.
(WebCore::Cairo::State::setImageInterpolationQuality): Deleted.
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::setPlatformAlpha):
(WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::save):
(WebCore::PlatformContextCairo::drawSurfaceToContext):
(WebCore::PlatformContextCairo::State::State): Deleted.
(WebCore::PlatformContextCairo::setImageInterpolationQuality): Deleted.
(WebCore::PlatformContextCairo::imageInterpolationQuality const): Deleted.
(WebCore::PlatformContextCairo::globalAlpha const): Deleted.
(WebCore::PlatformContextCairo::setGlobalAlpha): Deleted.
* platform/graphics/cairo/PlatformContextCairo.h:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):

Source/WebKit:

* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::paint):
Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::convertCairoSurfaceToShareableBitmap): Ditto.

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

21 months agoWebDriver: add support for test expectations
carlosgc@webkit.org [Wed, 17 Jan 2018 11:23:58 +0000 (11:23 +0000)]
WebDriver: add support for test expectations
https://bugs.webkit.org/show_bug.cgi?id=180420

Reviewed by Carlos Alberto Lopez Perez.

Tools:

Add support for parsing test expectations from a JSON file and mark tests on collection accordingly.

* Scripts/run-webdriver-tests: Get the retval from process_results().
* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook._install_pytest): Install also py because pytest needs it.
* Scripts/webkitpy/webdriver_tests/pytest_runner.py:
(TestExpectationsMarker): Plugin to mark tests based on given expectations.
(TestExpectationsMarker.__init__): Initialize expectations.
(TestExpectationsMarker.pytest_collection_modifyitems): Mark tests if needed,
(run): Create and use TestExpectationsMarker plugin.
* Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py:
(WebDriverSeleniumExecutor.run): Pass expectations to pytest_runner.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py:
(WebDriverTestRunner.__init__): Create a TestExpectations and pass it to the runners.
(WebDriverTestRunner.run): Do not count results here.
(WebDriverTestRunner.process_results): Rename print_results() as process_results() since it now returns the
amount of failures. Printing the test summary while processing results will be made optional in a follow up
patch.
(WebDriverTestRunner.process_results.report): Return the amount of failures.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner_selenium.py:
(WebDriverTestRunnerSelenium.__init__): Initialize _expectations.
(WebDriverTestRunnerSelenium.collect_tests): Do not include skipped tests.
(WebDriverTestRunnerSelenium.run): Stop returning the tests count.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py:
(WebDriverTestRunnerW3C.__init__): Initialize _expectations.
(WebDriverTestRunnerW3C.collect_tests): Do not include skipped tests.
(WebDriverTestRunnerW3C._scan_directory): Ditto.
(WebDriverTestRunnerW3C.run): Stop returning the tests count.
* Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py:
(WebDriverW3CExecutor.run): Pass expectations to pytest_runner.

WebDriverTests:

Add initial test expectations. For now I'm only adding the W3C test expectations, selenium ones will be added in
a follow up patch.

* TestExpectations.json: Added.

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

21 months agoUnreviewed WPE gardening. Mark some known unit test failures.
carlosgc@webkit.org [Wed, 17 Jan 2018 11:21:39 +0000 (11:21 +0000)]
Unreviewed WPE gardening. Mark some known unit test failures.

* TestWebKitAPI/glib/TestExpectations.json:

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

21 months ago[GTK][WPE] Use the same subtest names in GTK and WPE unit tests
carlosgc@webkit.org [Wed, 17 Jan 2018 11:16:10 +0000 (11:16 +0000)]
[GTK][WPE] Use the same subtest names in GTK and WPE unit tests
https://bugs.webkit.org/show_bug.cgi?id=181724

Reviewed by Philippe Normand.

We currently use /webkit2/foo/bar for GTK and /wpe/foo/bar for WPE. Many of the tests are common, so there's no
reason to use different names. This way we can refer to the same test names for both and we can share the
expectations in the TestExpectations.json file.

* TestWebKitAPI/glib/TestExpectations.json:
* TestWebKitAPI/glib/WebKitGLib/TestMain.h: Use /webkit/foo/bar in GTK and WPE.

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

21 months agoREGRESSION(r226973/r226974): Four multimedia tests failing
philn@webkit.org [Wed, 17 Jan 2018 11:10:39 +0000 (11:10 +0000)]
REGRESSION(r226973/r226974): Four multimedia tests failing
https://bugs.webkit.org/show_bug.cgi?id=181696

Reviewed by Carlos Garcia Campos.

This patch reverts some of the changes of the above revisions so as to fix layout test failures.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Properly
prepare stalled event when an error was detected.
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): Revert to previous version.
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
Emit progress event also when streaming but not when an error was
detected.
(WebCore::MediaPlayerPrivateGStreamer::totalBytes const): use isLiveStream like everywhere else.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init): Revert to keep-alive FALSE by default.

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

21 months agoUnreviewed. Increase the slow timeout of GTK and WPE unit tests.
carlosgc@webkit.org [Wed, 17 Jan 2018 11:07:25 +0000 (11:07 +0000)]
Unreviewed. Increase the slow timeout of GTK and WPE unit tests.

We are using now a lower default timeout, so multiplying by 5 is no longer enough for some of the WTF
tests. Multiply by 10 so that we get the same slow timeout as before, 50.

* glib/api_test_runner.py:
(TestRunner._run_test_glib):
(TestRunner._run_google_test):

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

21 months agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.19.6 release.
carlosgc@webkit.org [Wed, 17 Jan 2018 10:36:59 +0000 (10:36 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.6 release.

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit:

* gtk/NEWS: Add release notes for 2.19.6.

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

21 months ago[GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes...
carlosgc@webkit.org [Wed, 17 Jan 2018 10:06:28 +0000 (10:06 +0000)]
[GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds
https://bugs.webkit.org/show_bug.cgi?id=179914

Reviewed by Žan Doberšek.

Source/WebKit:

Add symbols detected by check-for-global-bss-symbols-in-webkigtk-libs to the version script.

* webkitglib-symbols.map:

Tools:

Add two scripts to be run by dist-check step when releasing. One is to detect symbols duplicated in
libjavascriptcoregtk and libwebkit2gtk that should be included to the version script. The other one is to ensure
all symbols listed in the script are present in the library.

* Scripts/check-for-global-bss-symbols-in-webkigtk-libs: Added.
(bss_symbols):
* Scripts/check-for-invalid-symbols-in-version-script: Added.
(script_symbols):
* Scripts/make-dist:
(Distcheck.build):
(Distcheck):
(Distcheck.check_symbols):
(Distcheck.check):

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

21 months ago[GTK][WPE] Propagate the parameters when restarting glib api tests after a crash
carlosgc@webkit.org [Wed, 17 Jan 2018 10:04:14 +0000 (10:04 +0000)]
[GTK][WPE] Propagate the parameters when restarting glib api tests after a crash
https://bugs.webkit.org/show_bug.cgi?id=181722

Reviewed by Žan Doberšek.

I forgot to pass the parameters to run() when restarting.

* glib/glib_test_runner.py:
(GLibTestRunner.run):

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

21 months ago[Cairo] Move prepareForFilling(), prepareForStroking() code to CairoOperations
zandobersek@gmail.com [Wed, 17 Jan 2018 09:35:58 +0000 (09:35 +0000)]
[Cairo] Move prepareForFilling(), prepareForStroking() code to CairoOperations
https://bugs.webkit.org/show_bug.cgi?id=181721

Reviewed by Carlos Garcia Campos.

Move the prepareForFilling() and prepareForStroking() code off of the
PlatformContextCairo class and into static functions inside the
CairoOperations implementation files. The original methods weren't
called from any place other than the Cairo operations, and they only
operated with the cairo_t object that's stored in and retrievable from
the PlatformContextCairo object.

No new tests -- no change in behavior.

* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::reduceSourceByAlpha):
(WebCore::Cairo::prepareCairoContextSource):
(WebCore::Cairo::clipForPatternFilling):
(WebCore::Cairo::prepareForFilling):
(WebCore::Cairo::prepareForStroking):
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::fillCurrentCairoPath):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::reduceSourceByAlpha): Deleted.
(WebCore::prepareCairoContextSource): Deleted.
(WebCore::PlatformContextCairo::prepareForFilling): Deleted.
(WebCore::PlatformContextCairo::prepareForStroking): Deleted.
(WebCore::PlatformContextCairo::clipForPatternFilling): Deleted.
* platform/graphics/cairo/PlatformContextCairo.h:

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

21 months agoUpdate web platform tests for Visual Viewport API
commit-queue@webkit.org [Wed, 17 Jan 2018 09:34:46 +0000 (09:34 +0000)]
Update web platform tests for Visual Viewport API
https://bugs.webkit.org/show_bug.cgi?id=181689

Patch by Ali Juma <ajuma@chromium.org> on 2018-01-17
Reviewed by Alex Christensen.

Rename the test directory from 'viewport' to 'visual-viewport', and update
viewport-resize-event-on-load-overflowing-page.html.

This corresponds to the following upstream commits:
1) https://github.com/w3c/web-platform-tests/commit/f878fee4df619e55c7fbfce1a2ff5e5d4d83a03b
2) https://github.com/w3c/web-platform-tests/commit/03a684d63e62d85cffed38bc942f468692d7d54f

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* web-platform-tests/viewport/w3c-import.log: Removed.
* web-platform-tests/visual-viewport/viewport-no-resize-event-on-overflow-recalc-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-no-resize-event-on-overflow-recalc-expected.txt.
* web-platform-tests/visual-viewport/viewport-no-resize-event-on-overflow-recalc.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-no-resize-event-on-overflow-recalc.html.
* web-platform-tests/visual-viewport/viewport-read-size-causes-layout-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-read-size-causes-layout-expected.txt.
* web-platform-tests/visual-viewport/viewport-read-size-causes-layout.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-read-size-causes-layout.html.
* web-platform-tests/visual-viewport/viewport-read-size-in-iframe-causes-layout-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-read-size-in-iframe-causes-layout-expected.txt.
* web-platform-tests/visual-viewport/viewport-read-size-in-iframe-causes-layout.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-read-size-in-iframe-causes-layout.html.
* web-platform-tests/visual-viewport/viewport-resize-event-on-load-overflowing-page-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-resize-event-on-load-overflowing-page-expected.txt.
* web-platform-tests/visual-viewport/viewport-resize-event-on-load-overflowing-page.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-resize-event-on-load-overflowing-page.html.
* web-platform-tests/visual-viewport/viewport-scrollbars-cause-resize-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-scrollbars-cause-resize-expected.txt.
* web-platform-tests/visual-viewport/viewport-scrollbars-cause-resize.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-scrollbars-cause-resize.html.
* web-platform-tests/visual-viewport/viewport-type-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-type-expected.txt.
* web-platform-tests/visual-viewport/viewport-type.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-type.html.
* web-platform-tests/visual-viewport/viewport-unscaled-scale-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-scale-expected.txt.
* web-platform-tests/visual-viewport/viewport-unscaled-scale-iframe-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-scale-iframe-expected.txt.
* web-platform-tests/visual-viewport/viewport-unscaled-scale-iframe.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-scale-iframe.html.
* web-platform-tests/visual-viewport/viewport-unscaled-scale.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-scale.html.
* web-platform-tests/visual-viewport/viewport-unscaled-scroll-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-scroll-expected.txt.
* web-platform-tests/visual-viewport/viewport-unscaled-scroll-iframe-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-scroll-iframe-expected.txt.
* web-platform-tests/visual-viewport/viewport-unscaled-scroll-iframe.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-scroll-iframe.html.
* web-platform-tests/visual-viewport/viewport-unscaled-scroll.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-scroll.html.
* web-platform-tests/visual-viewport/viewport-unscaled-size-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-size-expected.txt.
* web-platform-tests/visual-viewport/viewport-unscaled-size-iframe-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-size-iframe-expected.txt.
* web-platform-tests/visual-viewport/viewport-unscaled-size-iframe.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-size-iframe.html.
* web-platform-tests/visual-viewport/viewport-unscaled-size.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport-unscaled-size.html.
* web-platform-tests/visual-viewport/viewport_support.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/viewport/viewport_support.js.
* web-platform-tests/visual-viewport/w3c-import.log: Added.

LayoutTests:

* TestExpectations: Updated test path.
* platform/ios/imported/w3c/web-platform-tests/visual-viewport/viewport-unscaled-scroll-iframe-expected.txt: Renamed from LayoutTests/platform/ios/imported/w3c/web-platform-tests/viewport/viewport-unscaled-scroll-iframe-expected.txt.
* platform/ios/imported/w3c/web-platform-tests/visual-viewport/viewport-unscaled-size-expected.txt: Renamed from LayoutTests/platform/ios/imported/w3c/web-platform-tests/viewport/viewport-unscaled-size-expected.txt.
Updated expectation since tests in a directory named 'viewport' but not 'visual-viewport' get a flexible viewport on iOS.
* platform/ios/imported/w3c/web-platform-tests/visual-viewport/viewport-unscaled-size-iframe-expected.txt: Renamed from LayoutTests/platform/ios/imported/w3c/web-platform-tests/viewport/viewport-unscaled-size-iframe-expected.txt.

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

21 months agoDFG::Node::convertToConstant needs to clear the varargs flags
sbarati@apple.com [Wed, 17 Jan 2018 09:24:26 +0000 (09:24 +0000)]
DFG::Node::convertToConstant needs to clear the varargs flags
https://bugs.webkit.org/show_bug.cgi?id=181697
<rdar://problem/36497332>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/dfg-node-convert-to-constant-must-clear-varargs-flags.js: Added.
(doIndexOf):
(bar):
(i.bar):

Source/JavaScriptCore:

* dfg/DFGNode.h:
(JSC::DFG::Node::convertToConstant):

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

21 months agoClear Caches volatile storage as a memory optimization.
commit-queue@webkit.org [Wed, 17 Jan 2018 09:22:35 +0000 (09:22 +0000)]
Clear Caches volatile storage as a memory optimization.
https://bugs.webkit.org/show_bug.cgi?id=181643

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-17
Reviewed by Chris Dumez.

clearMemoryRepresentation clears m_caches which exposes data potentially stored in m_volatileStorage.
Clearing m_volatileStorage allows releasing some memory.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::clearMemoryRepresentation):

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

21 months ago[Cairo] Use one-time ShadowBlur objects when performing shadowing
zandobersek@gmail.com [Wed, 17 Jan 2018 09:20:54 +0000 (09:20 +0000)]
[Cairo] Use one-time ShadowBlur objects when performing shadowing
https://bugs.webkit.org/show_bug.cgi?id=181720

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Don't maintain a ShadowBlur object in the PlatformContextCairo class.
Instead, use temporary ShadowBlur objects whenever shadowing is needed,
providing all the shadow state information to it and drawing shadow into
the given GraphicsContext object.

ShadowBlur constructors are cleaned up. The 'shadows ignored' argument
can now also be provided to the variant that accepts explicit shadow
attributes, but the argument is false by default.

In CairoOperations, the ShadowBlurUsage functionality is rolled into the
new ShadowState class. ShadowState parameter is now used for operations
that might need to perform shadow painting. Call sites are modified
accordingly.

Cairo::State::setShadowValues() and Cairo::State::clearShadow() are
removed, since the ShadowBlur object that was modified through those is
being removed from the PlatformContextCairo class. We still have to flip
the Y-axis of the shadow offset in GraphicsContext::setPlatformShadow()
when shadows are ignoring transformations.

No new tests -- no change in behavior.

* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::ShadowBlur):
* platform/graphics/ShadowBlur.h:
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::drawGlyphsShadow):
(WebCore::Cairo::ShadowState::ShadowState):
(WebCore::Cairo::ShadowState::isVisible const):
(WebCore::Cairo::ShadowState::isRequired const):
(WebCore::Cairo::fillRect):
(WebCore::Cairo::fillRoundedRect):
(WebCore::Cairo::fillRectWithRoundedHole):
(WebCore::Cairo::fillPath):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::State::setShadowValues): Deleted.
(WebCore::Cairo::State::clearShadow): Deleted.
(WebCore::Cairo::ShadowBlurUsage::ShadowBlurUsage): Deleted.
(WebCore::Cairo::ShadowBlurUsage::required const): Deleted.
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::restorePlatformState):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::setPlatformShadow):
(WebCore::GraphicsContext::clearPlatformShadow):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::drawSurfaceToContext):
* platform/graphics/cairo/PlatformContextCairo.h:
(WebCore::PlatformContextCairo::shadowBlur): Deleted.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):

Source/WebKit:

* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::paint):
Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::convertCairoSurfaceToShareableBitmap): Ditto.

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

21 months agoCanvasImageData: createImageData() parameter should not be nullable
zandobersek@gmail.com [Wed, 17 Jan 2018 08:59:01 +0000 (08:59 +0000)]
CanvasImageData: createImageData() parameter should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=181670

Reviewed by Sam Weinig.

Source/WebCore:

createImageData() method on the CanvasImageData interface should not
treat the ImageData parameter as nullable, but should instead reject any
null values with a TypeError, as demanded by the specification.

No new tests -- current tests covering createImageData(null) are updated
to properly cover new behavior of throwing a TypeError exception.

* html/canvas/CanvasImageData.idl:
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::createImageData const):
* html/canvas/CanvasRenderingContext2DBase.h:

LayoutTests:

Update createImageData(null) tests that should now throw a TypeError.

* canvas/philip/tests/2d.imageData.create1.zero.html:
* fast/canvas/canvas-createImageData-expected.txt:
* fast/canvas/canvas-createImageData.html:

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

21 months ago[CMake] Remove WebCoreDerivedSources library target
commit-queue@webkit.org [Wed, 17 Jan 2018 07:14:24 +0000 (07:14 +0000)]
[CMake] Remove WebCoreDerivedSources library target
https://bugs.webkit.org/show_bug.cgi?id=181664

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-01-16
Reviewed by Carlos Garcia Campos.

Source/WebCore:

After unified source build has been introduced, CMake Visual
Studio build suffers complicated unnecessary recompilation issues
because Visual Studio invokes scripts twice in both WebCore and
WebCoreDerivedSources projects (Bug 181117).

WebCoreDerivedSources library has been introduced in r198766 to
avoid command line length limit of CMake Ninja build on macOS.
Fortunately, unified source build has reduced the number of source
files to compile, WebCore doesn't need to be split anymore.

No new tests (No behavior change)

* CMakeLists.txt: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES. Removed WebCoreDerivedSources library target.
Do not compile each JavaScript Builtins.cpp files because the unified source WebCoreJSBuiltins.cpp is already included.
* PlatformGTK.cmake: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES.
* PlatformWin.cmake: Ditto.

Source/WebKit:

* CMakeLists.txt: Do not link WebCoreDerivedSources.
* PlatformGTK.cmake: Appended WebCore after WebCorePlatformGTK in WebKit_LIBRARIES.
* PlatformWin.cmake: Ditto.

Source/WebKitLegacy:

* PlatformWin.cmake: Do not link WebCoreDerivedSources.

Tools:

* TestWebKitAPI/PlatformWPE.cmake: Do not link WebCoreDerivedSources.
* TestWebKitAPI/PlatformWin.cmake: Ditto.

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

21 months agoMove Debug Test262, Release Test262 and Performance queues to Sierra
lingcherd_ho@apple.com [Wed, 17 Jan 2018 07:04:07 +0000 (07:04 +0000)]
Move Debug Test262, Release Test262 and Performance queues to Sierra
https://bugs.webkit.org/show_bug.cgi?id=181692

Unreviewed

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

21 months agoAllow dangerous disabling of poison
jfbastien@apple.com [Wed, 17 Jan 2018 05:40:40 +0000 (05:40 +0000)]
Allow dangerous disabling of poison
https://bugs.webkit.org/show_bug.cgi?id=181685
<rdar://problem/36546265>

Reviewed by Keith Miller.

Some tools such as leak detectors and such like to look at real
pointers, and poisoned ones confuse them. Add a JSC option to
disable poisoning, but log to the console when this is done.

* runtime/JSCPoison.cpp:
(JSC::initializePoison):
* runtime/Options.h:

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

21 months agoCan't scroll iframe after toggling it to display:none and back
simon.fraser@apple.com [Wed, 17 Jan 2018 01:34:42 +0000 (01:34 +0000)]
Can't scroll iframe after toggling it to display:none and back
https://bugs.webkit.org/show_bug.cgi?id=181708
rdar://problem/13234778

Reviewed by Tim Horton.

Source/WebCore:

Nothing updated the FrameView's set of scrollable areas when a subframe came back from display:none.
Mirror the existing virtual removeChild() by making addChild() virtual, and using it to mark
the FrameView's scrollable area set as dirty.

Test: tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe.html

* page/FrameView.cpp:
(WebCore::FrameView::addChild):
* page/FrameView.h:
* platform/ScrollView.h:

LayoutTests:

* tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe-expected.txt: Added.
* tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe.html: Added.

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

21 months agoSWServerWorker::m_contextConnectionIdentifier may get out of date
cdumez@apple.com [Wed, 17 Jan 2018 00:49:56 +0000 (00:49 +0000)]
SWServerWorker::m_contextConnectionIdentifier may get out of date
https://bugs.webkit.org/show_bug.cgi?id=181687
<rdar://problem/36548111>

Reviewed by Brady Eidson.

SWServerWorker::m_contextConnectionIdentifier may get out of date. This happens when the
context process crashes and is relaunched.

No new tests, added assertion in terminateWorkerInternal() that hits without this fix.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::runServiceWorker):
(WebCore::SWServer::terminateWorkerInternal):
(WebCore::SWServer::unregisterServiceWorkerClient):
* workers/service/server/SWServerWorker.h:
(WebCore::SWServerWorker::setContextConnectionIdentifier):

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

21 months agoReset MediaSourcePrivateAVFObjC's m_sourceBufferWithSelectedVideo when the underlying...
jer.noble@apple.com [Wed, 17 Jan 2018 00:04:56 +0000 (00:04 +0000)]
Reset MediaSourcePrivateAVFObjC's m_sourceBufferWithSelectedVideo when the underlying SourceBufferPrivate is removed.
https://bugs.webkit.org/show_bug.cgi?id=181707
<rdar://problem/34809474>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-source/media-source-remove-unload-crash.html

* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):

LayoutTests:

* media/media-source/media-source-remove-unload-crash-expected.txt: Added.
* media/media-source/media-source-remove-unload-crash.html: Added.

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

21 months agoWeb Inspector: Canvas tab: typing a "space" in the QuickConsole shouldn't trigger...
mattbaker@apple.com [Tue, 16 Jan 2018 23:17:36 +0000 (23:17 +0000)]
Web Inspector: Canvas tab: typing a "space" in the QuickConsole shouldn't trigger a recording
https://bugs.webkit.org/show_bug.cgi?id=181706
<rdar://problem/36558221>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView):
(WI.CanvasOverviewContentView.prototype._handleSpace):

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

21 months ago[WebAuthN] Implement dummy WebAuthN IDLs
jiewen_tan@apple.com [Tue, 16 Jan 2018 23:08:44 +0000 (23:08 +0000)]
[WebAuthN] Implement dummy WebAuthN IDLs
https://bugs.webkit.org/show_bug.cgi?id=181627
<rdar://problem/36459864>

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/credential-management/credentialscontainer-create-basics.https-expected.txt:

Source/WebCore:

This patch implements dummy WebAuthN IDLs and connect them with Credential Management as well.
All implementations in this patch are subject to change when real implementations land. The
purpose here on the other hand is to have IDLs, bindings and implementations connected. This
patch should handle all IDLs that we need.

No tests.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/credentialmanagement/CredentialCreationOptions.h:
* Modules/credentialmanagement/CredentialCreationOptions.idl:
* Modules/credentialmanagement/CredentialRequestOptions.h:
* Modules/credentialmanagement/CredentialRequestOptions.idl:
* Modules/webauthn/AuthenticatorAssertionResponse.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
(WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
(WebCore::AuthenticatorAssertionResponse::~AuthenticatorAssertionResponse):
(WebCore::AuthenticatorAssertionResponse::authenticatorData):
(WebCore::AuthenticatorAssertionResponse::signature):
(WebCore::AuthenticatorAssertionResponse::userHandle):
* Modules/webauthn/AuthenticatorAssertionResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/AuthenticatorAssertionResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/AuthenticatorAttestationResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
(WebCore::AuthenticatorAttestationResponse::AuthenticatorAttestationResponse):
(WebCore::AuthenticatorAttestationResponse::~AuthenticatorAttestationResponse):
(WebCore::AuthenticatorAttestationResponse::attestationObject):
* Modules/webauthn/AuthenticatorAttestationResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/AuthenticatorAttestationResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/AuthenticatorResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
(WebCore::AuthenticatorResponse::AuthenticatorResponse):
(WebCore::AuthenticatorResponse::~AuthenticatorResponse):
(WebCore::AuthenticatorResponse::clientDataJSON):
* Modules/webauthn/AuthenticatorResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/AuthenticatorResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::rawId):
(WebCore::PublicKeyCredential::response):
(WebCore::PublicKeyCredential::getClientExtensionResults):
(WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredential.idl:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl: Added.
* Modules/webauthn/PublicKeyCredentialDescriptor.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
* Modules/webauthn/PublicKeyCredentialDescriptor.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/PublicKeyCredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
* Modules/webauthn/PublicKeyCredentialRequestOptions.idl: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/PublicKeyCredentialType.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/PublicKeyCredentialType.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

LayoutTests:

Modify some tests to reflect the update.

* http/wpt/credential-management/credentialscontainer-create-basics.https-expected.txt:
* http/wpt/credential-management/credentialscontainer-create-basics.https.html:
* http/wpt/credential-management/credentialscontainer-get-basics.https-expected.txt:
* http/wpt/credential-management/credentialscontainer-get-basics.https.html:

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

21 months agoAX: Do not trigger layout in updateBackingStore() unless it is safe to do so
zalan@apple.com [Tue, 16 Jan 2018 23:06:54 +0000 (23:06 +0000)]
AX: Do not trigger layout in updateBackingStore() unless it is safe to do so
https://bugs.webkit.org/show_bug.cgi?id=181703
<rdar://problem/36365706>

Reviewed by Ryosuke Niwa.

Document::isSafeToUpdateStyleOrLayout() can tell whether it is safe to run layout.

Unable to create test with WebInspector involved.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore):
* dom/Document.cpp:
(WebCore::Document::isSafeToUpdateStyleOrLayout const):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayout):
(WebCore::isSafeToUpdateStyleOrLayout): Deleted.
* dom/Document.h:

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

21 months agoUnreviewed, rolling out r226962.
ryanhaddad@apple.com [Tue, 16 Jan 2018 22:52:47 +0000 (22:52 +0000)]
Unreviewed, rolling out r226962.

The LayoutTest added with this change is a flaky timeout.

Reverted changeset:

"Support for preconnect Link headers"
https://bugs.webkit.org/show_bug.cgi?id=181657
https://trac.webkit.org/changeset/226962

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

21 months agoUnreviewed, rolling out r226937.
ryanhaddad@apple.com [Tue, 16 Jan 2018 22:35:39 +0000 (22:35 +0000)]
Unreviewed, rolling out r226937.

Tests added with this change are failing due to a missing
exception check.

Reverted changeset:

"[JSC] NumberPrototype::extractRadixFromArgs incorrectly cast
double to int32_t"
https://bugs.webkit.org/show_bug.cgi?id=181182
https://trac.webkit.org/changeset/226937

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

21 months agoWeb Inspector: Make Console's Execution Context picker stand out when it is non-default
commit-queue@webkit.org [Tue, 16 Jan 2018 22:26:26 +0000 (22:26 +0000)]
Web Inspector: Make Console's Execution Context picker stand out when it is non-default
https://bugs.webkit.org/show_bug.cgi?id=181628
<rdar://problem/36492044>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-01-16
Reviewed by Matt Baker.

* UserInterface/Views/HierarchicalPathComponent.css:
(.hierarchical-path-component > .selector-arrows):
* UserInterface/Views/HierarchicalPathComponent.js:
(WI.HierarchicalPathComponent.prototype.set selectorArrows):
Switch to SVG element so we can style the arrows.

* UserInterface/Views/QuickConsole.css:
(.quick-console > .navigation-bar > .hierarchical-path .execution-context):
(.quick-console > .navigation-bar > .hierarchical-path .execution-context .separator):
(.quick-console > .navigation-bar > .hierarchical-path.non-default-execution-context .execution-context):
(.quick-console > .navigation-bar > .hierarchical-path.non-default-execution-context .execution-context .selector-arrows):
Styles for the execution context picker. We hide the unused separator
and instead use margin so that the selected background and border don't
have an extra 7px on the right/end side.

* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole.prototype._activeExecutionContextChanged):
Toggle the non-default class name on the path.

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

21 months agoMerge sync and async code paths for getting context menus
achristensen@apple.com [Tue, 16 Jan 2018 21:58:34 +0000 (21:58 +0000)]
Merge sync and async code paths for getting context menus
https://bugs.webkit.org/show_bug.cgi?id=181423

Reviewed by Joseph Pecoraro.

What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!

* UIProcess/API/APIContextMenuClient.h:
(API::ContextMenuClient::getContextMenuFromProposedMenu):
(API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageContextMenuClient):
* UIProcess/API/glib/WebKitContextMenuClient.cpp:
* UIProcess/WebContextMenuProxy.h:
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::show):
(WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
* UIProcess/gtk/WebContextMenuProxyGtk.h:
* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
(WebKit::WebContextMenuProxyMac::showContextMenu):
* UIProcess/wpe/WebContextMenuProxyWPE.h:

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

21 months agoText looks bad on some CSS spec pages
simon.fraser@apple.com [Tue, 16 Jan 2018 21:52:09 +0000 (21:52 +0000)]
Text looks bad on some CSS spec pages
https://bugs.webkit.org/show_bug.cgi?id=181700
rdar://problem/36552107

Reviewed by Tim Horton.

When making new tiles in a TileController, we failed to set their "supports antialiased layer text"
setting, so tile caches could end up with a mixture of layers that do and do not support
antialiased layer text.

No tests because the tiled drawing tests don't dump out tiles inside of tile caches.

* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::createTileLayer):

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

21 months agoWeb Inspector: Styles: pressing down key should select first item from completion...
nvasilyev@apple.com [Tue, 16 Jan 2018 20:54:04 +0000 (20:54 +0000)]
Web Inspector: Styles: pressing down key should select first item from completion list when focusing on empty value
https://bugs.webkit.org/show_bug.cgi?id=181633
<rdar://problem/36501797>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SpreadsheetTextField.js:
(WI.SpreadsheetTextField.prototype._updateCompletions):

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

21 months agoWeb Inspector: Styles Redesign: Long value causes bad wrapping
nvasilyev@apple.com [Tue, 16 Jan 2018 20:31:54 +0000 (20:31 +0000)]
Web Inspector: Styles Redesign: Long value causes bad wrapping
https://bugs.webkit.org/show_bug.cgi?id=181618
<rdar://problem/36485175>

Reviewed by Joseph Pecoraro.

Wrap long values only when editing.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor .value.editing):

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

21 months agoWeb Inspector: Styles Redesign: clicking on the white space after the property someti...
nvasilyev@apple.com [Tue, 16 Jan 2018 20:23:12 +0000 (20:23 +0000)]
Web Inspector: Styles Redesign: clicking on the white space after the property sometimes places a blank property at the wrong index
https://bugs.webkit.org/show_bug.cgi?id=179585
<rdar://problem/35490780>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved):
Layout call is needed to update data-property-index attributes on the property views.

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

21 months agoREGRESSION(r221292): svg/animations/animateTransform-pattern-transform.html crashes...
said@apple.com [Tue, 16 Jan 2018 20:21:28 +0000 (20:21 +0000)]
REGRESSION(r221292): svg/animations/animateTransform-pattern-transform.html crashes with security assertion
https://bugs.webkit.org/show_bug.cgi?id=179986

Reviewed by Simon Fraser.

Source/WebCore:

This patch reverts all or parts of the following changes-sets
    <http://trac.webkit.org/changeset/221292>
    <http://trac.webkit.org/changeset/197967>
    <http://trac.webkit.org/changeset/196670>

A JS statement like this:
    var item = text.x.animVal.getItem(0);

Creates the following C++ objects:
    SVGAnimatedListPropertyTearOff<SVGLengthListValues> for 'text.x'
    SVGListPropertyTearOff<SVGLengthListValues> for 'text.x.animVal'
    SVGPropertyTearOff<SVGLengthValue> for 'text.x.animVal.getItem(0)'

If 'item' changes, the attribute 'x' of the element '<text>' will change
as well. But this binding works only in one direction. If the attribute
'x' of the element '<text>' changes, e.g.:

    text.setAttribute('x', '10,20,30');

This will detach 'item' from the element <text> and any further changes
in 'item' won't affect the attribute 'x' of element <text>.

The one direction binding can only work if this chain of tear-off objects
is kept connected. This is implemented by RefCounted back pointers from
SVGPropertyTearOff and SVGListPropertyTearOff to SVGAnimatedListPropertyTearOff.

The security crashes and the memory leaks are happening because of the
raw forward pointers:
    -- SVGAnimatedListPropertyTearOff maintains raw pointers of type
       SVGListPropertyTearOff for m_baseVal and m_animVal
    -- The m_wrappers and m_animatedWrappers of SVGAnimatedListPropertyTearOff
       are vectors of raw pointer Vector<SVGLength*>

To control the life cycle of the raw pointers, SVGListPropertyTearOff and
SVGPropertyTearOff call SVGAnimatedListPropertyTearOff::propertyWillBeDeleted()
to notify it they are going to be deleted. In propertyWillBeDeleted(), we
clear the pointers so they are not used after being freed. This mechanism
has been error-prone and we've never got it 100% right.

The solution we need to adopt with SVG tear-off objects is the following:
    -- All the forward pointers should be weak pointers.
    -- All the back pointers should be ref pointers.

This solution may not look intuitive but it solves the bugs and keeps the
one direction binding. The forward weak pointers allows the tear-off
objects to go aways if no reference from JS exists. The back ref pointers
maintains the chain of objects and guarantees the correct binding.

* svg/SVGPathSegList.h:
* svg/SVGTransformList.h:
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::baseVal):
(WebCore::SVGAnimatedListPropertyTearOff::animVal):
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGAnimatedProperty.h:
(WebCore::SVGAnimatedProperty::isAnimatedListTearOff const):
(WebCore::SVGAnimatedProperty::propertyWillBeDeleted): Deleted.
* svg/properties/SVGAnimatedPropertyTearOff.h:
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::initializeValuesAndWrappers):
(WebCore::SVGListProperty::getItemValuesAndWrappers):
(WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
(WebCore::SVGListProperty::replaceItemValuesAndWrappers):
(WebCore::SVGListProperty::removeItemValuesAndWrappers):
(WebCore::SVGListProperty::appendItemValuesAndWrappers):
(WebCore::SVGListProperty::createWeakPtr const):
* svg/properties/SVGListPropertyTearOff.h:
(WebCore::SVGListPropertyTearOff::removeItemFromList):
(WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff): Deleted.
* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::createWeakPtr const):
(WebCore::SVGPropertyTearOff::~SVGPropertyTearOff):

LayoutTests:

* svg/dom/SVGAnimatedListPropertyTearOff-leak.html:

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

21 months agoWeb Inspector: Network Tab - Export HAR Context Menu not working
commit-queue@webkit.org [Tue, 16 Jan 2018 20:20:35 +0000 (20:20 +0000)]
Web Inspector: Network Tab - Export HAR Context Menu not working
https://bugs.webkit.org/show_bug.cgi?id=181694
<rdar://problem/36479197>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-01-16
Reviewed by Brian Burg.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.prototype.tableCellContextMenuClicked):
Ensure `this` works in the handler.

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

21 months agoDon't link WebKit target directly to JavaScriptCore
mcatanzaro@igalia.com [Tue, 16 Jan 2018 19:47:57 +0000 (19:47 +0000)]
Don't link WebKit target directly to JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=181688

Reviewed by Alex Christensen.

It's safer if we only link to the next lower-layered lib in the stack, so let's just link
directly to WebCore instead.

And WPE doesn't need to specify it twice.

* CMakeLists.txt:
* PlatformMac.cmake:
* PlatformWPE.cmake:

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

21 months agoAVSampleBufferDisplayLayer should be flushed when application activates
eric.carlson@apple.com [Tue, 16 Jan 2018 19:46:40 +0000 (19:46 +0000)]
AVSampleBufferDisplayLayer should be flushed when application activates
https://bugs.webkit.org/show_bug.cgi?id=181623
<rdar://problem/36487738>

Reviewed by Darin Adler.

Source/WebCore:

No new tests, I wasn't able to reproduce it in a test.

* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::addApplicationStateChangeListener): New.
(WebCore::Document::removeApplicationStateChangeListener): Ditto.
(WebCore::Document::forEachApplicationStateChangeListener): Ditto.
* dom/Document.h:

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::registerWithDocument): Register for application state changes.
(WebCore::HTMLMediaElement::unregisterWithDocument): Unregister.
(WebCore::HTMLMediaElement::applicationWillResignActive): Pass through to the player.
(WebCore::HTMLMediaElement::applicationDidBecomeActive): Ditto.
* html/HTMLMediaElement.h:

* page/ApplicationStateChangeListener.h: Added.
(WebCore::ApplicationStateChangeListener::applicationWillResignActive):
(WebCore::ApplicationStateChangeListener::applicationDidBecomeActive):
* page/Page.cpp:
(WebCore::Page::forEachDocument):
(WebCore::Page::applicationWillResignActive):
(WebCore::Page::applicationDidEnterBackground):
(WebCore::Page::applicationWillEnterForeground):
(WebCore::Page::applicationDidBecomeActive):
* page/Page.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::applicationWillResignActive):
(WebCore::MediaPlayer::applicationDidBecomeActive):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::applicationWillResignActive):
(WebCore::MediaPlayerPrivateInterface::applicationDidBecomeActive):

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Switch
to release logging.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueCorrectedVideoSample): Split out of enqueueVideoSample.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Move code that updates
the display later to enqueueCorrectedVideoSample. Rearrange logic to the image painter sample
buffer has the correct timestamp.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerErrorDidChange): Switch to release logging.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive): f the display
layer is in the "failed" state, flush the renderer and update the display mode.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Switch to release logging.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareToPlay): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateReadyState) Ditto.:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::logChannel const): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes): Deleted.

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationWillResignActive): Call page.
(WebKit::WebPage::applicationDidEnterBackground): Ditto, let it call libWebRTCProvider.
(WebKit::WebPage::applicationWillEnterForeground): Call page.
(WebKit::WebPage::applicationDidBecomeActive): Ditto, let it call libWebRTCProvider.

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

21 months agoPAL should link to JavaScriptCore rather than WTF
mcatanzaro@igalia.com [Tue, 16 Jan 2018 19:41:49 +0000 (19:41 +0000)]
PAL should link to JavaScriptCore rather than WTF
https://bugs.webkit.org/show_bug.cgi?id=181683

Reviewed by Konstantin Tokarev.

Source/WebCore:

Do not link directly to JavaScriptCore. Get it via PAL.

* CMakeLists.txt:

Source/WebCore/PAL:

Currently we are accidentally linking WTF into both libjavascriptcoregtk and libwebkit2gtk,
which could in theory cause problems similar to bug #179914. There are only two possible
solutions:

 - Ensure WTF always built as a shared library if JavaScriptCore is built as a shared
   library
 - Change PAL to link to JavaScriptCore instead of WTF

The problem here is caused by layer hopping. It can never be a problem if each library only
links to the next lowest-layered library.

The downside is this allows PAL to use JavaScriptCore symbols, which is not super desirable.
I came up with a hack yesterday for PAL to link to WTF usually, but link to JavaScriptCore
instead if ${JavaScriptCore_LIBRARY_TYPE} MATCHES "SHARED" AND ${WTF_LIBRARY_TYPE} MATCHES
"STATIC". But that is getting too complex and introduces more possibility for platform-
dependent build failures. Better to just accept that PAL will depend on JavaScriptCore.

Note: I'm not brave enough to update the XCode build. We can use that to enforce that no
JavaScriptCore symbols actually get used, I guess....

* pal/CMakeLists.txt:

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