WebKit-https.git
3 years ago[XSS Auditor] Truncate data URLs at quotes
dbates@webkit.org [Thu, 22 Sep 2016 21:33:20 +0000 (21:33 +0000)]
[XSS Auditor] Truncate data URLs at quotes
https://bugs.webkit.org/show_bug.cgi?id=161937

Reviewed by David Kilzer.

Source/WebCore:

Merged from Blink:
<https://chromium.googlesource.com/chromium/src/+/c6d6331190dd43f09459e2341c3111e796f9de12/>

Truncate a data URL at the first single or double quote character to avoid considering
characters that may come from the page content following an injected data URL.

Test: http/tests/security/xssAuditor/script-tag-with-source-data-url4.html

* html/parser/XSSAuditor.cpp:
(WebCore::truncateForSrcLikeAttribute):

LayoutTests:

* http/tests/security/xssAuditor/resources/echo-property.pl:
* http/tests/security/xssAuditor/script-tag-with-source-data-url4-expected.txt: Added.
* http/tests/security/xssAuditor/script-tag-with-source-data-url4.html: Added.

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

3 years agoRemove more ENABLE(TEXT_AUTOSIZING) code
dbates@webkit.org [Thu, 22 Sep 2016 21:22:32 +0000 (21:22 +0000)]
Remove more ENABLE(TEXT_AUTOSIZING) code
https://bugs.webkit.org/show_bug.cgi?id=162456

Reviewed by Simon Fraser.

.:

* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/WebCore:

* page/Settings.in:
* rendering/style/StyleVisualData.h:
(WebCore::StyleVisualData::operator==):

Source/WebKit2:

* UIProcess/API/efl/ewk_settings.cpp:
(ewk_settings_text_autosizing_enabled_set):
(ewk_settings_text_autosizing_enabled_get):
* UIProcess/API/efl/tests/test_ewk2_settings.cpp:
(TEST_F):

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

3 years agoFences on x86 should be a lot cheaper
fpizlo@apple.com [Thu, 22 Sep 2016 21:11:42 +0000 (21:11 +0000)]
Fences on x86 should be a lot cheaper
https://bugs.webkit.org/show_bug.cgi?id=162417

Reviewed by Mark Lam and Geoffrey Garen.
Source/JavaScriptCore:

It turns out that:

    lock; orl $0, (%rsp)

does everything that we wanted from:

    mfence

And it's a lot faster. When I tried mfence for making object visiting concurrent-GC-TSO-
friendly, it was a 9% regression on Octane/splay. But when I tried ortop, it was neutral.
So, we should use ortop from now on.

This part of the change is for the JITs. MacroAssembler::memoryFence() appears to always
mean something like an acqrel fence, so it's safe to make this use ortop. Since B3's Fence
compiles to Air MemoryFence, which is just MacroAssembler::memoryFence(), this also changes
B3 codegen.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::memoryFence):
* assembler/X86Assembler.h:
(JSC::X86Assembler::lock):
* b3/testb3.cpp:
(JSC::B3::testX86MFence):
(JSC::B3::testX86CompilerFence):

Source/WTF:

It turns out that:

    lock; orl $0, (%rsp)

does everything that we wanted from:

    mfence

And it's a lot faster. When I tried mfence for making object visiting concurrent-GC-TSO-
friendly, it was a 9% regression on Octane/splay. But when I tried ortop, it was neutral.
So, we should use ortop from now on.

This part of the change just affects our Atomics. I also changed this in the JITs.

* wtf/Atomics.h:
(WTF::x86_ortop):
(WTF::storeLoadFence):
(WTF::x86_mfence): Deleted.

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

3 years agoFullscreen controls inoperative in WebKitLegacy web views
jer.noble@apple.com [Thu, 22 Sep 2016 20:54:56 +0000 (20:54 +0000)]
Fullscreen controls inoperative in WebKitLegacy web views
https://bugs.webkit.org/show_bug.cgi?id=162374

Reviewed by Eric Carlson.

After r205365, the WebPlaybackSessionInterfaceAVKit was now created after the
WebPlaybackSessionModel which fed it data, so it no longer received the burst of data upon
creation. Instead, it should have always asked the model for its cached data as soon as it
was connected to set up its inital state.

* platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
(WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):

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

3 years agotest262: Function length should be number of parameters before parameters with defaul...
commit-queue@webkit.org [Thu, 22 Sep 2016 19:11:23 +0000 (19:11 +0000)]
test262: Function length should be number of parameters before parameters with default values
https://bugs.webkit.org/show_bug.cgi?id=162377

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-22
Reviewed by Saam Barati.

JSTests:

* stress/es6-default-parameters.js:
Add our own tests for function lengths with default parameters.

* test262.yaml:
We now pass all dflt-length tests.

Source/JavaScriptCore:

https://tc39.github.io/ecma262/#sec-function-definitions-static-semantics-expectedargumentcount

> NOTE: The ExpectedArgumentCount of a FormalParameterList is the number of
> FormalParameters to the left of either the rest parameter or the first
> FormalParameter with an Initializer. A FormalParameter without an
> initializer is allowed after the first parameter with an initializer
> but such parameters are considered to be optional with undefined as
> their default value.

Alongside the parameterCount value, maintain a separate count,
functionLength, which will be the count before seeing a rest parameter
or parameter with a default value. This will be the function's length.

* bytecode/UnlinkedCodeBlock.h:
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedFunctionExecutable.h:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createFunctionMetadata):
* parser/Nodes.cpp:
(JSC::FunctionMetadataNode::FunctionMetadataNode):
* parser/Nodes.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::isArrowFunctionParameters):
(JSC::Parser<LexerType>::parseGeneratorFunctionSourceElements):
(JSC::Parser<LexerType>::parseFormalParameters):
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::Parser<LexerType>::parseFunctionParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
* parser/Parser.h:
* parser/ParserFunctionInfo.h:
* parser/SourceProviderCacheItem.h:
(JSC::SourceProviderCacheItem::SourceProviderCacheItem):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createFunctionMetadata):
* runtime/Executable.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::createBuiltinFunction):
(JSC::JSFunction::reifyLength):

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

3 years agoRemove a bunch of unnecessary includes
joepeck@webkit.org [Thu, 22 Sep 2016 18:59:47 +0000 (18:59 +0000)]
Remove a bunch of unnecessary includes
https://bugs.webkit.org/show_bug.cgi?id=162376

Reviewed by Mark Lam.

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

3 years agoFix serialization of HTML void elements when they have children
cdumez@apple.com [Thu, 22 Sep 2016 18:47:34 +0000 (18:47 +0000)]
Fix serialization of HTML void elements when they have children
https://bugs.webkit.org/show_bug.cgi?id=162418

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/syntax/serializing-html-fragments/serializing-expected.txt:

Source/WebCore:

Fix serialization of HTML void elements when they have children.

Void elements (such as <hr>) cannot have a closing tag. When
encountering them, we would properly not serialize the void
element's children (if it had any). However, we would incorrectly
append an end tag (because the element technically has children).

Relevant specification:
- https://html.spec.whatwg.org/#html-fragment-serialisation-algorithm

In particular, this part:
""
If current node is an area, base, basefont, bgsound, br, col, embed,
frame, hr, img, input, keygen, link, meta, param, source, track or wbr
element, then continue on to the next child node at this point.
""

Firefox matches the specification.

No new tests, rebaselined existing test.

* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):

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

3 years ago[WinCairo] Fix build after r206196
commit-queue@webkit.org [Thu, 22 Sep 2016 18:43:40 +0000 (18:43 +0000)]
[WinCairo] Fix build after r206196

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2016-09-22
Reviewed by Alex Christensen.

* platform/text/win/LocaleWin.cpp:
(WebCore::LocaleWin::getLocaleInfoString):

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

3 years agoMarking imported/w3c/web-platform-tests/media-source/mediasource-duration.html as...
ryanhaddad@apple.com [Thu, 22 Sep 2016 18:30:33 +0000 (18:30 +0000)]
Marking imported/w3c/web-platform-tests/media-source/mediasource-duration.html as flaky on mac.
https://bugs.webkit.org/show_bug.cgi?id=162308

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoUnreviewed, rolling out r206112.
ryanhaddad@apple.com [Thu, 22 Sep 2016 18:19:49 +0000 (18:19 +0000)]
Unreviewed, rolling out r206112.

This change made inspector/network/xhr-json-blob-has-
content.html very flaky.

Reverted changeset:

"Web Inspector: adopt Object.awaitEvent in
LayoutTests/inspector/network"
https://bugs.webkit.org/show_bug.cgi?id=162099
http://trac.webkit.org/changeset/206112

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

3 years agoimported/w3c/web-platform-tests/resource-timing/idlharness.html is flaky
commit-queue@webkit.org [Thu, 22 Sep 2016 17:59:34 +0000 (17:59 +0000)]
imported/w3c/web-platform-tests/resource-timing/idlharness.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=162414

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-22

* TestExpectations:

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

3 years agoAutomatic Text Replacement Testing in WebKit2
jbedard@apple.com [Thu, 22 Sep 2016 17:39:51 +0000 (17:39 +0000)]
Automatic Text Replacement Testing in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=161919

Reviewed by Ryosuke Niwa.

Source/WebCore:

Fixing existing tests:
    editing/inserting/smart-link-when-caret-is-moved-before-URL.html
    editing/inserting/typing-space-to-trigger-smart-link.html

Implemented test hooks for text replacement for WebKit2.
Note that spell checking has not been implemented, so most tests which use text replacement still fail.

* testing/Internals.cpp:
(WebCore::Internals::Internals): Reset TextChecker.
(WebCore::Internals::setContinuousSpellCheckingEnabled): Converted exception to an assert.
(WebCore::Internals::setAutomaticQuoteSubstitutionEnabled): Converted exception to an assert.
(WebCore::Internals::setAutomaticLinkDetectionEnabled): Converted exception to an assert.
(WebCore::Internals::setAutomaticDashSubstitutionEnabled): Converted exception to an assert.
(WebCore::Internals::setAutomaticTextReplacementEnabled): Converted exception to an assert.
(WebCore::Internals::setAutomaticSpellingCorrectionEnabled): Converted exception to an assert.
* testing/Internals.h: Removed exception argument for TextChecker setters.
* testing/Internals.idl: Ditto.

Source/WebKit2:

Implemented test hooks for text replacement for WebKit2.
Note that spell checking has not been implemented, so most tests which use text replacement still fail.

* UIProcess/API/C/WKTextChecker.cpp: Added #ifdefs to include file for iOS and Mac.
(WKTextCheckerSetTestingMode): Added.
* UIProcess/API/C/WKTextChecker.h: Added #ifdefs to include file for iOS and Mac.
* UIProcess/TextChecker.h: Added hooks to bypass writing to NSUserDefaults.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::toggleSmartInsertDelete):  New message to toggle TextChecker flag.
(WebKit::WebPageProxy::toggleAutomaticQuoteSubstitution): Ditto.
(WebKit::WebPageProxy::toggleAutomaticLinkDetection): Ditto.
(WebKit::WebPageProxy::toggleAutomaticDashSubstitution): Ditto.
(WebKit::WebPageProxy::toggleAutomaticTextReplacement): Ditto.
* UIProcess/WebPageProxy.h: Added messages to toggle TextChecker flags.
* UIProcess/WebPageProxy.messages.in: Ditto.
* UIProcess/efl/TextCheckerEfl.cpp: Implemented new TextChecker hooks for non-Cocoa platforms.
* UIProcess/gtk/TextCheckerGtk.cpp: Ditto.
(WebKit::TextChecker::mutableState): Ditto.
* UIProcess/ios/TextCheckerIOS.mm: Implemented new TextChecker hooks.
(WebKit::TextChecker::mutableState): Allow modification of text checker without writing to NSUserDefaults.
(WebKit::TextChecker::state): Call mutableState.
(WebKit::TextChecker::accessSmartInsertDeleteEnabled): Dummy function.
* UIProcess/mac/TextCheckerMac.mm:
(WebKit::refresh): Reload TextChecker configuration from NSUserDefaults.
(WebKit::TextChecker::mutableState): Allow modification of text checker without writing to NSUserDefaults.
(WebKit::TextChecker::state): Call mutableState().
(WebKit::TextChecker::accessSmartInsertDeleteEnabled): Allow toggling of smartInsertDeleteEnabled without writing to NSUserDefaults.
(WebKit::initializeState): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetAutomaticLinkDetectionEnabled): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Removed WKBundleSetAutomaticLinkDetectionEnabled.
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setAutomaticLinkDetectionEnabled): Deleted.
* WebKit2.xcodeproj/project.pbxproj: Added WKTextChecker to Mac and iOS.
* WebProcess/InjectedBundle/InjectedBundle.h: Remove setAutomaticLinkDetectionEnabled.
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
(WebKit::WebEditorClient::toggleSmartInsertDelete): Send message to UI process to toggle TextChecker.
(WebKit::WebEditorClient::toggleAutomaticQuoteSubstitution): Ditto.
(WebKit::WebEditorClient::toggleAutomaticLinkDetection): Ditto.
(WebKit::WebEditorClient::toggleAutomaticDashSubstitution): Ditto.
(WebKit::WebEditorClient::toggleAutomaticTextReplacement): Ditto.

Tools:

Implemented test hooks for text replacement for WebKit2.
Note that spell checking has not been implemented, so most tests which use text replacement still fail.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: Removed setAutomaticLinkDetectionEnabled from TestRunner, moved to Internals.
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: Ditto.
(WTR::InjectedBundle::beginTesting): Ditto.
* WebKitTestRunner/InjectedBundle/TestRunner.cpp: Ditto.
* WebKitTestRunner/InjectedBundle/TestRunner.h: Ditto.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::runTest): Place TextChecker into testing mode.

LayoutTests:

Implemented test hooks for text replacement for WebKit2.
Note that spell checking has not been implemented, so most tests which use text replacement still fail.

* editing/inserting/smart-link-when-caret-is-moved-before-URL.html: Use internals instead of TestRunner.
* editing/inserting/typing-space-to-trigger-smart-link.html: Ditto.
* platform/efl/TestExpectations: Added port specific tests.
* platform/gtk/TestExpectations: Added port specific tests.
* platform/ios-simulator/TestExpectations: Added port specific tests.
* platform/ios-simulator-wk1/TestExpectations: Moved skipped tests to ios-simulator.
* platform/ios-simulator-wk2/TestExpectations: Moved skipped tests to ios-simulator.
* platform/mac-wk2/TestExpectations: Removed passing test.
* platform/win/TestExpectations: Added port specific tests.
* platform/wk2/TestExpectations: Added better explanation for failing test.

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

