WebKit-https.git
3 years agoInspector exception in `parseTextForRule()` when pasting into CSS rule selector
commit-queue@webkit.org [Thu, 6 Oct 2016 23:11:01 +0000 (23:11 +0000)]
Inspector exception in `parseTextForRule()` when pasting into CSS rule selector
https://bugs.webkit.org/show_bug.cgi?id=162792

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-10-06
Reviewed by Matt Baker.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype._handleSelectorPaste.parseTextForRule):
Changed regular expression for matching CSS rules to allow newlines in pasted text.

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

3 years agoURLParser: Non-ASCII characters in Non-UTF-8 encoded queries of relative URLs with...
achristensen@apple.com [Thu, 6 Oct 2016 23:05:17 +0000 (23:05 +0000)]
URLParser: Non-ASCII characters in Non-UTF-8 encoded queries of relative URLs with ws, wss, or nonspecial schemes should be UTF-8 encoded
https://bugs.webkit.org/show_bug.cgi?id=163089

Reviewed by Tim Horton.

Source/WebCore:

This is a change similar to r206818 but with relative URLs.
This matches the spec, URL::parse, and other browsers' behavior.
Covered by new API tests for URLParser.
This also fixes tests like http/tests/misc/url-in-utf32le.html when URLParser is enabled.

* platform/URL.cpp:
(WebCore::URL::URL):
Use the same encoding for the URL constructor whether or not the URLParser is enabled.
* platform/URLParser.cpp:
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::parse):
(WebCore::isSpecial): Deleted.
* platform/URLParser.h:
Use UTF-8 for non-special, ws, or wss schemes.

Tools:

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

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

3 years agoHasOwnPropertyCache flattening dictionaries is causing insane memory usage with the...
sbarati@apple.com [Thu, 6 Oct 2016 22:40:37 +0000 (22:40 +0000)]
HasOwnPropertyCache flattening dictionaries is causing insane memory usage with the uBlock Safari extension
https://bugs.webkit.org/show_bug.cgi?id=163091

Reviewed by Mark Lam.

I'm investigating a real fix for this in:
https://bugs.webkit.org/show_bug.cgi?id=163092
However, it's best to get this out of trunk for now.

* runtime/HasOwnPropertyCache.h:
(JSC::HasOwnPropertyCache::tryAdd):

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

3 years agoAdd back ASSERT(!needsLayout) to RenderTableSection which is now valid
zalan@apple.com [Thu, 6 Oct 2016 21:40:38 +0000 (21:40 +0000)]
Add back ASSERT(!needsLayout) to RenderTableSection which is now valid
https://bugs.webkit.org/show_bug.cgi?id=92954
<rdar://problem/12147973>

Reviewed by Dan Bernstein.

LayoutTests pass fine now with this assert on.

Covered by existing tests.

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paint):

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

3 years agoAdd a dummy SubtleCrypto interface
jiewen_tan@apple.com [Thu, 6 Oct 2016 21:32:02 +0000 (21:32 +0000)]
Add a dummy SubtleCrypto interface
https://bugs.webkit.org/show_bug.cgi?id=162992
<rdar://problem/28643573>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/digest/test_digest-expected.txt:
* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

Add a dummy SubtleCrypto interface and rename KeyPair to CryptoKeyPair.

Tests: crypto/subtle/gc-2.html
       crypto/subtle/gc-3.html
       crypto/subtle/gc.html
       crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html
       crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html
       crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html
       crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html
       crypto/webkitSubtle/aes-cbc-generate-key.html
       crypto/webkitSubtle/aes-cbc-import-jwk.html
       crypto/webkitSubtle/aes-cbc-invalid-length.html
       crypto/webkitSubtle/aes-cbc-unwrap-failure.html
       crypto/webkitSubtle/aes-cbc-unwrap-rsa.html
       crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html
       crypto/webkitSubtle/aes-cbc-wrap-rsa.html
       crypto/webkitSubtle/aes-cbc-wrong-key-class.html
       crypto/webkitSubtle/aes-export-key.html
       crypto/webkitSubtle/aes-kw-key-manipulation.html
       crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html
       crypto/webkitSubtle/aes-postMessage.html
       crypto/webkitSubtle/argument-conversion.html
       crypto/webkitSubtle/array-buffer-view-offset.html
       crypto/webkitSubtle/crypto-key-algorithm-gc.html
       crypto/webkitSubtle/crypto-key-usages-gc.html
       crypto/webkitSubtle/hmac-check-algorithm.html
       crypto/webkitSubtle/hmac-export-key.html
       crypto/webkitSubtle/hmac-generate-key.html
       crypto/webkitSubtle/hmac-import-jwk.html
       crypto/webkitSubtle/hmac-postMessage.html
       crypto/webkitSubtle/hmac-sign-verify-empty-key.html
       crypto/webkitSubtle/hmac-sign-verify.html
       crypto/webkitSubtle/import-jwk.html
       crypto/webkitSubtle/jwk-export-use-values.html
       crypto/webkitSubtle/jwk-import-use-values.html
       crypto/webkitSubtle/rsa-export-generated-keys.html
       crypto/webkitSubtle/rsa-export-key.html
       crypto/webkitSubtle/rsa-export-private-key.html
       crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
       crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
       crypto/webkitSubtle/rsa-indexeddb-private.html
       crypto/webkitSubtle/rsa-indexeddb.html
       crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html
       crypto/webkitSubtle/rsa-oaep-key-manipulation.html
       crypto/webkitSubtle/rsa-oaep-plaintext-length.html
       crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html
       crypto/webkitSubtle/rsa-postMessage.html
       crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html
       crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
       crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html
       crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html
       crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html
       crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html
       crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html
       crypto/webkitSubtle/sha-1.html
       crypto/webkitSubtle/sha-224.html
       crypto/webkitSubtle/sha-256.html
       crypto/webkitSubtle/sha-384.html
       crypto/webkitSubtle/sha-512.html
       crypto/webkitSubtle/unimplemented-unwrap-crash.html
       crypto/webkitSubtle/unwrapKey-check-usage.html
       crypto/webkitSubtle/wrapKey-check-usage.html
       crypto/workers/subtle/aes-postMessage-worker.html
       crypto/workers/subtle/gc-worker.html
       crypto/workers/subtle/hmac-postMessage-worker.html
       crypto/workers/subtle/hrsa-postMessage-worker.html
       crypto/workers/subtle/multiple-postMessage-worker.html
       crypto/workers/subtle/rsa-postMessage-worker.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* crypto/CryptoKeyPair.idl:
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::SubtleCrypto):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::create):
* crypto/SubtleCrypto.idl: Added.
* page/Crypto.cpp:
(WebCore::Crypto::Crypto):
(WebCore::Crypto::subtle):
* page/Crypto.h:
* page/Crypto.idl:

LayoutTests:

* crypto/resources/common.js:
* crypto/subtle/gc-2-expected.txt: Added.
* crypto/subtle/gc-2.html: Added.
* crypto/subtle/gc-3-expected.txt: Added.
* crypto/subtle/gc-3.html: Added.
* crypto/subtle/gc-expected.txt: Added.
* crypto/subtle/gc.html: Added.
* crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt-expected.txt.
* crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-192-encrypt-decrypt.html.
* crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt-expected.txt.
* crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-256-encrypt-decrypt.html.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-expected.txt.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding-expected.txt.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt-with-padding.html.
* crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-decrypt.html.
* crypto/webkitSubtle/aes-cbc-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-generate-key-expected.txt.
* crypto/webkitSubtle/aes-cbc-generate-key.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-generate-key.html.
* crypto/webkitSubtle/aes-cbc-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-jwk-expected.txt.
* crypto/webkitSubtle/aes-cbc-import-jwk.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-jwk.html.
* crypto/webkitSubtle/aes-cbc-invalid-length-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-invalid-length-expected.txt.
* crypto/webkitSubtle/aes-cbc-invalid-length.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-invalid-length.html.
* crypto/webkitSubtle/aes-cbc-unwrap-failure-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-failure-expected.txt.
* crypto/webkitSubtle/aes-cbc-unwrap-failure.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-failure.html.
* crypto/webkitSubtle/aes-cbc-unwrap-rsa-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa-expected.txt.
* crypto/webkitSubtle/aes-cbc-unwrap-rsa.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-unwrap-rsa.html.
* crypto/webkitSubtle/aes-cbc-wrap-rsa-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-expected.txt.
* crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable-expected.txt.
* crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa-non-extractable.html.
* crypto/webkitSubtle/aes-cbc-wrap-rsa.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrap-rsa.html.
* crypto/webkitSubtle/aes-cbc-wrong-key-class-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrong-key-class-expected.txt.
* crypto/webkitSubtle/aes-cbc-wrong-key-class.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-wrong-key-class.html.
* crypto/webkitSubtle/aes-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-export-key-expected.txt.
* crypto/webkitSubtle/aes-export-key.html: Renamed from LayoutTests/crypto/subtle/aes-export-key.html.
* crypto/webkitSubtle/aes-kw-key-manipulation-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-kw-key-manipulation-expected.txt.
* crypto/webkitSubtle/aes-kw-key-manipulation.html: Renamed from LayoutTests/crypto/subtle/aes-kw-key-manipulation.html.
* crypto/webkitSubtle/aes-kw-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt.
* crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html.
* crypto/webkitSubtle/aes-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-postMessage-expected.txt.
* crypto/webkitSubtle/aes-postMessage.html: Renamed from LayoutTests/crypto/subtle/aes-postMessage.html.
* crypto/webkitSubtle/argument-conversion-expected.txt: Renamed from LayoutTests/crypto/subtle/argument-conversion-expected.txt.
* crypto/webkitSubtle/argument-conversion.html: Renamed from LayoutTests/crypto/subtle/argument-conversion.html.
* crypto/webkitSubtle/array-buffer-view-offset-expected.txt: Renamed from LayoutTests/crypto/subtle/array-buffer-view-offset-expected.txt.
* crypto/webkitSubtle/array-buffer-view-offset.html: Renamed from LayoutTests/crypto/subtle/array-buffer-view-offset.html.
* crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt: Renamed from LayoutTests/crypto/subtle/crypto-key-algorithm-gc-expected.txt.
* crypto/webkitSubtle/crypto-key-algorithm-gc.html: Renamed from LayoutTests/crypto/subtle/crypto-key-algorithm-gc.html.
* crypto/webkitSubtle/crypto-key-usages-gc-expected.txt: Renamed from LayoutTests/crypto/subtle/crypto-key-usages-gc-expected.txt.
* crypto/webkitSubtle/crypto-key-usages-gc.html: Renamed from LayoutTests/crypto/subtle/crypto-key-usages-gc.html.
* crypto/webkitSubtle/hmac-check-algorithm-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-check-algorithm-expected.txt.
* crypto/webkitSubtle/hmac-check-algorithm.html: Renamed from LayoutTests/crypto/subtle/hmac-check-algorithm.html.
* crypto/webkitSubtle/hmac-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-export-key-expected.txt.
* crypto/webkitSubtle/hmac-export-key.html: Renamed from LayoutTests/crypto/subtle/hmac-export-key.html.
* crypto/webkitSubtle/hmac-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-export-key.html.
* crypto/webkitSubtle/hmac-generate-key.html: Renamed from LayoutTests/crypto/subtle/hmac-generate-key.html.
* crypto/webkitSubtle/hmac-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-import-jwk-expected.txt.
* crypto/webkitSubtle/hmac-import-jwk.html: Renamed from LayoutTests/crypto/subtle/hmac-import-jwk.html.
* crypto/webkitSubtle/hmac-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-postMessage-expected.txt.
* crypto/webkitSubtle/hmac-postMessage.html: Renamed from LayoutTests/crypto/subtle/hmac-postMessage.html.
* crypto/webkitSubtle/hmac-sign-verify-empty-key-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-empty-key-expected.txt.
* crypto/webkitSubtle/hmac-sign-verify-empty-key.html: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-empty-key.html.
* crypto/webkitSubtle/hmac-sign-verify-expected.txt: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify-expected.txt.
* crypto/webkitSubtle/hmac-sign-verify.html: Renamed from LayoutTests/crypto/subtle/hmac-sign-verify.html.
* crypto/webkitSubtle/import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/import-jwk-expected.txt.
* crypto/webkitSubtle/import-jwk.html: Renamed from LayoutTests/crypto/subtle/import-jwk-expected.html.
* crypto/webkitSubtle/jwk-export-use-values-expected.txt: Renamed from LayoutTests/crypto/subtle/jwk-export-use-values-expected.txt.
* crypto/webkitSubtle/jwk-export-use-values.html: Renamed from LayoutTests/crypto/subtle/jwk-export-use-values.html.
* crypto/webkitSubtle/jwk-import-use-values-expected.txt: Renamed from LayoutTests/crypto/subtle/jwk-import-use-values-expected.txt.
* crypto/webkitSubtle/jwk-import-use-values.html: Renamed from LayoutTests/crypto/subtle/jwk-import-use-values.html.
* crypto/webkitSubtle/resources/rsa-indexeddb-non-exportable.js: Renamed from LayoutTests/crypto/subtle/resources/rsa-indexeddb-non-exportable.js.
* crypto/webkitSubtle/resources/rsa-indexeddb.js: Renamed from LayoutTests/crypto/subtle/resources/rsa-indexeddb.js.
* crypto/webkitSubtle/rsa-export-generated-keys-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-generated-keys-expected.txt.
* crypto/webkitSubtle/rsa-export-generated-keys.html: Renamed from LayoutTests/crypto/subtle/rsa-export-generated-keys.html.
* crypto/webkitSubtle/rsa-export-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-key-expected.txt.
* crypto/webkitSubtle/rsa-export-key.html: Renamed from LayoutTests/crypto/subtle/rsa-export-key.html.
* crypto/webkitSubtle/rsa-export-private-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-export-private-key-expected.txt.
* crypto/webkitSubtle/rsa-export-private-key.html: Renamed from LayoutTests/crypto/subtle/rsa-export-private-key.html.
* crypto/webkitSubtle/rsa-indexeddb-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable-private-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable-private.html.
* crypto/webkitSubtle/rsa-indexeddb-non-exportable.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-non-exportable.html.
* crypto/webkitSubtle/rsa-indexeddb-private-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-private-expected.txt.
* crypto/webkitSubtle/rsa-indexeddb-private.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb-private.html.
* crypto/webkitSubtle/rsa-indexeddb.html: Renamed from LayoutTests/crypto/subtle/rsa-indexeddb.html.
* crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key-expected.txt.
* crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-generate-non-extractable-key.html.
* crypto/webkitSubtle/rsa-oaep-key-manipulation-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-key-manipulation-expected.txt.
* crypto/webkitSubtle/rsa-oaep-key-manipulation.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-key-manipulation.html.
* crypto/webkitSubtle/rsa-oaep-plaintext-length-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-plaintext-length-expected.txt.
* crypto/webkitSubtle/rsa-oaep-plaintext-length.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-plaintext-length.html.
* crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt.
* crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/rsa-oaep-wrap-unwrap-aes.html.
* crypto/webkitSubtle/rsa-postMessage-expected.txt: Renamed from LayoutTests/crypto/subtle/rsa-postMessage-expected.txt.
* crypto/webkitSubtle/rsa-postMessage.html: Renamed from LayoutTests/crypto/subtle/rsa-postMessage.html.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt-expected.txt: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt-expected.txt.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-decrypt.html.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt.
* crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html: Renamed from LayoutTests/crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-generate-key.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key-expected.txt: Added.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify-expected.txt.
* crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html: Renamed from LayoutTests/crypto/subtle/rsassa-pkcs1-v1_5-sign-verify.html.
* crypto/webkitSubtle/sha-1-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-1-expected.txt.
* crypto/webkitSubtle/sha-1.html: Renamed from LayoutTests/crypto/subtle/sha-1.html.
* crypto/webkitSubtle/sha-224-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-224-expected.txt.
* crypto/webkitSubtle/sha-224.html: Renamed from LayoutTests/crypto/subtle/sha-224.html.
* crypto/webkitSubtle/sha-256-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-256-expected.txt.
* crypto/webkitSubtle/sha-256.html: Renamed from LayoutTests/crypto/subtle/sha-256.html.
* crypto/webkitSubtle/sha-384-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-384-expected.txt.
* crypto/webkitSubtle/sha-384.html: Renamed from LayoutTests/crypto/subtle/sha-384.html.
* crypto/webkitSubtle/sha-512-expected.txt: Renamed from LayoutTests/crypto/subtle/sha-512-expected.txt.
* crypto/webkitSubtle/sha-512.html: Renamed from LayoutTests/crypto/subtle/sha-512.html.
* crypto/webkitSubtle/unimplemented-unwrap-crash-expected.txt: Renamed from LayoutTests/crypto/subtle/unimplemented-unwrap-crash-expected.txt.
* crypto/webkitSubtle/unimplemented-unwrap-crash.html: Renamed from LayoutTests/crypto/subtle/unimplemented-unwrap-crash.html.
* crypto/webkitSubtle/unwrapKey-check-usage-expected.txt: Renamed from LayoutTests/crypto/subtle/unwrapKey-check-usage-expected.txt.
* crypto/webkitSubtle/unwrapKey-check-usage.html: Renamed from LayoutTests/crypto/subtle/unwrapKey-check-usage.html.
* crypto/webkitSubtle/wrapKey-check-usage-expected.txt: Renamed from LayoutTests/crypto/subtle/wrapKey-check-usage-expected.txt.
* crypto/webkitSubtle/wrapKey-check-usage.html: Renamed from LayoutTests/crypto/subtle/wrapKey-check-usage.html.
* crypto/workers/subtle/aes-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/aes-postMessage-worker-expected.txt.
* crypto/workers/subtle/aes-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/aes-postMessage-worker.html.
* crypto/workers/subtle/gc-worker-expected.txt: Added.
* crypto/workers/subtle/gc-worker.html: Added.
* crypto/workers/subtle/hmac-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/hmac-postMessage-worker-expected.txt.
* crypto/workers/subtle/hmac-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/hmac-postMessage-worker.html.
* crypto/workers/subtle/hrsa-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/hrsa-postMessage-worker-expected.txt.
* crypto/workers/subtle/hrsa-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/hrsa-postMessage-worker.html.
* crypto/workers/subtle/multiple-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/multiple-postMessage-worker-expected.txt.
* crypto/workers/subtle/multiple-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/multiple-postMessage-worker.html.
* crypto/workers/subtle/resources/aes-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/aes-postMessage-worker.js.
* crypto/workers/subtle/resources/gc-worker.js: Added.
* crypto/workers/subtle/resources/hmac-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/hmac-postMessage-worker.js.
* crypto/workers/subtle/resources/hrsa-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/hrsa-postMessage-worker.js.
* crypto/workers/subtle/resources/rsa-postMessage-worker.js: Renamed from LayoutTests/crypto/workers/resources/rsa-postMessage-worker.js.
* crypto/workers/subtle/rsa-postMessage-worker-expected.txt: Renamed from LayoutTests/crypto/workers/rsa-postMessage-worker-expected.txt.
* crypto/workers/subtle/rsa-postMessage-worker.html: Renamed from LayoutTests/crypto/workers/rsa-postMessage-worker.html.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator-wk1/TestExpectations:
* platform/win/TestExpectations:

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

3 years agoUnreviewed, drop bad tests that were included by mistake in r206874.
cdumez@apple.com [Thu, 6 Oct 2016 21:26:36 +0000 (21:26 +0000)]
Unreviewed, drop bad tests that were included by mistake in r206874.

* web-platform-tests/html/webappapis/scripting/event-loops/microtask_after_raf.html: Removed.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setInterval.html: Removed.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-setTimeout.html: Removed.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setInterval.html: Removed.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-setTimeout.html: Removed.

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

3 years agoCrash when ApplePaySession.completeMerchantValidation is not passed a dictionary
andersca@apple.com [Thu, 6 Oct 2016 21:03:54 +0000 (21:03 +0000)]
Crash when ApplePaySession.completeMerchantValidation is not passed a dictionary
https://bugs.webkit.org/show_bug.cgi?id=163074
rdar://problem/27824842

Reviewed by Tim Horton.

Raise a type error on a null initializer object.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completeMerchantValidation):

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

3 years agoMutating styleSheet in shadow tree doesn't update the style
antti@apple.com [Thu, 6 Oct 2016 20:53:08 +0000 (20:53 +0000)]
Mutating styleSheet in shadow tree doesn't update the style
https://bugs.webkit.org/show_bug.cgi?id=162744
<rdar://problem/28550588>

Reviewed by Ryosuke Niwa.

Source/WebCore:

We weren't always invalidating the right AuthorStyleSheets (to be renamed) instance
for the scope after mutations.

Test: fast/shadow-dom/mutating-stylesheet-in-shadow-tree.html

* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
(WebCore::CSSStyleSheet::didMutate):
(WebCore::CSSStyleSheet::clearOwnerNode):
(WebCore::CSSStyleSheet::rootStyleSheet):
(WebCore::CSSStyleSheet::ownerDocument):
(WebCore::CSSStyleSheet::styleSheetScope):

    Invalidate the right scope after stylesheet mutations.

* css/CSSStyleSheet.h:
* dom/AuthorStyleSheets.cpp:
(WebCore::AuthorStyleSheets::styleResolver):
(WebCore::AuthorStyleSheets::styleResolverIfExists):

    Take care to update the right style resolver.

(WebCore::AuthorStyleSheets::forNode):
(WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode):

    Start the update timer so clients don't need to request update separately.

(WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
(WebCore::AuthorStyleSheets::updateActiveStyleSheets):
(WebCore::AuthorStyleSheets::updateStyleResolver):
* dom/AuthorStyleSheets.h:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::insertedIntoDocument):

    Save the scope we were inserted into so removals can be done reliably.

(WebCore::InlineStyleSheetOwner::removedFromDocument):

    Use and clear the saved scope.
    Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.

(WebCore::InlineStyleSheetOwner::clearDocumentData):
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::sheetLoaded):
(WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
(WebCore::authorStyleSheetsForElement): Deleted.
* dom/InlineStyleSheetOwner.h:
(WebCore::InlineStyleSheetOwner::styleSheetScope):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::styleResolverIfExists):
* dom/ShadowRoot.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom):

    Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.

* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::~HTMLStyleElement):
(WebCore::HTMLStyleElement::parseAttribute):

    Fix a bug where we wouldn't create stylesheet if a style element was activated by removing a media attribute.

(WebCore::HTMLStyleElement::insertedInto):
(WebCore::HTMLStyleElement::removedFrom):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::~SVGStyleElement):
(WebCore::SVGStyleElement::insertedInto):
(WebCore::SVGStyleElement::removedFrom):

LayoutTests:

* fast/shadow-dom/mutating-stylesheet-in-shadow-tree-expected.html: Added.
* fast/shadow-dom/mutating-stylesheet-in-shadow-tree.html: Added.

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

3 years agoSkip tabs and newlines between end of query and beginning of fragment in non-UTF...
achristensen@apple.com [Thu, 6 Oct 2016 20:47:44 +0000 (20:47 +0000)]
Skip tabs and newlines between end of query and beginning of fragment in non-UTF-8-encoded URLs
https://bugs.webkit.org/show_bug.cgi?id=163071

Reviewed by Tim Horton.

Source/WebCore:

Covered by a new API test that would have asserted before this change.

* platform/URLParser.cpp:
(WebCore::URLParser::encodeQuery):
Skip tabs and newlines before asserting that we are at the end.

Tools:

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

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

3 years agoURLParser should parse file URLs with ports consistently
achristensen@apple.com [Thu, 6 Oct 2016 20:46:04 +0000 (20:46 +0000)]
URLParser should parse file URLs with ports consistently
https://bugs.webkit.org/show_bug.cgi?id=163075

Reviewed by Brady Eidson.

Source/WebCore:

Covered by API tests.  We used to assert when parsing the newly tested URLs.

* 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@206878 268f45cc-cd09-0410-ab3c-d52691b4dbfc

3 years ago[WebIDL] Add support for having dictionaries in their own IDL file
cdumez@apple.com [Thu, 6 Oct 2016 20:22:16 +0000 (20:22 +0000)]
[WebIDL] Add support for having dictionaries in their own IDL file
https://bugs.webkit.org/show_bug.cgi?id=162912

Reviewed by Darin Adler.

Add support for having dictionaries in their own IDL file so that they
can be shared by multiple interfaces.

Leverage this new support to merge Element::ScrollToOptions and
DOMWindow::ScrollToOptions.

No new tests, extended bindings tests.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGenerator.pm:
(ProcessDocument):
(IDLFileForInterface):
(GetDictionaryByName):
(IsDictionaryType):
(HasEnumImplementationNameOverride): Deleted.
(GetEnumImplementationNameOverride): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionary):
(GetEnumerationClassName):
(GenerateEnumerationImplementationContent):
(GenerateEnumerationHeaderContent):
(GetDictionaryClassName):
(GenerateDefaultValue):
(GenerateDictionaryHeaderContent):
(GenerateDictionariesHeaderContent):
(GenerateDictionaryImplementationContent):
(GenerateDictionariesImplementationContent):
(GenerateHeader):
(GenerateImplementation):
(GenerateParametersCheck):
(GenerateDictionaryHeader):
(GenerateDictionaryImplementation):
(GenerateCallbackHeader):
(GenerateCallbackImplementation):
(GetNativeType):
(JSValueToNative):
(GetNestedClassName): Deleted.
(GenerateConversionRuleWithLeadingComma): Deleted.
(addIterableProperties): Deleted.
* bindings/scripts/preprocess-idls.pl:
(containsInterfaceOrExceptionFromIDL):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter):
(WebCore::jsTestObjPrototypeFunctionAttachShadowRoot): Deleted.
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: Added.
(WebCore::convertDictionary<TestStandaloneDictionary>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h: Added.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestStandaloneDictionary.idl: Added.
* dom/Element.h:
* dom/Element.idl:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollTo):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* page/ScrollToOptions.h: Added.
* page/ScrollToOptions.idl: Added.

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

3 years agogetInternalObjcObject should validate the JSManagedObject's value.
keith_miller@apple.com [Thu, 6 Oct 2016 20:13:50 +0000 (20:13 +0000)]
getInternalObjcObject should validate the JSManagedObject's value.
https://bugs.webkit.org/show_bug.cgi?id=162985

Reviewed by Geoffrey Garen.

Previously, if, for instance, the JSManagedObject's weak value had been
cleared we would call tryUnwrapObjcObject with a nil context and value.
This triggered assertions failures as those functions expect their inputs
to be valid.

* API/JSVirtualMachine.mm:
(getInternalObjcObject):

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

3 years agoWeb Inspector: RemoteInspector should cache client capabilities for off-main thread...
bburg@apple.com [Thu, 6 Oct 2016 19:45:52 +0000 (19:45 +0000)]
Web Inspector: RemoteInspector should cache client capabilities for off-main thread usage
https://bugs.webkit.org/show_bug.cgi?id=163039
<rdar://problem/28571460>

Reviewed by Timothy Hatcher.

The fix in r206797 was incorrect because listings are always pushed out on the XPC connection queue.
Instead of delaying the listing needlessly, RemoteInspector should cache the capabilities of its
client while on the main thread, then use the cached struct data on the XPC connection queue rather
than directly accessing m_client. This is similar to how RemoteConnectionToTarget marshalls listing
information from arbitrary queues into m_targetListingMap, which can then be read from any queue.

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::updateClientCapabilities): Cache the capabilities.
(Inspector::RemoteInspector::setRemoteInspectorClient):
Re-cache the capabilities. Scope the lock to avoid reentrant locking.

(Inspector::RemoteInspector::clientCapabilitiesDidChange): Cache the capabilities.
(Inspector::RemoteInspector::pushListingsNow): Use cached client capabilities.
(Inspector::RemoteInspector::receivedGetListingMessage): Revert the change in r206797.
(Inspector::RemoteInspector::receivedAutomationSessionRequestMessage):

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

3 years agoImport html/webappapis web platform tests
cdumez@apple.com [Thu, 6 Oct 2016 19:17:44 +0000 (19:17 +0000)]
Import html/webappapis web platform tests
https://bugs.webkit.org/show_bug.cgi?id=163018

Reviewed by Youenn Fablet.

Import html/webappapis web platform tests from upstream to extend test
coverage.

* resources/resource-files.json:
* web-platform-tests/html/webappapis/animation-frames/callback-exception-expected.txt: Added.
* web-platform-tests/html/webappapis/animation-frames/callback-exception.html: Added.
* web-platform-tests/html/webappapis/animation-frames/callback-invoked-expected.txt: Added.
* web-platform-tests/html/webappapis/animation-frames/callback-invoked.html: Added.
* web-platform-tests/html/webappapis/animation-frames/callback-multicalls-expected.txt: Added.
* web-platform-tests/html/webappapis/animation-frames/callback-multicalls.html: Added.
* web-platform-tests/html/webappapis/animation-frames/cancel-invoked-expected.txt: Added.
* web-platform-tests/html/webappapis/animation-frames/cancel-invoked.html: Added.
* web-platform-tests/html/webappapis/animation-frames/idlharness-expected.txt: Added.
* web-platform-tests/html/webappapis/animation-frames/idlharness.html: Added.
* web-platform-tests/html/webappapis/animation-frames/same-dispatch-time-expected.txt: Added.
* web-platform-tests/html/webappapis/animation-frames/same-dispatch-time.html: Added.
* web-platform-tests/html/webappapis/animation-frames/w3c-import.log: Added.
* web-platform-tests/html/webappapis/atob/base64-expected.txt: Added.
* web-platform-tests/html/webappapis/atob/base64.html: Added.
* web-platform-tests/html/webappapis/atob/w3c-import.log: Added.
* web-platform-tests/html/webappapis/scripting/event-loops/contains.json: Added.
* web-platform-tests/html/webappapis/scripting/event-loops/microtask_after_script-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/event-loops/microtask_after_script.html: Added.
* web-platform-tests/html/webappapis/scripting/event-loops/resources/common.js: Added.
(log_test):
* web-platform-tests/html/webappapis/scripting/event-loops/resources/w3c-import.log: Added.
* web-platform-tests/html/webappapis/scripting/event-loops/task_microtask_ordering-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/event-loops/task_microtask_ordering.html: Added.
* web-platform-tests/html/webappapis/scripting/event-loops/w3c-import.log: Added.
* web-platform-tests/html/webappapis/scripting/events/body-onload-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/events/body-onload.html: Added.
* web-platform-tests/html/webappapis/scripting/events/contains.json: Added.
* web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-body-window-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/events/event-handler-attributes-body-window.html: Added.
* web-platform-tests/html/webappapis/scripting/events/event-handler-javascript-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/events/event-handler-javascript.html: Added.
* web-platform-tests/html/webappapis/scripting/events/event-handler-onresize-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/events/event-handler-onresize.html: Added.
* web-platform-tests/html/webappapis/scripting/events/event-handler-processing-algorithm-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/events/event-handler-processing-algorithm.html: Added.
* web-platform-tests/html/webappapis/scripting/events/event-handler-spec-example-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/events/event-handler-spec-example.html: Added.
* web-platform-tests/html/webappapis/scripting/events/inline-event-handler-ordering-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/events/inline-event-handler-ordering.html: Added.
* web-platform-tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-late.html: Added.
* web-platform-tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-once-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/events/invalid-uncompiled-raw-handler-compiled-once.html: Added.
* web-platform-tests/html/webappapis/scripting/events/onerroreventhandler-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/events/onerroreventhandler-frame.html: Added.
* web-platform-tests/html/webappapis/scripting/events/onerroreventhandler.html: Added.
* web-platform-tests/html/webappapis/scripting/events/w3c-import.log: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/addEventListener-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/addEventListener.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error-data-url-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error-data-url.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/body-onerror-compile-error.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/body-onerror-runtime-error-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/body-onerror-runtime-error.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-cross-origin.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-data-url-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-data-url.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-attribute.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-body-onerror.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-setInterval-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-setInterval.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-setTimeout-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-in-setTimeout.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/contains.json: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-cross-origin.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-data-url-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-data-url.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-in-attribute-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-in-attribute.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-in-body-onerror-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-in-body-onerror.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setInterval-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setInterval.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setTimeout-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-in-setTimeout.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-in-window-onerror-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-in-window-onerror.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setInterval.js: Added.
(setTimeout):
* web-platform-tests/html/webappapis/scripting/processing-model-2/support/syntax-error-in-setTimeout.js: Added.
(setTimeout):
* web-platform-tests/html/webappapis/scripting/processing-model-2/support/syntax-error.js: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setInterval.js: Added.
(setTimeout):
* web-platform-tests/html/webappapis/scripting/processing-model-2/support/undefined-variable-in-setTimeout.js: Added.
(setTimeout):
* web-platform-tests/html/webappapis/scripting/processing-model-2/support/undefined-variable.js: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/support/w3c-import.log: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/w3c-import.log: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-parse-error-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-parse-error.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error-throw-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error-throw.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-runtime-error.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-1.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-2.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-3-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-3.html: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-4-expected.txt: Added.
* web-platform-tests/html/webappapis/scripting/processing-model-2/window-onerror-with-cross-frame-event-listeners-4.html: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.html: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.js: Added.
(run_test.):
(run_test):
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/NavigatorID.worker.js: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/contains.json: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content.html: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/001-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/001.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/002-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/002.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/003-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/003.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/004-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/004.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/005.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/006-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/006.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/content/w3c-import.log: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-indexed-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-indexed.html: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigatorlanguage-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigatorlanguage.html: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol.html: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/001-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/001.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/002-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/002.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/003-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/003.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/004-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/004.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/005.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/006-expected.txt: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/006.xhtml: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/w3c-import.log: Added.
* web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/w3c-import.log: Added.
* web-platform-tests/html/webappapis/timers/evil-spec-example-expected.txt: Added.
* web-platform-tests/html/webappapis/timers/evil-spec-example.html: Added.
* web-platform-tests/html/webappapis/timers/w3c-import.log: Added.

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

3 years agoUnreviewed build fix when building with Direct2D.
bfulgham@apple.com [Thu, 6 Oct 2016 18:40:33 +0000 (18:40 +0000)]
Unreviewed build fix when building with Direct2D.

* PlatformWin.cmake: Add missing library references.

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

3 years agoUnreviewed build fix.
bfulgham@apple.com [Thu, 6 Oct 2016 18:37:42 +0000 (18:37 +0000)]
Unreviewed build fix.

* platform/graphics/Image.cpp: Add missing include
for 'NotImplemented' when building under Direct2D.

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

3 years ago[Win][Direct2D] Add Direct2D CMake rules
bfulgham@apple.com [Thu, 6 Oct 2016 18:01:32 +0000 (18:01 +0000)]
[Win][Direct2D] Add Direct2D CMake rules
https://bugs.webkit.org/show_bug.cgi?id=162925

Reviewed by Brent Fulgham.

.:

* Source/cmake/OptionsAppleWin.cmake: Add a new 'USE_DIRECT2D' option
flag for the build. Currently this is commented out and is unused.

Source/WebCore:

Modify PlatformAppleWin.cmake to conditionally build the CoreGraphics
and CoreAnimation implementation, or the Direct2D files, depending
on whether the USE_DIRECT2D macro is set in the CMake build options.
By default it builds the normal CA/CG way.

Add a stub GraphicsLayer implementation for Direct2D.

No new tests because there is no change in our active ports.

* PlatformAppleWin.cmake: Conditionalize the build for CA/CG or
Direct2D.
* config.h: Make sure CA is turned of for Direct2D builds.
* page/win/FrameWinDirect2D.cpp: Add missing include file.
* platform/graphics/win/GraphicsLayerDirect2D.cpp: Added.
* platform/graphics/win/GraphicsLayerDirect2D.h: Added.

Source/WTF:

* wtf/Platform.h: Don't USE(CA) or USE(CG) if building
with Direct2D.

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

3 years ago[WebCore][JSC] Use new @throwTypeError and @throwRangeError intrinsics
utatane.tea@gmail.com [Thu, 6 Oct 2016 17:59:33 +0000 (17:59 +0000)]
[WebCore][JSC] Use new @throwTypeError and @throwRangeError intrinsics
https://bugs.webkit.org/show_bug.cgi?id=163001

Reviewed by Keith Miller.

Source/JavaScriptCore:

Previously, the argument of @throwXXXError intrinsics must be string literal.
But it is error-prone restriction. This patch relaxes the restriction to accept
arbitrary values. To keep emitted bytecode small, if the argument is string literal,
we generate the same bytecode as before. If the argument is not string literal,
we evaluate it and perform to_string before passing to throw_static_error.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitThrowStaticError):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_throwTypeError):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_throwRangeError):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):