3 years agoSync web-platform-tests up to revision 3801ab5
commit-queue@webkit.org [Thu, 22 Sep 2016 16:20:59 +0000 (16:20 +0000)]
Sync web-platform-tests up to revision 3801ab5
https://bugs.webkit.org/show_bug.cgi?id=162375

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-22
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* resources/ImportExpectations:
* resources/TestRepositories:
* resources/resource-files.json:
* resources/web-platform-tests-modules.json:
* web-platform-tests/IndexedDB/idbindex-multientry-big-expected.txt:
* web-platform-tests/XMLHttpRequest/responsexml-document-properties-expected.txt:
* web-platform-tests/XMLHttpRequest/send-entity-body-document-expected.txt:
* web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed.htm:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/interfaces.html:
* web-platform-tests/dom/nodes/Document-createEvent-expected.txt:
* web-platform-tests/dom/nodes/Document-createEvent.html:
* web-platform-tests/dom/nodes/NodeList-Iterable.html: Added.
* web-platform-tests/dom/nodes/rootNode.html: Added.
* web-platform-tests/dom/nodes/w3c-import.log:
* web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt:
* web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.js:
(corsPreflightReferrer):
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl.js:
(redirectDataURL):
* web-platform-tests/fetch/api/response/response-static-redirect.html:
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html:
* web-platform-tests/html/browsers/origin/origin-of-data-document.html: Added.
* web-platform-tests/html/browsers/origin/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/semantics/tabular-data/w3c-import.log.
* web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub-expected.txt:
* web-platform-tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.sub-expected.txt:
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.forms-expected.txt:
* web-platform-tests/html/dom/documents/dom-tree-accessors/document.forms.html:
* web-platform-tests/html/dom/elements-embedded.js:
* web-platform-tests/html/dom/elements-metadata.js:
* web-platform-tests/html/dom/elements-tabular.js:
* web-platform-tests/html/dom/elements-text.js:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/reflection-embedded-expected.txt:
* web-platform-tests/html/dom/reflection-metadata-expected.txt:
* web-platform-tests/html/dom/reflection-tabular-expected.txt:
* web-platform-tests/html/dom/reflection-text-expected.txt:
* web-platform-tests/html/dom/reflection.js:
(ReflectionTests.resolveUrl):
(ReflectionTests.parseNonneg): Deleted.
(ReflectionTests.parseInt): Deleted.
* web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-style-element/historical.html: Added.
* web-platform-tests/html/semantics/document-metadata/the-style-element/style_scoped-expected.txt: Removed.
* web-platform-tests/html/semantics/document-metadata/the-style-element/style_scoped.html: Removed.
* web-platform-tests/html/semantics/document-metadata/the-style-element/w3c-import.log:
* web-platform-tests/html/semantics/embedded-content/media-elements/historical-expected.txt:
* web-platform-tests/html/semantics/embedded-content/media-elements/historical.html:
* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src-expected.txt:
* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/src.html:
* web-platform-tests/html/semantics/embedded-content/the-area-element/area-shape-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-area-element/area-shape.html:
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/historical.html:
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/historical.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/w3c-import.log:
* web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/nonexistent-image.html: Added.
* web-platform-tests/html/semantics/embedded-content/the-img-element/w3c-import.log:
* web-platform-tests/html/semantics/forms/constraints/form-validation-checkValidity-expected.txt:
* web-platform-tests/html/semantics/forms/constraints/form-validation-checkValidity.html:
* web-platform-tests/html/semantics/forms/constraints/form-validation-reportValidity-expected.txt:
* web-platform-tests/html/semantics/forms/constraints/form-validation-reportValidity.html:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow-expected.txt:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow.html:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow-expected.txt:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow.html:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-stepMismatch-expected.txt:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-stepMismatch.html:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid.html:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing.html:
* web-platform-tests/html/semantics/forms/constraints/form-validation-willValidate-expected.txt:
* web-platform-tests/html/semantics/forms/constraints/form-validation-willValidate.html:
* web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-expected.txt:
* web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application.html:
* web-platform-tests/html/semantics/forms/the-input-element/cloning-steps.html: Added.
* web-platform-tests/html/semantics/forms/the-input-element/datetime-2-expected.txt: Removed.
* web-platform-tests/html/semantics/forms/the-input-element/datetime-2.html: Removed.
* web-platform-tests/html/semantics/forms/the-input-element/files-expected.txt:
* web-platform-tests/html/semantics/forms/the-input-element/files.html:
* web-platform-tests/html/semantics/forms/the-input-element/month-expected.txt:
* web-platform-tests/html/semantics/forms/the-input-element/month.html:
* web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
* web-platform-tests/html/semantics/forms/the-input-element/type-change-state.html:
* web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt:
* web-platform-tests/html/semantics/forms/the-input-element/valueMode.html:
* web-platform-tests/html/semantics/forms/the-input-element/w3c-import.log:
* web-platform-tests/html/semantics/forms/the-option-element/option-form.html: Added.
* web-platform-tests/html/semantics/forms/the-option-element/w3c-import.log:
* web-platform-tests/html/semantics/forms/the-textarea-element/cloning-steps.html:
* web-platform-tests/html/semantics/forms/the-textarea-element/w3c-import.log:
* web-platform-tests/html/semantics/forms/the-textarea-element/wrap-reflect-1a-expected.html: Added.
* web-platform-tests/html/semantics/forms/the-textarea-element/wrap-reflect-1a.html: Added.
* web-platform-tests/html/semantics/forms/the-textarea-element/wrap-reflect-1b-expected.html: Added.
* web-platform-tests/html/semantics/forms/the-textarea-element/wrap-reflect-1b.html: Added.
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-close-expected.txt:
* web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-close.html:
* web-platform-tests/html/semantics/scripting-1/the-script-element/historical.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-before-after-events-expected.txt: Removed.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-before-after-events.html: Removed.
* web-platform-tests/html/semantics/scripting-1/the-script-element/w3c-import.log:
* web-platform-tests/html/semantics/tabular-data/historical.html: Added.
* web-platform-tests/html/semantics/tabular-data/w3c-import.log:
* web-platform-tests/html/semantics/text-level-semantics/historical.html: Added.
* web-platform-tests/html/semantics/text-level-semantics/w3c-import.log: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/the-xhtml-syntax/parsing-xhtml-documents/w3c-import.log.
* web-platform-tests/html/syntax/parsing/foreign_content_001.html: Added.
* web-platform-tests/html/syntax/parsing/foreign_content_003.html: Added.
* web-platform-tests/html/syntax/parsing/foreign_content_004.html: Added.
* web-platform-tests/html/syntax/parsing/foreign_content_005.html: Added.
* web-platform-tests/html/syntax/parsing/foreign_content_006.html: Added.
* web-platform-tests/html/syntax/parsing/foreign_content_008.html: Added.
* web-platform-tests/html/syntax/parsing/foreign_content_009.html: Added.
* web-platform-tests/html/syntax/parsing/foreign_content_010.html: Added.
* web-platform-tests/html/syntax/parsing/foreign_content_013.html: Added.
* web-platform-tests/media-source/import_tests.sh:
* web-platform-tests/media-source/mediasource-append-buffer-expected.txt:
* web-platform-tests/media-source/mediasource-is-type-supported-expected.txt:
* web-platform-tests/media-source/mediasource-sourcebuffer-mode-expected.txt:
* web-platform-tests/media-source/mp4/w3c-import.log: Added.
* web-platform-tests/media-source/w3c-import.log: Added.
* web-platform-tests/media-source/webm/w3c-import.log: Added.
* web-platform-tests/resource-timing/idlharness-expected.txt: Added.
* web-platform-tests/resource-timing/idlharness.html: Added.
* web-platform-tests/resource-timing/resource-timing-expected.txt:
* web-platform-tests/resource-timing/resource-timing.js:
(window.onload):
* web-platform-tests/resource-timing/w3c-import.log:

LayoutTests:

* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-checkValidity-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-reportValidity-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeOverflow-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-rangeUnderflow-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-stepMismatch-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-willValidate-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/month-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt: Added.
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/resource-timing/idlharness-expected.txt: Added.
* platform/wk2/imported/w3c/web-platform-tests/html/semantics/document-metadata/styling/LinkStyle-expected.txt:
* tests-options.json:

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

3 years agoAX: aria-pressed state not correctly conveyed to VoiceOver iOS on <button> unless...
n_wang@apple.com [Thu, 22 Sep 2016 15:14:27 +0000 (15:14 +0000)]
AX: aria-pressed state not correctly conveyed to VoiceOver iOS on <button> unless role=button added
https://bugs.webkit.org/show_bug.cgi?id=162269

Reviewed by Chris Fleizach.

Source/WebCore:

<button> with aria-pressed attribute has a toggle button role, however, we were looking for explicit
roles in order to convey the aria-press state. Since there's no spec requiring authors explicitly defining
default ARIA semantics in such case, I'm exposing the aria-pressed state for all valid toggle buttons.

Changes are covered in modified test.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isPressed):

LayoutTests:

Added test cases and also fixed a wrong expected output.

* accessibility/ios-simulator/aria-pressed-state-expected.txt:
* accessibility/ios-simulator/aria-pressed-state.html:

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

3 years agoAttempt to fix the open source iOS build.
andersca@apple.com [Thu, 22 Sep 2016 14:15:08 +0000 (14:15 +0000)]
Attempt to fix the open source iOS build.

* platform/spi/cocoa/PassKitSPI.h:

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

3 years ago[GStreamer] Support a direct GPU-to-GPU copy of video textures to WebGL
commit-queue@webkit.org [Thu, 22 Sep 2016 12:43:55 +0000 (12:43 +0000)]
[GStreamer] Support a direct GPU-to-GPU copy of video textures to WebGL
https://bugs.webkit.org/show_bug.cgi?id=159928

Patch by Olivier Blin <olivier.blin@softathome.com> on 2016-09-22
Reviewed by Carlos Garcia Campos.

Copy of GStreamer video frames to WebGL textures was not accelerated.

WebGLRenderingContextBase::texImage2D(HTMLVideoElement) went
through a slow software paint() wrapping the video frame into
cairo surface (ImageGStreamer), downloading it to draw to the
image cache context, copying it again in software, and uploading
it back to an OpenGL texture.

This patch implements copyVideoTextureToPlatformTexture() for
the GStreamer media player backend, to do GPU-to-GPU copy, by
extracting code from nativeImageForCurrentTime().

Doing this also fixes bug #159621: red and blue colors were
swapped in video rendered through WebGL with GSTREAMER_GL enabled.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::prepareContextForCairoPaint):
(WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface):
(WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
(WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

3 years ago[GTK] Rename DataObjectGtk as SelectionData
carlosgc@webkit.org [Thu, 22 Sep 2016 12:14:39 +0000 (12:14 +0000)]
[GTK] Rename DataObjectGtk as SelectionData
https://bugs.webkit.org/show_bug.cgi?id=162380

Reviewed by Žan Doberšek.

Source/WebCore:

DataObjectGtk represents the data of a selection, like GtkSelectionData, used for clipboard and drag adn drop
operations. Data object is a very generic name, and the Gtk suffix sounds like if this is the GTK implementation
of a generic DataObject class.

* PlatformGTK.cmake:
* editing/gtk/EditorGtk.cpp:
(WebCore::createFragmentFromPasteboardData):
* page/gtk/DragControllerGtk.cpp:
* platform/DragData.h:
* platform/Pasteboard.h:
* platform/PasteboardStrategy.h:
(WebCore::PasteboardStrategy::~PasteboardStrategy): Deleted.
* platform/PlatformPasteboard.h:
* platform/gtk/DragDataGtk.cpp:
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::createPrivate):
(WebCore::Pasteboard::createForDragAndDrop):
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::selectionData):
(WebCore::selectionDataTypeFromHTMLClipboardType):
(WebCore::Pasteboard::writeToClipboard):
(WebCore::Pasteboard::readFromClipboard):
(WebCore::Pasteboard::writeString):
(WebCore::Pasteboard::writePlainText):
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::writePasteboard):
(WebCore::Pasteboard::clear):
(WebCore::Pasteboard::canSmartReplace):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::hasData):
(WebCore::Pasteboard::types):
(WebCore::Pasteboard::readString):
(WebCore::Pasteboard::readFilenames):
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::getClipboardContents):
(WebCore::PasteboardHelper::targetListForSelectionData):
(WebCore::PasteboardHelper::fillSelectionData):
(WebCore::ClipboardSetData::ClipboardSetData):
(WebCore::getClipboardContentsCallback):
(WebCore::PasteboardHelper::writeClipboardContents):
(WebCore::clearClipboardContentsCallback): Deleted.
* platform/gtk/PasteboardHelper.h:
* platform/gtk/PlatformPasteboardGtk.cpp:
(WebCore::PlatformPasteboard::writeToClipboard):
(WebCore::PlatformPasteboard::readFromClipboard):
* platform/gtk/SelectionData.cpp: Renamed from Source/WebCore/platform/gtk/DataObjectGtk.cpp.
(WebCore::SelectionData::setText):
(WebCore::SelectionData::setURIList):
(WebCore::SelectionData::setURL):
(WebCore::SelectionData::urlLabel):
(WebCore::SelectionData::clearAllExceptFilenames):
(WebCore::SelectionData::clearAll):
* platform/gtk/SelectionData.h: Renamed from Source/WebCore/platform/gtk/DataObjectGtk.h.
(WebCore::SelectionData::create):
(WebCore::SelectionData::text):
(WebCore::SelectionData::hasText):
(WebCore::SelectionData::clearText):
(WebCore::SelectionData::setMarkup):
(WebCore::SelectionData::markup):
(WebCore::SelectionData::hasMarkup):
(WebCore::SelectionData::clearMarkup):
(WebCore::SelectionData::hasURL):
(WebCore::SelectionData::clearURL):
(WebCore::SelectionData::filenames):
(WebCore::SelectionData::hasURIList):
(WebCore::SelectionData::hasFilenames):
(WebCore::SelectionData::setImage):
(WebCore::SelectionData::image):
(WebCore::SelectionData::hasImage):
(WebCore::SelectionData::unknownTypeData):
(WebCore::SelectionData::unknownTypes):
(WebCore::SelectionData::hasUnknownTypeData):
(WebCore::SelectionData::canSmartReplace):
(WebCore::SelectionData::url): Deleted.
(WebCore::SelectionData::uriList): Deleted.
(WebCore::SelectionData::clearURIList): Deleted.
(WebCore::SelectionData::clearImage): Deleted.
(WebCore::SelectionData::setUnknownTypeData): Deleted.

Source/WebKit2:

* PlatformGTK.cmake:
* Shared/gtk/ArgumentCodersGtk.cpp:
(IPC::ArgumentCoder<SelectionData>::encode):
(IPC::ArgumentCoder<SelectionData>::decode):
* Shared/gtk/ArgumentCodersGtk.h:
* Shared/gtk/WebSelectionData.cpp: Renamed from Source/WebKit2/Shared/gtk/PasteboardContent.cpp.
(WebKit::WebSelectionData::WebSelectionData):
(WebKit::WebSelectionData::encode):
(WebKit::WebSelectionData::decode):
* Shared/gtk/WebSelectionData.h: Renamed from Source/WebKit2/Shared/gtk/PasteboardContent.h.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::startDrag):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::performDragControllerAction):
(WebKit::WebPageProxy::startDrag):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:
* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::DroppingContext::DroppingContext):
(WebKit::DragAndDropHandler::startDrag):
(WebKit::DragAndDropHandler::fillDragData):
(WebKit::DragAndDropHandler::finishDrag):
(WebKit::DragAndDropHandler::dropDataSelection):
(WebKit::DragAndDropHandler::dragEntered):
(WebKit::DragAndDropHandler::dragDataSelection):
(WebKit::DragAndDropHandler::dragMotion):
(WebKit::DragAndDropHandler::dragLeave):
(WebKit::DragAndDropHandler::drop):
* UIProcess/gtk/DragAndDropHandler.h:
* UIProcess/gtk/WebPasteboardProxyGtk.cpp:
(WebKit::WebPasteboardProxy::writeToClipboard):
(WebKit::WebPasteboardProxy::readFromClipboard):
(WebKit::WebPasteboardProxy::setPrimarySelectionOwner): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::writeToClipboard):
(WebKit::WebPlatformStrategies::readFromClipboard):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

3 years agoCachedResourceRequest should store a SecurityOrigin
commit-queue@webkit.org [Thu, 22 Sep 2016 08:57:12 +0000 (08:57 +0000)]
CachedResourceRequest should store a SecurityOrigin
https://bugs.webkit.org/show_bug.cgi?id=162258

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-22
Reviewed by Sam Weinig.

Source/WebCore:

Test: http/tests/local/script-crossorigin-loads-file-scheme.html

Passing SecurityOrigin from loader clients to CachedResource through CachedResourceRequest.
This ensures that specific origin properties like universal access are well preserved.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest): Set origin to the request.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource): Setting origin from the request.
Computing CORS state based on that origin.
(WebCore::CachedResource::load): Removing origin computation.
(WebCore::CachedResource::loadFrom): Ditto.
(WebCore::CachedResource::computeOrigin): Deleted.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
(WebCore::CachedResourceLoader::prepareFetch): Introduced to implement step 1 to 7 of https://fetch.spec.whatwg.org/#fetching.
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin): Storing origin.
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::setOrigin):
(WebCore::CachedResourceRequest::releaseOrigin):
(WebCore::CachedResourceRequest::origin):

LayoutTests:

Updated test to expect load even though CORS checks should fail as the document origin has universal access.

* http/tests/local/script-crossorigin-loads-fail-origin-expected.txt: Removed.
* http/tests/local/script-crossorigin-loads-file-scheme-expected.txt: Added.
* http/tests/local/script-crossorigin-loads-file-scheme.html: Renamed from LayoutTests/http/tests/local/script-crossorigin-loads-fail-origin.html.

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

3 years agoRefactor ContentSecurityPolicy::allow* methods
commit-queue@webkit.org [Thu, 22 Sep 2016 08:28:37 +0000 (08:28 +0000)]
Refactor ContentSecurityPolicy::allow* methods
https://bugs.webkit.org/show_bug.cgi?id=162335

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-22
Reviewed by Darin Adler.

No change of behavior.

Removing the second parameter of ContentSecurityPolicy::allow* methods.
When true, this parameter makes the methods return true.
This patch updates the callers of allow* methods to check for the parameter before making the call.

Made some refactoring to share more code between the various allow* methods.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isSafeToLoadURL):
(WebCore::HTMLMediaElement::outOfBandTrackSources):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::allowedToLoadPluginContent):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::canLoadURL):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::redirectReceived):
(WebCore::DocumentThreadableLoader::loadRequest):
(WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy):
* loader/DocumentThreadableLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkIfFormActionAllowedByCSP):
* loader/PolicyChecker.cpp:
(WebCore::isAllowedByContentSecurityPolicy):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::createJavaAppletWidget):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
* page/EventSource.cpp:
(WebCore::EventSource::create):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowObjectFromSource):
(WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
(WebCore::ContentSecurityPolicy::allowResourceFromSource):
(WebCore::ContentSecurityPolicy::allowChildContextFromSource):
(WebCore::ContentSecurityPolicy::allowScriptFromSource):
(WebCore::ContentSecurityPolicy::allowImageFromSource):
(WebCore::ContentSecurityPolicy::allowStyleFromSource):
(WebCore::ContentSecurityPolicy::allowFontFromSource):
(WebCore::ContentSecurityPolicy::allowMediaFromSource):
(WebCore::ContentSecurityPolicy::allowConnectToSource):
(WebCore::ContentSecurityPolicy::allowFormAction):
* page/csp/ContentSecurityPolicy.h:
* workers/AbstractWorker.cpp:
(WebCore::AbstractWorker::resolveURL):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::initSend):

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

3 years ago[css-grid] Remove the x2 computation of row sizes with indefinite heights
svillar@igalia.com [Thu, 22 Sep 2016 07:57:32 +0000 (07:57 +0000)]
[css-grid] Remove the x2 computation of row sizes with indefinite heights
https://bugs.webkit.org/show_bug.cgi?id=162150

Reviewed by Darin Adler.

PerformanceTests:

Added a new test case which checks the layout performance of grids inside other grids, i.e,
grids acting both as grid container and grid item.

* Layout/nested-grid.html: Added.

Source/WebCore:

On r192154, among other things, we added a second pass of the track sizing algorithm for
rows in order to properly compute row sizes when the height was indefinite. We did that in
order to have a symmetrical implementation for columns and rows, but unfortunatelly that was
not correct.

Apart from issuing incorrect results in some cases it created a huge performance issue in
the case of having nested grids because we were exponentially increasing the amount of
executions of the track sizing algorithm. The attached performance test shows a 200%
improvement with the patch (26 vs 80 runs/s).

Test: fast/css-grid-layout/nested-grid.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalHeight):
(WebCore::RenderGrid::layoutGridItems):

LayoutTests:

Added a new reftest to check the behavior of grids acting also as grid items and how the
track sizing of rows depend on that. It includes tests for grids which stretch their
children and grids which do not.

Apart from that some expected results were updated so that they no longer fail.

* fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html: Updated expectations.
* fast/css-grid-layout/nested-grid-expected.html: Added.
* fast/css-grid-layout/nested-grid.html: Added.
* fast/css-grid-layout/percent-track-breadths-regarding-container-size.html: Removed FIXME.
* fast/css-grid-layout/percent-track-breadths-regarding-container-size-expected.txt: Fixed 2
failing tests.

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

3 years agoImprove DeferredWrapper code
commit-queue@webkit.org [Thu, 22 Sep 2016 07:35:46 +0000 (07:35 +0000)]
Improve DeferredWrapper code
https://bugs.webkit.org/show_bug.cgi?id=161787

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-22
Reviewed by Darin Adler.

No change of behavior.

Renaming DeferredWrapper to DeferredPromise.
Adding create method that creates the underlying JSC::JSPromiseDeferred in non-worker environments.
Updated create method to take references.
Introducing domWindow helper accessor into JSDOMObject to ease creation of promise in non-worker environments.
Doing some minor clean up (renaming of m_wrapper to m_promiseDeferred, accessor change).

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
* Modules/applepay/ApplePaySession.h:
* Modules/fetch/DOMWindowFetch.cpp:
(WebCore::DOMWindowFetch::fetch):
* Modules/fetch/DOMWindowFetch.h: Updated to take a DeferredPromise to make it consistent with WorkerGlobalScopeFetch.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::arrayBuffer):
(WebCore::FetchBody::blob):
(WebCore::FetchBody::json):
(WebCore::FetchBody::text):
(WebCore::FetchBody::consume):
(WebCore::FetchBody::consumeArrayBuffer):
(WebCore::FetchBody::consumeArrayBufferView):
(WebCore::FetchBody::consumeText):
(WebCore::FetchBody::consumeBlob):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::formData):
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::resolveWithData):
(WebCore::FetchBodyConsumer::resolve):
* Modules/fetch/FetchBodyConsumer.h:
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::arrayBuffer):
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::json):
(WebCore::FetchBodyOwner::text):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::consume):
(WebCore::FetchResponse::finishConsumingStream):
* Modules/fetch/FetchResponse.h:
* Modules/fetch/WorkerGlobalScopeFetch.cpp:
(WebCore::WorkerGlobalScopeFetch::fetch):
* Modules/fetch/WorkerGlobalScopeFetch.h:
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::whenDefinedPromise):
(WebCore::JSCustomElementRegistry::whenDefined):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMDeferredPromise::DOMDeferredPromise):
(WebCore::DOMDeferredPromise::~DOMDeferredPromise):
(WebCore::DOMDeferredPromise::clear):
(WebCore::DOMDeferredPromise::contextDestroyed):
(WebCore::DOMDeferredPromise::promise):
(WebCore::DOMDeferredPromise::callFunction):
(WebCore::DOMDeferredPromise::reject):
(WebCore::rejectPromiseWithExceptionIfAny):
(WebCore::fulfillPromiseWithJSON):
(WebCore::fulfillPromiseWithArrayBuffer):
(WebCore::DeferredWrapper::DeferredWrapper): Deleted.
(WebCore::DeferredWrapper::~DeferredWrapper): Deleted.
(WebCore::DeferredWrapper::clear): Deleted.
(WebCore::DeferredWrapper::contextDestroyed): Deleted.
(WebCore::DeferredWrapper::promise): Deleted.
(WebCore::DeferredWrapper::callFunction): Deleted.
(WebCore::DeferredWrapper::reject): Deleted.
* bindings/js/JSDOMPromise.h:
(WebCore::DOMDeferredPromise::create):
(WebCore::callPromiseFunction):
(WebCore::DOMPromise::DOMPromise):
(WebCore::DOMPromise::deferredPromise):
(WebCore::DOMDeferredPromise::resolveWithValue):
(WebCore::DOMDeferredPromise::resolveWithNewlyCreated):
(WebCore::DOMDeferredPromise::rejectWithValue):
(WebCore::DOMDeferredPromise::resolve):
(WebCore::DOMDeferredPromise::reject):
(WebCore::DeferredWrapper::create): Deleted.
(WebCore::DOMPromise::deferredWrapper): Deleted.
(WebCore::DeferredWrapper::resolveWithValue): Deleted.
(WebCore::DeferredWrapper::resolveWithNewlyCreated): Deleted.
(WebCore::DeferredWrapper::rejectWithValue): Deleted.
(WebCore::DeferredWrapper::resolve): Deleted.
(WebCore::DeferredWrapper::reject): Deleted.
* bindings/js/JSDOMWrapper.cpp: Introducing domWindow() accessor.
* bindings/js/JSDOMWrapper.h:
* bindings/js/JSFontFaceCustom.cpp:
(WebCore::JSFontFace::loaded):
* bindings/js/JSFontFaceSetCustom.cpp:
(WebCore::JSFontFaceSet::ready):
* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::JSMediaDevices::getUserMedia):
* bindings/js/JSMediaStreamTrackCustom.cpp:
(WebCore::JSMediaStreamTrack::applyConstraints):
* bindings/js/JSReadableStreamSourceCustom.cpp:
(WebCore::JSReadableStreamSource::start):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::JSWebKitSubtleCrypto::encrypt):
(WebCore::JSWebKitSubtleCrypto::decrypt):
(WebCore::JSWebKitSubtleCrypto::sign):
(WebCore::JSWebKitSubtleCrypto::verify):
(WebCore::JSWebKitSubtleCrypto::digest):
(WebCore::JSWebKitSubtleCrypto::generateKey):
(WebCore::JSWebKitSubtleCrypto::importKey):
(WebCore::JSWebKitSubtleCrypto::exportKey):
(WebCore::JSWebKitSubtleCrypto::wrapKey):
(WebCore::JSWebKitSubtleCrypto::unwrapKey):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateReturnParameters):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
* dom/CustomElementRegistry.h:
(WebCore::CustomElementRegistry::promiseMap):

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

3 years agoRolling out r206244, as it caused flaky crashes on tests.
ap@apple.com [Thu, 22 Sep 2016 06:01:33 +0000 (06:01 +0000)]
Rolling out r206244, as it caused flaky crashes on tests.
Was: Correct uses of 'safeCast'

Source/WebCore:

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::adjustSize):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyMetadataAndNotify):
(WebCore::BitmapImage::cacheFrame):
(WebCore::BitmapImage::didDecodeProperties):
(WebCore::BitmapImage::dataChanged):
(WebCore::BitmapImage::frameImageAtIndex):
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::decodedSizeChanged):
(WebCore::PDFDocumentImage::updateCachedImageIfNeeded):

Source/WTF:

* wtf/StdLibExtras.h:
(WTF::safeCast):

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

3 years agoUnreviewed, update ios-simulator-wk1 test expectations
jiewen_tan@apple.com [Thu, 22 Sep 2016 05:19:14 +0000 (05:19 +0000)]
Unreviewed, update ios-simulator-wk1 test expectations

* platform/ios-simulator-wk1/TestExpectations:
* platform/ios-simulator/TestExpectations:

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

3 years ago[macOS] Upon layout, _webView:renderingProgressDidChange: fires before the intrinsic...
mitz@apple.com [Thu, 22 Sep 2016 05:03:01 +0000 (05:03 +0000)]
[macOS] Upon layout, _webView:renderingProgressDidChange: fires before the intrinsic content size is updated
https://bugs.webkit.org/show_bug.cgi?id=162359
<rdar://problem/27776454>

Reviewed by Tim Horton.

Source/WebKit2:

Test: added to TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm

* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Fixed a bug where
  m_pendingNewlyReachedLayoutMilestones was never initialized.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Added
  m_pendingNewlyReachedLayoutMilestones member variable to this derived class as well.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers): If we have pending milestones, notify
  the WebPageProxy now, after any content size changes have been sent.
(WebKit::TiledCoreAnimationDrawingArea::dispatchDidReachLayoutMilestone): New override that
  accumulates the milestones into m_pendingNewlyReachedLayoutMilestones and returns true,
  so that the caller won’t notify the WebPageProxy immediately.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm:
(TEST):

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

3 years agoFix serialization of bgsound, keygen and track elements
cdumez@apple.com [Thu, 22 Sep 2016 04:36:22 +0000 (04:36 +0000)]
Fix serialization of bgsound, keygen and track elements
https://bugs.webkit.org/show_bug.cgi?id=162353

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C tests now that more checks are passing.

* web-platform-tests/html/syntax/serializing-html-fragments/outerHTML-expected.txt:
* web-platform-tests/html/syntax/serializing-html-fragments/serializing-expected.txt:
* web-platform-tests/html/syntax/serializing-xml-fragments/outerHTML-expected.txt:

Source/WebCore:

Fix serialization of keygen and track elements to match the specification:
- https://html.spec.whatwg.org/#serialising-html-fragments

They are not supposed to have an end tag. Firefox and Chrome agree with
the specification.

No new tests, rebaselined existing tests.

* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::elementCannotHaveEndTag):

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

3 years agoFix build for future versions of Clang.
keith_miller@apple.com [Thu, 22 Sep 2016 04:32:12 +0000 (04:32 +0000)]
Fix build for future versions of Clang.
https://bugs.webkit.org/show_bug.cgi?id=162346

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This fixes issues with the WebCore build where inline
template-class function definitions are marked as exported. This
genereates a weak external symobl that our build does not like.

* runtime/VM.h:
(JSC::VM::setGlobalConstRedeclarationShouldThrow):

Source/WebCore:

This fixes issues with the WebCore build where inline
template-class function definitions are marked as exported. This
genereates a weak external symobl that our build does not like.

* Configurations/WebCore.unexp:
* dom/Exception.h:
* page/Frame.h:
* platform/cocoa/WebPlaybackSessionModelMediaElement.h:
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
(WebCore::WebVideoFullscreenModelVideoElement::videoElement):
* platform/graphics/Color.h:
* platform/graphics/transforms/TransformationMatrix.h:
(WebCore::TransformationMatrix::rotate):
* platform/mac/WebVideoFullscreenInterfaceMac.h:
* platform/network/ParsedContentRange.h:
(WebCore::ParsedContentRange::ParsedContentRange):
(WebCore::ParsedContentRange::isValid):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::certificateInfo):
* platform/text/TextStream.h:
(WebCore::TextStream::increaseIndent):
(WebCore::TextStream::decreaseIndent):

Source/WTF:

This fixes issues with the WebCore build where inline
template-class function definitions are marked as exported. This
genereates a weak external symobl that our build does not like.

* wtf/text/StringImpl.h:

Tools:

* TestWebKitAPI/Counters.cpp:
* TestWebKitAPI/Counters.h:
(DeleterCounter::deleterCount):
(DeleterCounter::TestingScope::TestingScope):
(DeleterCounter::operator()):
* TestWebKitAPI/Tests/WTF/HashCountedSet.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST):

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

3 years agoCorrect uses of 'safeCast'
bfulgham@apple.com [Thu, 22 Sep 2016 01:23:26 +0000 (01:23 +0000)]
Correct uses of 'safeCast'
https://bugs.webkit.org/show_bug.cgi?id=162301
<rdar://problem/28343658>

Reviewed by Antti Koivisto.

Source/WebCore:

A number of integer calculations in BitmapImage and PDFDocumentImage
are not properly checked for overflow. Correct this.

Tested by fast/images/large-size-image-crash.html

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::adjustSize): RELEASE_ASSERT on overflow.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyMetadataAndNotify):
(WebCore::BitmapImage::cacheFrame):
(WebCore::BitmapImage::didDecodeProperties):
(WebCore::BitmapImage::dataChanged):
(WebCore::BitmapImage::ensureFrameAtIndexIsCached):
(WebCore::BitmapImage::frameImageAtIndex):
* platform/graphics/BitmapImage.h:
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::decodedSizeChanged):
(WebCore::PDFDocumentImage::updateCachedImageIfNeeded):

Source/WTF:

* wtf/StdLibExtras.h:
(WTF::safeCast): RELEASE_ASSERT on overflow.

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

3 years agoSetting HTMLMeterElement's attributes to non-finite values throws wrong exception...
cdumez@apple.com [Wed, 21 Sep 2016 23:50:24 +0000 (23:50 +0000)]
Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type
https://bugs.webkit.org/show_bug.cgi?id=162364

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Merge meter test changes from https://github.com/w3c/web-platform-tests/pull/3791.

* web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt:
* web-platform-tests/html/semantics/forms/the-meter-element/meter.html:

Source/WebCore:

Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type.
It should throw a TypeError because their type is 'double' but we throw a
NOT_SUPPORTED_ERR.

Specification:
- https://html.spec.whatwg.org/#htmlmeterelement

Firefox and Chrome agree with the specification.

No new tests, updated existing test.

* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::setMin):
(WebCore::HTMLMeterElement::setMax):
(WebCore::HTMLMeterElement::setValue):
(WebCore::HTMLMeterElement::setLow):
(WebCore::HTMLMeterElement::setHigh):
(WebCore::HTMLMeterElement::setOptimum):
* html/HTMLMeterElement.h:
* html/HTMLMeterElement.idl:

LayoutTests:

Update existing test to reflect behavior change.

* fast/dom/HTMLMeterElement/script-tests/set-meter-properties.js:
* fast/dom/HTMLMeterElement/set-meter-properties-expected.txt:

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

3 years agoFix open source build.
andersca@apple.com [Wed, 21 Sep 2016 23:20:01 +0000 (23:20 +0000)]
Fix open source build.

* platform/spi/cocoa/PassKitSPI.h:

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

3 years agoFix spelling errors (that were supposed to be part of my previous commit).
andersca@apple.com [Wed, 21 Sep 2016 23:08:52 +0000 (23:08 +0000)]
Fix spelling errors (that were supposed to be part of my previous commit).

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

3 years agoFix serialization of HTML Element attributes
cdumez@apple.com [Wed, 21 Sep 2016 22:52:42 +0000 (22:52 +0000)]
Fix serialization of HTML Element attributes
https://bugs.webkit.org/show_bug.cgi?id=162356

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic-expected.txt:
* web-platform-tests/html/syntax/serializing-html-fragments/serializing-expected.txt:

Source/WebCore:

Fix serialization of HTML Element attributes to align with:
- https://html.spec.whatwg.org/#html-fragment-serialisation-algorithm
- https://html.spec.whatwg.org/#escapingString

In particular, we should not escape '<' and '>'.

Firefox and Chrome both match the specification.

Note that we keep escaping '<' and '>' for Element attributes in the
context of XML serialization, as per:
- https://w3c.github.io/DOM-Parsing/#dfn-serializing-an-attribute-value

No new tests, rebaselined existing test.

* editing/MarkupAccumulator.h:

LayoutTests:

Rebaseline test to reflect behavior change.

* editing/pasteboard/paste-noscript-expected.txt:

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

3 years agoInline function only used in one place
commit-queue@webkit.org [Wed, 21 Sep 2016 22:52:37 +0000 (22:52 +0000)]
Inline function only used in one place
https://bugs.webkit.org/show_bug.cgi?id=162363

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-21
Reviewed by Saam Barati.

* bytecompiler/NodesCodegen.cpp:
(JSC::ForInNode::emitBytecode):
(JSC::ForInNode::emitMultiLoopBytecode):
* parser/Nodes.h:
No need for the extra function, it adds no clarification.

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

3 years agoSource/WebCore:
andersca@apple.com [Wed, 21 Sep 2016 22:51:52 +0000 (22:51 +0000)]
Source/WebCore:
support openPaymentSetup API on ApplePaySession object
https://bugs.webkit.org/show_bug.cgi?id=162357
rdar://problem/26776939

Reviewed by Tim Horton.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::openPaymentSetup):
Perform security checks and then call into the PaymentCoordiantor. In its completion handler, we resolve the promise.

* Modules/applepay/ApplePaySession.h:
Add new members.

* Modules/applepay/ApplePaySession.idl:
Add openPaymentSetup declaration.

* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::openPaymentSetup):
Call through to the clients.

* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
Add new members.

* loader/EmptyClients.cpp:
Add new stub.

* platform/spi/cocoa/PassKitSPI.h:
Add SPI declaration.

Source/WebKit/mac:
Support openPaymentSetup API on ApplePaySession object
https://bugs.webkit.org/show_bug.cgi?id=162357
rdar://problem/26776939

Reviewed by Tim Horton.

Add openPaymentSetup stub.

* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::openPaymentSetup):

Source/WebKit2:
support openPaymentSetup API on ApplePaySession object
https://bugs.webkit.org/show_bug.cgi?id=162357
rdar://problem/26776939

Reviewed by Tim Horton.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
Call through to platformOpenPaymentSetup, and in the completion handler, send back a OpenPaymentSetupReply message.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
Add new members.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
Add OpenPaymentSetup message.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
Allocate a PKPassLibrary and call openPaymentSetupForMerchantIdentifier:domain:completion: on it.

* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::generateOpenPaymentSetupReplyID):
New helper function to generate a reply ID.

(WebKit::WebPaymentCoordinator::openPaymentSetup):
Add the completion handler to m_pendingOpenPaymentSetupCallbacks and send a OpenPaymentSetup message to the UI process.

(WebKit::WebPaymentCoordinator::openPaymentSetupReply):
Grab the callback given its ID and invoke it.

* WebProcess/ApplePay/WebPaymentCoordinator.h:
Add new members.

* WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
Add OpenPaymentSetupReply message.

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

3 years agoWeb Inspector: Improve output of TestHarness.expect* failures
mattbaker@apple.com [Wed, 21 Sep 2016 21:40:22 +0000 (21:40 +0000)]
Web Inspector: Improve output of TestHarness.expect* failures
https://bugs.webkit.org/show_bug.cgi?id=162177
<rdar://problem/28367186>

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

This patch adds specific expectation functions to TestHarness, to better
express intent when writing tests, and to allow more details to be logged
in the event of a failure.

For functions taking both `actual` and `expected` parameters, the `actual`
parameter comes first. This convention simplifies the implementation of
TestHarness, improves the readability of tests involving inequalities,
and is consistent with XCTest assertions.

* UserInterface/Test/TestHarness.js:
(TestHarness):
(TestHarness.prototype.expectThat):
(TestHarness.prototype.expectFalse):
(TestHarness.prototype.expectNull):
(TestHarness.prototype.expectNotNull):
(TestHarness.prototype.expectEqual):
(TestHarness.prototype.expectNotEqual):
(TestHarness.prototype.expectShallowEqual):
(TestHarness.prototype.expectNotShallowEqual):
(TestHarness.prototype.expectEqualWithAccuracy):
(TestHarness.prototype.expectLessThan):
(TestHarness.prototype.expectLessThanOrEqual):
(TestHarness.prototype.expectGreaterThan):
(TestHarness.prototype.expectGreaterThanOrEqual):
New expectation functions, all of which call _expect under the hood.

(TestHarness.prototype._expect):
Helper method which calls pass or fail. Creates a message when no user
message is provided, and logs expected and actual values in the event
of a failure.

(TestHarness.prototype._expectationValueAsString):
(TestHarness.prototype._expectationMessageFormat):
Get a message format string for the expectation type. Used to create
pass/fail message when no user message is provided.

(TestHarness.prototype._expectedValueFormat):
Get a format string for displaying the expected value. Used to create
the "Expected: " failure message line.

LayoutTests:

Extend coverage to more TestHarness messages by omitting the optional
`message` parameter when calling expect* functions.

Other improvements:
- expectEqual/expectNotEqual should test WebInspector object instances,
  to cover more TestHarness message formatting cases.
- expectEqual/expectNotEqual should test shallow equal arrays, since the
  test is for strict equality.

* inspector/indexeddb/requestData-expected.txt:
* inspector/unit-tests/number-utilities-expected.txt:
Updated expectations for new TestHarness output.

* inspector/unit-tests/test-harness-expect-functions-expected.txt:
* inspector/unit-tests/test-harness-expect-functions.html:

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

3 years agoUnreviewed, rolling out r206222 and r206227.
commit-queue@webkit.org [Wed, 21 Sep 2016 21:22:00 +0000 (21:22 +0000)]
Unreviewed, rolling out r206222 and r206227.
https://bugs.webkit.org/show_bug.cgi?id=162361

"broke the windows build" (Requested by keith_mi_ on #webkit).

Reverted changesets:

"Fix build for future versions of Clang."
https://bugs.webkit.org/show_bug.cgi?id=162346
http://trac.webkit.org/changeset/206222

"Attempt to fix windows build after r206222."
http://trac.webkit.org/changeset/206227

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

3 years agoURLParser should match URL::parse when parsing data urls with slashes in them
achristensen@apple.com [Wed, 21 Sep 2016 21:16:15 +0000 (21:16 +0000)]
URLParser should match URL::parse when parsing data urls with slashes in them
https://bugs.webkit.org/show_bug.cgi?id=162352

Reviewed by Darin Adler.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

3 years ago[Win] Null pointer crash under WebCore::CACFLayerTreeHost::create().
pvollan@apple.com [Wed, 21 Sep 2016 20:53:49 +0000 (20:53 +0000)]
[Win] Null pointer crash under WebCore::CACFLayerTreeHost::create().
https://bugs.webkit.org/show_bug.cgi?id=162266
<rdar://problem/28345073>

Reviewed by Brent Fulgham.

Add null pointer check.

* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::create):

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

3 years agoFix enumeration of properties cross origin
cdumez@apple.com [Wed, 21 Sep 2016 20:47:00 +0000 (20:47 +0000)]
Fix enumeration of properties cross origin
https://bugs.webkit.org/show_bug.cgi?id=162328

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C test now that one more check is passing.

* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:

Source/WebCore:

All cross origin properties for Window / Location are supposed to be not enumerable:
- https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)

Therefore, there should be no properties to iterate on for cross origin Window /
Location objects.

No new tests, rebaselined existing test.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertyNames):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::getOwnPropertyNames):

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

3 years agoMarking inspector/css/manager-preferredInspectorStyleSheetForFrame.html as flaky...
ryanhaddad@apple.com [Wed, 21 Sep 2016 20:40:59 +0000 (20:40 +0000)]
Marking inspector/css/manager-preferredInspectorStyleSheetForFrame.html as flaky on mac.
https://bugs.webkit.org/show_bug.cgi?id=162305

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoURLParser should fail when parsing invalid relative URLs with no schemes
achristensen@apple.com [Wed, 21 Sep 2016 20:19:07 +0000 (20:19 +0000)]
URLParser should fail when parsing invalid relative URLs with no schemes
https://bugs.webkit.org/show_bug.cgi?id=162355

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::copyASCIIStringUntil):
When copying from a null String, is8Bit dereferences a null pointer.  We don't want to do that.
(WebCore::URLParser::parse):
What the spec calls a "null" URL matches !url.isValid(), not url.isNull().
The former reflects whether the parsing succeeded,
the latter whether the contained String (which could be an invalid URL) is null.

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

3 years agoDocument::styleResolverChanged simplification
antti@apple.com [Wed, 21 Sep 2016 19:59:47 +0000 (19:59 +0000)]
Document::styleResolverChanged simplification
https://bugs.webkit.org/show_bug.cgi?id=162347

Reviewed by Anders Carlsson.