Source/WebCore:

Replace `throw new @XXXError(...)` to @throwXXXError intrinsic.
It reduces the size of bytecode sequence and facilitate inlining.

No behavior change.

* Modules/fetch/FetchHeaders.js:
(initializeFetchHeaders):
* Modules/fetch/FetchInternals.js:
(fillFetchHeaders):
* Modules/fetch/FetchRequest.js:
(initializeFetchRequest):
* Modules/fetch/FetchResponse.js:
(initializeFetchResponse):
(clone):
* Modules/mediastream/NavigatorUserMedia.js:
(webkitGetUserMedia):
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):
(getLocalStreams):
(getStreamById):
(addStream):
* Modules/streams/ReadableStream.js:
(initializeReadableStream):
(getReader):
* Modules/streams/ReadableStreamDefaultController.js:
(enqueue):
(error):
(close):
* Modules/streams/ReadableStreamDefaultReader.js:
(releaseLock):
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultReader):
(privateInitializeReadableStreamDefaultController):
(doStructuredClone):
(readableStreamError):
* Modules/streams/StreamInternals.js:
(validateAndNormalizeQueuingStrategy):
(enqueueValueWithSize):
* Modules/streams/WritableStream.js:
(initializeWritableStream):
(state):
* xml/XMLHttpRequest.js:
(response):

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

3 years agoUpdate Resource Load Statistics
wilander@apple.com [Thu, 6 Oct 2016 17:40:12 +0000 (17:40 +0000)]
Update Resource Load Statistics
https://bugs.webkit.org/show_bug.cgi?id=162811

Reviewed by Alex Christensen.

Source/WebCore:

No new tests. The counting is based on top privately owned domains
which currently is not supported by layout tests nor API tests.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect):
    Now captures statistics for web sockets too.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/ResourceLoadObserver.cpp:
    Now captures statistics for synchronous XHR too.
(WebCore::is3xxRedirect):
    Convenience function.
(WebCore::ResourceLoadObserver::shouldLog):
    Convenience function.
(WebCore::ResourceLoadObserver::logFrameNavigation):
    Updated to make use of new convenience functions.
(WebCore::ResourceLoadObserver::logSubresourceLoading):
    Updated to make use of new convenience functions.
(WebCore::ResourceLoadObserver::logWebSocketLoading):
    Added.
(WebCore::ResourceLoadObserver::logUserInteraction):
    Updated to make use of new convenience functions.
(WebCore::ResourceLoadObserver::primaryDomain):
    Now makes use of the Public Suffix list.
    Removed old custom parsing of primary domain.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction):
    Convenience function.
(WebCore::ResourceLoadStatisticsStore::processStatistics): Deleted.
* loader/ResourceLoadStatisticsStore.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
    Moved logging call higher up and added a check for whether we
    are loading the main resource. The reason for moving it up is
    to capture the request before some data may be cleared out in
    redirect handling. We also want to capture failed CORS requests
    since they are sent and then cancelled on the way back.

Source/WebKit2:

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics):
    Switched to vector-based classification.
(WebKit::WebResourceLoadStatisticsStore::classifyResource):
    Simplified logic and moved the split between has and has
    no user interaction into ResourceLoadStatisticsStore.
(WebKit::WebResourceLoadStatisticsStore::clearDataRecords):
    Added.
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
    Updated to make use of the new functions.
(WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
    Removed stray whitespace.
(WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
    Removed stray whitespace.
(WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk):
    Removed stray whitespace.
(WebKit::hasPrevalentResourceCharacteristics): Deleted.
(WebKit::classifyPrevalentResources): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:
    Added member variables for clearing of data records.

Tools:

* TestWebKitAPI/Tests/mac/PublicSuffix.mm:
    Change from USE(PUBLIC_SUFFIX_LIST) to ENABLE(PUBLIC_SUFFIX_LIST)

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

3 years agoWebRTC: Add support for the iceconnectionstatechange event in MediaEndpointPeerConnection
adam.bergkvist@ericsson.com [Thu, 6 Oct 2016 17:27:23 +0000 (17:27 +0000)]
WebRTC: Add support for the iceconnectionstatechange event in MediaEndpointPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=162961

Reviewed by Eric Carlson.

Source/WebCore:

Implement MediaEndpointPeerConnection's iceTransportStateChanged callback. When called, it
updates the ICE transport state of the corresponding transceiver and determines if the
RTCPeerConnection's aggregated iceConnectionState needs to be updated.

Update MediaEndpointMock's emulatePlatformEvent feature to support a new action:
"step-ice-transport-states". When initiated, this action replays a predefined set of ICE
transport state changes on a set of transceivers which can be observed via the
iceTransportStateChanged (mentioned above).

Test: fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::deriveAggregatedIceConnectionState):
(WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* platform/mediastream/MediaEndpoint.h:
(WebCore::MediaEndpointClient::~MediaEndpointClient):
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::emulatePlatformEvent):
(WebCore::MockMediaEndpoint::stepIceTransportStates):
(WebCore::MockMediaEndpoint::iceTransportTimerFired):
* platform/mock/MockMediaEndpoint.h:

LayoutTests:

Emulate changing the ICE transport sates of three transceivers and observe the resulting
changes to the aggregated iceConnectionState.

* fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event-expected.txt: Added.
* fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html: Added.
* platform/mac/TestExpectations:
Skip above test until the Mac port builds with WEB_RTC.

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

3 years agoCachedResource client handling methods should take reference
commit-queue@webkit.org [Thu, 6 Oct 2016 16:53:58 +0000 (16:53 +0000)]
CachedResource client handling methods should take reference
https://bugs.webkit.org/show_bug.cgi?id=163014

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

Source/WebCore:

No change of behavior.

* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::~CachedScriptSourceProvider):
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::~CSSCrossfadeValue):
(WebCore::CSSCrossfadeValue::loadSubimages):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::~CSSFilterImageValue):
(WebCore::CSSFilterImageValue::loadSubimages):
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::CSSFontFaceSource):
(WebCore::CSSFontFaceSource::~CSSFontFaceSource):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::~StyleRuleImport):
(WebCore::StyleRuleImport::requestStyleSheet):
* dom/DataTransfer.cpp:
(WebCore::DragImageLoader::startLoading):
(WebCore::DragImageLoader::stopLoading):
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::create):
(WebCore::LoadableClassicScript::~LoadableClassicScript):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::parseStyleSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::process):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
(WebCore::CrossOriginPreflightChecker::startPreflight):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::detachFromFrame):
(WebCore::DocumentLoader::clearMainResource):
(WebCore::DocumentLoader::becomeMainResourceClient):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::~DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::clearResource):
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::~ImageLoader):
(WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::~LinkLoader):
(WebCore::LinkLoader::notifyFinished):
(WebCore::LinkLoader::loadLink):
* loader/LinkPreloadResourceClients.h:
(WebCore::LinkPreloadResourceClient::addResource):
(WebCore::LinkPreloadResourceClient::clearResource):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::MediaResource):
(WebCore::MediaResource::stop):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::~TextTrackLoader):
(WebCore::TextTrackLoader::cancelLoad):
(WebCore::TextTrackLoader::load):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::didAddClient):
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::didAddClient):
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didAddClient):
(WebCore::CachedImage::didRemoveClient):
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::didAddClient):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::addClient):
(WebCore::CachedResource::didAddClient):
(WebCore::CachedResource::addClientToSet):
(WebCore::CachedResource::removeClient):
(WebCore::CachedResource::switchClientsToRevalidatedResource):
(WebCore::CachedResource::Callback::timerFired):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::hasClient):
(WebCore::CachedResource::didRemoveClient):
* loader/cache/CachedSVGDocumentReference.cpp:
(WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
(WebCore::CachedSVGDocumentReference::load):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::didAddClient):
* loader/cache/CachedXSLStyleSheet.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):
(WebCore::MemoryCache::removeImageFromCache):
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::stopLoading):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::startLoading):
(WebCore::WebCoreAVCFResourceLoader::stopLoading):
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::startLoading):
(WebCore::WebCoreAVFResourceLoader::stopLoading):
* rendering/RenderImageResource.cpp:
(WebCore::RenderImageResource::shutdown):
(WebCore::RenderImageResource::setCachedImage):
* rendering/RenderLayerFilterInfo.cpp:
(WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
(WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::addClient):
(WebCore::StyleCachedImage::removeClient):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::clearResourceReferences):
(WebCore::SVGFEImageElement::requestImageResource):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::~SVGFontFaceUriElement):
(WebCore::SVGFontFaceUriElement::loadFont):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::~SVGUseElement):
(WebCore::SVGUseElement::updateExternalDocument):
* xml/XSLImportRule.cpp:
(WebCore::XSLImportRule::~XSLImportRule):
(WebCore::XSLImportRule::setXSLStyleSheet):
(WebCore::XSLImportRule::loadSheet):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::~XMLDocumentParser):
(WebCore::XMLDocumentParser::endElementNs):

Source/WebKit/mac:

* WebView/WebHTMLView.mm:
(promisedDataClient):

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

3 years ago[GStreamer][OWR] GL rendering support
philn@webkit.org [Thu, 6 Oct 2016 16:38:48 +0000 (16:38 +0000)]
[GStreamer][OWR] GL rendering support
https://bugs.webkit.org/show_bug.cgi?id=162972

Reviewed by Žan Doberšek.

When GStreamer-GL is enabled the GL context needs to be properly passed
to the GStreamer pipeline running within the OpenWebRTC video renderer.
This is now supported using a new OpenWebRTC API that allows the
renderer to request the context from the application using a callback
registered within the renderer.

Source/WebCore:

The player's GL context/display set-up was refactored to a new
method, requestGLContext, which is used as callback for the
OpenWebRTC request_context handler.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
(WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
(WebCore::MediaPlayerPrivateGStreamerBase::gstGLContext):
(WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):

Tools:

* gtk/jhbuild.modules: Bump to latest OpenWebRTC for the new
owr_video_renderer_set_request_context_callback API added
recently.

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

3 years agoSkip accessibility/mac/wk1-set-selected-text-marker-range-input-element.html on mac...
ryanhaddad@apple.com [Thu, 6 Oct 2016 16:20:12 +0000 (16:20 +0000)]
Skip accessibility/mac/wk1-set-selected-text-marker-range-input-element.html on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=162999

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years ago[Modern Media Controls] Icon service and the IconButton class
commit-queue@webkit.org [Thu, 6 Oct 2016 13:30:51 +0000 (13:30 +0000)]
[Modern Media Controls] Icon service and the IconButton class
https://bugs.webkit.org/show_bug.cgi?id=162970
<rdar://problem/28631803>

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

Source/WebCore:

We introduce the new IconButton class to display buttons that show an icon
in modern media controls. An IconButton uses a CSS mask-image to display the icon
such that we may set the actual button color to any value by setting the element's
background-color property.

Icons are obtained through the `iconService` singleton which knows how to load the
right icon for the current layout traits and resolution. Icons loaded through the
icon service are cached. In a later patch, we will be introducing functionality,
through the MediaControlsHost, to load the icon from the WebCore bundle.

Tests: media/modern-media-controls/icon-button/icon-button-active-state.html
       media/modern-media-controls/icon-button/icon-button.html
       media/modern-media-controls/icon-service/icon-service.html

* Modules/modern-media-controls/controls/button.css:
(button):
* Modules/modern-media-controls/controls/icon-button.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/button.css.
(button.icon):
(button.icon:active):
* Modules/modern-media-controls/controls/icon-button.js: Added.
(IconButton):
(IconButton.prototype.get iconName):
(IconButton.prototype.set iconName):
(IconButton.prototype.handleEvent):
(IconButton.prototype.layout):
(IconButton.prototype._imageDidLoad):
(IconButton.prototype._updateImage):
* Modules/modern-media-controls/controls/icon-service.js: Copied from Source/WebCore/Modules/modern-media-controls/controls/layout-item.js.
(const.iconService.new.IconService):
(const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits):
(const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
* Modules/modern-media-controls/controls/layout-item.js:
* Modules/modern-media-controls/images/iOS/pause@2x.png: Added.
* Modules/modern-media-controls/images/iOS/pause@3x.png: Added.
* Modules/modern-media-controls/images/iOS/start@2x.png: Added.
* Modules/modern-media-controls/images/iOS/start@3x.png: Added.
* Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png: Added.
* Modules/modern-media-controls/images/macOS/pause@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pause@2x.png: Added.
* Modules/modern-media-controls/images/macOS/start@1x.png: Added.
* Modules/modern-media-controls/images/macOS/start@2x.png: Added.

LayoutTests:

Testing all public properties and methods of the iconService singleton and IconButton class.

* media/modern-media-controls/icon-button/icon-button-active-state-expected.txt: Added.
* media/modern-media-controls/icon-button/icon-button-active-state.html: Added.
* media/modern-media-controls/icon-button/icon-button-expected.txt: Added.
* media/modern-media-controls/icon-button/icon-button.html: Added.
* media/modern-media-controls/icon-service/icon-service-expected.txt: Added.
* media/modern-media-controls/icon-service/icon-service.html: Added.
* media/modern-media-controls/layout-item/layout-item-expected.txt:
* media/modern-media-controls/layout-item/layout-item.html:
* platform/ios-simulator/TestExpectations:

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

3 years ago[GTK] Fix build with GSTREAMER_GL enabled and ACCELERATED_2D_CANVAS disabled
commit-queue@webkit.org [Thu, 6 Oct 2016 13:07:56 +0000 (13:07 +0000)]
[GTK] Fix build with GSTREAMER_GL enabled and ACCELERATED_2D_CANVAS disabled
https://bugs.webkit.org/show_bug.cgi?id=163008

Patch by Miguel Gomez <magomez@igalia.com> on 2016-10-06
Reviewed by Carlos Garcia Campos.

Put functions using cairo-gl behind appropriate guards.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

3 years ago[GTK] Copying video textures to webgl should not depend on cairo-gl
commit-queue@webkit.org [Thu, 6 Oct 2016 10:53:28 +0000 (10:53 +0000)]
[GTK] Copying video textures to webgl should not depend on cairo-gl
https://bugs.webkit.org/show_bug.cgi?id=162904

Patch by Miguel Gomez <magomez@igalia.com> on 2016-10-06
Reviewed by Žan Doberšek.

Perform the texture copy without using cairo-gl.

Covered by existent tests.

* platform/GStreamer.cmake:
Add the new VideoTextureCopierGStreamer class to the build.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
Use VideoTextureCopierGStreamer to perform the copy.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
Add a VideoTextureCopierGStreamer as a class attribute.
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp: Added.
(WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):
Recalculates the matrix used as the texture coordinates transformation.
(WebCore::VideoTextureCopierGStreamer::updateTransformationMatrix):
Recalculates the matrices used as the vertices coordinates transformation.
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
Performs the texture copy by using a shader that applies the rotation needed to follow
the video orientation.
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: Added.

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

3 years ago[GTK] Build fix for X11 and GStreamerGL after r183731
yoon@igalia.com [Thu, 6 Oct 2016 10:44:31 +0000 (10:44 +0000)]
[GTK] Build fix for X11 and GStreamerGL after r183731
https://bugs.webkit.org/show_bug.cgi?id=163000

Reviewed by Philippe Normand.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
Include gstgldisplay_egl.h if platform uses EGL.

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

3 years agoRefresh WPT tests up to c875b42
commit-queue@webkit.org [Thu, 6 Oct 2016 10:38:13 +0000 (10:38 +0000)]
Refresh WPT tests up to c875b42
https://bugs.webkit.org/show_bug.cgi?id=159712

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-06

* TestExpectations: Removed flakiness expectations for tests introduced in bug 159712.

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

3 years ago[GStreamer] Can't play any video with GSTREAMER_GL enabled
mario@webkit.org [Thu, 6 Oct 2016 10:22:59 +0000 (10:22 +0000)]
[GStreamer] Can't play any video with GSTREAMER_GL enabled
https://bugs.webkit.org/show_bug.cgi?id=162669

Reviewed by Philippe Normand.

Make sure an EGLDisplay type is passed when creating the GstGlDisplay
for the EGL code path, instead of a native X11 display type, so
that we get a valid GstGlDisplay as a result, not a dummy one.

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

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

3 years ago[Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
commit-queue@webkit.org [Thu, 6 Oct 2016 10:00:28 +0000 (10:00 +0000)]
[Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
https://bugs.webkit.org/show_bug.cgi?id=162785

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

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker-expected.txt:

Source/WebCore:

Covered by rebased and existing tests.

Ensuring non-HTTP redirection URLs are not followed at DocumentThreadableLoader level for fetch API only.
This should be applied to all clients at some point, but there is still some uncertainty for data URLs.

Did some refactoring to better separate the case of security checks in case of regular request or redirected request.
This allows in particular to handle more clearly the case of data URLs which are allowed in all modes for regular requests.
But they are not allowed for same-origin redirected requests.

* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentThreadableLoader.cpp:
(WebCore::reportRedirectionWithBadScheme): Reporting bad scheme redirection error.
(WebCore::DocumentThreadableLoader::redirectReceived): Checking that redirection URLs are HTTP(s) in case of Fetch API.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::checkInsecureContent):
(WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
(WebCore::isSameOriginDataURL):
(WebCore::CachedResourceLoader::canRequest):
(WebCore::CachedResourceLoader::canRequestAfterRedirection):
(WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceLoader.h:

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

3 years ago[Fetch API] Use ReadableStream pull to transfer binary data to stream when applicatio...
commit-queue@webkit.org [Thu, 6 Oct 2016 09:43:52 +0000 (09:43 +0000)]
[Fetch API] Use ReadableStream pull to transfer binary data to stream when application needs it
https://bugs.webkit.org/show_bug.cgi?id=162892

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

Covered by existing tests.

Before this patch, FetchResponse was never resolving the start promise.
This way, it could enqueue data, error or close the stream whenever desired.

With this patch, FetchResponse will feed the stream when being asked to.
This allows keeping the data in WebCore until the application needs it.
This is only implemented for network data.
For other data owned by response (blob, text...), data will be enqueued like previously as fast as possible.

Note that FetchResponse can enqueue/error/close the stream at any time since JSFetchResponse has a reference to the stream.
And the stream has a reference to the controller.

In addition to transfer binary chunks to ReadableStream only when needed, WebCore is now aware of the data
stored in the response, which may allow applying backpressure to the network source in the future.

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didReceiveData): Enqueuing only if stream is pulling.
Otherwise, storing in FetchBodyConsumer. If stream is pulling, we enqueue both buffered data and received chunk.
(WebCore::FetchResponse::consumeBodyAsStream): Resolving pull promise if we enqueued some buffered data.
(WebCore::FetchResponse::closeStream):
(WebCore::FetchResponse::feedStream): If we have some buffered data, we enqueue it. If there is no loader, the stream can be closed.
* Modules/fetch/FetchResponse.h:
* Modules/fetch/FetchResponseSource.cpp:
(WebCore::FetchResponseSource::doPull):
(WebCore::FetchResponseSource::close):
(WebCore::FetchResponseSource::error):
* Modules/fetch/FetchResponseSource.h:
* Modules/streams/ReadableStreamSource.h:
(WebCore::ReadableStreamSource::isPulling): Renamed from isStarting.
(WebCore::ReadableStreamSource::isStarting): Deleted.

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

3 years agoWebRTC: Add support for the icecandidate event in MediaEndpointPeerConnection
adam.bergkvist@ericsson.com [Thu, 6 Oct 2016 08:54:49 +0000 (08:54 +0000)]
WebRTC: Add support for the icecandidate event in MediaEndpointPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=162957

Reviewed by Eric Carlson.

Source/WebCore:

Implement MediaEndpointPeerConnection's gotIceCandidate and doneGatheringCandidates
callbacks. These are used by the MediaEndpoint (WebRTC backend implementation) to
notify about ICE events.

Add API to Internals to emulate WebRTC platform events, such as dispatching a set of ICE
candidates followed by a gathering done indication. Initially, only a single action,
"dispatch-fake-ice-candidates", is supported, but the intention is to extend the set of
actions to support more test cases.

Test: fast/mediastream/RTCPeerConnection-icecandidate-event.html

* Modules/mediastream/MediaEndpointPeerConnection.cpp:
(WebCore::MediaEndpointPeerConnection::emulatePlatformEvent):
(WebCore::MediaEndpointPeerConnection::gotIceCandidate):
(WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
* Modules/mediastream/MediaEndpointPeerConnection.h:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCIceTransport.h: Added.
RTCIceCandidate will eventually be part of the JS API, but right now it's
only used to keep track of the ICE states related to a RTCRtpTranscevier.
(WebCore::RTCIceTransport::create):
(WebCore::RTCIceTransport::~RTCIceTransport):
(WebCore::RTCIceTransport::transportState):
(WebCore::RTCIceTransport::setTransportState):
(WebCore::RTCIceTransport::gatheringState):
(WebCore::RTCIceTransport::setGatheringState):
(WebCore::RTCIceTransport::RTCIceTransport):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::emulatePlatformEvent):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpTransceiver.cpp:
(WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
* Modules/mediastream/RTCRtpTransceiver.h:
(WebCore::RTCRtpTransceiver::iceTransport):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/MediaEndpoint.h:
(WebCore::MediaEndpoint::emulatePlatformEvent):
* platform/mediastream/PeerConnectionStates.h:
* platform/mock/MockMediaEndpoint.cpp:
(WebCore::MockMediaEndpoint::MockMediaEndpoint):
(WebCore::MockMediaEndpoint::updateReceiveConfiguration):
(WebCore::MockMediaEndpoint::emulatePlatformEvent):
(WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
(WebCore::MockMediaEndpoint::iceCandidateTimerFired):
* platform/mock/MockMediaEndpoint.h:
* testing/Internals.cpp:
(WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
Generic API to signal down to the WebRTC platform mock.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Dispatch fake ICE candidates from the WebRTC platform mock (MockMediaEndpoint) and
inspect the result.

* fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt: Added.
* fast/mediastream/RTCPeerConnection-icecandidate-event.html: Added.
* platform/mac/TestExpectations:
Skip above test until the Mac port builds with WEB_RTC

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

3 years ago[WK2] 304 revalidation on the network process does not update the validated response
commit-queue@webkit.org [Thu, 6 Oct 2016 08:30:01 +0000 (08:30 +0000)]
[WK2] 304 revalidation on the network process does not update the validated response
https://bugs.webkit.org/show_bug.cgi?id=162973

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

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/conditional-get-expected.txt: Added.
* web-platform-tests/fetch/api/basic/conditional-get.html: Added.
* web-platform-tests/fetch/api/resources/cache.py: Added.

Source/WebKit2:

* NetworkProcess/NetworkResourceLoader.cpp: Updating cache entry with the revalidated one.

LayoutTests:

* http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header-expected.txt:
Rebasing expectation as memory cache revalidation is no longer needed now that the disk cache is updating the response passed to the memory cache.
The disk cache is doing revalidation on the second load. It receives the updated response with longer validity.
As the extended validity response is now passed to the memory cache, the memory cache revalidation no longer happens.

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

3 years agoAX:[Mac] Unable to edit text input, textarea fields in iframe using VO naivgation
n_wang@apple.com [Thu, 6 Oct 2016 08:03:43 +0000 (08:03 +0000)]
AX:[Mac] Unable to edit text input, textarea fields in iframe using VO naivgation
https://bugs.webkit.org/show_bug.cgi?id=162999

Reviewed by Chris Fleizach.

Source/WebCore:

In WebKit1, the top web area setting the selection to an input element inside an iframe
will make the input field not editable. The issue is that when the web area and the input element
have different documents, the setSelection function in FrameSelection will set the selection on
the input's frame and cause the caret to disappear. I fixed it by not setting the selection in such case.

Test: accessibility/mac/wk1-set-selected-text-marker-range-input-element.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):

LayoutTests:

* accessibility/mac/wk1-set-selected-text-marker-range-input-element-expected.txt: Added.
* accessibility/mac/wk1-set-selected-text-marker-range-input-element.html: Added.

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

3 years ago[JSC] Add @throwXXXError bytecode intrinsic
utatane.tea@gmail.com [Thu, 6 Oct 2016 07:44:23 +0000 (07:44 +0000)]
[JSC] Add @throwXXXError bytecode intrinsic
https://bugs.webkit.org/show_bug.cgi?id=162995

Reviewed by Saam Barati.

Source/JavaScriptCore:

Builtin JS code need to check arguments carefully since it is somewhat standard library for JS.
So bunch of `throw new @TypeError("...")` exists while usual code does not have so many.
However the above code bloats 32 instructions per site, enlarges the size of bytecodes of builtins,
and prevent us from inlining. We should have a way to reduce this size.

Fortunately, we already have such a opcode: op_throw_static_error. In this patch,
1. We extends op_throw_static_error to throw arbitrary errors. Previously, only TypeError and ReferenceError are allowed.
   We can embed ErrorType enum in op_throw_static_error to throw any types of errors.
2. We introduce several new bytecode intrinsics, `@throwTypeError("...")`, `@throwRangeError("...")`,
   and `@throwOutOfMemoryError()`. And use it inside builtin JS instead of `throw new @TypeError("...")` thingy.
3. DFG Node for throw_static_error is incorrectly named as "ThrowReferenceError". This patch renames it to "ThrowStaticError".

* builtins/ArrayConstructor.js:
* builtins/ArrayIteratorPrototype.js:
(next):
* builtins/ArrayPrototype.js:
(values):
(keys):
(entries):
(reduce):
(reduceRight):
(every):
(forEach):
(filter):
(map):
(some):
(fill):
(find):
(findIndex):
(includes):
(sort):
(concatSlowPath):
(copyWithin):
* builtins/DatePrototype.js:
(toLocaleString.toDateTimeOptionsAnyAll):
(toLocaleString):
(toLocaleDateString.toDateTimeOptionsDateDate):
(toLocaleDateString):
(toLocaleTimeString.toDateTimeOptionsTimeTime):
(toLocaleTimeString):
* builtins/FunctionPrototype.js:
(bind):
* builtins/GeneratorPrototype.js:
(globalPrivate.generatorResume):
* builtins/GlobalOperations.js:
(globalPrivate.speciesConstructor):
* builtins/MapPrototype.js:
(forEach):
* builtins/ModuleLoaderPrototype.js:
(provide):
* builtins/ObjectConstructor.js:
(values):
(entries):
(assign):
* builtins/PromiseConstructor.js:
(race):
(reject):
(resolve):
* builtins/PromiseOperations.js:
(globalPrivate.newPromiseCapability.executor):
(globalPrivate.newPromiseCapability):
(globalPrivate.initializePromise):
* builtins/PromisePrototype.js:
* builtins/ReflectObject.js:
(apply):
(deleteProperty):
(has):
* builtins/RegExpPrototype.js:
(globalPrivate.regExpExec):
(match):
(replace):
(search):
(split):
(intrinsic.RegExpTestIntrinsic.test):
* builtins/SetPrototype.js:
(forEach):
* builtins/StringConstructor.js:
(raw):
* builtins/StringIteratorPrototype.js:
(next):
* builtins/StringPrototype.js:
(match):
(globalPrivate.repeatSlowPath):
(repeat):
(padStart):
(padEnd):
(intrinsic.StringPrototypeReplaceIntrinsic.replace):
(localeCompare):
(search):
(split):
* builtins/TypedArrayConstructor.js:
(of):
(from):
* builtins/TypedArrayPrototype.js:
(globalPrivate.typedArraySpeciesConstructor):
(every):
(find):
(findIndex):
(forEach):
(some):
(subarray):
(reduce):
(reduceRight):
(map):
(filter):
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitThrowStaticError):
(JSC::BytecodeGenerator::emitThrowReferenceError):
(JSC::BytecodeGenerator::emitThrowTypeError):
(JSC::BytecodeGenerator::emitThrowRangeError):
(JSC::BytecodeGenerator::emitThrowOutOfMemoryError):
(JSC::BytecodeGenerator::emitReadOnlyExceptionIfNeeded):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_throwTypeError):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_throwRangeError):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_throwOutOfMemoryError):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_throw_static_error):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_throw_static_error): Deleted.
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL): Deleted.
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
* runtime/Error.cpp:
(JSC::createError):
(WTF::printInternal):
* runtime/Error.h:

LayoutTests:

* js/Object-assign-expected.txt:

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

3 years agoUnreviewed, rolling out r206845.
commit-queue@webkit.org [Thu, 6 Oct 2016 06:54:46 +0000 (06:54 +0000)]
Unreviewed, rolling out r206845.
https://bugs.webkit.org/show_bug.cgi?id=162998

broke el capitan build (Requested by alexchristensen on
#webkit).

Reverted changeset:

"Add Display P3 ColorSpace"
https://bugs.webkit.org/show_bug.cgi?id=162880
http://trac.webkit.org/changeset/206845

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

3 years agoReuse CodeGenerator::UpdateFile in Tools CodeGenerator
commit-queue@webkit.org [Thu, 6 Oct 2016 06:45:34 +0000 (06:45 +0000)]
Reuse CodeGenerator::UpdateFile in Tools CodeGenerator
https://bugs.webkit.org/show_bug.cgi?id=162960

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

Source/WebCore:

No change of behavior.

* bindings/scripts/CodeGenerator.pm:
(UpdateFile): Adding FIXME to enable lazy writing when feasible.

Tools:

* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
(WriteData): Using CodeGenerator::UpdateFile to do lazy generated file update when it is made feasible.
* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
(WriteData): Ditto.

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

3 years ago[SOUP] HostTLSCertificateSet should not use SHA-1 hashes to compare certificates
mcatanzaro@igalia.com [Thu, 6 Oct 2016 06:39:14 +0000 (06:39 +0000)]
[SOUP] HostTLSCertificateSet should not use SHA-1 hashes to compare certificates
https://bugs.webkit.org/show_bug.cgi?id=162965

Reviewed by Carlos Garcia Campos.

Use SHA-256 instead.

No new tests, covered by TestSSL.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::HostTLSCertificateSet::computeCertificateHash):

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

3 years ago[GTK] Bump Chrome version in Chrome user agent quirk
mcatanzaro@igalia.com [Thu, 6 Oct 2016 06:38:34 +0000 (06:38 +0000)]
[GTK] Bump Chrome version in Chrome user agent quirk
https://bugs.webkit.org/show_bug.cgi?id=162984

Reviewed by Carlos Garcia Campos.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):

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

3 years agoUnreviewed, attempt to fix CLoop build after r206846
utatane.tea@gmail.com [Thu, 6 Oct 2016 05:51:52 +0000 (05:51 +0000)]
Unreviewed, attempt to fix CLoop build after r206846
https://bugs.webkit.org/show_bug.cgi?id=162941

Attempt to fix CLoop build part 2. r206847 was not valid.

* jsc.cpp:

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

3 years agoUnreviewed, build fix after r206846
utatane.tea@gmail.com [Thu, 6 Oct 2016 05:38:48 +0000 (05:38 +0000)]
Unreviewed, build fix after r206846
https://bugs.webkit.org/show_bug.cgi?id=162941

DOMJIT::Patchpoint part should be guarded by ENABLE(JIT).

* jsc.cpp:

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

3 years ago[DOMJIT] Add initial CheckDOM and CallDOM implementations
utatane.tea@gmail.com [Thu, 6 Oct 2016 05:20:10 +0000 (05:20 +0000)]
[DOMJIT] Add initial CheckDOM and CallDOM implementations
https://bugs.webkit.org/show_bug.cgi?id=162941

Reviewed by Filip Pizlo.

JSTests:

* stress/domjit-getter-poly.js: Added.
(shouldBe):
(access):
* stress/domjit-getter-proto.js: Added.
(shouldBe):
(access):
* stress/domjit-getter-super-poly.js: Added.
(shouldBe):
(access):
* stress/domjit-getter.js: Added.
(shouldBe):
(access):

Source/JavaScriptCore:

This patch implements a prototype of DOMJIT accelerated getter.
We add two new DFG nodes, CheckDOM and CallDOM.

CheckDOM is used to filter inappropriate |this| object for DOM getter. Its functionality
is equivalent to jsDynamicCast's Check. You can use like "CheckDOM, @1, JSNode::info()",
and this CheckDOM incurs a BadType exit if the class of the given @1 is not a subclass of
JSNode::info().

CallDOM is used to emit actual DOM operations. It takes GlobalObject and checked DOM
object. And it returns JSValue as its result.

Both CheckDOM and CallDOM can take a DOMJIT::Patchpoint. This is somewhat code snippet
generator, and is injectable to DFG and FTL. DFG and FTL set up registers correctly
according to DOMJIT::Patchpoint's requirement and invoke this patchpoint generator to emit code.
While CallDOM always requires a patchpoint, ideally CheckDOM does not require it since
isSubclassOf check can be implemented in DFG / FTL side. However, some classes have a
faster way to query isSubclassOf. For example, JSNode in WebCore introduces a special
JSType to optimize this query. CheckDOM's patchpoint gives us a chance to emit special
faster code for such a case.

By leveraging above nodes, we can construct DOMJIT accelerated getter. When DFG recognizes the
given getter call is CustomGetter and it has DOMJIT::GetterSetter information, DFG emits the above nodes.
We implemented a prototype in jsc.cpp shell as DOMJITGetter to test the functionality.

Notes about the future extensions.

1. Currently, we do not allow CallDOM to emit any function calls. This will be extended by
   adding `addSlowPathCall` functionality to DOMJIT::Patchpoint later. Interesting thing is that
   we need to create an abstraction over DFG slow path call and FTL slow path call!

2. CheckDOM is not handled in DFGTypeCheckHoistingPhase yet. And we have a chance to merge several CheckDOM into one.
   For example, given CheckDOM A and CheckDOM B to the same target. If A is subclass of B, we can merge them to CheckDOM A.

* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3Effects.h:
(JSC::B3::Effects::forCheck):
* b3/B3Value.cpp:
(JSC::B3::Value::effects):
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
(JSC::GetByIdStatus::makesCalls):
(JSC::GetByIdStatus::dump):
* bytecode/GetByIdStatus.h:
(JSC::GetByIdStatus::GetByIdStatus):
(JSC::GetByIdStatus::isCustom):
(JSC::GetByIdStatus::takesSlowPath):
(JSC::GetByIdStatus::isSimple): Deleted.
* bytecode/SpeculatedType.cpp:
(JSC::speculationFromClassInfo):
* dfg/DFGAbstractInterpreter.h:
(JSC::DFG::AbstractInterpreter::filterClassInfo):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::filterClassInfo):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::filterClassInfo):
* dfg/DFGAbstractValue.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleDOMJITGetter):
(JSC::DFG::ByteCodeParser::handleGetById):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction):
(JSC::DFG::Node::hasDOMJIT):
(JSC::DFG::Node::domJIT):
(JSC::DFG::Node::hasClassInfo):
(JSC::DFG::Node::classInfo):
(JSC::DFG::Node::OpInfoWrapper::OpInfoWrapper):
(JSC::DFG::Node::OpInfoWrapper::operator=):
* dfg/DFGNodeType.h:
* dfg/DFGOpInfo.h:
(JSC::DFG::OpInfo::OpInfo):
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::allocateTemporaryRegistersForPatchpoint):
(JSC::DFG::SpeculativeJIT::compileCallDOM):
(JSC::DFG::SpeculativeJIT::compileCheckDOM):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStructureAbstractValue.cpp:
(JSC::DFG::StructureAbstractValue::filterClassInfoSlow):
(JSC::DFG::StructureAbstractValue::isSubClassOf):
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::filterClassInfo):
(JSC::DFG::StructureAbstractValue::filter): Deleted.
* domjit/DOMJITPatchpointParams.h: Copied from Source/JavaScriptCore/dfg/DFGOpInfo.h.
(JSC::DOMJIT::PatchpointParams::~PatchpointParams):
(JSC::DOMJIT::PatchpointParams::size):
(JSC::DOMJIT::PatchpointParams::at):
(JSC::DOMJIT::PatchpointParams::operator[]):
(JSC::DOMJIT::PatchpointParams::gpScratch):
(JSC::DOMJIT::PatchpointParams::fpScratch):
(JSC::DOMJIT::PatchpointParams::PatchpointParams):
* domjit/DOMJITReg.h: Added.
(JSC::DOMJIT::Reg::Reg):
(JSC::DOMJIT::Reg::isGPR):
(JSC::DOMJIT::Reg::isFPR):
(JSC::DOMJIT::Reg::isJSValueRegs):
(JSC::DOMJIT::Reg::gpr):
(JSC::DOMJIT::Reg::fpr):
(JSC::DOMJIT::Reg::jsValueRegs):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileCheckDOM):
(JSC::FTL::DFG::LowerDFGToB3::compileCallDOM):
(JSC::FTL::DFG::LowerDFGToB3::compileUnreachable): Deleted.
* jit/AssemblyHelpers.h:
* jsc.cpp:
(WTF::DOMJITNode::DOMJITNode):
(WTF::DOMJITNode::createStructure):
(WTF::DOMJITNode::create):
(WTF::DOMJITNode::value):
(WTF::DOMJITNode::offsetOfValue):
(WTF::DOMJITGetter::DOMJITGetter):
(WTF::DOMJITGetter::createStructure):
(WTF::DOMJITGetter::create):
(WTF::DOMJITGetter::DOMJITNodeDOMJIT::DOMJITNodeDOMJIT):
(WTF::DOMJITGetter::domJITNodeGetterSetter):
(WTF::DOMJITGetter::finishCreation):
(WTF::DOMJITGetter::customGetter):
(GlobalObject::finishCreation):
(functionCreateDOMJITNodeObject):
(functionCreateDOMJITGetterObject):

Source/WTF:

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

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

3 years agoAdd Display P3 ColorSpace
dino@apple.com [Thu, 6 Oct 2016 05:15:32 +0000 (05:15 +0000)]
Add Display P3 ColorSpace
https://bugs.webkit.org/show_bug.cgi?id=162880
<rdar://problem/28598564>

Reviewed by Sam Weinig.

Add a new ColorSpace for Display P3.

This will be tested once the Color class can create
objects that reference other color spaces.

* platform/graphics/ColorSpace.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::displayP3ColorSpaceRef):
* platform/graphics/cg/GraphicsContextCG.h:
(WebCore::cachedCGColorSpace):

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

3 years ago[JSC] Do not construct Simple GetByIdStatus against self-custom-accessor case
utatane.tea@gmail.com [Thu, 6 Oct 2016 04:24:57 +0000 (04:24 +0000)]
[JSC] Do not construct Simple GetByIdStatus against self-custom-accessor case
https://bugs.webkit.org/show_bug.cgi?id=162993

Reviewed by Filip Pizlo.

We accidentally created a Simple GetByIdStatus against self-custom-accessor case: the object has own custom accessor property and get_by_id hits.
If we returned such a result, the GetById will be turned to GetByOffset and it looks up incorrect thing like CustomGetterSetter object.
We do not hit this bug before since maybe there is no object that has own custom-accessor and this custom-accessor does not raise an error.
For example, "Node.prototype" has "firstChild" custom accessor. But since "Node.prototype" itself does not have Node::info(), "Node.prototype.firstChild"
access always raises an error. I guess all the custom accessors follow this pattern. This bug is uncovered when testing DOMJIT (This bug causes crash and
it can occur even if we disabled DOMJIT).

But such a assumption is not guaranteed. In this patch, we fix this by not returning Simple GetById.

* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFromLLInt):
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
(JSC::GetByIdStatus::computeFor):

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

3 years agoIntroduce InputEvent bindings in preparation for the input events spec
wenson_hsieh@apple.com [Thu, 6 Oct 2016 04:05:35 +0000 (04:05 +0000)]
Introduce InputEvent bindings in preparation for the input events spec
https://bugs.webkit.org/show_bug.cgi?id=162954

Reviewed by Ryosuke Niwa.

Source/WebCore:

Creates new bindings for InputEvent. Also introduces a runtime switch that allows Node to dispatch InputEvents
rather than generic events of type 'input'. Adds a new test verifying that when the switch is enabled, inputs
and contenteditable divs fire these new InputEvents on input. So far, only inputType is a part of the object
prototype, since we will be implementing this first. getTargetRanges() will follow once the finer details of
StaticRange are hashed out. See https://bugs.webkit.org/show_bug.cgi?id=162947 for more details.

Tests: fast/events/input-events-fired-when-typing.html
       fast/events/ios/input-events-fired-when-typing-in-contenteditable.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/Event.cpp:
(WebCore::Event::composed):
(WebCore::Event::isInputEvent):
* dom/Event.h:
* dom/EventNames.in:
* dom/InputEvent.cpp: Added.
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h: Added.
* dom/InputEvent.idl: Added.
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
(WebCore::Node::defaultEventHandler):
* dom/Node.h:
* editing/Editor.cpp:
(WebCore::Editor::setBaseWritingDirection):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setEditingValue):
(WebCore::HTMLInputElement::setValueFromRenderer):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::listBoxOnChange):
(WebCore::HTMLSelectElement::dispatchChangeEventForMenuList):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTimelineElement::defaultEventHandler):
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit2:

Adds a new runtime switch for enabling InputEvents.

* Shared/WebPreferencesDefinitions.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests:

Adds a new test verifying that InputEvents are fired when the runtime switch for input events is enabled.

* fast/events/input-events-fired-when-typing-expected.txt: Added.
* fast/events/input-events-fired-when-typing.html: Added.
* fast/events/ios/input-events-fired-when-typing-in-contenteditable-expected.txt: Added.
* fast/events/ios/input-events-fired-when-typing-in-contenteditable.html: Added.
* js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/ios-simulator/TestExpectations:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

3 years agoURLParser should parse IPv4 addresses as the last two pieces of an IPv6 address
achristensen@apple.com [Thu, 6 Oct 2016 02:35:12 +0000 (02:35 +0000)]
URLParser should parse IPv4 addresses as the last two pieces of an IPv6 address
https://bugs.webkit.org/show_bug.cgi?id=162991

Reviewed by Saam Barati.

Source/WebCore:

The last 32 bits of an IPv6 address can be written in the form of an IPv4 address,
but the syntax is stricter than if it were just an IPv4 address.  There must be 4 pieces,
and each piece must be decimal (no octal or hex allowed).  These should serialize to
regular hex IPv6 addresses.

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv4Piece):
(WebCore::URLParser::parseIPv4Host):
(WebCore::URLParser::parseIPv4PieceInsideIPv6):
(WebCore::URLParser::parseIPv4AddressInsideIPv6):
(WebCore::URLParser::parseIPv6Host):
(WebCore::URLParser::parseIPv4Number): Deleted.
* platform/URLParser.h:

Tools:

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

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

3 years agoPCToCodeOriginMap builder should use labelIgnoringWatchpoints() inside the DFG
sbarati@apple.com [Thu, 6 Oct 2016 00:50:59 +0000 (00:50 +0000)]
PCToCodeOriginMap builder should use labelIgnoringWatchpoints() inside the DFG
https://bugs.webkit.org/show_bug.cgi?id=162936

Reviewed by Michael Saboff.

label() may insert nops because of an InvalidationPoint. It does that
because we don't want code that comes after an InvalidationPoint that isn't
effected by the invalidation point to be overwritten if we fire the
InvalidationPoint. PCToCodeOriginMap just grabs labels to build
a mapping, it never emits code that actually jumps to those labels.
Therefore, it should never cause us to emit nops.

* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::runSlowPathGenerators):
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):

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

3 years ago[EFL] Mark timeout tests to *Timeout*
gyuyoung.kim@webkit.org [Thu, 6 Oct 2016 00:47:39 +0000 (00:47 +0000)]
[EFL] Mark timeout tests to *Timeout*

Unreviewed EFL gardening.

Timeout has been happened on some tests.

Patch by Gyuyoung Kim <gyuyoung.kim@navercorp.com> on 2016-10-05

* platform/efl/TestExpectations:

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

3 years agoPut variation fonts work behind a compile-time flag
mmaxfield@apple.com [Thu, 6 Oct 2016 00:40:41 +0000 (00:40 +0000)]
Put variation fonts work behind a compile-time flag
https://bugs.webkit.org/show_bug.cgi?id=162949

Reviewed by Simon Fraser.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

No new tests because there is no behavior change.

* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontVariationValue.cpp:
* css/CSSFontVariationValue.h:
* css/CSSPropertyNames.in:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isFontFeatureValue): Deleted.
(WebCore::CSSValue::isFontVariationValue): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontVariationSettings): Deleted.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings): Deleted.
(WebCore::StyleBuilderCustom::applyInheritFontVariationSettings): Deleted.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFontVariationSettings): Deleted.
* css/parser/CSSParserMode.h:
* page/Settings.in:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
(WebCore::blendFunc): Deleted.
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator==):
(WebCore::FontDescriptionKey::computeHash):
* platform/graphics/FontDescription.cpp:
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::operator==):
(WebCore::FontDescription::setFeatureSettings): Deleted.
(WebCore::FontDescription::setVariationSettings): Deleted.
* platform/graphics/FontTaggedSettings.cpp:
(WebCore::operator<<): Deleted.
* platform/graphics/FontTaggedSettings.h:
(WebCore::FontVariationSettings::isEmpty):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::cascadeToLastResortAndVariationsFontDescriptor):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setFontVariationSettings): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontVariationSettings): Deleted.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::variationFontsEnabled):
(WebCore::InternalSettings::setVariationFontsEnabled):
* testing/InternalSettings.h:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

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

3 years agoImport v1 custom elements tests from W3C
rniwa@webkit.org [Thu, 6 Oct 2016 00:35:23 +0000 (00:35 +0000)]
Import v1 custom elements tests from W3C
https://bugs.webkit.org/show_bug.cgi?id=162987

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Import tests in https://github.com/w3c/web-platform-tests/tree/master/custom-elements except v1 tests
as of eae188126a21a593715ba2626cc059144d6f0978.

* web-platform-tests/custom-elements/CustomElementRegistry-expected.txt: Added.
* web-platform-tests/custom-elements/CustomElementRegistry.html: Added.
* web-platform-tests/custom-elements/HTMLElement-constructor-expected.txt: Added.
* web-platform-tests/custom-elements/HTMLElement-constructor.html: Added.
* web-platform-tests/custom-elements/OWNERS: Added.
* web-platform-tests/custom-elements/adopted-callback-expected.txt: Added.
* web-platform-tests/custom-elements/adopted-callback.html: Added.
* web-platform-tests/custom-elements/attribute-changed-callback-expected.txt: Added.
* web-platform-tests/custom-elements/attribute-changed-callback.html: Added.
* web-platform-tests/custom-elements/connected-callbacks-expected.txt: Added.
* web-platform-tests/custom-elements/connected-callbacks.html: Added.
* web-platform-tests/custom-elements/custom-element-registry/define-expected.txt: Added.
* web-platform-tests/custom-elements/custom-element-registry/define.html: Added.
* web-platform-tests/custom-elements/custom-element-registry/w3c-import.log: Added.
* web-platform-tests/custom-elements/disconnected-callbacks-expected.txt: Added.
* web-platform-tests/custom-elements/disconnected-callbacks.html: Added.
* web-platform-tests/custom-elements/htmlconstructor/newtarget-expected.txt: Added.
* web-platform-tests/custom-elements/htmlconstructor/newtarget.html: Added.
* web-platform-tests/custom-elements/htmlconstructor/w3c-import.log: Added.
* web-platform-tests/custom-elements/reaction-timing-expected.txt: Added.
* web-platform-tests/custom-elements/reaction-timing.html: Added.
* web-platform-tests/custom-elements/reactions/Attr-expected.txt: Added.
* web-platform-tests/custom-elements/reactions/Attr.html: Added.
* web-platform-tests/custom-elements/reactions/ChildNode-expected.txt: Added.
* web-platform-tests/custom-elements/reactions/ChildNode.html: Added.
* web-platform-tests/custom-elements/reactions/DOMTokenList-expected.txt: Added.
* web-platform-tests/custom-elements/reactions/DOMTokenList.html: Added.
* web-platform-tests/custom-elements/reactions/Document-expected.txt: Added.
* web-platform-tests/custom-elements/reactions/Document.html: Added.
* web-platform-tests/custom-elements/reactions/Element-expected.txt: Added.
* web-platform-tests/custom-elements/reactions/Element.html: Added.
* web-platform-tests/custom-elements/reactions/NamedNodeMap-expected.txt: Added.
* web-platform-tests/custom-elements/reactions/NamedNodeMap.html: Added.
* web-platform-tests/custom-elements/reactions/Node-expected.txt: Added.
* web-platform-tests/custom-elements/reactions/Node.html: Added.
* web-platform-tests/custom-elements/reactions/ParentNode-expected.txt: Added.
* web-platform-tests/custom-elements/reactions/ParentNode.html: Added.
* web-platform-tests/custom-elements/reactions/Range-expected.txt: Added.
* web-platform-tests/custom-elements/reactions/Range.html: Added.
* web-platform-tests/custom-elements/reactions/resources/reactions.js: Added.
* web-platform-tests/custom-elements/reactions/resources/w3c-import.log: Added.
* web-platform-tests/custom-elements/reactions/w3c-import.log: Added.
* web-platform-tests/custom-elements/resources/custom-elements-helpers.js: Added.
* web-platform-tests/custom-elements/resources/document-types.js: Added.
* web-platform-tests/custom-elements/resources/empty-html-document.html: Added.
* web-platform-tests/custom-elements/resources/w3c-import.log: Added.
* web-platform-tests/custom-elements/w3c-import.log: Added.

LayoutTests:

Removed custom elements tests that have been upstreamed to and reimported from web-platform-tests.

* fast/custom-elements/CustomElementRegistry-expected.txt: Removed.
* fast/custom-elements/CustomElementRegistry.html: Removed.
* fast/custom-elements/HTMLElement-constructor-expected.txt: Removed.
* fast/custom-elements/HTMLElement-constructor.html: Removed.
* fast/custom-elements/adopted-callback-expected.txt: Removed.
* fast/custom-elements/adopted-callback.html: Removed.
* fast/custom-elements/attribute-changed-callback-expected.txt: Removed.
* fast/custom-elements/attribute-changed-callback.html: Removed.
* fast/custom-elements/connected-callbacks-expected.txt: Removed.
* fast/custom-elements/connected-callbacks.html: Removed.
* fast/custom-elements/disconnected-callbacks-expected.txt: Removed.
* fast/custom-elements/disconnected-callbacks.html: Removed.

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

3 years ago[INTL] Implement Intl.getCanonicalLocales
commit-queue@webkit.org [Thu, 6 Oct 2016 00:07:21 +0000 (00:07 +0000)]
[INTL] Implement Intl.getCanonicalLocales
https://bugs.webkit.org/show_bug.cgi?id=162768

Patch by Andy VanWagoner <thetalecrafter@gmail.com> on 2016-10-05
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Implement Intl.getCanonicalLocales from ECMA 402 (3rd edition)
http://ecma-international.org/ecma-402/3.0/index.html#sec-intl.getcanonicallocales

Reuse canonicalizeLocaleList and copy the results into a new JSArray.

* runtime/IntlObject.cpp:
(JSC::IntlObject::finishCreation):
(JSC::intlObjectFuncGetCanonicalLocales):

LayoutTests:

* js/intl-expected.txt: Added tests for Intl.getCanonicalLocales
* js/script-tests/intl.js: Added test for Intl.getCanonicalLocales

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

3 years agoBad ASSERT in ClonedArguments::createByCopyingFrom()
msaboff@apple.com [Wed, 5 Oct 2016 23:47:34 +0000 (23:47 +0000)]
Bad ASSERT in ClonedArguments::createByCopyingFrom()
https://bugs.webkit.org/show_bug.cgi?id=162988

Reviewed by Keith Miller.

Removed bogus assert.

* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::createByCopyingFrom):

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

3 years agoMarking inspector/formatting/formatting-javascript.html as a flaky crash on mac-wk1.
ryanhaddad@apple.com [Wed, 5 Oct 2016 23:19:53 +0000 (23:19 +0000)]
Marking inspector/formatting/formatting-javascript.html as a flaky crash on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=162986

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoFix the build.
timothy_horton@apple.com [Wed, 5 Oct 2016 23:12:44 +0000 (23:12 +0000)]
Fix the build.

* UIProcess/Cocoa/WebViewImpl.mm:

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

3 years agoAvoid automatically re-taking snapshots for back-forward items that were never loaded...
timothy_horton@apple.com [Wed, 5 Oct 2016 23:08:44 +0000 (23:08 +0000)]
Avoid automatically re-taking snapshots for back-forward items that were never loaded into the view
https://bugs.webkit.org/show_bug.cgi?id=162955
<rdar://problem/27659173>

Reviewed by Simon Fraser.

Make it possible for clients to control the snapshot for back-forward
items that are restored from session state without navigating to them,
by ensuring that we won't stomp on the snapshot that they explicitly take,
until a load occurs.

* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::addItem):
(WebKit::WebBackForwardList::goToItem):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::trackSwipeGesture):
Disambiguate explicit API-driven snapshot recording from automatic,
navigation-driven snapshot recording.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::saveBackForwardSnapshotForCurrentItem):
Get rid of the version of recordNavigationSnapshot() that doesn't take a
back-forward list item, and grab the current item at the one remaining caller.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::recordAutomaticNavigationSnapshot):
(WebKit::WebPageProxy::recordNavigationSnapshot):
(WebKit::WebPageProxy::restoreFromSessionState):
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebPageProxy.h:
Rename m_suppressNavigationSnapshotting to m_suppressAutomaticNavigationSnapshotting,
and make it be only about automatic (navigation-driven) snapshots; it won't have
any impact on explicit snapshots forced by clients.

Set m_suppressAutomaticNavigationSnapshotting unconditionally when restoring
from session state, so that we won't start automatically snapshotting until
something has loaded in the view.

* TestWebKitAPI/Tests/WebKit2Cocoa/SnapshotStore.mm:
(-[SnapshotTestWKWebView init]):
(forceRepaintCallback):
(-[SnapshotTestWKWebView synchronouslyForceRepaint]):
(-[SnapshotTestWKWebView synchronouslyLoadTestPageAndForceRepaint:]):
(TEST):
(makeRedSquareView):
Add a test that restoring session state into a web view without navigating,
then explicitly snapshotting and navigating away, leaves the original snapshot alone.

Adjust the existing test, as well, to ensure that it will reliably fail
if the feature is broken. Use an explicitly added and removed red square
instead of scrolling, because we can't scroll in the restore-without-navigating case.

Stop trying to override the window scale, because it's not working (we're getting partial snapshots)
and isn't necessary; instead just multiply the expected value by the page scale.

(-[SnapshotTestWKWebView loadPageNamed:]): Deleted.
* TestWebKitAPI/mac/TestWKWebViewMac.h:
* TestWebKitAPI/mac/TestWKWebViewMac.mm:
(-[TestWKWebView synchronouslyLoadTestPageNamed:]):
Reorganize to reduce duplication.

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

3 years agoUnreviewed build fix after r206830
bfulgham@apple.com [Wed, 5 Oct 2016 21:23:34 +0000 (21:23 +0000)]
Unreviewed build fix after r206830