* dom/Document.cpp:
(WebCore::Document::implicitClose):
(WebCore::Document::setParsing):
(WebCore::Document::write):
(WebCore::Document::styleResolverChanged):

    - Remove unncessary AnimationUpdateBlock, it is created by recalcStyle.
    - Remove explicit setNeedsLayoutAndPrefWidthsRecalc/scheduleRelayout calls, style resolution
      invalidates those as needed.
    - Remove evaluateMediaQueryList call, that is done on layout as needed.
    - Remove the ancient INSTRUMENT_LAYOUT_SCHEDULING and the related printfs.

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

3 years agoVersioning.
bshafiei@apple.com [Wed, 21 Sep 2016 19:42:49 +0000 (19:42 +0000)]
Versioning.

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

3 years agoAttempt to fix windows build after r206222.
keith_miller@apple.com [Wed, 21 Sep 2016 19:33:05 +0000 (19:33 +0000)]
Attempt to fix windows build after r206222.

* page/MainFrame.h:
(WebCore::Frame::isMainFrame):

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

3 years agoAdd a Fence opcode to B3
fpizlo@apple.com [Wed, 21 Sep 2016 19:09:24 +0000 (19:09 +0000)]
Add a Fence opcode to B3
https://bugs.webkit.org/show_bug.cgi?id=162343

Reviewed by Geoffrey Garen.
Source/JavaScriptCore:

This adds the most basic fence support to B3. Currently, this is optimal on x86 and correct
on ARM. It also happens to be sufficient and optimal for what we'll do in the concurrent GC.

The idea of Fence is that it can represent any standalone fence instruction by having two
additional params: a read range and a write range. If the write range is empty, this is
taken to be a store-store fence, which turns into zero code on x86 and a cheaper fence on
ARM.

It turns out that this is powerful enough to express store-load and store-store fences. For
load-store and load-load fences, you wouldn't have wanted to use any code on x86 and you
wouldn't have wanted a standalone barrier on ARM. For those cases, you'd want either a
fenced load (load acquire) or a dependency. See bug 162349 and bug 162350, respectively.

This isn't yet optimized for store-store fences on ARM because we don't have the
MacroAssembler support. Also, the support for "dmb ish" is not really what we want (it seems
to use a heavier fence). I don't think that this is urgent because of how the concurrent GC
will use this facility. I've left that to bug 162342.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MacroAssemblerCodeRef.cpp:
(JSC::MacroAssemblerCodeRef::tryToDisassemble):
(JSC::MacroAssemblerCodeRef::disassembly):
* assembler/MacroAssemblerCodeRef.h:
(JSC::MacroAssemblerCodeRef::size): Deleted.
(JSC::MacroAssemblerCodeRef::tryToDisassemble): Deleted.
* b3/B3Compilation.h:
(JSC::B3::Compilation::codeRef):
(JSC::B3::Compilation::disassembly):
(JSC::B3::Compilation::code): Deleted.
* b3/B3Effects.h:
* b3/B3FenceValue.cpp: Added.
(JSC::B3::FenceValue::~FenceValue):
(JSC::B3::FenceValue::cloneImpl):
(JSC::B3::FenceValue::FenceValue):
* b3/B3FenceValue.h: Added.
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::lower):
* b3/B3Opcode.cpp:
(WTF::printInternal):
* b3/B3Opcode.h:
* b3/B3Validate.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::effects):
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::checkUsesInstruction):
(JSC::B3::checkDoesNotUseInstruction):
(JSC::B3::testX86MFence):
(JSC::B3::testX86CompilerFence):
(JSC::B3::run):

Websites/webkit.org:

* docs/b3/intermediate-representation.html:

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

3 years agoNew DocumentLoader logging causes crashes
cdumez@apple.com [Wed, 21 Sep 2016 18:41:07 +0000 (18:41 +0000)]
New DocumentLoader logging causes crashes
https://bugs.webkit.org/show_bug.cgi?id=162348
<rdar://problem/28404744>

Patch by Keith Rollin <krollin@apple.com> on 2016-09-21
Reviewed by Chris Dumez

Check for NULL m_frame before using it.

No new tests -- no tests for logging, though this issue was found by
contentfiltering/block-after-will-send-request-then-allow-unblock.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):

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

3 years agoOptimize URLParser
achristensen@apple.com [Wed, 21 Sep 2016 18:33:30 +0000 (18:33 +0000)]
Optimize URLParser
https://bugs.webkit.org/show_bug.cgi?id=162338

Reviewed by Tim Horton.

No change in behavior. Just a marginal performance improvement.

* platform/URLParser.cpp:
(WebCore::isValidSchemeCharacter):
Added to reduce branches when parsing the scheme of a URL.  Now there is a table lookup instead of many range checks.
(WebCore::URLParser::parse):
Use appendVector, which uses memcpy.
(WebCore::URLParser::parseHostAndPort):
If we know that we are parsing the serialized output of a valid URL,
we do not need to convert host characters to lower case.
They are already lower case.

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

3 years agoFix build for future versions of Clang.
keith_miller@apple.com [Wed, 21 Sep 2016 18:24:43 +0000 (18:24 +0000)]
Fix build for future versions of Clang.
https://bugs.webkit.org/show_bug.cgi?id=162346

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This fixes issues with the WebCore build where inline
template-class function definitions are marked as exported. This
genereates a weak external symobl that our build does not like.

* runtime/VM.h:
(JSC::VM::setGlobalConstRedeclarationShouldThrow):

Source/WebCore:

This fixes issues with the WebCore build where inline
template-class function definitions are marked as exported. This
genereates a weak external symobl that our build does not like.

* Configurations/WebCore.unexp:
* dom/Exception.h:
* page/Frame.h:
* platform/cocoa/WebPlaybackSessionModelMediaElement.h:
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
(WebCore::WebVideoFullscreenModelVideoElement::videoElement):
* platform/graphics/Color.h:
* platform/graphics/transforms/TransformationMatrix.h:
(WebCore::TransformationMatrix::rotate):
* platform/mac/WebVideoFullscreenInterfaceMac.h:
* platform/network/ParsedContentRange.h:
(WebCore::ParsedContentRange::ParsedContentRange):
(WebCore::ParsedContentRange::isValid):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::certificateInfo):
* platform/text/TextStream.h:
(WebCore::TextStream::increaseIndent):
(WebCore::TextStream::decreaseIndent):

Source/WTF:

This fixes issues with the WebCore build where inline
template-class function definitions are marked as exported. This
genereates a weak external symobl that our build does not like.

* wtf/text/StringImpl.h:

Tools:

* TestWebKitAPI/Counters.cpp:
* TestWebKitAPI/Counters.h:
(DeleterCounter::deleterCount):
(DeleterCounter::TestingScope::TestingScope):
(DeleterCounter::operator()):
* TestWebKitAPI/Tests/WTF/HashCountedSet.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST):

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

3 years agoObject.getOwnPropertyDescriptor() does not work correctly cross origin
cdumez@apple.com [Wed, 21 Sep 2016 18:23:33 +0000 (18:23 +0000)]
Object.getOwnPropertyDescriptor() does not work correctly cross origin
https://bugs.webkit.org/show_bug.cgi?id=162311

Reviewed by Gavin Barraclough.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:

Source/JavaScriptCore:

Add a CustomGetterSetter field to PropertySlot that gets populated
by getOwnPropertySlot() and use it in getOwnPropertyDescriptor()
to properly populate the descriptor. We used to rely on reifying
the properties and then call getDirect() in order to get the
CustomGetterSetter. However, this hack was insufficient to support
the cross-origin case because we need to control more precisely
the visibility of the getter and the setter. For example, Location's
href property has both a getter and a setter in the same origin
case but only has a setter in the cross-origin case.

In the future, we can extend the use of PropertySlot's
customGetterSetter field to the same origin case and get rid of the
reification + getDirect() hack in getOwnPropertyDescriptor().

* runtime/JSObject.cpp:
(JSC::JSObject::getOwnPropertyDescriptor):
* runtime/PropertySlot.cpp:
(JSC::PropertySlot::customAccessorGetter):
* runtime/PropertySlot.h:

Source/WebCore:

Object.getOwnPropertyDescriptor() does not work correctly cross origin. In particular:
- We return value descriptors for attributes instead of getter/setter descriptors
- attributes / operations are wrongly marked as non-configurable

Corresponding specification:
- https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
- https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)

Test: http/tests/security/cross-origin-descriptors.html

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::getOwnPropertySlotDelegate):

LayoutTests:

Add layout test coverage.

* http/tests/security/cross-origin-descriptors-expected.txt: Added.
* http/tests/security/cross-origin-descriptors.html: Added.

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

3 years agoPrepare API tests for enabling URLParser by default
achristensen@apple.com [Wed, 21 Sep 2016 18:04:39 +0000 (18:04 +0000)]
Prepare API tests for enabling URLParser by default
https://bugs.webkit.org/show_bug.cgi?id=162341

Reviewed by Tim Horton.

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::checkURL):
(TestWebKitAPI::checkRelativeURL):
(TestWebKitAPI::checkURLDifferences):
(TestWebKitAPI::checkRelativeURLDifferences):
(TestWebKitAPI::shouldFail):

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

3 years agoURLParser: Correctly parse URLs that are just nonspecialscheme:/
achristensen@apple.com [Wed, 21 Sep 2016 18:02:52 +0000 (18:02 +0000)]
URLParser: Correctly parse URLs that are just nonspecialscheme:/
https://bugs.webkit.org/show_bug.cgi?id=162340

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):
r206162 wasn't quite right.  If a url is just nonspecialscheme:/ then the path should indeed be /

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

3 years agoURLParser: correctly parse relative URLs that are just one character
achristensen@apple.com [Wed, 21 Sep 2016 18:00:19 +0000 (18:00 +0000)]
URLParser: correctly parse relative URLs that are just one character
https://bugs.webkit.org/show_bug.cgi?id=162344

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

3 years agoREGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change...
dbates@webkit.org [Wed, 21 Sep 2016 17:44:43 +0000 (17:44 +0000)]
REGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change on iPad
https://bugs.webkit.org/show_bug.cgi?id=162227
<rdar://problem/27201529>

Reviewed by Simon Fraser.

Source/WebCore:

The CSS property -webkit-text-size-adjust should be respected on all iOS devices. Following
r201090 we respect it only on iPhone and in iPhone-apps run on iPad.

Tests: fast/text-autosizing/ios/ipad/programmatic-text-size-adjust.html
       fast/text-autosizing/ios/ipad/text-size-adjust-inline-style.html
       fast/text-autosizing/ios/programmatic-text-size-adjust.html
       fast/text-autosizing/ios/text-size-adjust-inline-style.html
       fast/text-autosizing/text-size-adjust-inline-style.html

* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue): Remove unused code to validate -webkit-text-size-adjust.
This code is never used because -webkit-text-size-adjust is a value property (since it accepts a
<percentage> as a value and CSSParserFastPaths::isKeywordPropertyID(CSSPropertyWebkitTextSizeAdjust)
returns false). That is, it is not a keyword property.
(WebCore::CSSParser::parseValue): Always enable the -webkit-text-size-adjust CSS property when
building for iOS regardless of whether Settings:textAutosizingEnabled() is enabled.

LayoutTests:

Add tests to ensure setting the CSS property -webkit-text-size-adjust in a stylesheet or
programmatically is respected on iPhone and iPad. Also added a test to ensure that this
CSS property is ignored on macOS by default.

Note that we have existing tests that ensure that -webkit-text-size-adjust is respected
on macOS when the internal setting Settings::textAutosizingEnabled() is enabled.

* fast/text-autosizing/ios/ipad/programmatic-text-size-adjust-expected.txt: Added.
* fast/text-autosizing/ios/ipad/programmatic-text-size-adjust.html: Added.
* fast/text-autosizing/ios/ipad/text-size-adjust-inline-style-expected.html: Added.
* fast/text-autosizing/ios/ipad/text-size-adjust-inline-style.html: Added.
* fast/text-autosizing/ios/programmatic-text-size-adjust-expected.txt: Added.
* fast/text-autosizing/ios/programmatic-text-size-adjust.html: Added.
* fast/text-autosizing/ios/text-size-adjust-inline-style-expected.html: Added.
* fast/text-autosizing/ios/text-size-adjust-inline-style.html: Added.
* fast/text-autosizing/text-size-adjust-inline-style-expected.html: Added.
* fast/text-autosizing/text-size-adjust-inline-style.html: Added.
* platform/mac/TestExpectations: Skip the iOS and iPad tests on Mac. Otherwise, they will fail
because these tests intentionally do not call window.internal.settings.setTextAutosizingEnabled(true)
so as to test the default port behavior. And on Mac automatic text size adjustment is disabled
by default.

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

3 years agoUnreviewed, build fix.
gns@gnome.org [Wed, 21 Sep 2016 17:35:54 +0000 (17:35 +0000)]
Unreviewed, build fix.

* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
(WebKit::AcceleratedBackingStoreWayland::paint): fix usage of deviceScaleFactor variable which was
removed.

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

3 years agoUnreviewed gardening; after r206208, update url-null.html test to reflect current...
jer.noble@apple.com [Wed, 21 Sep 2016 17:20:44 +0000 (17:20 +0000)]
Unreviewed gardening; after r206208, update url-null.html test to reflect current (specced) behavior.

* fast/files/url-null-expected.txt:
* fast/files/url-null.html:

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

3 years agoUnreviewed gardening; add some whitespace to expected results.
jer.noble@apple.com [Wed, 21 Sep 2016 17:16:33 +0000 (17:16 +0000)]
Unreviewed gardening; add some whitespace to expected results.

* web-platform-tests/media-source/URL-createObjectURL-null-expected.txt:

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

3 years ago[GTK] Build fails with GSTREAMER_GL enabled
commit-queue@webkit.org [Wed, 21 Sep 2016 16:28:48 +0000 (16:28 +0000)]
[GTK] Build fails with GSTREAMER_GL enabled
https://bugs.webkit.org/show_bug.cgi?id=162337

Patch by Miguel Gomez <magomez@igalia.com> on 2016-09-21
Reviewed by Michael Catanzaro.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Remove uneeded const.

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

3 years agoFTL needs to reserve callee stack space in bytes
msaboff@apple.com [Wed, 21 Sep 2016 16:26:13 +0000 (16:26 +0000)]
FTL needs to reserve callee stack space in bytes
https://bugs.webkit.org/show_bug.cgi?id=162324

Reviewed by Geoffrey Garen.

Changed two instances where we call B3::Procedure::requestCallArgAreaSize() with the
number of JSValue sized objects of stack space instead of bytes.  The correct units
to use is bytes.

Renamed both the Air and B3 related callArgAreaSize() to callArgAreaSizeInBytes().

No new tests as this doesn't surface as an issue when arguments are passed on the stack.