* platform/graphics/win/FontPlatformDataWin.cpp: Add missing include
when building with Direct2D.

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

3 years ago[Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building...
bfulgham@apple.com [Wed, 5 Oct 2016 21:16:27 +0000 (21:16 +0000)]
[Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building for D2D
https://bugs.webkit.org/show_bug.cgi?id=162977

Reviewed by Alex Christensen.

Currently the Direct2D implementation does not support some of the accelerated compositing
features that require CoreAnimation. During this bring-up, we want to disable these routines
so that we can build and run in (mostly) unaccelerated drawing.

This patch mostly consists of adding "#if USE(CG)" and "#if USE(CA)" to files that are
specific to those implementations.

This change should have no impact on non-Direct2D ports.

No change in behavior for active ports.

* config.h: Turn of CG when building in Direct2D.
* css/CSSFontFaceSource.cpp:
* loader/cache/CachedFont.cpp:
* loader/cache/CachedSVGFont.cpp:
* page/CaptionUserPreferencesMediaAF.cpp:
* page/win/FrameCGWin.cpp:
* page/win/FrameDirect2D.cpp: Added.
* platform/graphics/Font.cpp:
* platform/graphics/FontCache.cpp:
* platform/graphics/FontPlatformData.cpp:
* platform/graphics/GraphicsContext.h:
* platform/graphics/Image.cpp:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
* platform/graphics/ca/GraphicsLayerCA.cpp:
* platform/graphics/ca/PlatformCALayer.cpp:
* platform/graphics/ca/TileController.cpp:
* platform/graphics/ca/TileGrid.cpp:
* platform/graphics/ca/TileGrid.h:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
* platform/graphics/ca/win/LayerChangesFlusher.cpp:
* platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
* platform/graphics/ca/win/PlatformCAAnimationWin.h:
* platform/graphics/ca/win/PlatformCAFiltersWin.cpp:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
* platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
* platform/graphics/cg/GradientCG.cpp:
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cg/ImageBufferCG.cpp:
* platform/graphics/cg/ImageBufferDataCG.cpp:
* platform/graphics/cg/PDFDocumentImage.cpp:
* platform/graphics/cg/PatternCG.cpp:
* platform/graphics/cg/SubimageCacheWithTimer.cpp:
* platform/graphics/win/FontCGWin.cpp:
* platform/graphics/win/FontPlatformDataCGWin.cpp:
* platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
* platform/graphics/win/GradientDirect2D.cpp:
* platform/graphics/win/PathDirect2D.cpp: Fix a few build problems I didn't notice
while building without Direct2D active.
* platform/graphics/win/SimpleFontDataCGWin.cpp:
* platform/graphics/win/SimpleFontDataWin.cpp:
* platform/win/DragImageCGWin.cpp:
* platform/win/DragImageDirect2D.cpp: Added.
* rendering/RenderMediaControls.cpp:

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

3 years agoMake it possible to test ViewSnapshotStore behaviors
timothy_horton@apple.com [Wed, 5 Oct 2016 21:14:17 +0000 (21:14 +0000)]
Make it possible to test ViewSnapshotStore behaviors
https://bugs.webkit.org/show_bug.cgi?id=162983

Reviewed by Simon Fraser.

Add two pieces of SPI to make it easier to test ViewSnapshotStore:

- [WKWebView _disableBackForwardSnapshotVolatilityForTesting]
    This makes it so that we don't make snapshots volatile after we
    take them, so that they won't get purged while the test is running
    and cause the test to be flaky.

- [WKBackForwardListItem _copySnapshotForTesting]
    This returns a CGImage with the content of the given back-forward
    item's current snapshot, if there is one.

* UIProcess/API/Cocoa/WKBackForwardListItem.mm:
(-[WKBackForwardListItem _copySnapshotForTesting]):
* UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
* UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Added.
Add WKBackForwardListItem SPI to retrieve the snapshot for a given back-forward list item.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _disableBackForwardSnapshotVolatilityForTesting]):
Add WKWebView SPI to disable volatility of snapshots, for testing purposes.

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::takeViewSnapshot):
Adopt ViewSnapshot::setVolatile instead of reaching into the surface.

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::removeSwipeSnapshot):
Adopt ViewSnapshot::setVolatile instead of reaching into the surface.

* UIProcess/mac/ViewSnapshotStore.h:
(WebKit::ViewSnapshotStore::setDisableSnapshotVolatilityForTesting):
(WebKit::ViewSnapshotStore::disableSnapshotVolatilityForTesting):
* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshotStore::ViewSnapshotStore):
(WebKit::ViewSnapshot::setVolatile):
(WebKit::ViewSnapshot::asLayerContents):
Move all touching of snapshot volatility into the new setVolatile,
and short-circuit if the testing-only m_disableSnapshotVolatility bit is set

(WebKit::ViewSnapshot::asImageForTesting):
Make a CGImageRef for the aforementioned WKBackForwardListItem SPI.
This is currently not implemented for the iOS Simulator, because we
don't have access to the bits of the image in that case.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/SnapshotStore.mm: Added.
(-[SnapshotTestWKWebView init]):
(-[SnapshotTestWKWebView loadPageNamed:]):
(imagesAreEqual):
Add tests for existing basic snapshotting behavior:

- a back-forward item shouldn't have a snapshot
  until it is navigated away from

- causing a back-forward item to fall out of the
  back-forward list should remove the snapshot

- calling the explicit snapshotting SPI, then navigating away from the page,
  should result in the snapshot being retaken

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

3 years agoKeyboardEvent.getModifierState() should support "CapsLock" modifier
cdumez@apple.com [Wed, 5 Oct 2016 21:12:51 +0000 (21:12 +0000)]
KeyboardEvent.getModifierState() should support "CapsLock" modifier
https://bugs.webkit.org/show_bug.cgi?id=162861

Reviewed by Darin Adler.

Source/WebCore:

Add support for "CapsLock" modifier on Mac / iOS for KeyboardEvent's
getModifierState() API, as per:
- https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate

No new tests, updated existing test.

* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::getModifierState):
* dom/KeyboardEvent.h:
* platform/PlatformEvent.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::modifiersForEvent):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyIdentifierForKeyEvent):

Source/WebKit2:

Add support for CapsLock modifier on events.

* Shared/API/c/WKEvent.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
(WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
(WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
* Shared/efl/WebEventFactory.cpp:
(WebKit::toWebEventModifiers):
* Shared/ios/WebIOSEventFactory.mm:
(modifiersForEvent):
* Shared/mac/WebEventFactory.mm:
(WebKit::modifiersForEvent):
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(toNSEventModifierFlags):
* UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):

Tools:

Add support for 'capsLockKey' modifier for EventSender.keyDown() so
that we can test this new modifier support for layout tests.

* TestWebKitAPI/mac/PlatformWebViewMac.mm:
(TestWebKitAPI::modifierFlagsForWKModifiers):
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::parseModifier):
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::buildModifierFlags):

LayoutTests:

Extend layout test coverage to cover 'Caps Lock' modifier.

* fast/events/special-key-events-in-input-text-expected.txt:
* fast/events/special-key-events-in-input-text.html:

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

3 years agoAdd MobileMiniBrowser tests for control center and looping fullscreen.
commit-queue@webkit.org [Wed, 5 Oct 2016 20:46:15 +0000 (20:46 +0000)]
Add MobileMiniBrowser tests for control center and looping fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=162748

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-10-05
Reviewed by Jer Noble.

Refactor existing MobileMiniBrowserTests and add new tests for
- fullscreen rotation
- fullscreen looping (failing)
- control center interruption (failing)

* MobileMiniBrowser/MobileMiniBrowser.xcodeproj/project.pbxproj:
* MobileMiniBrowser/MobileMiniBrowserFramework/Resources/looping2s.html: Added.
* MobileMiniBrowser/MobileMiniBrowserFramework/test2s.mp4: Added.
* MobileMiniBrowser/MobileMiniBrowserUITests/MobileMiniBrowserUITests.m:
(-[MobileMiniBrowserUITests setUp]):
(-[MobileMiniBrowserUITests waitToTapButtonNamed:forApp:]):
(-[MobileMiniBrowserUITests loadURL:]):
(-[MobileMiniBrowserUITests requireMinFPS:sampleDurationSeconds:message:]):
(-[MobileMiniBrowserUITests ensureFullscreenControls]):
(-[MobileMiniBrowserUITests timeForTimeString:]):
(-[MobileMiniBrowserUITests testBasicVideoPlayback]):
(-[MobileMiniBrowserUITests testBasicVideoFullscreen]):
(-[MobileMiniBrowserUITests testVideoFullscreenAndRotationAnimation]):
(-[MobileMiniBrowserUITests testVideoFullscreenControlCenter]):
(-[MobileMiniBrowserUITests testLoopingFullscreenLockup]):

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

3 years ago[GTK] Improve OS X UA quirk
mcatanzaro@igalia.com [Wed, 5 Oct 2016 20:21:25 +0000 (20:21 +0000)]
[GTK] Improve OS X UA quirk
https://bugs.webkit.org/show_bug.cgi?id=162613

Reviewed by Carlos Garcia Campos.

Include OS X version number in user agent, like Safari does.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):

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

3 years ago[GTK] Improve comment in platformVersionForUAString
mcatanzaro@igalia.com [Wed, 5 Oct 2016 20:20:02 +0000 (20:20 +0000)]
[GTK] Improve comment in platformVersionForUAString
https://bugs.webkit.org/show_bug.cgi?id=162612

Reviewed by Carlos Garcia Campos.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::platformVersionForUAString):

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

3 years agoMissing quotation mark when <q> gets reparented.
zalan@apple.com [Wed, 5 Oct 2016 18:50:20 +0000 (18:50 +0000)]
Missing quotation mark when <q> gets reparented.
https://bugs.webkit.org/show_bug.cgi?id=162940

Reviewed by Darin Adler.

Source/WebCore:

When an opening RenderQuote gets removed due to some change in the render tree,
we notify the closing RenderQuote so that it can update its content (") accordingly (and vice versa).
However when the same RenderQuote is added back to the render tree (aka reparenting), we fail to
let the other RenderQuote know about it and its content becomes stale.
This patch ensures that when either the opening or closing part of the quotation mark gets reparented,
we inform the other, corresponding opening/closing renderer about it.

Test: fast/css-generated-content/missing-quotes-with-dynamic-content.html

* dom/PseudoElement.cpp:
(WebCore::PseudoElement::didAttachRenderers):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::insertedIntoTree):
* rendering/RenderQuote.h:

LayoutTests:

The position of the closing quotation mark is driven by the multicolumn code hence the cover div.

* fast/css-generated-content/missing-quotes-with-dynamic-content-expected.html: Added.
* fast/css-generated-content/missing-quotes-with-dynamic-content.html: Added.

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

3 years agoVersioning.
bshafiei@apple.com [Wed, 5 Oct 2016 18:42:09 +0000 (18:42 +0000)]
Versioning.

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

3 years agoURLParser should correctly strip unnecessary 0's in IPv6 addresses
achristensen@apple.com [Wed, 5 Oct 2016 18:27:53 +0000 (18:27 +0000)]
URLParser should correctly strip unnecessary 0's in IPv6 addresses
https://bugs.webkit.org/show_bug.cgi?id=162979

Reviewed by Brady Eidson.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parseIPv6Host):
Strip leading 0's and any 0's before the last 0 if the value is 0.

Tools:

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

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

3 years agoUTF-8 encode queries of nonspecial and websocket schemes
achristensen@apple.com [Wed, 5 Oct 2016 18:25:02 +0000 (18:25 +0000)]
UTF-8 encode queries of nonspecial and websocket schemes
https://bugs.webkit.org/show_bug.cgi?id=162956

Reviewed by Geoffrey Garen and Brady Eidson.

Source/WebCore:

The URL spec says in the query state:
'If url is not special or url's scheme is either "ws" or "wss", set encoding to UTF-8.'
This should be determined as soon as we are done parsing the scheme.

Covered by new API tests.
This also fixes tests like fast/loader/javascript-url-encoding-2.html when URLParser is enabled.

* platform/URLParser.cpp:
(WebCore::isValidSchemeCharacter):
Renamed Scheme to ValidScheme so I can use Scheme as the name of an enum class in the same namespace.
(WebCore::isSpecial):
(WebCore::scheme):
Separate functionality so we can have different behavior for different sets of
ws and wss schemes, special, and non-special schemes.
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::parse):
Set isUTF8Encoding to true when we finish parsing the scheme if the scheme is ws, wss, or non-special,
according to spec.  This also matches existing behavior.  This way we will already know whether to go
into UTF8Query or NonUTF8Query state when we see a '?'.
(WebCore::isSpecialScheme): Deleted.

Tools:

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

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

3 years agoPrepare to enable URLParser
achristensen@apple.com [Wed, 5 Oct 2016 18:19:19 +0000 (18:19 +0000)]
Prepare to enable URLParser
https://bugs.webkit.org/show_bug.cgi?id=162974

Reviewed by Brady Eidson.

Source/WebCore:

* platform/URL.cpp:
(WebCore::URL::serialize):
When we enable the URLParser, this attempt to make serialized URLs more spec compliant
won't be needed any more.

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):
Added some tests that are unrelated to the code change, but these are
reflected in changed LayoutTest results when enabling the URLParser,
and they weren't in the URLParser tests yet.  They should be.

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

3 years ago[Win][Direct2D] Connect WebCore/WebKit Drawing
bfulgham@apple.com [Wed, 5 Oct 2016 17:21:55 +0000 (17:21 +0000)]
[Win][Direct2D] Connect WebCore/WebKit Drawing
https://bugs.webkit.org/show_bug.cgi?id=162924

Reviewed by Alex Christensen.

Update the Windows WebKit layer to optionally use the Direct2D
backend.

* FullscreenVideoController.cpp: Disable some CoreAnimation-based
accelerated compositing logic.
* FullscreenVideoController.h:
* WebFrame.cpp:
(WebFrame::spoolPages): Disable in Direct2D.
* WebView.cpp:
(WebView::ensureBackingStore): Add Direct2D logic.
(WebView::scrollBackingStore): Ditto.
(WebView::sizeChanged): Ditto.
(WebView::paintWithDirect2D): Added.
(WebView::WebViewWndProc): Call Direct2D paint routine.
* WebView.h:

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

3 years ago[Win][Direct2D] Add initial D2D Path and Gradient implementation
bfulgham@apple.com [Wed, 5 Oct 2016 17:18:31 +0000 (17:18 +0000)]
[Win][Direct2D] Add initial D2D Path and Gradient implementation
https://bugs.webkit.org/show_bug.cgi?id=162923

Reviewed by Alex Christensen.

This patch lands a set of new files that implements initial Path
and Gradient features on Windows using Direct2D.

No new tests until complete backend lands.

* platform/graphics/Gradient.h:
* platform/graphics/Path.cpp:
* platform/graphics/Path.h:
* platform/graphics/win/GradientDirect2D.cpp: Added.
* platform/graphics/win/PathDirect2D.cpp: Added.

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

3 years ago[Readable Streams API] Align function names with spec
commit-queue@webkit.org [Wed, 5 Oct 2016 16:46:19 +0000 (16:46 +0000)]
[Readable Streams API] Align function names with spec
https://bugs.webkit.org/show_bug.cgi?id=162967

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2016-10-05
Reviewed by Darin Adler.

Align function names with spec. Behaviour was already in line with spec, but previous function names had
sometimes been preserved to track the changes more easily. This led to some inconsistencies (for instance,
enqueueInReadableStream was still used even though it works on a controller instead of a stream) and it
also made it more difficult to compare spec and implementation.

No change in behaviour.

* Modules/fetch/FetchInternals.js:
(consumeStream): Updated with new function names.
* Modules/fetch/FetchResponse.js:
(clone): Updated with new function names.
* Modules/streams/ReadableStream.js:
(tee): Updated with new function names.
* Modules/streams/ReadableStreamDefaultController.js:
(enqueue): Updated with new function names.
(error): Updated with new function names.
* Modules/streams/ReadableStreamDefaultReader.js:
(read): Updated with new function names.
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultController): Updated with new function names.
(readableStreamDefaultControllerError): Updated with new function names.
(readableStreamTee): Updated with new function names.
(readableStreamTeePullFunction): Updated with new function names.
(readableStreamTeeBranch2CancelFunction): Updated with new function names.
(readableStreamError): Updated with new function names.
(readableStreamCancel): Updated with new function names.
(readableStreamDefaultControllerPull): Updated with new function names.
(readableStreamDefaultControllerClose): Updated with new function names.
(readableStreamClose): Updated with new function names.
(readableStreamDefaultControllerEnqueue): Updated with new function names.
(readableStreamDefaultReaderRead): Updated with new function names.

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

3 years ago[WK2][NetworkSession] Ping requests should follow redirects if applicable
dbates@webkit.org [Wed, 5 Oct 2016 16:29:37 +0000 (16:29 +0000)]
[WK2][NetworkSession] Ping requests should follow redirects if applicable
https://bugs.webkit.org/show_bug.cgi?id=162580
<rdar://problem/28631274>

Rename test anchor-ping-and-do-not-follow-redirect-when-sending-ping.html to anchor-ping-and-follow-redirect-when-sending-ping.html
to reflect what it is actually testing - that we follow a redirect when sending a ping for a <a ping>.

* http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping-expected.txt: Renamed from LayoutTests/http/tests/navigation/ping-attribute/anchor-ping-and-do-not-follow-redirect-when-sending-ping-expected.txt.
* http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html: Renamed from LayoutTests/http/tests/navigation/ping-attribute/anchor-ping-and-do-not-follow-redirect-when-sending-ping.html.
* http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.php: Only append the query string
if we have a non-empty query string to avoid appending a superfluous "?" on redirect.

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

3 years ago[Bindings] Declare dictionary / enumeration template specializations in the header
cdumez@apple.com [Wed, 5 Oct 2016 16:09:20 +0000 (16:09 +0000)]
[Bindings] Declare dictionary / enumeration template specializations in the header
https://bugs.webkit.org/show_bug.cgi?id=162929

Reviewed by Darin Adler.

Declare dictionary / enumeration template specializations in the header
so that:
- They can be used from custom bindings code.
- Dictionaries / enumerations can be used to their own IDL files to
  share them (Bug 162912).

No new tests, rebaselined bindings tests.

* WebCore.xcodeproj/project.pbxproj:
* bindings/generic/IDLTypes.h:
* bindings/js/JSDOMConvert.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateInterface):
(GenerateEnumerationImplementationContent):
(GenerateEnumerationHeaderContent):
(GenerateDictionaryHeaderContent):
(GenerateHeader):
(GenerateCallbackHeader):
(GenerateCallbackImplementation):
(GenerateDefaultValue): Deleted.
(GenerateDictionaryImplementationContent): Deleted.
(GenerateParametersCheck): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:

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

3 years agoRename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
zandobersek@gmail.com [Wed, 5 Oct 2016 16:02:35 +0000 (16:02 +0000)]
Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
https://bugs.webkit.org/show_bug.cgi?id=162903

Reviewed by Alex Christensen.

Rename build guards for the remaining implementation of the legacy EME API
to ENABLE_LEGACY_ENCRYPTED_MEDIA. This will allow for the future implementation
of the near-finished API to be guarded with the simple ENABLE_ENCRYPTED_MEDIA guards.

.:

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

No new tests -- no change in behavior.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/encryptedmedia/CDM.cpp:
* Modules/encryptedmedia/CDM.h:
* Modules/encryptedmedia/CDMPrivate.h:
* Modules/encryptedmedia/CDMPrivateClearKey.cpp:
* Modules/encryptedmedia/CDMPrivateClearKey.h:
* Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
* Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
* Modules/encryptedmedia/CDMSessionClearKey.h:
* Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
* Modules/encryptedmedia/MediaKeyMessageEvent.h:
* Modules/encryptedmedia/MediaKeyMessageEvent.idl:
* Modules/encryptedmedia/MediaKeyNeededEvent.cpp:
* Modules/encryptedmedia/MediaKeyNeededEvent.h:
* Modules/encryptedmedia/MediaKeyNeededEvent.idl:
* Modules/encryptedmedia/MediaKeySession.cpp:
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeys.cpp:
* Modules/encryptedmedia/MediaKeys.h:
* Modules/encryptedmedia/MediaKeys.idl:
* bindings/js/JSDictionary.cpp:
* bindings/js/JSDictionary.h:
* dom/Element.idl:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
(WebCore::HTMLMediaElement::webkitAddKey):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/MediaError.h:
* html/MediaError.idl:
* html/MediaKeyError.h:
* html/MediaKeyError.idl:
* page/Settings.h:
* platform/graphics/CDMSession.h:
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
(WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
(WebCore::playerKVOProperties):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockCDM.cpp:
* testing/MockCDM.h:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
* WebProcess/WebProcess.cpp:
(WebKit::m_resourceLoadStatisticsStorage):

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Also remove the
ENABLE_IOS_TEXT_AUTOSIZING feature define that was renamed in r206395 and was
throwing up style checker errors.

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

3 years ago[WK2][NetworkSession] Ping requests should follow redirects if applicable
dbates@webkit.org [Wed, 5 Oct 2016 14:26:40 +0000 (14:26 +0000)]
[WK2][NetworkSession] Ping requests should follow redirects if applicable
https://bugs.webkit.org/show_bug.cgi?id=162580
<rdar://problem/28631274>

Reviewed by Alex Christensen.

Source/WebKit2:

Implement support for following redirects, if applicable, of a ping request when using the
Network Session (ENABLE(NETWORK_SESSION)) code path in WebKit2. For ping requests that are
in response to hyperlink auditing (e.g. <a ping>) we should follow redirect responses.
For Content Security Policy and XSS Auditor violation reports we should not follow redirect
responses.

Currently we always ignore redirects for ping requests that are sent using the Network Session
code path in WebKit2. This behavior disagrees with the behavior described in section
"Hyperlink auditing" of the HTML standard, <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing> (27 September 2016),
as well as the behavior in Legacy WebKit and WebKit2 with Network Session disabled. We should
follow redirects for ping requests initiated as part of hyperlink auditing to more closely
conform to the HTML standard and match the behavior in Legacy WebKit and WebKit2 with Network
Session disabled.

* NetworkProcess/PingLoad.h:

LayoutTests:

Add tests to ensure that we follow redirects for ping requests that are initiated as part
of hyperlink auditing.

Modified http/tests/navigation/resources/save-Ping.php to include the host and request URI
information in the saved report and updated expected results for existing tests as a result
of this change.

* http/tests/contentextensions/block-cookies-in-csp-report-expected.txt:
* http/tests/contentextensions/block-cookies-in-image-load-in-onunload-expected.txt:
* http/tests/contentextensions/block-cookies-in-ping-expected.txt:
* http/tests/contentextensions/hide-on-csp-report-expected.txt:
* http/tests/contentextensions/hide-on-ping-expected.txt:
* http/tests/contentextensions/hide-on-ping-with-ping-that-redirects-expected.txt: Added.
* http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html: Added.
* http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html.json: Added.
* http/tests/contentextensions/resources/save-ping-and-redirect-to-save-ping.php: Added.
* http/tests/contentextensions/resources/save-ping.php:
* http/tests/navigation/image-load-in-pagehide-handler-expected.txt:
* http/tests/navigation/image-load-in-unload-handler-expected.txt:
* http/tests/navigation/ping-attribute/anchor-cookie-expected.txt:
* http/tests/navigation/ping-attribute/anchor-cross-origin-expected.txt:
* http/tests/navigation/ping-attribute/anchor-cross-origin-from-https-expected.txt:
* http/tests/navigation/ping-attribute/anchor-ping-and-do-not-follow-redirect-when-sending-ping-expected.txt: Added.
* http/tests/navigation/ping-attribute/anchor-ping-and-do-not-follow-redirect-when-sending-ping.html: Added.
* http/tests/navigation/ping-attribute/anchor-same-origin-expected.txt:
* http/tests/navigation/ping-attribute/area-cookie-expected.txt:
* http/tests/navigation/ping-attribute/area-cross-origin-expected.txt:
* http/tests/navigation/ping-attribute/area-cross-origin-from-https-expected.txt:
* http/tests/navigation/ping-attribute/area-same-origin-expected.txt:
* http/tests/navigation/resources/save-Ping.php:
* http/tests/navigation/resources/save-ping-and-redirect-to-save-ping.php: Added.

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

3 years agoDo not follow redirects when sending violation report
dbates@webkit.org [Wed, 5 Oct 2016 14:22:43 +0000 (14:22 +0000)]
Do not follow redirects when sending violation report
https://bugs.webkit.org/show_bug.cgi?id=162520
<rdar://problem/27957639>

Reviewed by Alex Christensen.

Source/WebCore:

Do not follow redirects when sending a Content Security Policy or XSS Auditor violation report
as redirects can be used to forward report details to a third-party.

This changes makes WebKit more closely conform to the reporting requirements in section Reporting
of the Content Security Level 2 standard: <https://w3c.github.io/webappsec-csp/2/#violation-reports>
(Editor's Draft, 25 April 2016).

Tests: http/tests/security/contentSecurityPolicy/report-blocked-uri-and-do-not-follow-redirect-when-sending-report.php
       http/tests/security/xssAuditor/report-script-tag-and-do-not-follow-redirect-when-sending-report.html
       http/tests/security/xssAuditor/report-script-tag-full-block-and-do-not-follow-redirect-when-sending-report.html

* loader/LoaderStrategy.h: Modified createPingHandle() to take a boolean, shouldFollowRedirects,
whether to follow redirect responses for a ping request.
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage): Pass ShouldFollowRedirects::Yes to PingLoader::startPingLoad to
keep our current behavior.
(WebCore::PingLoader::sendPing): Ditto. Note our current behavior of following redirects matches
the behavior described in the section "Hyperlink auditing" of the HTML standard:
<https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing> (23 September 2016).
(WebCore::PingLoader::sendViolationReport): Pass ShouldFollowRedirects::No to PingLoader::startPingLoad
so that we do not follow redirects when sending a violation report.
(WebCore::PingLoader::startPingLoad): Modified to take argument shouldFollowRedirects whether to
follow redirect responses for a ping request.
* loader/PingLoader.h:
* platform/network/PingHandle.h: Add boolean m_shouldFollowRedirects. I grouped this boolean with
the existing boolean, m_shouldUseCredentialStorage, as opposed to appending to the end of the class
definition to avoid increasing object size as clang will coalesces the two bools into a single
machine word. Override ResourceHandleClient::willSendRequest() and ResourceHandleClient::willSendRequestAsync()
to follow a redirect, if applicable.

Source/WebKit:

Update implementation of legacy WebKit loader strategy to pass through a boolean,
shouldFollowRedirects, to PingHandle as to whether to follow redirect responses
for a ping request.

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::createPingHandle):
* WebCoreSupport/WebResourceLoadScheduler.h:

Source/WebKit2:

Update the non-Network Session WebKit2 implementation to follow redirect responses for a ping
request, if applicable. I did not update the Network Session implementation at this time. I
will fix it in <https://bugs.webkit.org/show_bug.cgi?id=162580>.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::loadPing): Tell PingHandle whether to follow redirects.
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode): Encode NetworkResourceLoadParameters::shouldFollowRedirects.
(WebKit::NetworkResourceLoadParameters::decode): Decode NetworkResourceLoadParameters::shouldFollowRedirects.
* NetworkProcess/PingLoad.h: Added FIXME comment to implement support for following redirects,
if applicable (for hyperlink auditing). See <https://bugs.webkit.org/show_bug.cgi?id=162580>
for more details.
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::createPingHandle): Modified to take a boolean whether to follow
redirects responses and set NetworkResourceLoadParameters::shouldFollowRedirects as appropriate.
* WebProcess/Network/WebLoaderStrategy.h:

LayoutTests:

Add tests for Content Security Policy and XSS Auditor to ensure that we do not follow redirects
when sending a violation report. Modified http/tests/security/contentSecurityPolicy/resources/save-report.php
to save the URL of the original ping request and conditionally clear cookies. Modified
http/tests/security/xssAuditor/resources/echo-intertag.pl to support testing for the XSS Auditor.
These changes together with the existing HTTP Host information that is saved with the report we can detect
if a redirect occurred when saving a report.

Updated expected results of existing tests now that we emit the URL of the ping request in the saved report.

* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-cross-origin-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-cross-origin-https-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-same-origin-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-same-origin-https-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt:
* http/tests/security/contentSecurityPolicy/report-and-enforce-expected.txt:
* http/tests/security/contentSecurityPolicy/report-blocked-data-uri-expected.txt:
* http/tests/security/contentSecurityPolicy/report-blocked-file-uri-expected.txt:
* http/tests/security/contentSecurityPolicy/report-blocked-uri-and-do-not-follow-redirect-when-sending-report-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/report-blocked-uri-and-do-not-follow-redirect-when-sending-report.php: Added.
* http/tests/security/contentSecurityPolicy/report-blocked-uri-cross-origin-expected.txt:
* http/tests/security/contentSecurityPolicy/report-blocked-uri-expected.txt:
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-expected.txt:
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-only-expected.txt:
* http/tests/security/contentSecurityPolicy/report-only-from-header-expected.txt:
* http/tests/security/contentSecurityPolicy/report-only-upgrade-insecure-expected.txt:
* http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-expected.txt:
* http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-from-child-frame-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-from-inline-javascript-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-from-javascript-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-scheme-relative-expected.txt:
* http/tests/security/contentSecurityPolicy/resources/save-report-and-redirect-to-save-report.php: Added.
* http/tests/security/contentSecurityPolicy/resources/save-report.php:
* http/tests/security/xssAuditor/report-script-tag-and-do-not-follow-redirect-when-sending-report-expected.txt: Added.
* http/tests/security/xssAuditor/report-script-tag-and-do-not-follow-redirect-when-sending-report.html: Added.
* http/tests/security/xssAuditor/report-script-tag-expected.txt:
* http/tests/security/xssAuditor/report-script-tag-full-block-and-do-not-follow-redirect-when-sending-report-expected.txt: Added.
* http/tests/security/xssAuditor/report-script-tag-full-block-and-do-not-follow-redirect-when-sending-report.html: Added.
* http/tests/security/xssAuditor/report-script-tag-full-block-expected.txt:
* http/tests/security/xssAuditor/report-script-tag-replace-state-expected.txt:
* http/tests/security/xssAuditor/resources/echo-intertag.pl:

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

3 years agoARM EABI buildfix after r206778
ossy@webkit.org [Wed, 5 Oct 2016 10:51:06 +0000 (10:51 +0000)]
ARM EABI buildfix after r206778
https://bugs.webkit.org/show_bug.cgi?id=162964

Unreviewed trivial fix.

* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsWithExecState):

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

3 years ago[SOUP] Move global TLS errors handling from ResourceHandle to SoupNetworkSession
carlosgc@webkit.org [Wed, 5 Oct 2016 09:43:28 +0000 (09:43 +0000)]
[SOUP] Move global TLS errors handling from ResourceHandle to SoupNetworkSession
https://bugs.webkit.org/show_bug.cgi?id=162910

Reviewed by Alex Christensen.

Source/WebCore:

So that it will be shared with network session code. Also remove setHostAllowsAnyHTTPSCertificate() that we have
never actually used.

* platform/network/ResourceHandle.h:
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::tlsErrorsChangedCallback): Use SoupNetworkSession::checkTLSErrors().
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::HostTLSCertificateSet::add):
(WebCore::HostTLSCertificateSet::contains):
(WebCore::HostTLSCertificateSet::computeCertificateHash):
(WebCore::clientCertificates):
(WebCore::SoupNetworkSession::setShouldIgnoreTLSErrors):
(WebCore::SoupNetworkSession::checkTLSErrors):
(WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
* platform/network/soup/SoupNetworkSession.h:

Source/WebKit2:

Use SoupNetworkSession instead of ResourceHandle.

* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::setIgnoreTLSErrors):
(WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost):

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

3 years agoUnreviewed. Fix GTK+ build with USE_REDIRECTED_XCOMPOSITE_WINDOW disabled.
carlosgc@webkit.org [Wed, 5 Oct 2016 09:23:52 +0000 (09:23 +0000)]
Unreviewed. Fix GTK+ build with USE_REDIRECTED_XCOMPOSITE_WINDOW disabled.

* UIProcess/AcceleratedDrawingAreaProxy.cpp:
(WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):

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

3 years ago[SOUP] Move request HTTP body handling to ResourceRequestSoup and simplify it
carlosgc@webkit.org [Wed, 5 Oct 2016 07:08:38 +0000 (07:08 +0000)]
[SOUP] Move request HTTP body handling to ResourceRequestSoup and simplify it
https://bugs.webkit.org/show_bug.cgi?id=162891

Reviewed by Michael Catanzaro.

We are currently adding the HTTP body to the message in ResourceHandleSoup, but we could do it as part of the
ResourceRequest::updateSoupMessage() method, since the HTTP body is indeed part of the request. The code can be
also simplified, especially the handling of files, by using SharedBuffer that already mmaps the file when
possible, instead of using GMappedFile API.

* platform/SharedBuffer.h: Add createSoupBuffer() method.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::createSoupMessageForHandleAndRequest):
(WebCore::milisecondsSinceRequest): Deleted.
(WebCore::ResourceHandle::didStartRequest): Deleted.
(WebCore::startingCallback): Deleted.
(WebCore::networkEventCallback): Deleted.
(WebCore::ResourceHandle::start): Deleted.
(WebCore::ResourceHandle::releaseForDownload): Deleted.
(WebCore::ResourceHandle::timeoutFired): Deleted.
* platform/network/soup/ResourceRequest.h:
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::appendEncodedBlobItemToSoupMessageBody): Helper method to append the blob to the request message body.
(WebCore::ResourceRequest::updateSoupMessageBody): Add HTTPBody to the request message body.
(WebCore::ResourceRequest::updateSoupMessage): Call updateSoupMessageBody() to also update the body.
* platform/soup/SharedBufferSoup.cpp:
(WebCore::SharedBuffer::createSoupBuffer): Returns a new SoupBuffer for the SharedBuffer.

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

3 years agoString.prototype.toLowerCase should be a DFG/FTL intrinsic
sbarati@apple.com [Wed, 5 Oct 2016 06:16:15 +0000 (06:16 +0000)]
String.prototype.toLowerCase should be a DFG/FTL intrinsic
https://bugs.webkit.org/show_bug.cgi?id=162887

Reviewed by Filip Pizlo and Yusuke Suzuki.

JSTests:

* microbenchmarks/to-lower-case.js: Added.
(assert):
(foo):
(bar):
* stress/to-lower-case.js: Added.
(assert):
(foo):

Source/JavaScriptCore:

This patch makes ToLowerCase an intrinsic in the DFG/FTL. On the fast
path, the intrinsic will loop over an 8-bit string ensuring it's already
lower case, and simply return the string. In the slow path, it'll call
into C code to make a new string.

This is a 7-8% speedup on ES6SampleBench/Basic.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileToLowerCase):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileToLowerCase):
* jit/JITOperations.h:
* runtime/Intrinsic.h:
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):

Source/WTF:

This patch exposes a new StringImpl function called convertToLowercaseWithoutLocaleStartingAtFailingIndex8Bit
which extracts slow path for the 8-bit part of convertToLowercaseWithoutLocale
into a helper function. I decided to extract this into its own function because
it may be the case that JSCs JITs will want to continue the operation
after it has already ensured that part of an 8-bit string is lower case.

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToLowercaseWithoutLocale):
(WTF::StringImpl::convertToLowercaseWithoutLocaleStartingAtFailingIndex8Bit):
* wtf/text/StringImpl.h:
* wtf/text/WTFString.cpp:
(WTF::String::convertToLowercaseWithoutLocaleStartingAtFailingIndex8Bit):
* wtf/text/WTFString.h:

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

3 years agoImplement KeyboardEvent.code from the UI Event spec
cdumez@apple.com [Wed, 5 Oct 2016 03:13:35 +0000 (03:13 +0000)]
Implement KeyboardEvent.code from the UI Event spec
https://bugs.webkit.org/show_bug.cgi?id=149584

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt:

Source/WebCore:

Add support for Keyboard.code attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-code
- https://w3c.github.io/uievents-code/

The feature is only enabled on Mac for now as the implementation is
platform-specific and Mac only.

Test: fast/events/keyboardevent-code.html

* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::code):
(WebCore::PlatformKeyboardEvent::unmodifiedText): Deleted.
* platform/mac/PlatformEventFactoryMac.h:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::codeForKeyEvent):
(WebCore::keyIdentifierForKeyEvent):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
(JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):

Source/WebKit2:

Add support for Keyboard.code attribute:
- https://w3c.github.io/uievents/#dom-keyboardevent-code
- https://w3c.github.io/uievents-code/