* b3/B3Procedure.cpp:
(JSC::B3::Procedure::callArgAreaSizeInBytes):
(JSC::B3::Procedure::requestCallArgAreaSizeInBytes):
(JSC::B3::Procedure::callArgAreaSize): Deleted.
(JSC::B3::Procedure::requestCallArgAreaSize): Deleted.
* b3/B3Procedure.h:
* b3/air/AirAllocateStack.cpp:
(JSC::B3::Air::allocateStack):
* b3/air/AirCCallingConvention.cpp:
(JSC::B3::Air::computeCCallingConvention):
* b3/air/AirCode.h:
(JSC::B3::Air::Code::callArgAreaSizeInBytes):
(JSC::B3::Air::Code::requestCallArgAreaSizeInBytes):
(JSC::B3::Air::Code::callArgAreaSize): Deleted.
(JSC::B3::Air::Code::requestCallArgAreaSize): Deleted.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):

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

3 years agoREGRESSION(r206127): ASSERTION FAILED: !isClosed() in WebCore::MediaSource::detachFro...
jer.noble@apple.com [Wed, 21 Sep 2016 16:25:14 +0000 (16:25 +0000)]
REGRESSION(r206127): ASSERTION FAILED: !isClosed() in WebCore::MediaSource::detachFromElement
https://bugs.webkit.org/show_bug.cgi?id=162307

Reviewed by Eric Carlson.

The test is crashing when the ScriptExecutionContext is calling stop() on the media element before
it's attached MediaSource has been open()ed, which is a valid state. Removing this ASSERT().

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::detachFromElement):

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

3 years agoLayoutTests/imported/w3c:
jer.noble@apple.com [Wed, 21 Sep 2016 16:16:01 +0000 (16:16 +0000)]
LayoutTests/imported/w3c:
Unreviewed gardening; added test expectations for new tests.

* web-platform-tests/media-source/mediasource-attach-stops-delaying-load-event-expected.txt: Added.
* web-platform-tests/media-source/mediasource-sourcebuffer-mode-timestamps-expected.txt: Added.

LayoutTests:
Unreviewed gardening; mark imported/w3c/web-platform-tests/media-source/ tests as passing by default
and mark specific tests to skip or fail (rather than vice versa).

* platform/mac/TestExpectations:

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

3 years ago[media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-activesou...
jer.noble@apple.com [Wed, 21 Sep 2016 16:13:57 +0000 (16:13 +0000)]
[media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-activesourcebuffers.html
https://bugs.webkit.org/show_bug.cgi?id=162257

Reviewed by Eric Carlson.

Source/WebCore:

Some of the conditions in the track changed methods were reversed, and all failed to schedule
a change event.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::videoTrackSelectedChanged):
(WebCore::SourceBuffer::audioTrackEnabledChanged):
(WebCore::SourceBuffer::textTrackModeChanged):

LayoutTests:

* platform/mac/TestExpectations:

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

3 years ago[media-source] Fix imported/w3c/web-platform-tests/media-source/URL-createObjectURL...
jer.noble@apple.com [Wed, 21 Sep 2016 16:12:33 +0000 (16:12 +0000)]
[media-source] Fix imported/w3c/web-platform-tests/media-source/URL-createObjectURL-null.html
https://bugs.webkit.org/show_bug.cgi?id=162299

Reviewed by Eric Carlson.

Source/WebCore:

URL.createObjectURL() should not take an optional parameter (nor return an optional String).
(Ref: https://w3c.github.io/FileAPI/#dfn-createObjectURL)

* Modules/mediasource/DOMURLMediaSource.cpp:
(WebCore::DOMURLMediaSource::createObjectURL):
* Modules/mediasource/DOMURLMediaSource.h:
* Modules/mediasource/DOMURLMediaSource.idl:
* Modules/mediasource/MediaSourceRegistry.cpp:
(WebCore::MediaSourceRegistry::registerURL):
* Modules/mediasource/MediaSourceRegistry.h:
* Modules/mediastream/DOMURLMediaStream.cpp:
(WebCore::DOMURLMediaStream::createObjectURL):
* Modules/mediastream/DOMURLMediaStream.h:
* Modules/mediastream/DOMURLMediaStream.idl:
* Modules/mediastream/MediaStreamRegistry.cpp:
(WebCore::MediaStreamRegistry::registerURL):
* Modules/mediastream/MediaStreamRegistry.h:
* fileapi/Blob.cpp:
(WebCore::BlobURLRegistry::registerURL):
* html/DOMURL.cpp:
(WebCore::DOMURL::createObjectURL):
(WebCore::DOMURL::createPublicURL):
* html/DOMURL.h:
* html/DOMURL.idl:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setSrcObject):
* html/PublicURLManager.cpp:
(WebCore::PublicURLManager::registerURL):
* html/PublicURLManager.h:
* html/URLRegistry.h:

LayoutTests:

* platform/mac/TestExpectations:

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

3 years ago[ARM] Unreviewed buildfix after r206136.
ossy@webkit.org [Wed, 21 Sep 2016 12:39:10 +0000 (12:39 +0000)]
[ARM] Unreviewed buildfix after r206136.

* assembler/MacroAssembler.h:
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::branchPtr): Added.

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

3 years ago[Fetch] Align Accept header default values with fetch spec
commit-queue@webkit.org [Wed, 21 Sep 2016 09:56:16 +0000 (09:56 +0000)]
[Fetch] Align Accept header default values with fetch spec
https://bugs.webkit.org/show_bug.cgi?id=162260

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-21
Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Ensuring Accept and Accept-Language user-specific values are going up to the server.

* web-platform-tests/fetch/api/basic/accept-header-expected.txt:
* web-platform-tests/fetch/api/basic/accept-header-worker-expected.txt:
* web-platform-tests/fetch/api/basic/accept-header.js:
(promise_test):

Source/WebCore:

Covered by existing and updated tests.

To start implementing step 1 to 7 of fetch algorithm, this patch updates Accept header handling.

Default values are set according the spec based on resource type.
Some resource types are not defined in the spec and we keep using existing values.

We check if Accept header is already present in the request. If that is the case, no change is done to that header.

If the Accept header is not set, the default value '*/*' is used.
An Accept header is therefore always set at CachedResourceLoader level.

* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet): Removing accept initialization.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load): Removing accept header setting.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::accept): Deleted.
(WebCore::CachedResource::setAccept): Deleted.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::acceptHeaderValueFromType): helper routine merging fetch spec and existing WebKit accept values.
(WebCore::CachedResourceLoader::prepareFetch): Should implement step 1 to 7 of https://fetch.spec.whatwg.org/#fetching.
(WebCore::CachedResourceLoader::requestResource): Making use of prepareFetch.
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::CachedSVGDocument): Removing accept initialization.
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::CachedScript): Removing accept initialization.
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet): Removing accept initialization.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::hasHTTPHeader): Introduced to check for header presence.
* platform/network/ResourceRequestBase.h:

LayoutTests:

* http/tests/misc/resources/image-checks-for-accept.php: Updated according new image Accept header value.

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

3 years ago[GTK] Fix build failure of ScrollbarThemeGtk with libc++
commit-queue@webkit.org [Wed, 21 Sep 2016 09:48:51 +0000 (09:48 +0000)]
[GTK] Fix build failure of ScrollbarThemeGtk with libc++
https://bugs.webkit.org/show_bug.cgi?id=162302

Patch by Jeremy Huddleston Sequoia <jeremyhu@apple.com> on 2016-09-21
Reviewed by Carlos Garcia Campos.

* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::paint): Add missing #include <cstdlib>

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

3 years ago[OpenWebRTC] Miscellaneous fixes
philn@webkit.org [Wed, 21 Sep 2016 09:44:06 +0000 (09:44 +0000)]
[OpenWebRTC] Miscellaneous fixes
https://bugs.webkit.org/show_bug.cgi?id=162332

Reviewed by Alejandro G. Castro.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::currentTime): Improved logging.
(WebCore::MediaPlayerPrivateGStreamerOwr::load): Ditto.
(WebCore::MediaPlayerPrivateGStreamerOwr::loadingFailed): Ditto.
(WebCore::MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin):
Pre-roll the autoaudiosink, fetch the underlying platform audio
sink and pass it to the OpenWebRTC renderer.
(WebCore::MediaPlayerPrivateGStreamerOwr::maybeHandleChangeMutedState): Improved logging.
(WebCore::MediaPlayerPrivateGStreamerOwr::setSize): Don't configure invalid video renderer.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Fix copy-paste error.

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

3 years agoRefactor CachedResourceLoader::canRequest
commit-queue@webkit.org [Wed, 21 Sep 2016 08:43:23 +0000 (08:43 +0000)]
Refactor CachedResourceLoader::canRequest
https://bugs.webkit.org/show_bug.cgi?id=162144

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-21
Reviewed by Darin Adler.

Covered by existing tests.

Simplifying CachedResourceLoader::canRequest by doing:
- CSP checks in another method
- Removing Same-Origin type-specific checks by setting FetchOptions::Mode appropriately in resource loader clients
- Moving script specific check in ScriptElement

Note that the last check may affect the loading behavior in the case scripts are enabled when starting the load
of a script, but gets disabled before receiving a redirection for the script load.

* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet): Setting XSLT stylesheet fetch mode to SameOrigin.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestScriptWithCache): Returning early if scripts are disabled.
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::startPreflight): Bypassing CSP checks.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource): Bypassing CSP checks as CachedResourceLoader was not
checking them for MainResource.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest): Ditto.
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded): Using new CachedResourceRequest constructor to enable moving the ResourceRequest.
(WebCore::LinkLoader::loadLink): Skipping CSP checks for link prefetch/subresources as CachedResourceLoader was
not checking them for Link Prefetch and Subresource types.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy): Helper routine to check for CSP.
(WebCore::CachedResourceLoader::canRequest): Making use of introduced helper routine.
Simplified same origin check as all requests should have their options set.
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest): More efficient constructor.
* loader/cache/CachedResourceRequest.h:
* loader/cache/CachedSVGDocumentReference.cpp:
(WebCore::CachedSVGDocumentReference::load): Setting fetch mode to SameOrigin.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::updateExternalDocument): Ditto.
* xml/XSLImportRule.cpp:
(WebCore::XSLImportRule::loadSheet): Ditto.

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

3 years agoBuild fails with GSTREAMER_GL when both desktop GL and GLES2 are enabled in gst-plugi...
commit-queue@webkit.org [Wed, 21 Sep 2016 07:48:32 +0000 (07:48 +0000)]
Build fails with GSTREAMER_GL when both desktop GL and GLES2 are enabled in gst-plugins-bad
https://bugs.webkit.org/show_bug.cgi?id=159562

Patch by Miguel Gomez <magomez@igalia.com> on 2016-09-21
Reviewed by Philippe Normand.

Refactor video orientation code so including TextureMapperGL in MediaPlayerPrivateGStreamerBase.h
is not necessary.