* Shared/WebEvent.h:
(WebKit::WebKeyboardEvent::code):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
(WebKit::WebKeyboardEvent::encode):
(WebKit::WebKeyboardEvent::decode):
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebKeyboardEvent):

Source/WTF:

Add build time flag to toggle support for the code attribute on
KeyboardEvent and only enable it on Mac for now, given that the
implementation is missing on other platforms.

* wtf/FeatureDefines.h:

LayoutTests:

Extend layout test coverage.

* fast/events/arrow-keys-on-body-expected.txt:
* fast/events/arrow-keys-on-body.html:
* fast/events/constructors/keyboard-event-constructor-expected.txt:
* fast/events/constructors/keyboard-event-constructor.html:
* fast/events/key-events-in-input-button-expected.txt:
* fast/events/key-events-in-input-button.html:
* fast/events/key-events-in-input-text-expected.txt:
* fast/events/key-events-in-input-text.html:
* fast/events/keyboardevent-code-expected.txt: Added.
* fast/events/keyboardevent-code.html: Added.
* fast/events/special-key-events-in-input-text-expected.txt:
* fast/events/special-key-events-in-input-text.html:

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

3 years agoThe dragged image should be the current frame only of the animated image
commit-queue@webkit.org [Wed, 5 Oct 2016 01:52:35 +0000 (01:52 +0000)]
The dragged image should be the current frame only of the animated image
https://bugs.webkit.org/show_bug.cgi?id=162109

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-10-04
Reviewed by Tim Horton.

Source/WebCore:

Instead of creating an NSImage with all the frames for the dragImage,
create an NSImage with the current frame only.

* dom/DataTransferMac.mm:
(WebCore::DataTransfer::createDragImage): Call snapshotNSImage() to create the dragImage.
* editing/cocoa/HTMLConverter.mm:
(fileWrapperForElement):  Call the Image function with its new name.
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::nsImage): Rename getNSImage() to nsImage().
(WebCore::Image::snapshotNSImage): Returns the NSImage of the current frame.
(WebCore::Image::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::Image::getNSImage): Deleted.
(WebCore::Image::getTIFFRepresentation): Deleted.
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
(WebCore::BitmapImage::nsImage): Rename getNSImage() to nsImage().
(WebCore::BitmapImage::snapshotNSImage): Returns the NSImage of the current frame.
(WebCore::BitmapImage::getTIFFRepresentation): Deleted.
(WebCore::BitmapImage::getNSImage): Deleted.
* platform/mac/CursorMac.mm:
(WebCore::createCustomCursor): Call snapshotNSImage() since the cursor does not animate anyway.
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageFromImage): Use snapshotNSImage() for the dragImage.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write): Call the Image function with its new name.

Source/WebKit/mac:

* DOM/DOM.mm:
(-[DOMElement image]): Call the Image function with its new name.
(-[DOMElement _imageTIFFRepresentation]): Ditto.
* Misc/WebElementDictionary.mm:
(-[WebElementDictionary _image]): Call the Image function with its new name.
* Misc/WebIconDatabase.mm:
(-[WebIconDatabase defaultIconWithSize:]): Call snapshotNSImage() to create the icon image.
(webGetNSImage): Call the Image function with its new name.
* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::imageForCurrentSharingServicePickerItem): Call snapshotNSImage() instead of nsImage()..
(WebContextMenuClient::contextMenuForEvent): Ditto.
* WebView/WebHTMLView.mm:
(-[WebHTMLView pasteboard:provideDataForType:]): Call the Image function with its new name.

Source/WebKit2:

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::provideDataForPasteboard): Call the Image function with its new name.

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

3 years ago[iOS] Crash in WebResourceLoaderQuickLookDelegate when the client cancels the navigat...
aestes@apple.com [Wed, 5 Oct 2016 01:02:27 +0000 (01:02 +0000)]
[iOS] Crash in WebResourceLoaderQuickLookDelegate when the client cancels the navigation to a QuickLook resource
https://bugs.webkit.org/show_bug.cgi?id=162950
<rdar://problem/23759114>

Reviewed by Brady Eidson.

Source/WebCore:

When we receive data from QLPreviewConverter for the first time, we call
ResourceLoader::didReceiveResponse() with the preview NSURLResponse from QuickLook. If the
client decides to cancel this navigation in decidePolicyForResponse(),
WebResourceLoaderQuickLookDelegate will end up with a null _resourceLoader after
didReceiveResponse() returns. This change adds null checks in the methods that use
_resourceLoader after calling -_sendDidReceiveResponseIfNecessary.

New API test: QuickLook.CancelNavigationAfterResponse

* platform/network/ios/QuickLook.mm:
(-[WebResourceLoaderQuickLookDelegate connection:didReceiveDataArray:]): Changed to only
call ResourceLoader::didReceiveDataArray() if _resourceLoader is non-null.
(-[WebResourceLoaderQuickLookDelegate connection:didReceiveData:lengthReceived:]): Ditto for
ResourceLoader::didReceiveData().
(-[WebResourceLoaderQuickLookDelegate connection:didFailWithError:]): Ditto for
ResourceLoader::didFail().

Tools:

Added a new API test.

* TestWebKitAPI/Tests/WebKit2Cocoa/QuickLook.mm: Sorted imports and removed redundant
initialization of static bools.
(runTest): Factored out the common test logic between QuickLook.NavigationDelegate and
QuickLook.CancelNavigationAfterResponse.
(TEST): Added QuickLook.CancelNavigationAfterResponse.
(-[QuickLookDecidePolicyDelegate
webView:decidePolicyForNavigationResponse:decisionHandler:]): Canceled the navigation.
(-[QuickLookDecidePolicyDelegate webView:didFailProvisionalNavigation:withError:]): Set
isDone to true.

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

3 years agoAdd the support for running ES6SampleBench to run-benchmark
rniwa@webkit.org [Wed, 5 Oct 2016 00:42:37 +0000 (00:42 +0000)]
Add the support for running ES6SampleBench to run-benchmark
https://bugs.webkit.org/show_bug.cgi?id=162890

Reviewed by Saam Barati.

Added the support for running ES6SampleBench as "es6bench".
e.g. ./Tools/Scripts/run-benchmark --platform osx --plan es6bench --browser safari

Instead of the default 10 iterations, run the test 4 iterations using 5 instances of browser
for the total of 20 iterations.

* Scripts/webkitpy/benchmark_runner/data/patches/ES6SampleBench.patch: Added.
* Scripts/webkitpy/benchmark_runner/data/plans/es6bench.plan: Added.
* Scripts/webkitpy/benchmark_runner/run_benchmark.py:
(start): Fixed the bug that the linter will complain about the presence of "debugOutput" by
removing it if it's present.

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

3 years agoRevert a change erroneously committed in r206795.
rniwa@webkit.org [Wed, 5 Oct 2016 00:40:25 +0000 (00:40 +0000)]
Revert a change erroneously committed in r206795.

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

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

3 years ago[iOS WK2] Make it possible for a test to describe a user gesture as a stream of event...
simon.fraser@apple.com [Wed, 5 Oct 2016 00:23:51 +0000 (00:23 +0000)]
[iOS WK2] Make it possible for a test to describe a user gesture as a stream of events in JSON format
https://bugs.webkit.org/show_bug.cgi?id=162934

Reviewed by Dean Jackson.

Tools:

With this change, a test can describe a user gesture in an "event stream", which is
some JSON describing an array of events with their underlying touches. The added
test describes a single tap.

The implementation fires up an NSThread, and sleeps the thread between events to dispatch
them at close to real time.

In future, HIDEventGenerator could use this internally for all of the "compound" interactions.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::sendEventStream):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::sendEventStream):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/HIDEventGenerator.h:
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(transducerTypeFromString):
(phaseFromString):
(-[HIDEventGenerator eventMaskFromEventInfo:]):
(-[HIDEventGenerator touchFromEventInfo:]):
(-[HIDEventGenerator _createIOHIDEventWithInfo:]):
(-[HIDEventGenerator dispatchEventWithInfo:]):
(-[HIDEventGenerator eventDispatchThreadEntry:]):
(-[HIDEventGenerator sendEventStream:completionBlock:]):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::sendEventStream):

LayoutTests:

* fast/events/ios/event-stream-single-tap-expected.txt: Added.
* fast/events/ios/event-stream-single-tap.html: Added.

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

3 years agoWeb Inspector: don't synchronously send a listing message if we might need to query...
bburg@apple.com [Wed, 5 Oct 2016 00:15:39 +0000 (00:15 +0000)]
Web Inspector: don't synchronously send a listing message if we might need to query _WKAutomationDelegate
https://bugs.webkit.org/show_bug.cgi?id=162810
<rdar://problem/28571460>

Reviewed by Timothy Hatcher.

We shouldn't ever access the _WKAutomationDelegate through RemoteInspector::Client methods
off of the main thread, because it could cause problems. This happens when we pushListingsNow()
in response to a WIRApplicationGetListingMessage XPC message. In this case, just use
pushListingsSoon() since it dispatches on the correct (main) queue to gather listing information.

This may induce a slight update delay when first connecting to the UIProcess through RemoteInspector,
but this is at most 200ms and will coalesce with other updates that happen when UIProcess gets set up.

There are no other code paths through RemoteInspector (for UIProcess) that could cause a call
to pushListingsNow(), so this only needs to be changed in the XPC message handler.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::receivedGetListingMessage):

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

3 years agoAdd support for KeyboardEvent.isComposing attribute
cdumez@apple.com [Wed, 5 Oct 2016 00:02:48 +0000 (00:02 +0000)]
Add support for KeyboardEvent.isComposing attribute
https://bugs.webkit.org/show_bug.cgi?id=162921

Reviewed by Darin Adler.

Source/WebCore:

Add support for KeyboardEvent.isComposing attribute:
- https://www.w3.org/TR/uievents/#dom-keyboardevent-iscomposing
- https://www.w3.org/TR/uievents/#ref-for-dom-keyboardevent-iscomposing-3

Manual test: https://jsfiddle.net/ay92sr08/9/

No new tests, extended existing tests.

* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:

LayoutTests:

Extend layout test coverage to test KeyboardEvent.isComposing.

* editing/mac/input/kotoeri-enter-to-confirm-and-newline-expected.txt:
* editing/mac/input/kotoeri-enter-to-confirm-and-newline.html:
* fast/events/constructors/keyboard-event-constructor-expected.txt:
* fast/events/constructors/keyboard-event-constructor.html:

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

3 years agoShadowRoot interface should have elementFromPoint
rniwa@webkit.org [Tue, 4 Oct 2016 23:42:18 +0000 (23:42 +0000)]
ShadowRoot interface should have elementFromPoint
https://bugs.webkit.org/show_bug.cgi?id=162882

Reviewed by Chris Dumez.

Source/WebCore:

Add elementFromPoint to ShadowRoot's prototype as specified at:
https://www.w3.org/TR/shadow-dom/#extensions-to-the-documentorshadowroot-mixin
with changes proposed at https://github.com/w3c/csswg-drafts/issues/556

Added TreeScope::retargetToScope which implements

This patch also factors DocumentOrShadowRoot.idl out of Document and ShadowRoot interfaces to better match
the latest DOM specification: https://dom.spec.whatwg.org/#mixin-documentorshadowroot

Test: fast/shadow-dom/Document-prototype-elementFromPoint.html

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::nodeFromPoint): Moved to TreeScope.
(WebCore::Document::elementFromPoint): Moved to TreeScope.
* dom/Document.h:
* dom/Document.idl: Moved elementFromPoint and activeElement to DocumentOrShadowRoot.idl.
* dom/DocumentOrShadowRoot.idl: Added.
* dom/EventPath.cpp:
(WebCore::RelatedNodeRetargeter::checkConsistency): Use newly added TreeScope::retargetToScope.
* dom/ShadowRoot.idl: Moved activeElement to DocumentOrShadowRoot.idl.
* dom/TreeScope.cpp:
(WebCore::TreeScope::retargetToScope): Added. Implements https://dom.spec.whatwg.org/#retarget efficiently.
Instead of checking whether A (node) is a shadow-including inclusive ancestor of B (this scope) at each
parent, find the lowest ancestor which contains both A and B, and return the self-inclusive ancestor of B
in that tree. To find the lowest common ancestor in O(n), traverse all ancestors of A and B separately and
do a top-down traversal. The last tree scope in which A's ancestor and B's ancestor match is the lowest
common ancestor.
(WebCore::TreeScope::nodeFromPoint): Moved from Document.
(WebCore::TreeScope::elementFromPoint): Moved from Document. Use retargetToScope and parentInComposedTree
instead of parentNode and ancestorInThisScope to match the semantics proposed in
https://github.com/w3c/csswg-drafts/issues/556
* dom/TreeScope.h:

LayoutTests:

Add a W3C style testharness.js test for elementFromPoint on ShadowRoot.

* fast/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint-expected.txt: Added.
* fast/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html: Added.

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

3 years agoWebAssembly: handle a few corner cases
jfbastien@apple.com [Tue, 4 Oct 2016 23:25:33 +0000 (23:25 +0000)]
WebAssembly: handle a few corner cases
https://bugs.webkit.org/show_bug.cgi?id=162884

Reviewed by Keith Miller.

JSTests:

* stress/wasm/generate-wasmops-header.js:
(const.opcodeIterator): max opcode value

Source/JavaScriptCore:

* wasm/JSWASMModule.cpp: missing include broke cmake build
* wasm/WASMFunctionParser.h:
(JSC::WASM::FunctionParser<Context>::parseBlock): check op is valid
(JSC::WASM::FunctionParser<Context>::parseExpression): switch covers all cases
* wasm/WASMOps.h:
(JSC::WASM::isValidOpType): op is valid
* wasm/WASMParser.h:
(JSC::WASM::Parser::consumeString): avoid str[i] being one-past-the-end
(JSC::WASM::Parser::parseUInt32): shift math around to avoid overflow

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

3 years agoAdd Megan to contributor's list
commit-queue@webkit.org [Tue, 4 Oct 2016 23:20:39 +0000 (23:20 +0000)]
Add Megan to contributor's list
https://bugs.webkit.org/show_bug.cgi?id=162944

Patch by Megan Gardner <megan_gardner@apple.com> on 2016-10-04
Reviewed by Tim Horton.

Add Megan to the contributor's lists so that her e-mail autocompletes for CC

* Scripts/webkitpy/common/config/contributors.json:

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

3 years agoAdd tests verifying non-special URL hosts are parsed according to spec
achristensen@apple.com [Tue, 4 Oct 2016 23:13:33 +0000 (23:13 +0000)]
Add tests verifying non-special URL hosts are parsed according to spec
https://bugs.webkit.org/show_bug.cgi?id=162885

Reviewed by Sam Weinig.

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

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

3 years agofont-family: cursive should map to KaiTi in Chinese
mmaxfield@apple.com [Tue, 4 Oct 2016 23:10:26 +0000 (23:10 +0000)]
font-family: cursive should map to KaiTi in Chinese
https://bugs.webkit.org/show_bug.cgi?id=162889
<rdar://problem/28363547>

Reviewed by Tim Horton.

Source/WebCore:

According to Bobby Tung, this is a better mapping. Previously, we were
relying on the system fallback mechanism. However, an explicit mapping
is more robust.

Test: fast/text/cursive-zh.html

* page/cocoa/SettingsCocoa.mm:
(WebCore::Settings::initializeDefaultFontFamilies):

LayoutTests:

* fast/text/cursive-zh-expected.html: Added.
* fast/text/cursive-zh.html: Added.

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

3 years agoREGRESSION (r206778): Release JSC test ChakraCore.yaml/ChakraCore/test/Error/validate...
utatane.tea@gmail.com [Tue, 4 Oct 2016 22:51:38 +0000 (22:51 +0000)]
REGRESSION (r206778): Release JSC test ChakraCore.yaml/ChakraCore/test/Error/validate_line_column.js.default failing
https://bugs.webkit.org/show_bug.cgi?id=162937

Reviewed by Saam Barati.

We dropped expression info accidentally at r206777.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitCallDefineProperty):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::PropertyListNode::emitPutConstantProperty):
(JSC::ClassExprNode::emitBytecode):

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

3 years agoProperly kill web processes in the launching state
andersca@apple.com [Tue, 4 Oct 2016 22:41:01 +0000 (22:41 +0000)]
Properly kill web processes in the launching state
https://bugs.webkit.org/show_bug.cgi?id=162938

Reviewed by Tim Horton.

Source/WebKit2:

* UIProcess/Launcher/ProcessLauncher.h:
Add m_xpcConnection member.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
Store the XPC connection in the m_xpcConnection member variable.
In the reply handler, handle m_xpcConnection being null.

(WebKit::ProcessLauncher::platformInvalidate):
Cancel and kill the connection.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::terminateProcess):
Get rid of an assertion.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::requestTermination):
Handle the launching state.

Tools:

* TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp:
Enable this test again.

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

3 years agoMarking http/tests/cache/disk-cache/disk-cache-media.html as flaky on mac-wk2.
ryanhaddad@apple.com [Tue, 4 Oct 2016 22:26:44 +0000 (22:26 +0000)]
Marking http/tests/cache/disk-cache/disk-cache-media.html as flaky on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=162946

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoMarking http/tests/cache/disk-cache/disk-cache-request-max-stale.html as flaky on...
ryanhaddad@apple.com [Tue, 4 Oct 2016 22:26:41 +0000 (22:26 +0000)]
Marking http/tests/cache/disk-cache/disk-cache-request-max-stale.html as flaky on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=162945

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoMarking http/tests/cache/disk-cache/resource-becomes-uncacheable.html as flaky on...
ryanhaddad@apple.com [Tue, 4 Oct 2016 22:11:01 +0000 (22:11 +0000)]
Marking http/tests/cache/disk-cache/resource-becomes-uncacheable.html as flaky on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=161649

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoMarking transitions/background-position-transitions.html as flaky.
ryanhaddad@apple.com [Tue, 4 Oct 2016 21:52:00 +0000 (21:52 +0000)]
Marking transitions/background-position-transitions.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=162881

Unreviewed test gardening.

* TestExpectations:

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

3 years agoURLParser: query-only URLs relative to file URLs should just add a query
achristensen@apple.com [Tue, 4 Oct 2016 21:22:34 +0000 (21:22 +0000)]
URLParser: query-only URLs relative to file URLs should just add a query
https://bugs.webkit.org/show_bug.cgi?id=162888

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):
Like bug 206749 but with queries instead of fragments.

Tools:

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

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