Covered by existent tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::texMapFlagFromOrientation):
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
(WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

3 years agoImport html/syntax web platform tests
cdumez@apple.com [Wed, 21 Sep 2016 07:14:41 +0000 (07:14 +0000)]
Import html/syntax web platform tests
https://bugs.webkit.org/show_bug.cgi?id=162331

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Import html/syntax web platform tests to improve test coverage.

* web-platform-tests/html/syntax/*: Added.

LayoutTests:

* tests-options.json:

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

3 years ago[GTK] Fix build failure in clipboard support
commit-queue@webkit.org [Wed, 21 Sep 2016 07:09:30 +0000 (07:09 +0000)]
[GTK] Fix build failure in clipboard support
https://bugs.webkit.org/show_bug.cgi?id=162261

Patch by Jeremy Huddleston Sequoia <jeremyhu@apple.com> on 2016-09-21
Reviewed by Carlos Garcia Campos.

* platform/PlatformPasteboard.h: Add missing #include <functional>
* platform/gtk/PasteboardHelper.h: Add missing #include <functional>

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

3 years agoVariadicHelper::Result should not include constructor to initialize members
nael.ouedraogo@crf.canon.fr [Wed, 21 Sep 2016 06:44:04 +0000 (06:44 +0000)]
VariadicHelper::Result should not include constructor to initialize members
https://bugs.webkit.org/show_bug.cgi?id=162298

Reviewed by Darin Adler.

Remove the constructor since member-wise initialization does the same thing.

No new tests required.

* bindings/js/JSDOMBinding.h: Remove useless constructor.

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

3 years agoOptimize URLParser
achristensen@apple.com [Wed, 21 Sep 2016 06:34:13 +0000 (06:34 +0000)]
Optimize URLParser
https://bugs.webkit.org/show_bug.cgi?id=162105

Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by new API tests.
This is about a 5% speedup on my URLParser benchmark.

* platform/URLParser.cpp:
(WebCore::percentEncodeByte):
(WebCore::utf8PercentEncode):
(WebCore::utf8QueryEncode):
(WebCore::encodeQuery):
(WebCore::URLParser::parse):
(WebCore::serializeURLEncodedForm):
(WebCore::percentEncode): Deleted.
(WebCore::utf8PercentEncodeQuery): Deleted.

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

3 years ago[GTK] Clean up DataObjectGtk handling
carlosgc@webkit.org [Wed, 21 Sep 2016 06:17:13 +0000 (06:17 +0000)]
[GTK] Clean up DataObjectGtk handling
https://bugs.webkit.org/show_bug.cgi?id=162267

Reviewed by Michael Catanzaro.

Source/WebCore:

* platform/Pasteboard.h: Use Ref instead of RefPtr for DataObjectGtk member.
* platform/PasteboardStrategy.h: Pass a const reference to DataObjectGtk in write method and return a Ref from read.
* platform/PlatformPasteboard.h: Ditto.
* platform/gtk/DataObjectGtk.h:
(WebCore::DataObjectGtk::image): Use Image instead of GdkPixbuf.
(WebCore::DataObjectGtk::setImage):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::createForDragAndDrop): Use a reference instead of a pointer.
(WebCore::Pasteboard::Pasteboard): Receives a reference, so we can also remove the ASSERT.
(WebCore::Pasteboard::dataObject):
(WebCore::Pasteboard::writeToClipboard): Remove the ShouldIncludeSmartPaste parameter, callers should also update
canSmartPaste property of DataObjectGtk before calling this.
(WebCore::Pasteboard::writePlainText):
(WebCore::Pasteboard::write): Do not convert the image the GdkPixbuf, pass the image to the DataObjectGtk instead.
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::fillSelectionData): Convert the DataObjectGtk image to GdkPixbuf right before
passing it to gtk_selection_data_set_pixbuf().
(WebCore::ClipboardSetData::ClipboardSetData): Use reference instead of pointer.
(WebCore::getClipboardContentsCallback):
(WebCore::clearClipboardContentsCallback): Never clear the saved DataObjectGtk, that was only needed when we had
a global DataObjectGtk associated to a GtkClipboard.
(WebCore::PasteboardHelper::writeClipboardContents): Use TemporaryChange to set the settingClipboardDataObject global.
* platform/gtk/PlatformPasteboardGtk.cpp:
(WebCore::PlatformPasteboard::writeToClipboard):
(WebCore::PlatformPasteboard::readFromClipboard):

Source/WebKit2:

In some cases the ownership of DataObjectGtk instances is not clear enough, and we have hacks to avoid memory
leaks because of that.

* Shared/gtk/ArgumentCodersGtk.cpp:
(IPC::encodeImage): Use Image instead of GdkPixbuf.
(IPC::decodeImage): Ditto.
(IPC::ArgumentCoder<DataObjectGtk>::encode):
(IPC::ArgumentCoder<DataObjectGtk>::decode):
(IPC::encode): Deleted.
(IPC::decode): Deleted.
(IPC::ArgumentCoder<DragData>::encode): Deleted.
(IPC::ArgumentCoder<DragData>::decode): Deleted.
* Shared/gtk/ArgumentCodersGtk.h:
* Shared/gtk/PasteboardContent.cpp:
(WebKit::PasteboardContent::PasteboardContent): Add empty constructor that creates a new DataObjectGtk, a
constructor that receives a const reference and another one that takes the ownership of the given DataObjectGtk.
(WebKit::PasteboardContent::encode):
(WebKit::PasteboardContent::decode):
* Shared/gtk/PasteboardContent.h: Use Ref instead of RefPtr for the DataObjectGtk member.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::startDrag): Transfer the DataObjectGtk to the DragAndDropHandler, instead of using DragData.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::performDragControllerAction): Instead of sending a DragData object to the web process,
send the DataObjectGtk and DragData members needed as parameters.
(WebKit::WebPageProxy::startDrag): Transfer the received DataObjectGtk to page client, instead of using
DragData. Also notify the web process that drag started.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in: Update StartDrag message parameters.
* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::DragAndDropHandler): Remove unneeded initialization.
(WebKit::DragAndDropHandler::startDrag): Take ownership of the given DataObjectGtk.
* UIProcess/gtk/DragAndDropHandler.h:
* UIProcess/gtk/WebPasteboardProxyGtk.cpp:
(WebKit::WebPasteboardProxy::writeToClipboard):
(WebKit::WebPasteboardProxy::readFromClipboard):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::writeToClipboard):
(WebKit::WebPlatformStrategies::readFromClipboard):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::convertCairoSurfaceToShareableBitmap):
(WebKit::WebDragClient::startDrag): Do not create a DragData and pass the DataObjectGtk directly to the
message. Also notify the WebPage that drag is about to start.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction): Remove explicit DataObjectGtk derefs and simply create a
DragData using the DataObjectGtk pointer as platform data.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Update PerformDragControllerAction message parameters.

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

3 years agoRequire WTFMove for String::adopt
achristensen@apple.com [Wed, 21 Sep 2016 03:10:57 +0000 (03:10 +0000)]
Require WTFMove for String::adopt
https://bugs.webkit.org/show_bug.cgi?id=162313

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

* runtime/JSStringBuilder.h:
(JSC::JSStringBuilder::build):

Source/WebCore:

No change in behavior.  This just makes it more clear what is going on when a String adopts a Vector.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readString):
* css/parser/CSSParser.cpp:
(WebCore::quoteCSSStringInternal):
* dom/Document.cpp:
(WebCore::canonicalizedTitle):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::normalizeSpaces):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
* platform/Length.cpp:
(WebCore::newCoordsArray):
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::serialize):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::ReplicaState::cloneID):
* platform/text/TextCodecUTF16.cpp:
(WebCore::TextCodecUTF16::decode):
* platform/text/TextCodecUTF8.cpp:
(WebCore::TextCodecUTF8::decode):
* platform/text/mac/TextCodecMac.cpp:
(WebCore::TextCodecMac::decode):

Source/WTF:

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::removeCharacters):
(WTF::StringImpl::simplifyMatchedCharactersToSpace):
(WTF::StringImpl::adopt):
* wtf/text/StringImpl.h:
(WTF::StringImpl::adopt):
* wtf/text/WTFString.h:
(WTF::String::adopt):

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

3 years agoWeb Inspector: Reload unexpectedly switches to Storage Tab
commit-queue@webkit.org [Wed, 21 Sep 2016 02:46:17 +0000 (02:46 +0000)]
Web Inspector: Reload unexpectedly switches to Storage Tab
https://bugs.webkit.org/show_bug.cgi?id=162323
<rdar://problem/28393954>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-20
Reviewed by Matt Baker.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
We aren't stealing if the ContentView doesn't yet have a parent!
This fixes restoration when switching to the Storage tab at a
later time after a reload.

* UserInterface/Views/StorageSidebarPanel.js:
(WebInspector.StorageSidebarPanel._treeSelectionDidChange):
Don't showRepresentedObject if we aren't visible. That would force this
tab to the foreground and we don't want that. This only happens when
tree elements are removed (main frame navigation) and TreeOutline
selects the next available tree element.

(WebInspector.StorageSidebarPanel.prototype._storageCleared):
Simplify and close all content views. We were missing IndexedDB content views.

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

3 years ago[EFL] ewk_context_menu_item_select test have been failed
hs85.jeong@samsung.com [Wed, 21 Sep 2016 02:34:14 +0000 (02:34 +0000)]
[EFL] ewk_context_menu_item_select test have been failed
https://bugs.webkit.org/show_bug.cgi?id=162143

Reviewed by Gyuyoung Kim.

ewk_context_menu_item_select has been waited until test page loading is finished, but it is
unnecessary to wait the loading is finished. It would be good to pass if *testFinished*
flag is true.

* UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:
(EWK2ContextMenuTest::checkBasicContextMenuItem):
(EWK2ContextMenuTest::testContextMenu):
(TEST_F):

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

3 years agoAdopt MRMediaRemoteSetParentApplication.
jer.noble@apple.com [Wed, 21 Sep 2016 01:10:18 +0000 (01:10 +0000)]
Adopt MRMediaRemoteSetParentApplication.
https://bugs.webkit.org/show_bug.cgi?id=162259
<rdar://problem/28376161>

Reviewed by Anders Carlsson.

Allow MediaSessionManagerMac to retrieve the correct parent application identifier
from a PlatformMediaSession so that it can pass that identifier through to MediaRemote
via MRMediaRemoteSetParentApplication.

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::sourceApplicationIdentifier):
* Modules/webaudio/AudioContext.h:
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::sourceApplicationIdentifier):
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::resetPlaybackSessionState): Deleted.
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
* platform/mac/MediaRemoteSoftLink.cpp:
* platform/mac/MediaRemoteSoftLink.h:

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

3 years agoREGRESSION(r205692): Minified builds have broken inspector
joepeck@webkit.org [Wed, 21 Sep 2016 01:03:22 +0000 (01:03 +0000)]
REGRESSION(r205692): Minified builds have broken inspector
https://bugs.webkit.org/show_bug.cgi?id=162327
<rdar://problem/28370137>

Reviewed by Matt Baker.

* Scripts/cssmin.py:
(cssminify):
Converge on the newer cssmin that we mistakenly dropped in r205692.
This knows how to handle more cases.

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

3 years agoAX: AppleVisUser: VO can't navigate web dialogs iOS10
n_wang@apple.com [Wed, 21 Sep 2016 00:27:38 +0000 (00:27 +0000)]
AX: AppleVisUser: VO can't navigate web dialogs iOS10
https://bugs.webkit.org/show_bug.cgi?id=162322

Reviewed by Chris Fleizach.

Source/WebCore:

When using VoiceOver to navigate a web dialog's children, we were setting focus
onto the focusable parent in accessibilityElementDidBecomeFocused. When the focusable
parent is the dialog, it will cause the VO cursor jumping back and forward. Fixed it
by not setting focus on web dialogs in such case.

Test: accessibility/ios-simulator/dialog-did-become-focused.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):

LayoutTests:

* accessibility/ios-simulator/dialog-did-become-focused-expected.txt: Added.
* accessibility/ios-simulator/dialog-did-become-focused.html: Added.

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

3 years agoAdd new logging for network resource loading
krollin@apple.com [Wed, 21 Sep 2016 00:27:17 +0000 (00:27 +0000)]
Add new logging for network resource loading
https://bugs.webkit.org/show_bug.cgi?id=162237

Reviewed by Antti Koivisto.

Add new logging along the non-main path for resource loading. This
logging should allow us to differentiate between lack-of-logging due
execution along a path that doesn't have logging statements and
lack-of-logging due to a hung process.

Source/WebCore:

No new tests -- there are no tests for logging.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
(WebCore::DocumentLoader::isAlwaysOnLoggingAllowed):
* loader/DocumentLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterWillSubmitForm):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::isAlwaysOnLoggingAllowed):
* loader/cache/CachedResourceLoader.h:
* page/Frame.h:

Source/WebKit2:

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::setDefersLoading):
(WebKit::NetworkResourceLoader::abort):
(WebKit::NetworkResourceLoader::didReceiveBuffer):
* NetworkProcess/NetworkResourceLoader.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::loadResource):
(WebKit::WebLoaderStrategy::scheduleLoad):

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

3 years agoREGRESSION (r204552): Athlete search on Strava gives bad rendering.
zalan@apple.com [Wed, 21 Sep 2016 00:25:07 +0000 (00:25 +0000)]
REGRESSION (r204552): Athlete search on Strava gives bad rendering.
https://bugs.webkit.org/show_bug.cgi?id=162250

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/layers/blank-content-when-child-layer-is-at-negative-big-number.html

* platform/graphics/LayoutRect.cpp:
(WebCore::LayoutRect::checkedUnite):
* platform/graphics/LayoutRect.h:
(WebCore::LayoutRect::isMaxXMaxYRepresentable):
(WebCore::LayoutRect::maxXMaxYCorner): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):

LayoutTests:

While computing the size of a particular layer, we unite the content size and the descendant layers' size.
If a descendant layer is positioned far off, the computed rectangle might not fully cover the original rectangles.
This happens when the 2 rectangles' distance is close to the maximum LayoutUnit value.
It's fairly common technic to put some content offscreen (top: -99999999px;). In order to keep the main content
visible, we need to ensure that the parent layer never gets cut off, while uniting it with the descendant layers.

* fast/layers/blank-content-when-child-layer-is-at-negative-big-number-expected.html: Added.
* fast/layers/blank-content-when-child-layer-is-at-negative-big-number.html: Added.

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

3 years agoenable remote_api (for debugging) in flakiness dashboard app
aakash_jain@apple.com [Wed, 21 Sep 2016 00:21:02 +0000 (00:21 +0000)]
enable remote_api (for debugging) in flakiness dashboard app
https://bugs.webkit.org/show_bug.cgi?id=162325

Reviewed by Alexey Proskuryakov.

* TestResultServer/app.yaml: enabled remote_api and datastore_admin.

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

3 years ago[media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-appendwin...
jer.noble@apple.com [Tue, 20 Sep 2016 23:58:00 +0000 (23:58 +0000)]
[media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-appendwindow.html
https://bugs.webkit.org/show_bug.cgi?id=162306

Reviewed by Darin Adler.

Source/WebCore:

appendWindowStart should be a restricted double, and both it and appendWindowEnd should throw
TypeError exceptions when setting them to disallowed values.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::setAppendWindowStart):
(WebCore::SourceBuffer::setAppendWindowEnd):
* Modules/mediasource/SourceBuffer.idl:

LayoutTests:

* platform/mac/TestExpectations:

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

3 years ago[media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-preload...
jer.noble@apple.com [Tue, 20 Sep 2016 23:56:38 +0000 (23:56 +0000)]
[media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-preload.html
https://bugs.webkit.org/show_bug.cgi?id=162304

Reviewed by Darin Adler.

Source/WebCore:

If an error occurs while loading a URL on behalf of MediaPlayerPrivateAVFObjC, make sure to signal
that error to AVFoundation, so that the HTMLMediaElement is notified of the error.

* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::notifyFinished):

LayoutTests:

* platform/mac/TestExpectations:

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

3 years agoUnreviewed, rolling out r206180.
ryanhaddad@apple.com [Tue, 20 Sep 2016 23:11:08 +0000 (23:11 +0000)]
Unreviewed, rolling out r206180.

Roll r206178 back in as the necessary changes have been made
on the build master.

Reverted changeset:

"Unreviewed, rolling out r206178."
https://bugs.webkit.org/show_bug.cgi?id=162249
http://trac.webkit.org/changeset/206180

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

3 years agoDFG::StoreBarrierInsertionPhase should assume that any epoch increment may make objec...
fpizlo@apple.com [Tue, 20 Sep 2016 22:57:16 +0000 (22:57 +0000)]
DFG::StoreBarrierInsertionPhase should assume that any epoch increment may make objects older
https://bugs.webkit.org/show_bug.cgi?id=162319

Reviewed by Saam Barati.

The store barrier phase needs to be aware of the fact that an object that is not in the
OldBlack state may be concurrently brought into that state. That means that:

- We cannot reason about the relative ages of objects. An object is either new, in which
  case we can store to it without barriers, or it's not in which case it needs a barrier.

- After we insert a barrier on an object, the object is no longer new, because now the GC
  knows about it and the GC may do things to it, like make it OldBlack.

This is a perf-neutral change. These optimizations were never particularly profitable.

* dfg/DFGStoreBarrierInsertionPhase.cpp:

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

3 years agoUse a hardcoded patch for sRGB color profile
ap@apple.com [Tue, 20 Sep 2016 22:36:02 +0000 (22:36 +0000)]
Use a hardcoded patch for sRGB color profile
https://bugs.webkit.org/show_bug.cgi?id=162320
rdar://problem/28387318

Reviewed by Simon Fraser.

This is a workaround for rdar://problem/28392768

* DumpRenderTree/mac/LayoutTestHelper.m:
(installLayoutTestColorProfile):

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

3 years agoRemove "in-store" from "-apple-pay-button-type"
andersca@apple.com [Tue, 20 Sep 2016 22:30:49 +0000 (22:30 +0000)]
Remove "in-store" from "-apple-pay-button-type"
https://bugs.webkit.org/show_bug.cgi?id=162321
rdar://problem/28394581

Reviewed by Beth Dakin.

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
* css/CSSValueKeywords.in:
* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/RenderThemeCocoa.mm:
(WebCore::toPKPaymentButtonType):
* rendering/style/RenderStyleConstants.h:

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

3 years agoUnreviewed, rolling out r206178.
ryanhaddad@apple.com [Tue, 20 Sep 2016 22:30:29 +0000 (22:30 +0000)]
Unreviewed, rolling out r206178.

This change caused buildbot config issues.

Reverted changeset:

"Add Sierra bots to buildbot and dashboard."
https://bugs.webkit.org/show_bug.cgi?id=162249
http://trac.webkit.org/changeset/206178

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

3 years agoFix occasional using uninitialized memory crashes after r206168.
achristensen@apple.com [Tue, 20 Sep 2016 22:19:16 +0000 (22:19 +0000)]
Fix occasional using uninitialized memory crashes after r206168.
https://bugs.webkit.org/show_bug.cgi?id=162247

This fixes a crash in imported/w3c/web-platform-tests/url/urlsearchparams-constructor.html
I could reproduce about 10% of the time.

* html/URLSearchParams.h:
Initialize the pointer to nullptr.

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

3 years agoAdd Sierra bots to buildbot and dashboard.
commit-queue@webkit.org [Tue, 20 Sep 2016 22:16:31 +0000 (22:16 +0000)]
Add Sierra bots to buildbot and dashboard.
https://bugs.webkit.org/show_bug.cgi?id=162249

Patch by Dean Johnson <dean_johnson@apple.com> on 2016-09-20
Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):

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

3 years agoReduce allocations in URLParser
achristensen@apple.com [Tue, 20 Sep 2016 21:50:30 +0000 (21:50 +0000)]
Reduce allocations in URLParser
https://bugs.webkit.org/show_bug.cgi?id=162241

Reviewed by Chris Dumez.

Source/WebCore:

Use Vectors instead of StringBuilders.  This allows us to use the inline capacity on the stack
for short URLs (<2KB) and also allows us to skip branches because we know whether the
contained type is UChar or LChar at compile time.  It also allows us to use uncheckedAppend.

Added new API tests for parts that were less tested, but there is
no change in behavior except for a performance improvement.

* platform/URLParser.cpp:
(WebCore::appendCodePoint):
(WebCore::encodeQuery):
(WebCore::URLParser::failure):
(WebCore::URLParser::parse):
(WebCore::percentDecode):
(WebCore::domainToASCII):
(WebCore::hasInvalidDomainCharacter):
(WebCore::URLParser::parseHost):
(WebCore::formURLDecode):
(WebCore::isC0Control): Deleted.
* platform/URLParser.h:

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):
(TestWebKitAPI::checkURL):

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

3 years agoCan't present a payment sheet if a sheet is already active in another window
andersca@apple.com [Tue, 20 Sep 2016 21:43:26 +0000 (21:43 +0000)]
Can't present a payment sheet if a sheet is already active in another window
https://bugs.webkit.org/show_bug.cgi?id=162314
rdar://problem/27643511

Reviewed by Tim Horton.

Instead of keeping track of whether a sheet is active or not, keep track of its underlying payment coordinator proxy,
so we can hide it and send a cancel event to WebCore if another sheet is being presented.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy):
(WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
(WebKit::WebPaymentCoordinatorProxy::didReachFinalState):

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

3 years agoRename MarkedSpace::version/MarkedBlock::version to MarkedSpace::markingVersion/Marke...
fpizlo@apple.com [Tue, 20 Sep 2016 21:04:06 +0000 (21:04 +0000)]
Rename MarkedSpace::version/MarkedBlock::version to MarkedSpace::markingVersion/MarkedBlock::markingVersion
https://bugs.webkit.org/show_bug.cgi?id=162310

Reviewed by Geoffrey Garen.

In bug 162309, which is part of my concurrent GC work, I'll need to introduce a second
version-based flip. This one will be for newlyAllocated bits. This will allow me to
cheaply preserve per-object live state during marking. MarkedBlock::aboutToMarkSlow() will
do this instead of clearMarks():

    - Walk the mark bits, simultaneously counting the number of set bits and clearing
      them.
    - If the count is zero, then we're done.
    - If the count is equal to the max number of cells in the block, then set the
      allocated bit for the block.
    - If the count is something else, create a newlyAllocated vector.

The hope is that the last mode is going to be rare, since most blocks are not fragmented
at end of GC. Usually, we will fill them in with objects by allocating! But if we do
create newlyAllocated bits then we need to have some way of blowing them away later.

This is where a second version comes in. We can have a version for newlyAllocated bits,
which we increment at the end of marking, at around the same time that we clear all
allocated bits.

This means that the MarkedBlock will have two different version-based flips, so terms like
"flip" and "version" aren't enough.

This patch gets rid of the term "flip" entirely. It's a term of art in GCs that refers to
the state change at the beginning or end of GC. It refers to the logical state change, not
the physical one. It doesn't actually make sense to speak of a block being flipped
independently of other blocks. It's true that our implementation of the flip makes some
state updates happen lazily, but the block updating itself in some way (like clearing mark
bits) isn't the flip - the flip already happened when the version was incremented.

We no longer refer to a version without qualifying what kind of version it is. The type is
HeapVersion. All of the version members were renamed to markingVersion, to reflect the
fact that this version is just used for doing things to marking state. Instead of asking
if the block needsFlip(), we ask if areMarksStale().

This will let us introduce a second version for newlyAllocated, and will let us speak of
the two versions unambiguously.

* heap/CellContainer.h:
* heap/CellContainerInlines.h:
(JSC::CellContainer::isMarked):
(JSC::CellContainer::isMarkedOrNewlyAllocated):
(JSC::CellContainer::aboutToMark):
(JSC::CellContainer::areMarksStale):
(JSC::CellContainer::needsFlip): Deleted.
* heap/ConservativeRoots.cpp:
(JSC::ConservativeRoots::genericAddPointer):
(JSC::ConservativeRoots::genericAddSpan):
* heap/HeapInlines.h:
(JSC::Heap::isMarked):
(JSC::Heap::isMarkedConcurrently):
(JSC::Heap::testAndSetMarked):
* heap/HeapUtil.h:
(JSC::HeapUtil::findGCObjectPointersForMarking):
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::isPagedOut):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::MarkedBlock):
(JSC::MarkedBlock::Handle::specializedSweep):
(JSC::MarkedBlock::Handle::sweepHelperSelectSweepMode):
(JSC::MarkedBlock::Handle::sweepHelperSelectMarksMode):
(JSC::MarkedBlock::aboutToMarkSlow):
(JSC::MarkedBlock::clearMarks):
(JSC::MarkedBlock::assertMarksNotStale):
(JSC::MarkedBlock::areMarksStale):
(JSC::MarkedBlock::Handle::areMarksStale):
(JSC::MarkedBlock::isMarked):
(JSC::MarkedBlock::Handle::isMarkedOrNewlyAllocated):
(JSC::MarkedBlock::isMarkedOrNewlyAllocated):
(JSC::MarkedBlock::markCount):
(JSC::MarkedBlock::Handle::isLive):
(JSC::MarkedBlock::Handle::isLiveCell):
(JSC::MarkedBlock::Handle::sweepHelperSelectFlipMode): Deleted.
(JSC::MarkedBlock::assertFlipped): Deleted.
(JSC::MarkedBlock::needsFlip): Deleted.
(JSC::MarkedBlock::Handle::needsFlip): Deleted.
* heap/MarkedBlock.h:
(JSC::MarkedBlock::areMarksStale):
(JSC::MarkedBlock::aboutToMark):
(JSC::MarkedBlock::assertMarksNotStale):
(JSC::MarkedBlock::Handle::assertMarksNotStale):
(JSC::MarkedBlock::isMarked):
(JSC::MarkedBlock::isMarkedConcurrently):
(JSC::MarkedBlock::testAndSetMarked):
(JSC::MarkedBlock::Handle::isMarkedOrNewlyAllocated):
(JSC::MarkedBlock::isMarkedOrNewlyAllocated):
(JSC::MarkedBlock::needsFlip): Deleted.
(JSC::MarkedBlock::assertFlipped): Deleted.
(JSC::MarkedBlock::Handle::assertFlipped): Deleted.
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::isLive):
(JSC::MarkedBlock::Handle::isLiveCell):
(JSC::MarkedBlock::resetMarkingVersion):
(JSC::MarkedBlock::resetVersion): Deleted.
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::beginMarking):
* heap/MarkedSpace.h:
(JSC::MarkedSpace::markingVersion):
(JSC::MarkedSpace::version): Deleted.
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::SlotVisitor):
(JSC::SlotVisitor::didStartMarking):
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
(JSC::SlotVisitor::setMarkedAndAppendToMarkStack):
(JSC::SlotVisitor::markAuxiliary):
* heap/SlotVisitor.h:
(JSC::SlotVisitor::markingVersion):
(JSC::SlotVisitor::version): Deleted.
* heap/WeakBlock.cpp:
(JSC::WeakBlock::specializedVisit):
(JSC::WeakBlock::reap):

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

3 years ago[JSC] Do not use EagerRun on tests counting recompilation
commit-queue@webkit.org [Tue, 20 Sep 2016 20:57:31 +0000 (20:57 +0000)]
[JSC] Do not use EagerRun on tests counting recompilation
https://bugs.webkit.org/show_bug.cgi?id=162248

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-09-20
Reviewed by Geoffrey Garen.

This patch adds defaultNoEagerRun to all the tests
for which recompilation is the symptom of a bug.
The reason is that an OSR Exit can be unrelated to the tested
nodes when we are running in Eager mode.

* stress/arith-abs-on-various-types.js:
* stress/arith-ceil-on-various-types.js:
* stress/arith-clz32-on-various-types.js:
* stress/arith-cos-on-various-types.js:
* stress/arith-floor-on-various-types.js:
* stress/arith-fround-on-various-types.js:
* stress/arith-log-on-various-types.js:
* stress/arith-round-on-various-types.js:
* stress/arith-sin-on-various-types.js:
* stress/arith-sqrt-on-various-types.js:
* stress/arith-tan-on-various-types.js:
* stress/arith-trunc-on-various-types.js:

* stress/compare-strict-eq-on-various-types.js:
(testAllTypesCall):
The value 2 came from the other tests.
CompareStrictEq supports many more cases, the worst case
is bool->int->int52->number->polymorphic.

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

3 years agoAX: voiceover does not read contents of input role="spinbutton"
n_wang@apple.com [Tue, 20 Sep 2016 20:44:26 +0000 (20:44 +0000)]
AX: voiceover does not read contents of input role="spinbutton"
https://bugs.webkit.org/show_bug.cgi?id=162137

Reviewed by Chris Fleizach.

Source/WebCore:

The aria-valuenow attribute value on the spinbutton is not exposed
on iOS. We should expose aria-valuenow attribute for range controls
based on https://www.w3.org/TR/wai-aria/states_and_properties#aria-valuenow

Changes are covered in the modified test.

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityValue]):

LayoutTests:

* accessibility/ios-simulator/spinbutton-expected.txt:
* accessibility/ios-simulator/spinbutton.html:

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

3 years agoURLParser: uidna_IDNToASCII_56 is deprecated
achristensen@apple.com [Tue, 20 Sep 2016 20:25:03 +0000 (20:25 +0000)]
URLParser: uidna_IDNToASCII_56 is deprecated
https://bugs.webkit.org/show_bug.cgi?id=161841

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2016-09-20
Reviewed by Alex Christensen.

Add pragmas to silence the warning, plus a FIXME.

* platform/URLParser.cpp:
(WebCore::domainToASCII):

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

3 years agoMake URLSearchParams spec-compliant
achristensen@apple.com [Tue, 20 Sep 2016 20:11:54 +0000 (20:11 +0000)]
Make URLSearchParams spec-compliant
https://bugs.webkit.org/show_bug.cgi?id=162247

Reviewed by Chris Dumez and Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/url/url-constructor-expected.txt:

Source/WebCore:

Covered by newly-passing web platform tests.

* html/DOMURL.cpp:
(WebCore::DOMURL::~DOMURL):
(WebCore::DOMURL::setHref):
(WebCore::DOMURL::setQuery):
Update any associated URLSearchParams object when the query could change.
(WebCore::DOMURL::searchParams):
The lifetime of the URLSearchParams was wrong.  We were creating a new URLSearchParams each time
URL.searchParams was called, and we should have been creating one the first time and returning the
same instance for subsequent calls.  This means the DOMURL must own the URLSearchParams if it is associated,
but if it is not associated, then a URLSearchParams can live on its own.
* html/DOMURL.h:
* html/URLSearchParams.h:
(WebCore::URLSearchParams::URLDestroyed):
(WebCore::URLSearchParams::setContents):

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

3 years agoRemove AuthorStyleSheets::m_hadActiveLoadingStylesheet bit
antti@apple.com [Tue, 20 Sep 2016 20:05:31 +0000 (20:05 +0000)]
Remove AuthorStyleSheets::m_hadActiveLoadingStylesheet bit
https://bugs.webkit.org/show_bug.cgi?id=162312

Reviewed by Chris Dumez.

* dom/AuthorStyleSheets.cpp:
(WebCore::AuthorStyleSheets::analyzeStyleSheetChange):

    We can handle loading sheets with the normal stylesheet change logic. Remove the special case.

(WebCore::filterEnabledNonemptyCSSStyleSheets):

    Filter out loading stylesheets.

* dom/AuthorStyleSheets.h:

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

3 years agoAdjust current networking logging
krollin@apple.com [Tue, 20 Sep 2016 20:03:45 +0000 (20:03 +0000)]
Adjust current networking logging
https://bugs.webkit.org/show_bug.cgi?id=162235

Reviewed by Antti Koivisto.

Update the "always on" network logging in order to better track the
loading of a particular resource and to better bind together the
resources downloaded for a particular page and frame. Do this by
consistently logging pageID, frameID, and resourceID.

Source/WebCore:

No new tests -- there are no tests for logging.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::frame):

Source/WebKit2:

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::didFailLoading):
(WebKit::NetworkResourceLoader::continueWillSendRequest):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::startLocalLoad):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::create):
(WebKit::WebResourceLoader::WebResourceLoader):
(WebKit::WebResourceLoader::willSendRequest):
(WebKit::WebResourceLoader::didReceiveResponse):
(WebKit::WebResourceLoader::didReceiveData):
(WebKit::WebResourceLoader::didFinishResourceLoad):
(WebKit::WebResourceLoader::didFailResourceLoad):
(WebKit::WebResourceLoader::didReceiveResource):
* WebProcess/Network/WebResourceLoader.h:

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

3 years agoNon-special URLs should have an opaque origin
achristensen@apple.com [Tue, 20 Sep 2016 20:01:08 +0000 (20:01 +0000)]
Non-special URLs should have an opaque origin
https://bugs.webkit.org/show_bug.cgi?id=162254

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/url/a-element-expected.txt:
* web-platform-tests/url/a-element-xhtml-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:

Source/WebCore:

Covered by newly passing web platform tests.

* page/SecurityOrigin.cpp:
(WebCore::shouldTreatAsUniqueOrigin):
According to https://url.spec.whatwg.org/#origin all URLs with non-special protocols
should have a unique SecurityOrigin whose serialization is "null".

LayoutTests:

* http/tests/security/postMessage/invalid-origin-throws-exception-expected.txt:
* http/tests/security/postMessage/invalid-origin-throws-exception.html:

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