WebKit-https.git
2 years agoMake it possible to test non-stable-state scrolling on iOS
simon.fraser@apple.com [Sat, 19 Nov 2016 19:02:04 +0000 (19:02 +0000)]
Make it possible to test non-stable-state scrolling on iOS
https://bugs.webkit.org/show_bug.cgi?id=164905

Reviewed by Dan Bernstein.

Source/WebKit2:

Make it possible for an iOS layout test to force every visible rect update
from the UI process to the web process to be in a non-stable state. This emulates
what happens during panning and zooming interactions, and allows us to test the
scrolling and layer trees in these transient states.

This is done by adding a testing property on WKWebView, _stableStateOverride, whose
getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView
consults the NSNumber's boolValue and uses it to override the stable state.

To facilitate this kind of testing, also add immediateScrollToOffset() and
immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate()
which provides a callback that fires after one trip to the web process and back.

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

Tools:

Make it possible for an iOS layout test to force every visible rect update
from the UI process to the web process to be in a non-stable state. This emulates
what happens during panning and zooming interactions, and allows us to test the
scrolling and layer trees in these transient states.

This is done by adding a testing property on WKWebView, _stableStateOverride, whose
getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView
consults the NSNumber's boolValue and uses it to override the stable state.

To facilitate this kind of testing, also add immediateScrollToOffset() and
immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate()
which provides a callback that fires after one trip to the web process and back.

Add code generation support for optional boolean attributes in IDL.

Align CodeGeneratorDumpRenderTree.pm and CodeGeneratorTestRunner.pm.

* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
(_generateImplementationFile):
(_platformTypeConstructor):
(_returnExpression):
* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::doAfterPresentationUpdate):
(WTR::contentOffsetBoundedInValidRange):
(WTR::UIScriptController::scrollToOffset):
(WTR::UIScriptController::immediateScrollToOffset):
(WTR::UIScriptController::immediateZoomToScale):
(WTR::UIScriptController::stableStateOverride):
(WTR::UIScriptController::setStableStateOverride):
* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::doAfterPresentationUpdate):
* TestRunnerShared/Bindings/JSWrappable.h:
(WTR::JSValueMakeBooleanOrNull):
(WTR::JSValueToNullableBoolean):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::immediateScrollToOffset):
(WTR::UIScriptController::immediateZoomToScale):
(WTR::UIScriptController::stableStateOverride):
(WTR::UIScriptController::setStableStateOverride):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
(_classRefGetter):
(_platformTypeConstructor):
(_returnExpression):
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView dealloc]):
(-[TestRunnerWKWebView _stableStateOverride]):
(-[TestRunnerWKWebView _setStableStateOverride:]):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::doAsyncTask):
(WTR::UIScriptController::doAfterPresentationUpdate):
(WTR::UIScriptController::zoomToScale):
(WTR::UIScriptController::immediateScrollToOffset):
(WTR::UIScriptController::immediateZoomToScale):
(WTR::UIScriptController::stableStateOverride):
(WTR::UIScriptController::setStableStateOverride):
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::doAfterPresentationUpdate):

LayoutTests:

* scrollingcoordinator/ios/non-stable-viewport-scroll-expected.txt: Added.
* scrollingcoordinator/ios/non-stable-viewport-scroll.html: Added.

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

2 years agoAdd --timeoutMultiplier option to allow some tests more time to run.
mark.lam@apple.com [Sat, 19 Nov 2016 17:39:25 +0000 (17:39 +0000)]
Add --timeoutMultiplier option to allow some tests more time to run.
https://bugs.webkit.org/show_bug.cgi?id=164951

Reviewed by Yusuke Suzuki.

JSTests:

Extended the timeout for these tests by 50% more because they run quite slow on
low-end machines.

* stress/op_div-ConstVar.js:
* stress/op_div-VarConst.js:
* stress/op_div-VarVar.js:

Source/JavaScriptCore:

* jsc.cpp:
(timeoutThreadMain):
- Modified to factor in a timeout multiplier that can adjust the timeout duration.
(startTimeoutThreadIfNeeded):
- Moved the code that starts the timeout thread here from main() so that we can
call it after command line args have been parsed instead.
(main):
- Deleted old timeout thread starting code.
(CommandLine::parseArguments):
- Added parsing of the --timeoutMultiplier option.
(jscmain):
- Start the timeout thread if needed after we've parsed the command line args.

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

2 years agoAX: [ATK] Expose aria-busy via ATK_STATE_BUSY
jdiggs@igalia.com [Sat, 19 Nov 2016 08:08:03 +0000 (08:08 +0000)]
AX: [ATK] Expose aria-busy via ATK_STATE_BUSY
https://bugs.webkit.org/show_bug.cgi?id=164909

Reviewed by Chris Fleizach.

Source/WebCore:

Expose aria-busy via ATK_STATE_BUSY. Also rename ariaLiveRegionBusy()
to isBusy() because in ARIA 1.1 aria-busy is no longer limited to live
regions.

Test: accessibility/aria-busy.html

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isBusy):
(WebCore::AccessibilityObject::ariaLiveRegionBusy): Deleted.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isBusy):
(WebCore::AccessibilityRenderObject::ariaLiveRegionBusy): Deleted.
* accessibility/AccessibilityRenderObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkStateSetFromCoreObject):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityARIAIsBusy]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

Tools:

Implement boolAttributeValue() for ATK so we can test AXElementBusy.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::boolAttributeValue):

LayoutTests:

* accessibility/aria-busy-expected.txt: Added.
* accessibility/aria-busy.html: Added.

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

2 years agoFix missing exception checks in JSC inspector files.
mark.lam@apple.com [Sat, 19 Nov 2016 08:03:48 +0000 (08:03 +0000)]
Fix missing exception checks in JSC inspector files.
https://bugs.webkit.org/show_bug.cgi?id=164959

Reviewed by Saam Barati.

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::getInternalProperties):
(Inspector::JSInjectedScriptHost::weakMapEntries):
(Inspector::JSInjectedScriptHost::weakSetEntries):
(Inspector::JSInjectedScriptHost::iteratorEntries):
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::scopeDescriptions):

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

2 years agoREGRESSION(r200964): Tab focus navigation is broken on results.en.voyages-sncf.com
rniwa@webkit.org [Sat, 19 Nov 2016 08:02:03 +0000 (08:02 +0000)]
REGRESSION(r200964): Tab focus navigation is broken on results.en.voyages-sncf.com
https://bugs.webkit.org/show_bug.cgi?id=164888

Reviewed by Antti Koivisto.

Source/WebCore:

The bug was caused by FocusNavigationScope::parentInScope incorrectly returning nullptr when moving out of
a user agent shadow tree of a SVG use element. Fixed the bug by explicitly checking against the focus scope's
root node or its slot element. Also removed a superfluous early return when the parent node is a focus scope.

Tests: fast/shadow-dom/focus-navigation-out-of-slot.html
       fast/shadow-dom/focus-navigation-passes-shadow-host.html
       fast/shadow-dom/focus-navigation-passes-svg-use-element.html

* page/FocusController.cpp:
(WebCore::FocusNavigationScope::parentInScope):

LayoutTests:

Add regression tests for moving the focus across a shadow tree and a SVG use element
and the one that moves out of a slot element.

* fast/shadow-dom/focus-navigation-out-of-slot-expected.txt: Added.
* fast/shadow-dom/focus-navigation-out-of-slot.html: Added.
* fast/shadow-dom/focus-navigation-passes-shadow-host-expected.txt: Added.
* fast/shadow-dom/focus-navigation-passes-shadow-host.html: Added.
* fast/shadow-dom/focus-navigation-passes-svg-use-element-expected.txt: Added.
* fast/shadow-dom/focus-navigation-passes-svg-use-element.html: Added.
* platform/ios-simulator/TestExpectations: Skip the newly added tests on iOS.

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

2 years ago[iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into...
simon.fraser@apple.com [Sat, 19 Nov 2016 07:35:47 +0000 (07:35 +0000)]
[iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
https://bugs.webkit.org/show_bug.cgi?id=164980

Reviewed by Chris Dumez.

Source/WebCore:

WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
flag that impacts tile coverage.

During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().

Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.

Tests: fast/scrolling/ios/scroll-events-default.html
       fast/scrolling/ios/scroll-events-responsive.html
       fast/scrolling/ios/scroll-events-unresponsive.html

* page/Page.h:
(WebCore::Page::eventThrottlingBehaviorOverride):
(WebCore::Page::setEventThrottlingBehaviorOverride):
* testing/Internals.cpp:
(WebCore::Internals::setEventThrottlingBehaviorOverride):
(WebCore::Internals::eventThrottlingBehaviorOverride):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
flag that impacts tile coverage.

During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().

Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetEventThrottlingBehaviorOverride):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::eventThrottlingDelay):

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::prepare):

LayoutTests:

* fast/scrolling/ios/scroll-events-default-expected.txt: Added.
* fast/scrolling/ios/scroll-events-default.html: Added.
* fast/scrolling/ios/scroll-events-responsive-expected.txt: Added.
* fast/scrolling/ios/scroll-events-responsive.html: Added.
* fast/scrolling/ios/scroll-events-unresponsive-expected.txt: Added.
* fast/scrolling/ios/scroll-events-unresponsive.html: Added.

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

2 years agoUnreviewed attempt to fix the build after r208917.
cdumez@apple.com [Sat, 19 Nov 2016 05:09:02 +0000 (05:09 +0000)]
Unreviewed attempt to fix the build after r208917.

* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll):

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

2 years agoUnreviewed attempt to fix the build after r208917.
cdumez@apple.com [Sat, 19 Nov 2016 04:45:47 +0000 (04:45 +0000)]
Unreviewed attempt to fix the build after r208917.

* dom/CustomElementReactionQueue.cpp:

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

2 years agoUpdate SubtleCrypto::decrypt to match the latest spec
jiewen_tan@apple.com [Sat, 19 Nov 2016 04:38:59 +0000 (04:38 +0000)]
Update SubtleCrypto::decrypt to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164739
<rdar://problem/29257848>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt:
* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::decrypt method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-decrypt.
   It also refers to the latest Editor's Draft to a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-decrypt.
2. It implements decrypt operations of the following algorithms: AES-CBC,
   RSAES-PKCS1-V1_5, and RSA-OAEP.

Tests: crypto/subtle/aes-cbc-decrypt-malformed-parameters.html
       crypto/subtle/aes-cbc-generate-key-encrypt-decrypt.html
       crypto/subtle/aes-cbc-import-key-decrypt.html
       crypto/subtle/decrypt-malformed-parameters.html
       crypto/subtle/rsa-oaep-decrypt-malformed-parameters.html
       crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label.html
       crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt.html
       crypto/subtle/rsa-oaep-import-key-decrypt-label.html
       crypto/subtle/rsa-oaep-import-key-decrypt.html
       crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt.html
       crypto/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html
       crypto/workers/subtle/aes-cbc-import-key-decrypt.html
       crypto/workers/subtle/rsa-oaep-import-key-decrypt.html
       crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::toCryptoKey):
(WebCore::toVector):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::jsSubtleCryptoFunctionDecryptPromise):
(WebCore::jsSubtleCryptoFunctionExportKeyPromise):
(WebCore::JSSubtleCrypto::decrypt):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::decrypt):
* crypto/CryptoAlgorithm.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
* crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
(WebCore::decryptRSAES_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::decryptRSA_OAEP):
(WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):

LayoutTests:

* crypto/subtle/aes-cbc-decrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/aes-cbc-decrypt-malformed-parameters.html: Added.
* crypto/subtle/aes-cbc-generate-key-encrypt-decrypt-expected.txt: Added.
* crypto/subtle/aes-cbc-generate-key-encrypt-decrypt.html: Added.
* crypto/subtle/aes-cbc-import-key-decrypt-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-decrypt.html: Added.
* crypto/subtle/decrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/decrypt-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-decrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/rsa-oaep-decrypt-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-expected.txt: Added.
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label-expected.txt: Added.
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt-label.html: Added.
* crypto/subtle/rsa-oaep-generate-key-encrypt-decrypt.html: Added.
* crypto/subtle/rsa-oaep-import-key-decrypt-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-decrypt-label-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-decrypt-label.html: Added.
* crypto/subtle/rsa-oaep-import-key-decrypt.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-generate-key-encrypt-decrypt.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-key-decrypt-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html: Added.
* crypto/workers/subtle/aes-cbc-import-key-decrypt-expected.txt: Added.
* crypto/workers/subtle/aes-cbc-import-key-decrypt.html: Added.
* crypto/workers/subtle/resources/aes-cbc-import-key-decrypt.js: Added.
* crypto/workers/subtle/resources/rsa-oaep-import-key-decrypt.js: Added.
* crypto/workers/subtle/resources/rsaes-pkcs1-v1_5-import-key-decrypt.js: Added.
* crypto/workers/subtle/rsa-oaep-import-key-decrypt-expected.txt: Added.
* crypto/workers/subtle/rsa-oaep-import-key-decrypt.html: Added.
* crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-decrypt-expected.txt: Added.
* crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-decrypt.html: Added.

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

2 years agoUnreviewed, rolling out r208837.
cdumez@apple.com [Sat, 19 Nov 2016 04:25:38 +0000 (04:25 +0000)]
Unreviewed, rolling out r208837.

The bots did not show a progression

Reverted changeset:

"REGRESSION(r208082): 1% Speedometer regression on iOS"
https://bugs.webkit.org/show_bug.cgi?id=164852
http://trac.webkit.org/changeset/208837

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

2 years agoRemove use of std::chrono in WebPage and entrained code
simon.fraser@apple.com [Sat, 19 Nov 2016 03:33:36 +0000 (03:33 +0000)]
Remove use of std::chrono in WebPage and entrained code
https://bugs.webkit.org/show_bug.cgi?id=164967

Reviewed by Tim Horton.

Replace std::chrono with Seconds and Monotonic Time.

Use more C++11 initialization for WebPage data members.

Source/WebCore:

* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::scrollPositionChanged):
(WebCore::FrameView::setScrollVelocity):
* page/FrameView.h:
* platform/Timer.h:
(WebCore::TimerBase::startRepeating):
(WebCore::TimerBase::startOneShot):
(WebCore::TimerBase::augmentFireInterval):
(WebCore::TimerBase::augmentRepeatInterval):
* platform/graphics/TiledBacking.h:
(WebCore::VelocityData::VelocityData):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::adjustTileCoverageRect):

Source/WebKit2:

* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::timestamp):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<MonotonicTime>::encode):
(IPC::ArgumentCoder<MonotonicTime>::decode):
(IPC::ArgumentCoder<Seconds>::encode):
(IPC::ArgumentCoder<Seconds>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/ios/WKContentView.mm:
(WebKit::HistoricalVelocityData::HistoricalVelocityData):
(WebKit::HistoricalVelocityData::velocityForNewData):
(WebKit::HistoricalVelocityData::append):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::eventThrottlingDelay):
* WebProcess/WebPage/ViewUpdateDispatcher.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::m_userActivityHysteresis):
(WebKit::WebPage::didFlushLayerTreeAtTime):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::eventThrottlingDelay):
(WebKit::WebPage::updateVisibleContentRects):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):

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

2 years agoAX: "(inverted-colors)" media query only matches on page reload; should match on...
dino@apple.com [Sat, 19 Nov 2016 02:51:15 +0000 (02:51 +0000)]
AX: "(inverted-colors)" media query only matches on page reload; should match on change
https://bugs.webkit.org/show_bug.cgi?id=163564
<rdar://problem/28807350>

Source/WebCore:

Reviewed by Simon Fraser.

Mark some media queries as responding to notifications that
system accessibility settings have changed. When Page gets told
that has happened, check if any of the results have changed.

Tests: fast/media/mq-inverted-colors-live-update.html
       fast/media/mq-monochrome-live-update.html
       fast/media/mq-prefers-reduced-motion-live-update.html

* css/MediaQueryEvaluator.cpp:
(WebCore::isAccessibilitySettingsDependent):
(WebCore::MediaQueryEvaluator::evaluate):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::addAccessibilitySettingsDependentMediaQueryResult):
(WebCore::StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange):
* css/StyleResolver.h:
(WebCore::StyleResolver::hasAccessibilitySettingsDependentMediaQueries):
* page/Page.cpp:
(WebCore::Page::accessibilitySettingsDidChange):
* page/Page.h:

Source/WebKit2:

Reviewed by Simon Fraser.

Listen for the appropriate notifications that accessibility settings
have changed. This is a single notification on macOS, which uses WebViewImpl,
and more fine-grained notifications on iOS, using WKWebView.

When we see the notification, send a message to the WebProcess which will
then tell the WebCore::Page.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _accessibilitySettingsDidChange:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKAccessibilitySettingsObserver initWithImpl:]):
(-[WKAccessibilitySettingsObserver dealloc]):
(-[WKAccessibilitySettingsObserver _settingsDidChange:]):
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::accessibilitySettingsDidChange):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::accessibilitySettingsDidChange):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::accessibilitySettingsDidChange):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Reviewed by NOBODY (OOPS!).

Add a UIScriptController method that tricks WebKit into thinking
it has received a notification that accessibility settings have
changed. Combined with our forced overrides, this allows us to
test if a page would react to the notifications.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::simulateAccessibilitySettingsChangeNotification):
* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::simulateAccessibilitySettingsChangeNotification):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::simulateAccessibilitySettingsChangeNotification):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::simulateAccessibilitySettingsChangeNotification):
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::simulateAccessibilitySettingsChangeNotification):

LayoutTests:

Reviewed by Simon Fraser.

* fast/media/mq-inverted-colors-live-update-in-subframes-expected.html: Added.
* fast/media/mq-inverted-colors-live-update-in-subframes.html: Added.
* fast/media/mq-inverted-colors-live-update-expected.html: Added.
* fast/media/mq-inverted-colors-live-update.html: Added.
* fast/media/mq-monochrome-live-update-expected.html: Added.
* fast/media/mq-monochrome-live-update.html: Added.
* fast/media/mq-prefers-reduced-motion-live-update-expected.html: Added.
* fast/media/mq-prefers-reduced-motion-live-update.html: Added.

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

2 years agoRename the 'other' Apple Pay Button type to 'donate'
andersca@apple.com [Sat, 19 Nov 2016 02:45:25 +0000 (02:45 +0000)]
Rename the 'other' Apple Pay Button type to 'donate'
https://bugs.webkit.org/show_bug.cgi?id=164978

Reviewed by Dean Jackson.

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

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

2 years agoFix missing exception checks in DFGOperations.cpp.
mark.lam@apple.com [Sat, 19 Nov 2016 01:46:01 +0000 (01:46 +0000)]
Fix missing exception checks in DFGOperations.cpp.
https://bugs.webkit.org/show_bug.cgi?id=164958

Reviewed by Geoffrey Garen.

* dfg/DFGOperations.cpp:

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

2 years agoFix exception scope verification failures in ShadowChicken.cpp.
mark.lam@apple.com [Sat, 19 Nov 2016 01:40:14 +0000 (01:40 +0000)]
Fix exception scope verification failures in ShadowChicken.cpp.
https://bugs.webkit.org/show_bug.cgi?id=164966

Reviewed by Saam Barati.

* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::functionsOnStack):

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

2 years agoUSE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView...
commit-queue@webkit.org [Sat, 19 Nov 2016 01:00:27 +0000 (01:00 +0000)]
USE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12))
https://bugs.webkit.org/show_bug.cgi?id=164962

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-11-18
Reviewed by Dean Jackson.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

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

2 years ago[WebGL2] Implement texStorage2D()
mmaxfield@apple.com [Sat, 19 Nov 2016 01:00:16 +0000 (01:00 +0000)]
[WebGL2] Implement texStorage2D()
https://bugs.webkit.org/show_bug.cgi?id=164493

Reviewed by Dean Jackson.

Source/WebCore:

Create a new validation function which only accepts sized internalFormats.
After running texStorage2D(), we also texSubImage2D() to zero-fill it. This
is to compensate for potentially buggy drivers.

Because glTexStorage2D() was only added to OpenGL in version 4.2, not all
OpenGL 3.2+ contexts can implement this command. However, according to
https://developer.apple.com/opengl/capabilities/ all Apple GPUs have the
GL_ARB_texture_storage which implements this call. In the future, we could
implement texStorage2D() on top of texImage2D() if there are any ports which
want WebGL2 but don't have 4.2 and don't have the extension.

Also, when calling texStorage2D, callers specify an internalFormat but not a
type/format pair. This means that storing the texture's type is only valid
for WebGL 1 contexts. This patch surrounds all calls to reading the texture
type with guards and adds an ASSERT() at the read site to make sure the
right thing is happening.

Test: fast/canvas/webgl/webgl2-texStorage.html

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateTexStorageFuncParameters):
(WebCore::WebGL2RenderingContext::texStorage2D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::validateTexFunc):
(WebCore::WebGLRenderingContextBase::validateTexFuncData):
(WebCore::WebGLRenderingContextBase::texImage2D):
* html/canvas/WebGLTexture.cpp:
(WebCore::WebGLTexture::WebGLTexture):
(WebCore::WebGLTexture::getType):
(WebCore::WebGLTexture::needToUseBlackTexture):
(WebCore::WebGLTexture::canGenerateMipmaps):
(WebCore::internalFormatIsFloatType):
(WebCore::internalFormatIsHalfFloatType):
(WebCore::WebGLTexture::update):
* html/canvas/WebGLTexture.h:
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::texImage2DResourceSafe):
(WebCore::GraphicsContext3D::packImageData):
(WebCore::GraphicsContext3D::extractImageData):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::texStorage2D):
(WebCore::GraphicsContext3D::texStorage3D):

LayoutTests:

* fast/canvas/webgl/webgl2-texStorage-expected.txt: Added.
* fast/canvas/webgl/webgl2-texStorage.html: Added.

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

2 years agoTextDecoder constructor should not accept replacement encodings
achristensen@apple.com [Sat, 19 Nov 2016 00:58:54 +0000 (00:58 +0000)]
TextDecoder constructor should not accept replacement encodings
https://bugs.webkit.org/show_bug.cgi?id=164903

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/encoding/api-replacement-encodings-expected.txt:

Source/WebCore:

Covered by newly passing web platform tests.

* dom/TextDecoder.cpp:
(WebCore::TextDecoder::create):
https://encoding.spec.whatwg.org/#textdecoder says about the constructor:
"If label is either not a label or is a label for replacement, throws a RangeError."
See https://bugs.webkit.org/show_bug.cgi?id=159180 for the mapping of the replacement
codec names to "replacement".

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

2 years agoAssertion failures in ActiveDOMObject::~ActiveDOMObject under Database destructor
cdumez@apple.com [Sat, 19 Nov 2016 00:38:43 +0000 (00:38 +0000)]
Assertion failures in ActiveDOMObject::~ActiveDOMObject under Database destructor
https://bugs.webkit.org/show_bug.cgi?id=164955
<rdar://problem/29336715>

Reviewed by Brady Eidson.

Make sure the Database's DatabaseContext object is destroyed on the context
thread given that DatabaseContext is an ActiveDOMObject and there is an
assertion in the ActiveDOMObject destructor that it should be destroyed on
on the context thread.

No new tests, already covered by existing tests.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::~Database):

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

2 years agoFix API test after r208902
achristensen@apple.com [Fri, 18 Nov 2016 23:50:08 +0000 (23:50 +0000)]
Fix API test after r208902
https://bugs.webkit.org/show_bug.cgi?id=144194

* TestWebKitAPI/Tests/Cocoa/URLExtras.mm:
(TestWebKitAPI::TEST):
The fullwidth solidus, U+FF0F, changed encoding from IDN2003 to IDN2008, probably to prevent domains from using it
to spoof other domains.  https://webkit.org/blog/ and https://webkit.org\uFF0Fblog/ would otherwise look
too similar when rendered.

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

2 years agoRefactor drag and drop for WebKit2 to encode DragData message exchange.
enrica@apple.com [Fri, 18 Nov 2016 23:35:28 +0000 (23:35 +0000)]
Refactor drag and drop for WebKit2 to encode DragData message exchange.
https://bugs.webkit.org/show_bug.cgi?id=164945

Reviewed by Tim Horton.

Source/WebCore:

No new tests. No change in functionality.

* loader/EmptyClients.h:
* page/DragClient.h:
* page/DragController.cpp:
(WebCore::createMouseEvent):
(WebCore::documentFragmentFromDragData):
(WebCore::DragController::dragIsMove):
(WebCore::DragController::dragEntered):
(WebCore::DragController::dragExited):
(WebCore::DragController::dragUpdated):
(WebCore::DragController::performDragOperation):
(WebCore::DragController::dragEnteredOrUpdated):
(WebCore::DragController::tryDocumentDrag):
(WebCore::DragController::operationForLoad):
(WebCore::DragController::dispatchTextInputEventFor):
(WebCore::DragController::concludeEditDrag):
(WebCore::DragController::canProcessDrag):
(WebCore::DragController::tryDHTMLDrag):
* page/DragController.h:
* page/efl/DragControllerEfl.cpp:
(WebCore::DragController::isCopyKeyDown):
(WebCore::DragController::dragOperation):
* page/gtk/DragControllerGtk.cpp:
(WebCore::DragController::isCopyKeyDown):
(WebCore::DragController::dragOperation):
* page/mac/DragControllerMac.mm:
(WebCore::DragController::isCopyKeyDown):
(WebCore::DragController::dragOperation):
* page/win/DragControllerWin.cpp:
(WebCore::DragController::dragOperation):
(WebCore::DragController::isCopyKeyDown):
* platform/DragData.h:
(WebCore::DragData::DragData):

Source/WebKit/mac:

* WebCoreSupport/WebDragClient.h:
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::actionMaskForDrag):
(WebDragClient::willPerformDragDestinationAction):

Source/WebKit2:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DragData>::encode):
(IPC::ArgumentCoder<DragData>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::performDragControllerAction):
* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::willPerformDragDestinationAction):
(WebKit::WebDragClient::actionMaskForDrag):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

2 years agoAdd runtime flag to enable pointer lock. Enable pointer lock feature for mac.
commit-queue@webkit.org [Fri, 18 Nov 2016 23:33:05 +0000 (23:33 +0000)]
Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
https://bugs.webkit.org/show_bug.cgi?id=163801

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-11-18
Reviewed by Simon Fraser.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

These tests now pass with DumpRenderTree.
LayoutTests/pointer-lock/lock-already-locked.html
LayoutTests/pointer-lock/lock-element-not-in-dom.html
LayoutTests/pointer-lock/locked-element-iframe-removed-from-dom.html
LayoutTests/pointer-lock/mouse-event-api.html

PointerLockController::requestPointerLock now protects against synchronous callback
to allowPointerLock().

Add pointerLockEnabled setting.

* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp:
(WebCore::Document::exitPointerLock): Fix existing typo.
(WebCore::Document::pointerLockElement):
* features.json:
* page/EventHandler.cpp:
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
(WebCore::PointerLockController::requestPointerUnlock):
* page/Settings.in:

Source/WebKit/mac:

Plumb through PointerLockEnabled setting.

* Configurations/FeatureDefines.xcconfig:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::requestPointerUnlock):
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences pointerLockEnabled]):
(-[WebPreferences setPointerLockEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Add SPI to notify client of pointer lock and for client to allow or deny.
Unlock pointer when view is not longer active.

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::requestPointerLock):
(API::UIClient::didLosePointerLock):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
(WKPageDidAllowPointerLock):
(WKPageDidDenyPointerLock):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/API/C/WKPreferences.cpp:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::requestPointerLock):
(WebKit::UIDelegate::UIClient::didLosePointerLock):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
(WebKit::WebPageProxy::requestPointerLock):
(WebKit::WebPageProxy::didAllowPointerLock):
(WebKit::WebPageProxy::didDenyPointerLock):
(WebKit::WebPageProxy::requestPointerUnlock):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WTF:

* wtf/FeatureDefines.h: ENABLE_POINTER_LOCK true for Mac.

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

2 years agoSupport IDN2008 with UTS #46 instead of IDN2003
achristensen@apple.com [Fri, 18 Nov 2016 22:47:24 +0000 (22:47 +0000)]
Support IDN2008 with UTS #46 instead of IDN2003
https://bugs.webkit.org/show_bug.cgi?id=144194

Reviewed by Darin Adler.

Source/WebCore:

Use uidna_nameToASCII instead of the deprecated uidna_IDNToASCII.
It uses IDN2008 instead of IDN2003, and it uses UTF #46 when used with a UIDNA opened with uidna_openUTS46.
This follows https://url.spec.whatwg.org/#concept-domain-to-ascii except we do not use Transitional_Processing
to prevent homograph attacks on german domain names with "ß" and "ss" in them.  These are now treated as separate domains.
Firefox also doesn't use Transitional_Processing. Chrome and the current specification use Transitional_processing,
but https://github.com/whatwg/url/issues/110 might change the spec.

In addition, http://unicode.org/reports/tr46/ says:
"implementations are encouraged to apply the Bidi and ContextJ validity criteria"
Bidi checks prevent domain names with bidirectional text, such as latin and hebrew characters in the same domain.  Chrome and Firefox do this.

ContextJ checks prevent code points such as U+200D, which is a zero-width joiner which users would not see when looking at the domain name.
Firefox currently enables ContextJ checks and it is suggested by UTS #46, so we'll do it.

ContextO checks, which we do not use and neither does any other browser nor the spec, would fail if a domain contains code points such as U+30FB,
which looks somewhat like a dot.  We can investigate enabling these checks later.

Covered by new API tests and rebased LayoutTests.
The new API tests verify that we do not use transitional processing, that we do apply the Bidi and ContextJ checks, but not ContextO checks.

* platform/URLParser.cpp:
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::internationalDomainNameTranscoder):
* platform/URLParser.h:
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::mapHostNameWithRange):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):
Add some tests from http://unicode.org/faq/idn.html verifying that we follow UTS46's deviations from IDN2008.
Add some tests based on https://tools.ietf.org/html/rfc5893 verifying that we check for bidirectional text.
Add a test based on https://tools.ietf.org/html/rfc5892 verifying that we do not do ContextO check.
Add a test for U+321D and U+321E which have particularly interesting punycode encodings.  We match Firefox here now.
Also add a test from http://www.unicode.org/reports/tr46/#IDNAComparison verifying we are not using IDN2003.
We should consider importing all of http://www.unicode.org/Public/idna/9.0.0/IdnaTest.txt as URL domain tests.

LayoutTests:

* fast/encoding/idn-security.html:
Move some characters with changed IDN encodings to inside the check for old ICU.
* fast/url/idna2003-expected.txt:
* fast/url/idna2008-expected.txt:
Update expected results.  We are now more compliant with IDN2008.

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

2 years agoREGRESSION(r208867): JSC test failure: ChakraCore.yaml/ChakraCore/test/strict/05...
utatane.tea@gmail.com [Fri, 18 Nov 2016 22:32:01 +0000 (22:32 +0000)]
REGRESSION(r208867): JSC test failure: ChakraCore.yaml/ChakraCore/test/strict/05.arguments_sm.js.default
https://bugs.webkit.org/show_bug.cgi?id=164929

Reviewed by Mark Lam.

ES2017 drops arguments.caller and JavaScriptCore is updated to meet the spec.
This patch rebaselines the result of ChakraCore test for JSC.

* ChakraCore/test/strict/05.arguments_sm.baseline-jsc:

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

2 years agoMarking two js/dom/domjit-function-get-element-by-id-* tests as flaky.
ryanhaddad@apple.com [Fri, 18 Nov 2016 22:31:13 +0000 (22:31 +0000)]
Marking two js/dom/domjit-function-get-element-by-id-* tests as flaky.
https://bugs.webkit.org/show_bug.cgi?id=164797

Unreviewed test gardening.

* TestExpectations:

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

2 years agoBetter testing for accessibility media queries
dino@apple.com [Fri, 18 Nov 2016 22:30:44 +0000 (22:30 +0000)]
Better testing for accessibility media queries
https://bugs.webkit.org/show_bug.cgi?id=164954
<rdar://problem/29338292>

Reviewed by Myles Maxfield.

Source/WebCore:

Provide an override mode for the accessibility media queries
that rely on system settings. This way we can test that they
are least responding to something.

Tests: fast/media/mq-inverted-colors-forced-value.html
       fast/media/mq-monochrome-forced-value.html

* css/MediaQueryEvaluator.cpp: Query the Settings to see if we're
forcing a value.
(WebCore::monochromeEvaluate):
(WebCore::invertedColorsEvaluate):
(WebCore::prefersReducedMotionEvaluate):
* page/Settings.h:
* testing/InternalSettings.cpp: Add new forcing values for inverted-colors
and monochrome.
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::settingsToInternalSettingsValue):
(WebCore::internalSettingsToSettingsValue):
(WebCore::InternalSettings::forcedColorsAreInvertedAccessibilityValue):
(WebCore::InternalSettings::setForcedColorsAreInvertedAccessibilityValue):
(WebCore::InternalSettings::forcedDisplayIsMonochromeAccessibilityValue):
(WebCore::InternalSettings::setForcedDisplayIsMonochromeAccessibilityValue):
(WebCore::InternalSettings::forcedPrefersReducedMotionAccessibilityValue):
(WebCore::InternalSettings::setForcedPrefersReducedMotionAccessibilityValue):
(WebCore::InternalSettings::forcedPrefersReducedMotionValue): Deleted.
(WebCore::InternalSettings::setForcedPrefersReducedMotionValue): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests:

* fast/media/mq-inverted-colors-forced-value-expected.html: Added.
* fast/media/mq-inverted-colors-forced-value.html: Copied from LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value.html.
* fast/media/mq-monochrome-forced-value-expected.html: Added.
* fast/media/mq-monochrome-forced-value.html: Added.
* fast/media/mq-prefers-reduced-motion-forced-value.html:

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

2 years agoUnreviewed, fix cloop.
fpizlo@apple.com [Fri, 18 Nov 2016 22:29:11 +0000 (22:29 +0000)]
Unreviewed, fix cloop.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::stronglyVisitStrongReferences):

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

2 years agoConcurrent GC should be able to run splay in debug mode and earley/raytrace in releas...
fpizlo@apple.com [Fri, 18 Nov 2016 22:11:51 +0000 (22:11 +0000)]
Concurrent GC should be able to run splay in debug mode and earley/raytrace in release mode with no perf regression
https://bugs.webkit.org/show_bug.cgi?id=164282

Reviewed by Geoffrey Garen and Oliver Hunt.

PerformanceTests:

CDjs is a fun benchmark for stressing concurrent GCs, but to really give the GC a good
workout you need to increase the amount of work that the test does. This adds a second
configuration of the benchmark that has more aircraft. It uses much more memory and causes us
to do more GCs and those GCs take longer.

* JetStream/cdjs/benchmark.js:
(benchmarkImpl):
(benchmark):
* JetStream/cdjs/large.js: Added.

Source/JavaScriptCore:

The two three remaining bugs were:

- Improper ordering inside putDirectWithoutTransition() and friends. We need to make sure
  that the GC doesn't see the store to Structure::m_offset until we've resized the butterfly.
  That proved a bit tricky. On the other hand, this means that we could probably remove the
  requirement that the GC holds the Structure lock in some cases. I haven't removed that lock
  yet because I still think it might protect some weird cases, and it doesn't seem to cost us
  anything.

- CodeBlock's GC strategy needed to be made thread-safe (visitWeakly, visitChildren, and
  their friends now hold locks) and incremental-safe (we need to update predictions in the
  finalizer to make sure we clear anything that was put into a value profile towards the end
  of GC).

- The GC timeslicing scheduler needed to be made a bit more aggressive to deal with
  generational workloads like earley, raytrace, and CDjs. Once I got those benchmarks to run,
  I found that they would do many useless iterations of GC because they wouldn't pause long
  enough after rescanning weak references and roots. I added a bunch of knobs for forcing a
  pause. In the end, I realized that I could get the desired effect by putting a ceiling on
  mutator utilization. We want the GC to finish quickly if it is possible to do so, even if
  the amount of allocation that the mutator had done is low. Having a utilization ceiling
  seems to accomplish this for benchmarks with trivial heaps (earley and raytrace) as well as
  huge heaps (like CDjs in its "large" configuration).

This preserves splay performance, makes the concurrent GC more stable, and makes the
concurrent GC not a perf regression on earley or raytrace. It seems to give us great CDjs
performance as well, but this is still hard to tell because we crash a lot in that benchmark.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::visitWeakly):
(JSC::CodeBlock::visitChildren):
(JSC::CodeBlock::shouldVisitStrongly):
(JSC::CodeBlock::shouldJettisonDueToOldAge):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::determineLiveness):
(JSC::CodeBlock::WeakReferenceHarvester::visitWeakReferences):
(JSC::CodeBlock::UnconditionalFinalizer::finalizeUnconditionally):
(JSC::CodeBlock::visitOSRExitTargets):
(JSC::CodeBlock::stronglyVisitStrongReferences):
(JSC::CodeBlock::stronglyVisitWeakReferences):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::clearVisitWeaklyHasBeenCalled):
* heap/CodeBlockSet.cpp:
(JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced):
* heap/Heap.cpp:
(JSC::Heap::ResumeTheWorldScope::ResumeTheWorldScope):
(JSC::Heap::markToFixpoint):
(JSC::Heap::beginMarking):
(JSC::Heap::addToRememberedSet):
(JSC::Heap::collectInThread):
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::mutatorFence):
* heap/MarkedBlock.cpp:
* runtime/JSCellInlines.h:
(JSC::JSCell::finishCreation):
* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectWithoutTransition):
(JSC::JSObject::putDirectInternal):
* runtime/Options.h:
* runtime/Structure.cpp:
(JSC::Structure::add):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::add):

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

2 years agoMarking http/tests/misc/link-rel-icon-beforeload.html as failing on mac-wk1.
ryanhaddad@apple.com [Fri, 18 Nov 2016 22:04:43 +0000 (22:04 +0000)]
Marking http/tests/misc/link-rel-icon-beforeload.html as failing on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=164933

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoWeb Inspector: TimelineDataGridNode assertions when refreshing page
mattbaker@apple.com [Fri, 18 Nov 2016 22:04:08 +0000 (22:04 +0000)]
Web Inspector: TimelineDataGridNode assertions when refreshing page
https://bugs.webkit.org/show_bug.cgi?id=162642
<rdar://problem/28505898>

Reviewed by Timothy Hatcher.

This patch fixes a number of deficiencies in the Network tab that caused
TimelineDataGridNode graphs to refresh before the tab became visible.

* UserInterface/Views/ElementsTabContentView.js:
(WebInspector.ElementsTabContentView):
(WebInspector.ElementsTabContentView.prototype.shown):
Drive-by fix: defer showing the DOM content view until the tab is shown.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
Drive-by event listener cleanup.
(WebInspector.NetworkGridContentView.prototype.get startTime):
(WebInspector.NetworkGridContentView.prototype.get endTime):
Back endTime with a variable, instead of using the ruler value which
isn't valid before the tab is shown for the first time.

(WebInspector.NetworkGridContentView.prototype.shown):
Force the grid to update its layout, and that of the Timeline column ruler.
During layout the ruler's secondsPerPixel value is used, which isn't
valid until the ruler does an initial layout.

(WebInspector.NetworkGridContentView.prototype.reset):
Clear pending records. This was causing duplicates to appear when the
inspected page was refreshed multiple times prior to showing the Network
tab for the first time.

(WebInspector.NetworkGridContentView.prototype.layout):
Should more closely match behavior in NetworkTimelineView.prototype.layout.
Graph end time padding is added if no longer updating the current time.

(WebInspector.NetworkGridContentView.prototype._networkTimelineRecordAdded):
Track endTime of the last record added, so that the graph end time can
be padded once the current time is no longer being updated.

(WebInspector.NetworkGridContentView.prototype._update):
(WebInspector.NetworkGridContentView.prototype._stopUpdatingCurrentTime):
Graph end time padding shouldn't be applied here, since this isn't called
if the inspected page finishes loading before the view is shown.

(WebInspector.NetworkGridContentView.prototype._clearNetworkItems): Deleted.
Replaced by an arrow function.

* UserInterface/Views/NetworkSidebarPanel.js:
(WebInspector.NetworkSidebarPanel.prototype._networkTimelineReset):
Don't show the content view if the tab is hidden.

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

2 years agoUnsupported emoji are invisible
mmaxfield@apple.com [Fri, 18 Nov 2016 21:55:09 +0000 (21:55 +0000)]
Unsupported emoji are invisible
https://bugs.webkit.org/show_bug.cgi?id=164944
<rdar://problem/28591608>

Reviewed by Dean Jackson.

Source/WebCore:

In WidthIterator, we explicitly skip characters which the OS has no font
to render with. However, for emoji, we should draw something to show that
there is missing content. Because we have nothing to draw, we can draw
the .notdef glyph (empty box, or "tofu").

Test: fast/text/emoji-draws.html

* platform/graphics/WidthIterator.cpp:
(WebCore::characterMustDrawSomething):
(WebCore::WidthIterator::advanceInternal):

LayoutTests:

* fast/text/emoji-draws-expected-mismatch.html: Added.
* fast/text/emoji-draws.html: Added.

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

2 years ago[WebIDL] Add support for record types
weinig@apple.com [Fri, 18 Nov 2016 21:47:42 +0000 (21:47 +0000)]
[WebIDL] Add support for record types
https://bugs.webkit.org/show_bug.cgi?id=164935

Reviewed by Tim Horton.

Source/WebCore:

Add support for WebIDLs record types. We map them to HashMap<String, {OtherType}>.

* bindings/generic/IDLTypes.h:
- Add IDLRecord type and helper predicate.
- Remove IDLRegExp which is no longer in WebIDL and we never supported.

* bindings/js/JSDOMBinding.cpp:
(WebCore::stringToByteString):
(WebCore::identifierToByteString):
(WebCore::valueToByteString):
(WebCore::hasUnpairedSurrogate):
(WebCore::stringToUSVString):
(WebCore::identifierToUSVString):
(WebCore::valueToUSVString):
* bindings/js/JSDOMBinding.h:
Refactor ByteString and USVString conversion to support converting from
either a JSValue or Identifier.

* bindings/js/JSDOMConvert.h:
(WebCore::DetailConverter<IDLRecord<K, V>>):
(WebCore::JSConverter<IDLRecord<K, V>>):
Add conversion support for record types. Use Detail::IdentifierConverter helper
to convert identifiers to strings using the correct conversion rules.

(WebCore::Converter<IDLUnion<T...>>::convert):
Update comments in union conversion to match current spec. Remove check
for regular expressions and add support for record types.

* bindings/scripts/CodeGenerator.pm:
(IsRefPtrType):
Add record and union types to the list of things that aren't RefPtrs.

(IsRecordType):
Add predicate for testing if a type is a record.

(IsWrapperType):
Remove check for union. This is now handled in the IsRefPtrType check.

(SkipIncludeHeader): Deleted.
(GetSequenceInnerType): Deleted.
(GetFrozenArrayInnerType): Deleted.
(GetSequenceOrFrozenArrayInnerType): Deleted.
Remove no longer necessary functions.

* bindings/scripts/CodeGeneratorJS.pm:
(AddIncludesForImplementationType):
Remove check for includes to skip. This is now only called for interfaces, which should be included
unconditionally.

(AddToIncludesForIDLType):
Add includes and recursive includes for record types.

(GenerateOverloadedFunctionOrConstructor):
Update to account for records.

(GetGnuVTableRefForInterface):
(GetGnuVTableNameForInterface):
(GetGnuMangledNameForInterface):
(GetWinVTableNameForInterface):
(GetWinMangledNameForInterface):
Strength-reduce GetNativeTypeForConversions and GetNamespaceForInterface into their callers.

(GetBaseIDLType):
Add support for IDLRecord. Remove call to GetIDLInterfaceName now that is simply the type name.

(GetNativeType):
Simplify sequence/FrozenArray support and add record support.

(GetNativeInnerType):
Generalize GetNativeVectorInnerType to work for record types as well.

(ShouldPassWrapperByReference):
Moved so native type accessors can be together.

(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Add record support.

(GetNativeTypeForConversions): Deleted.
(GetNamespaceForInterface): Deleted.
(GetNativeVectorType): Deleted.
(GetIDLInterfaceName): Deleted.
(GetNativeVectorInnerType): Deleted.
Remove unneeded functions.

* bindings/scripts/IDLParser.pm:
(typeDescription):
Add helper useful for debugging, that constructs the string form of a type.

(typeByApplyingTypedefs):
Add missing call to typeByApplyingTypedefs (this is noted by a fix in JSTestCallbackFunctionWithTypedefs.h)

(parseNonAnyType):
Remove unused $subtypeName variables and add support for parsing record types.

* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:
Add tests for records and update results.

* testing/TypeConversions.h:
(WebCore::TypeConversions::testLongRecord):
(WebCore::TypeConversions::setTestLongRecord):
(WebCore::TypeConversions::testNodeRecord):
(WebCore::TypeConversions::setTestNodeRecord):
(WebCore::TypeConversions::testSequenceRecord):
(WebCore::TypeConversions::setTestSequenceRecord):
* testing/TypeConversions.idl:
Add record types so it can be tested from layout tests.

LayoutTests:

* js/dom/webidl-type-mapping-expected.txt:
* js/dom/webidl-type-mapping.html:
Add tests for WebIDL record types.

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

2 years ago[CSS Parser] Support font-variation-settings
hyatt@apple.com [Fri, 18 Nov 2016 21:41:40 +0000 (21:41 +0000)]
[CSS Parser] Support font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=164947

Reviewed by Myles Maxfield.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontVariationTag):
(WebCore::consumeFontVariationSettings):
(WebCore::CSSPropertyParser::parseSingleValue):

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

2 years agoUpdate SubtleCrypto::encrypt to match the latest spec
jiewen_tan@apple.com [Fri, 18 Nov 2016 21:31:42 +0000 (21:31 +0000)]
Update SubtleCrypto::encrypt to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164738
<rdar://problem/29257812>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt:
* WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt:
* WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt:
* WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt:
* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::encrypt method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-encrypt.
   It also refers to the latest Editor's Draft to a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-encrypt.
2. It implements encrypt operations of the following algorithms: AES-CBC,
   RSAES-PKCS1-V1_5, and RSA-OAEP.
3. It addes ASSERT(parameters) for every method that accepts a
   std::unique_ptr<CryptoAlgorithmParameters>&& type parameter.
4. It changes RefPtr<CryptoKey>&& to Ref<CryptoKey>&& for every method that
   accepts a CryptoKey.

Tests: crypto/subtle/aes-cbc-encrypt-malformed-parameters.html
       crypto/subtle/aes-cbc-import-key-encrypt.html
       crypto/subtle/encrypt-malformed-parameters.html
       crypto/subtle/rsa-oaep-encrypt-malformed-parameters.html
       crypto/subtle/rsa-oaep-import-key-encrypt-label.html
       crypto/subtle/rsa-oaep-import-key-encrypt.html
       crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html
       crypto/workers/subtle/aes-cbc-import-key-encrypt.html
       crypto/workers/subtle/rsa-oaep-import-key-encrypt.html
       crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/BufferSource.h:
(WebCore::BufferSource::BufferSource):
Add a default constructor for initializing an empty BufferSource object.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::JSSubtleCrypto::encrypt):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::exportKey):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h:
* crypto/CryptoKey.h:
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::SubtleCrypto):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::workQueue):
* crypto/SubtleCrypto.idl:
* crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
* crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
* crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
(WebCore::CryptoAlgorithmAES_CBC::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
(WebCore::CryptoAlgorithmAES_KW::importKey):
(WebCore::CryptoAlgorithmAES_KW::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
(WebCore::CryptoAlgorithmHMAC::exportKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
(WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::transformAES_CBC):
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
(WebCore::encryptRSAES_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::encryptRSA_OAEP):
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/parameters/AesCbcParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesCbcParams.h: Added.
* crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h: Added.
* crypto/parameters/RsaOaepParams.idl: Added.

LayoutTests:

* TestExpectations:
* crypto/subtle/aes-cbc-encrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/aes-cbc-encrypt-malformed-parameters.html: Added.
* crypto/subtle/aes-cbc-import-key-encrypt-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-encrypt.html: Added.
* crypto/subtle/encrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/encrypt-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-encrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/rsa-oaep-encrypt-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt-label-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt-label.html: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html: Added.
* crypto/workers/subtle/aes-cbc-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/aes-cbc-import-key-encrypt.html: Added.
* crypto/workers/subtle/resources/aes-cbc-import-key-encrypt.js: Added.
* crypto/workers/subtle/resources/rsa-oaep-import-key-encrypt.js: Added.
* crypto/workers/subtle/resources/rsaes-pkcs1-v1_5-import-key-encrypt.js: Added.
* crypto/workers/subtle/rsa-oaep-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/rsa-oaep-import-key-encrypt.html: Added.
* crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html: Added.

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

2 years agoAttempt to fix iOS build again.
ryanhaddad@apple.com [Fri, 18 Nov 2016 21:23:41 +0000 (21:23 +0000)]
Attempt to fix iOS build again.
<rdar://problem/29312689>

Unreviewed build fix.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack):

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

2 years ago[CSS Font Loading] FontFaceSet.load() promises don't always fire
mmaxfield@apple.com [Fri, 18 Nov 2016 20:56:36 +0000 (20:56 +0000)]
[CSS Font Loading] FontFaceSet.load() promises don't always fire
https://bugs.webkit.org/show_bug.cgi?id=164902

Reviewed by David Hyatt.

Source/WebCore:

Test: fast/text/fontfaceset-rebuild-during-loading.html

We currently handle web fonts in two phases. The first phase is building up
StyleRuleFontFace objects which reflect the style on the page. The second is creating
CSSFontFace objects from those StyleRuleFontFace objects. When script modifies the
style on the page, we can often update the CSSFontFace objects, but there are some
modifications which we don't know how to model. For these operations, we destroy the
CSSFontFace objects and rebuild them from the newly modified StyleRuleFontFace objects.

Normally, this is fine. However, with the CSS font loading API, the CSSFontFaces back
Javascript objects which will persist across the rebuilding step mentioned above. This
means that the FontFace objects need to adopt the new CSSFontFace objects and forget
the old CSSFontFace objects.

There was one bit of state which I forgot to update during this rebuilding phase. The
FontFaceSet object contains an internal HashMap where a reference to a CSSFontFace
is used as a key. After the rebuilding phase, this reference wasn't updated to point
to the new CSSFontFace.

The solution is to instead use a reference to the higher-level FontFace as the key to
the HashMap. This object is persistent across the rebuilding phase (and it adopts
the new CSSFontFaces). There is not a lifetime problem because the FontFace holds a
strong reference to its backing CSSFontFace object.

This bug didn't cause a memory problem because the HashMap was keeping the old
CSSFontFace alive because the key was a strong reference.

This patch also adds a lengthy comment explaining how the migration works.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::initializeWrapper): This is another bit of state which didn't
survive the rebuilding phase. Moving it here causes it to survive.
(WebCore::CSSFontFace::wrapper):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::load):
(WebCore::FontFaceSet::faceFinished):
* css/FontFaceSet.h:

LayoutTests:

* fast/text/fontfaceset-rebuild-during-loading-expected.txt: Added.
* fast/text/fontfaceset-rebuild-during-loading.html: Added.

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

2 years ago[SVG -> OTF Font Converter] Fonts advances are not internally consistent inside the...
mmaxfield@apple.com [Fri, 18 Nov 2016 20:27:50 +0000 (20:27 +0000)]
[SVG -> OTF Font Converter] Fonts advances are not internally consistent inside the generated font file
https://bugs.webkit.org/show_bug.cgi?id=164846
<rdar://problem/29031509>

Reviewed by Darin Adler.

Source/WebCore:

The fonts I'm generating in the SVG -> OTF converter have fractional FUnit values for their advances.
The CFF table can encode that, but hmtx can't, which means the font isn't internally consistent.

Covered by existing tests.

* svg/SVGToOTFFontConversion.cpp:

LayoutTests:

* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-01-t-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-02-t-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-03-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-01-t-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-02-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-03-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-04-t-expected.txt:
* platform/ios-simulator/svg/batik/text/textEffect-expected.txt:
* platform/ios-simulator/svg/batik/text/textEffect3-expected.txt:
* platform/ios-simulator/svg/batik/text/textPosition2-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-01-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-02-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-01-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-02-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-04-t-expected.txt:
* platform/mac/svg/batik/text/textEffect3-expected.txt:
* platform/mac/svg/batik/text/textPosition2-expected.txt:
* platform/mac/svg/custom/svg-fonts-fallback-expected.txt:
* platform/mac/svg/wicd/test-rightsizing-b-expected.txt:
* svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:

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

2 years agoAttempt to fix iOS build.
ryanhaddad@apple.com [Fri, 18 Nov 2016 20:01:49 +0000 (20:01 +0000)]
Attempt to fix iOS build.
<rdar://problem/29312689>

Unreviewed build fix.

* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions):

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

2 years ago[CSS Parser] Hook up InspectorStyleSheet to the new CSS parser.
hyatt@apple.com [Fri, 18 Nov 2016 19:09:13 +0000 (19:09 +0000)]
[CSS Parser] Hook up InspectorStyleSheet to the new CSS parser.
https://bugs.webkit.org/show_bug.cgi?id=164886

Reviewed by Dean Jackson.

* css/CSSGrammar.y.in:
Get rid of the CSSRuleSourceData type enum, since StyleRule's type
enum is exactly the same.

* css/CSSPropertySourceData.cpp:
(WebCore::CSSPropertySourceData::CSSPropertySourceData):
* css/CSSPropertySourceData.h:
Add a concept of disabled to CSSPropertySourceData. This is used for
commented out properties.

(WebCore::CSSRuleSourceData::create):
(WebCore::CSSRuleSourceData::createUnknown):
(WebCore::CSSRuleSourceData::CSSRuleSourceData):
Get rid of the CSSRuleSourceData type enum, since StyleRule's type
enum is exactly the same.

* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::parseSheetForInspector):
(WebCore::CSSParser::parseDeclarationForInspector):
(WebCore::CSSParser::markSupportsRuleHeaderStart):
(WebCore::CSSParser::markRuleHeaderStart):
(WebCore::CSSParser::markPropertyEnd):
* css/parser/CSSParser.h:
Add functions that represent the new API for inspector sheet
and declaration parsing. Patch the old parse code to use StyleRule::Type
now that the CSSRuleSourceData type is gone.

* css/parser/CSSParserObserver.h:
Tweak the API for our memory management.

* inspector/InspectorStyleSheet.cpp:
(flattenSourceData):
(WebCore::parserContextForDocument):
(WebCore::StyleSheetHandler::StyleSheetHandler):
(WebCore::StyleSheetHandler::startRuleHeader):
(WebCore::StyleSheetHandler::setRuleHeaderEnd):
(WebCore::StyleSheetHandler::endRuleHeader):
(WebCore::StyleSheetHandler::observeSelector):
(WebCore::StyleSheetHandler::startRuleBody):
(WebCore::StyleSheetHandler::endRuleBody):
(WebCore::StyleSheetHandler::popRuleData):
(WebCore::fixUnparsedProperties):
(WebCore::StyleSheetHandler::fixUnparsedPropertyRanges):
(WebCore::StyleSheetHandler::observeProperty):
(WebCore::StyleSheetHandler::observeComment):
(WebCore::InspectorStyle::populateAllProperties):
(WebCore::isValidSelectorListString):
(WebCore::InspectorStyleSheet::ensureSourceData):
(WebCore::InspectorStyleSheetForInlineStyle::ensureParsedDataReady):
(WebCore::InspectorStyleSheetForInlineStyle::ruleSourceData):
(WebCore::createCSSParser): Deleted.
(WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges): Deleted.
* inspector/InspectorStyleSheet.h:
(WebCore::InspectorStyleProperty::setRawTextFromStyleDeclaration):
Add the new implementation. This involves duplicating most of the old
parser code for this into a new class, StyleSheetHandler, that implements
the observer interface and builds up the same data structures as the old
parser did in response to the callbacks.

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

2 years agoWeb Inspector: Generator functions should have a displayable name when shown in stack...
joepeck@webkit.org [Fri, 18 Nov 2016 18:57:17 +0000 (18:57 +0000)]
Web Inspector: Generator functions should have a displayable name when shown in stack traces
https://bugs.webkit.org/show_bug.cgi?id=164844
<rdar://problem/29300697>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/generator-function-name.js:
Add another test now that we name the inner generator function
that we do not break the lexical resolution of names.

Source/JavaScriptCore:

* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createGeneratorFunctionBody):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createGeneratorFunctionBody):
New way to create a generator function with an inferred name.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseGeneratorFunctionSourceElements):
* parser/Parser.h:
Pass on the name of the generator wrapper function so we can
use it on the inner generator function.

LayoutTests:

* inspector/debugger/js-stacktrace-expected.txt:
* inspector/debugger/js-stacktrace.html:
Add a test case for console.trace() / Error stack inside of generators.
Modernize the test to reduce redundency and get nicer output.

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

2 years agoTried to fix some non-macOS builds.
mitz@apple.com [Fri, 18 Nov 2016 15:17:36 +0000 (15:17 +0000)]
Tried to fix some non-macOS builds.
<rdar://problems/29331425&29331438&29331722>

* platform/mac/WebPlaybackControlsManager.h:

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

2 years ago[Win32] Start releasing memory earlier when memory is running low.
pvollan@apple.com [Fri, 18 Nov 2016 10:03:18 +0000 (10:03 +0000)]
[Win32] Start releasing memory earlier when memory is running low.
https://bugs.webkit.org/show_bug.cgi?id=164862

Reviewed by Brent Fulgham.

On Windows, 32-bit processes have 2GB of memory available, where some is used by the system.
Debugging has shown that allocations might fail and cause crashes when memory usage is > ~1GB.
We should start releasing memory before we reach 1GB.

* platform/win/MemoryPressureHandlerWin.cpp:
(WebCore::CheckMemoryTimer::fired):

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

2 years agoDownloads started by context menu actions should also have a web view associated
carlosgc@webkit.org [Fri, 18 Nov 2016 07:50:57 +0000 (07:50 +0000)]
Downloads started by context menu actions should also have a web view associated
https://bugs.webkit.org/show_bug.cgi?id=164364

Reviewed by Michael Catanzaro.

Source/WebKit2:

When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to
associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls
WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case.

* UIProcess/API/gtk/WebKitDownload.cpp:
(webkitDownloadCreateForRequest): Deleted.
* UIProcess/API/gtk/WebKitDownloadPrivate.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download()
because the WebKitDownload could have already been created by the web view download handler at this point.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_download_uri): We no longer need to associate the web view to the download here.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify
the page client.

Tools:

Add a GTK+ unit tests to check that downloads started by the context menu have a web view associated.

* TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
(downloadLocalFileSuccessfully):
(testDownloadOverwriteDestinationDisallowed):
(testDownloadLocalFileError):
(testDownloadRemoteFile):
(testDownloadRemoteFileError):
(testDownloadMIMEType):
(contextMenuCallback):
(testContextMenuDownloadActions):
(beforeAll):

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

2 years agoREGRESSION(r208511): ImageDecoders: Crash decoding GIF images since r208511
carlosgc@webkit.org [Fri, 18 Nov 2016 07:25:42 +0000 (07:25 +0000)]
REGRESSION(r208511): ImageDecoders: Crash decoding GIF images since r208511
https://bugs.webkit.org/show_bug.cgi?id=164864

Reviewed by Simon Fraser.

This happens sometimes since r208511 because the same decoder is used by more than one thread at the same
time and the decoders are not thread-safe. Several methods in ImageDecoder need to decode partially the image,
so it's possible that one method calls frameBufferAtIndex at the same times as createFrameImageAtIndex that now
can be called from the image decoder thread. Use a Lock in ImageDecoder to protect calls to frameBufferAtIndex.

* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::frameIsCompleteAtIndex):
(WebCore::ImageDecoder::frameDurationAtIndex):
(WebCore::ImageDecoder::createFrameImageAtIndex):
* platform/image-decoders/ImageDecoder.h:

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

2 years agoREGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
achristensen@apple.com [Fri, 18 Nov 2016 07:21:37 +0000 (07:21 +0000)]
REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=164631

Reviewed by Carlos Garcia Campos.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::convertToDownload):
I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION
by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload.  m_networkLoad
was not being set to nullptr before it was being checked in NetworkResourceLoader::abort

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

2 years agoFix CMake build after r208865
achristensen@apple.com [Fri, 18 Nov 2016 06:28:05 +0000 (06:28 +0000)]
Fix CMake build after r208865
https://bugs.webkit.org/show_bug.cgi?id=164894

* PlatformMac.cmake:
Add new files.

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

2 years agoAdd an experimental API to find elements across shadow boundaries
rniwa@webkit.org [Fri, 18 Nov 2016 05:30:24 +0000 (05:30 +0000)]
Add an experimental API to find elements across shadow boundaries
https://bugs.webkit.org/show_bug.cgi?id=164851
<rdar://problem/28220092>

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* runtime/CommonIdentifiers.h:

Source/WebCore:

Add window.collectMatchingElementsInFlatTree(Node node, DOMString selectors)
as an experimental API which finds a list of elements that matches the given CSS selectors
and expose it to a JSWorld on which WKBundleScriptWorldMakeAllShadowRootsOpen was called.

No new tests. More test cases are added to WebKit2.InjectedBundleMakeAllShadowRootsOpen.

* bindings/scripts/CodeGeneratorJS.pm:
(NeedsRuntimeCheck): Added. Abstracts checks for EnabledAtRuntime and EnabledForWorld.
(OperationShouldBeOnInstance):
(GeneratePropertiesHashTable):
(GetRuntimeEnableFunctionName): Use worldForDOMObject(this).condition() for EnabledForWorld.
Also split the line for EnabledAtRuntime and EnabledAtRuntime for a better readability.
(GenerateImplementation):
(addIterableProperties):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttribute):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorld):
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldCaller):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjPrototypeFunctionWorldSpecificMethod):
(WebCore::jsTestObjPrototypeFunctionWorldSpecificMethodCaller):
* bindings/scripts/test/TestGlobalObject.idl: Added a test case.
* bindings/scripts/test/TestObj.idl: Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::collectMatchingElementsInFlatTree): Added. Implements the feature by
calling SelectorQuery's matches on a node yielded by ComposedTreeIterator.
* page/DOMWindow.h:
* page/DOMWindow.idl:

Tools:

Added test cases for window.collectMatchingElementsInFlatTree to WebKit2.InjectedBundleMakeAllShadowRootOpen.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/InjectedBundleMakeAllShadowRoot*s*Open_Bundle.cpp: Renamed
from InjectedBundleMakeAllShadowRootOpen_Bundle.cpp.
(TestWebKitAPI::InjectedBundleMakeAllShadowRootOpenTest::initialize): Added test cases for
window.collectMatchingElementsInFlatTree by calling alert() many times.
* TestWebKitAPI/Tests/WebKit2/InjectedBundleMakeAllShadowRootsOpen.cpp:
(TestWebKitAPI::runJavaScriptAlert): Added expectations for multiple test cases. Each test case
finishes with a call to alert, and moves testNumber forward.
(TestWebKitAPI::TEST): Use the newly added closed-shadow-tree-test.html
* TestWebKitAPI/Tests/WebKit2/closed-shadow-tree-test.html: Added. Creates a shadow tree with slots
and tests that window.collectMatchingElementsInFlatTree is not present when
an event named "testnormalworld" is dispatched by the injected bundle.

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

2 years agoTry to fix some non-macOS builds.
mitz@apple.com [Fri, 18 Nov 2016 05:11:18 +0000 (05:11 +0000)]
Try to fix some non-macOS builds.

* WebView/WebView.mm:

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

2 years ago[WebIDL] Add support for ByteString
weinig@apple.com [Fri, 18 Nov 2016 05:07:23 +0000 (05:07 +0000)]
[WebIDL] Add support for ByteString
https://bugs.webkit.org/show_bug.cgi?id=164901

Reviewed by Darin Adler.

Source/WebCore:

* bindings/generic/IDLTypes.h:
Make IDLByteString a IDLString.

* bindings/js/JSDOMBinding.cpp:
(WebCore::valueToByteString):
(WebCore::valueToUSVString):
* bindings/js/JSDOMBinding.h:
Add conversion function for ByteString and fix valueToUSVString to take an ExecState reference.

* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLByteString>::convert):
(WebCore::JSConverter<IDLByteString>::convert):
Add conversion functions for ByteString, using valueToByteString.

(WebCore::Converter<IDLUSVString>::convert):
Update to pass the ExecState by reference.

* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
Update to pass the ExecState by reference.

* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::importScripts):
Update to pass the ExecState by reference.

* bindings/scripts/CodeGenerator.pm:
Add ByteString as a string type.

* testing/TypeConversions.h:
(WebCore::TypeConversions::testByteString):
(WebCore::TypeConversions::setTestByteString):
* testing/TypeConversions.idl:
Add a testByteString attribute for testing.

LayoutTests:

* js/dom/webidl-type-mapping-expected.txt:
* js/dom/webidl-type-mapping.html:
Add tests for ByteString using the new TypeConversions.testByteString attribute.

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

2 years agoWKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement...
rniwa@webkit.org [Fri, 18 Nov 2016 04:57:50 +0000 (04:57 +0000)]
WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled
https://bugs.webkit.org/show_bug.cgi?id=164857
<rdar://problem/27721742>

Reviewed by Wenson Hsieh.

Source/WebCore:

It turns out that some users want text replacement to be always enabled so change the semantics of
WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled to only disable everything else.

Instead of completely disabling spellchecking, remove all text checking options but text replacement
when the user types into an input element on which this API is used to disable spellchecking.

No new tests since we don't have a good facility to test text replacement.

* dom/Element.h:
(WebCore::Element::isSpellCheckingEnabled): Made this non-virtual now that there is no override.
* editing/Editor.cpp:
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Don't call resolveTextCheckingTypeMask twice.
(WebCore::Editor::resolveTextCheckingTypeMask): Filter out the text checking options if the root editable
element is inside an input element on which isSpellcheckDisabledExceptTextReplacement is set to true.
* editing/Editor.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::isSpellCheckingEnabled): Deleted.
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::setSpellcheckDisabledExceptTextReplacement): Renamed from setSpellcheckEnabled
to reflect the new semantics.
(WebCore::HTMLInputElement::isSpellcheckDisabledExceptTextReplacement): Ditto.

Source/WebKit2:

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):

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

2 years agoResource load statistics: Cover further data records, count removed data records...
wilander@apple.com [Fri, 18 Nov 2016 03:32:53 +0000 (03:32 +0000)]
Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed
https://bugs.webkit.org/show_bug.cgi?id=164659

Reviewed by Andy Estes.

Source/WebCore:

No new tests. This feature is behind a flag and off by default. Tests require real domain names.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
    All three functions are now more conservative in calls to
    m_store->fireDataModificationHandler(). They only fire when an important statistic has
    changed or data records have previously been removed for the domain in question.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode):
    Added the dataRecordsRemoved statistic.
(WebCore::ResourceLoadStatistics::decode):
    Now takes a version parameter to control which keys to expect.
    Added the dataRecordsRemoved statistic.
(WebCore::appendHashCountedSet):
    Removed stray linefeed.
(WebCore::ResourceLoadStatistics::toString):
    Added the dataRecordsRemoved statistic.
(WebCore::ResourceLoadStatistics::merge):
    Added the dataRecordsRemoved statistic.
* loader/ResourceLoadStatistics.h:
    Added the dataRecordsRemoved statistic.
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
    Now encodes a version number for the statistics model.
(WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
    Now tries to decode a version number and passes it on to statistics decoding.
(WebCore::ResourceLoadStatisticsStore::processStatistics):
    No longer gates processing on the number of data captured.
(WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
    Update function for the new dataRecordsRemoved statistic.
(WebCore::ResourceLoadStatisticsStore::hasEnoughDataForStatisticsProcessing): Deleted.
    No longer needed since we no longer gate processing on the number of data captured.
* loader/ResourceLoadStatisticsStore.h:

Source/WebKit2:

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
    Consistent naming with 'remove' rather than 'delete'.
    Now removes localStorage, IndexDB, disk cache, and memory cache too.
    Updates statistics with number of times it has removed data records.
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
    No longer checks whether it has enough data since the classification rules
    are absolute, not relative.
(WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:
    Consistent naming with 'remove' rather than 'delete'.

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

2 years agoFix WinCairo build after r208740
achristensen@apple.com [Fri, 18 Nov 2016 02:41:35 +0000 (02:41 +0000)]
Fix WinCairo build after r208740
https://bugs.webkit.org/show_bug.cgi?id=164749

* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore::GraphicsContext3D::validateAttributes):
(WebCore::GraphicsContext3D::getExtensions):
Use more references instead of pointers, like Myles did in r208740

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

2 years agoImplement TextDecoder and TextEncoder
achristensen@apple.com [Fri, 18 Nov 2016 02:11:05 +0000 (02:11 +0000)]
Implement TextDecoder and TextEncoder
https://bugs.webkit.org/show_bug.cgi?id=163771

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/encoding/api-basics-expected.txt:
* web-platform-tests/encoding/api-invalid-label-expected.txt:
* web-platform-tests/encoding/api-replacement-encodings-expected.txt:
* web-platform-tests/encoding/api-surrogates-utf8-expected.txt:
* web-platform-tests/encoding/idlharness-expected.txt:
* web-platform-tests/encoding/iso-2022-jp-decoder-expected.txt:
* web-platform-tests/encoding/single-byte-decoder-expected.txt:
* web-platform-tests/encoding/textdecoder-byte-order-marks-expected.txt:
* web-platform-tests/encoding/textdecoder-fatal-expected.txt:
* web-platform-tests/encoding/textdecoder-fatal-single-byte-expected.txt:
* web-platform-tests/encoding/textdecoder-fatal-streaming-expected.txt:
* web-platform-tests/encoding/textdecoder-ignorebom-expected.txt:
* web-platform-tests/encoding/textdecoder-labels-expected.txt:
* web-platform-tests/encoding/textdecoder-streaming-expected.txt:
* web-platform-tests/encoding/textdecoder-utf16-surrogates-expected.txt:
* web-platform-tests/encoding/textencoder-constructor-non-utf-expected.txt:
* web-platform-tests/encoding/textencoder-utf16-surrogates-expected.txt:

Source/WebCore:

This API is already implemented by Chrome and Firefox
as specified in https://encoding.spec.whatwg.org/

Covered by newly passing web platform tests.

* features.json:
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/TextDecoder.cpp: Added.
(WebCore::isEncodingWhitespace):
(WebCore::TextDecoder::create):
(WebCore::TextDecoder::TextDecoder):
(WebCore::TextDecoder::ignoreBOMIfNecessary):
(WebCore::TextDecoder::prependBOMIfNecessary):
(WebCore::codeUnitByteSize):
(WebCore::TextDecoder::decode):
(WebCore::TextDecoder::encoding):
* dom/TextDecoder.h: Added.
(WebCore::TextDecoder::fatal):
(WebCore::TextDecoder::ignoreBOM):
* dom/TextDecoder.idl: Added.
* dom/TextEncoder.cpp: Added.
(WebCore::TextEncoder::TextEncoder):
(WebCore::TextEncoder::encoding):
(WebCore::TextEncoder::encode):
* dom/TextEncoder.h: Added.
(WebCore::TextEncoder::create):
* dom/TextEncoder.idl: Added.

LayoutTests:

* fast/encoding/utf-8-non-ascii-expected.txt: Added.
* fast/encoding/utf-8-non-ascii.html: Added.
* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* 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:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

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

2 years agoTry to fix the windows build again.
weinig@apple.com [Fri, 18 Nov 2016 01:26:05 +0000 (01:26 +0000)]
Try to fix the windows build again.

* svg/SVGStringList.h:
* svg/properties/SVGStaticListPropertyTearOff.h:
(WebCore::SVGStaticListPropertyTearOff::SVGStaticListPropertyTearOff):

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

2 years agoTry to fix the windows build.
weinig@apple.com [Fri, 18 Nov 2016 01:09:44 +0000 (01:09 +0000)]
Try to fix the windows build.

* svg/SVGStringList.h:
Remove unnecessary using declarations.

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

2 years agoRegression(r208672?): ASSERTION FAILED: isMainThread() in WebCore::Node::ref()
cdumez@apple.com [Fri, 18 Nov 2016 00:55:34 +0000 (00:55 +0000)]
Regression(r208672?): ASSERTION FAILED: isMainThread() in WebCore::Node::ref()
https://bugs.webkit.org/show_bug.cgi?id=164887
<rdar://problem/29319497>

Reviewed by Brady Eidson.

Restore pre-r208672 behavior where we do not ref the script execution context in the
background thread since this is unsafe. We use WTFMove(m_scriptExecutionContext)
instead of m_scriptExecutionContext.copyRef(). Before r208672, it was calling
m_scriptExecutionContext.releaseNonNull() because m_scriptExecutionContext was a
RefPtr instead of a Ref. Note that copyRef() causes 2 issues here:
1. It refs the scriptExecutionContext in a non-main thread which is unsafe and asserts.
2. The point of this postTask in the destructor is to make sure the scriptExecutionContext
   gets destroyed in the main thread so we definitely want to *transfer* ownership of
   m_scriptExecutionContext to the main thread, not ref it to pass it to the main thread.

No new tests, already covered by storage/websql/multiple-transactions-on-different-handles.html.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::~Database):

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

2 years agoRebaseline fast/html/keygen.html for Sierra.
ryanhaddad@apple.com [Fri, 18 Nov 2016 00:48:06 +0000 (00:48 +0000)]
Rebaseline fast/html/keygen.html for Sierra.

Unreviewed test gardening.

* platform/mac/fast/html/keygen-expected.txt:

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

2 years ago[JSC] Drop arguments.caller
utatane.tea@gmail.com [Fri, 18 Nov 2016 00:37:28 +0000 (00:37 +0000)]
[JSC] Drop arguments.caller
https://bugs.webkit.org/show_bug.cgi?id=164859

Reviewed by Saam Barati.

JSTests:

* stress/strict-mode-arguments-caller.js: Added.
(strictArguments):
(shouldBe):

Source/JavaScriptCore:

Originally, some JavaScript engine has `arguments.caller` property.
But it easily causes some information leaks and it becomes obstacles
for secure ECMAScript (SES). In ES5, we make it deprecated in strict
mode. To do so, we explicitly set "caller" getter throwing TypeError
to arguments in strict mode.

But now, there is no modern engine which supports `arguments.caller`
in sloppy mode. So the original compatibility problem is gone and
"caller" getter in the strict mode arguments becomes meaningless.

ES2017 drops this from the spec. In this patch, we also drop this
`arguments.caller` in strict mode support.

Note that Function#caller is still alive.

* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
(JSC::ClonedArguments::put):
(JSC::ClonedArguments::deleteProperty):
(JSC::ClonedArguments::defineOwnProperty):
(JSC::ClonedArguments::materializeSpecials):

LayoutTests:

* js/basic-strict-mode-expected.txt:
* js/script-tests/basic-strict-mode.js:
* js/script-tests/strict-throw-type-error.js:
* js/script-tests/throw-type-error-is-unique.js:
(test):
* js/strict-throw-type-error-expected.txt:

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

2 years agoInlining should be disallowed when JSC_alwaysUseShadowChicken=true.
mark.lam@apple.com [Fri, 18 Nov 2016 00:23:34 +0000 (00:23 +0000)]
Inlining should be disallowed when JSC_alwaysUseShadowChicken=true.
https://bugs.webkit.org/show_bug.cgi?id=164893
<rdar://problem/29146436>

Reviewed by Saam Barati.

* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

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

2 years agoAdd _WKIconLoadingDelegate SPI.
beidson@apple.com [Fri, 18 Nov 2016 00:22:44 +0000 (00:22 +0000)]
Add _WKIconLoadingDelegate SPI.
https://bugs.webkit.org/show_bug.cgi?id=164894

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Manual testing possible in MiniBrowser now, WKTR tests coming soon in https://bugs.webkit.org/show_bug.cgi?id=164895).

With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.

WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.

For icons the app decides to load, WebKit will pass the data to the app without storing locally.

* WebCore.xcodeproj/project.pbxproj:

* dom/Document.cpp:
(WebCore::Document::implicitClose):

* html/LinkIconCollector.cpp:
(WebCore::iconSize):
(WebCore::compareIcons):
* html/LinkIconCollector.h:

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading):
(WebCore::DocumentLoader::didGetLoadDecisionForIcon):
(WebCore::DocumentLoader::finishedLoadingIcon):
* loader/DocumentLoader.h:

* loader/FrameLoaderClient.h:

* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::IconLoader):
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:

* platform/LinkIcon.h: Copied from Source/WebCore/html/LinkIconCollector.h.
(WebCore::LinkIcon::encode):
(WebCore::LinkIcon::decode):

Source/WebKit2:

With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.

WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.

For icons the app decides to load, WebKit will pass the data to the app without storing locally.

* UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
(API::IconLoadingClient::~IconLoadingClient):
(API::IconLoadingClient::getLoadDecisionForIcon):

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

* UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.

* UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
(-[_WKLinkIconParameters _initWithLinkIcon:]):
(-[_WKLinkIconParameters url]):
(-[_WKLinkIconParameters mimeType]):
(-[_WKLinkIconParameters size]):
(-[_WKLinkIconParameters iconType]):
* UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.

* UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
(WebKit::IconLoadingDelegate::IconLoadingDelegate):
(WebKit::IconLoadingDelegate::~IconLoadingDelegate):
(WebKit::IconLoadingDelegate::createIconLoadingClient):
(WebKit::IconLoadingDelegate::delegate):
(WebKit::IconLoadingDelegate::setDelegate):
(WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
(WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
(WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setIconLoadingClient):
(WebKit::WebPageProxy::getLoadDecisionForIcon):
(WebKit::WebPageProxy::finishedLoadingIcon):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::iconLoadingClient):
* UIProcess/WebPageProxy.messages.in:

* WebKit2.xcodeproj/project.pbxproj:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::useIconLoadingClient):
(WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
(WebKit::WebFrameLoaderClient::finishedLoadingIcon):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
(WebKit::WebFrameLoaderClient::setUseIconLoadingClient):

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didGetLoadDecisionForIcon):
(WebKit::WebPage::setUseIconLoadingClient):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Add MiniBrowser support for this new SPI, configurable with a setting.

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController loadsAllSiteIcons]):
(-[SettingsController toggleLoadsAllSiteIcons:]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
(-[WK2BrowserWindowController webView:shouldLoadIconWithParameters:completionHandler:]):

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

2 years agoUpdate TestExpectations for media/modern-media-controls/pip-support/pip-support-enabl...
ryanhaddad@apple.com [Fri, 18 Nov 2016 00:11:18 +0000 (00:11 +0000)]
Update TestExpectations for media/modern-media-controls/pip-support/pip-support-enabled.html.
https://bugs.webkit.org/show_bug.cgi?id=164336

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years ago[SVG] Moving more special casing of SVG out of the bindings - SVG lists
weinig@apple.com [Thu, 17 Nov 2016 23:58:03 +0000 (23:58 +0000)]
[SVG] Moving more special casing of SVG out of the bindings - SVG lists
https://bugs.webkit.org/show_bug.cgi?id=164790

Reviewed by Alex Christensen.

- Make SVGLengthList, SVGNumberList, SVGPointList, SVGStringList, SVGPathSegList and SVGTransformList
  real classes and stop special casing them in the bindings generator. This
  removes the remaining SVG specializations for tear offs from the bindings generator.
- Renamed existing SVGLengthList, SVGNumberList, SVGPointList, SVGStringList, SVGPathSegList,
  SVGPathSegList and SVGTransformList to SVG<Type>ListValues, to make way for the new classes.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAllInOne.cpp:
Add new files.

* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/CodeGeneratorJS.pm:
Remove SVG tear off specific code!

* rendering/svg/RenderSVGShape.cpp:
* rendering/svg/RenderSVGText.cpp:
* rendering/svg/RenderSVGTextPath.cpp:
* rendering/svg/SVGRenderTreeAsText.cpp:
* svg/SVGAnimateMotionElement.cpp:
* svg/SVGClipPathElement.cpp:
* svg/SVGLinearGradientElement.cpp:
* svg/SVGRadialGradientElement.cpp:
Remove unnecessary #includes.

* rendering/svg/SVGPathData.cpp:
(WebCore::updatePathFromPolygonElement):
(WebCore::updatePathFromPolylineElement):
* rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
(WebCore::updateCharacterData):
(WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap):
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::constructFromString):
(WebCore::parseLengthListFromString):
(WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedLengthListAnimator::calculateDistance):
* svg/SVGAnimatedLengthList.h:
* svg/SVGAnimatedNumberList.cpp:
(WebCore::SVGAnimatedNumberListAnimator::constructFromString):
(WebCore::SVGAnimatedNumberListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedNumberListAnimator::calculateDistance):
* svg/SVGAnimatedNumberList.h:
* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedPointList.cpp:
(WebCore::SVGAnimatedPointListAnimator::constructFromString):
(WebCore::SVGAnimatedPointListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedPointListAnimator::calculateDistance):
* svg/SVGAnimatedPointList.h:
* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::constructFromString):
(WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
* svg/SVGAnimatedTransformList.h:
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::createLengthList):
(WebCore::SVGAnimatedType::createNumberList):
(WebCore::SVGAnimatedType::createPointList):
(WebCore::SVGAnimatedType::createTransformList):
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::lengthList):
(WebCore::SVGAnimatedType::numberList):
(WebCore::SVGAnimatedType::pointList):
(WebCore::SVGAnimatedType::transformList):
* svg/SVGComponentTransferFunctionElement.cpp:
(WebCore::SVGComponentTransferFunctionElement::parseAttribute):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::parseAttribute):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
(WebCore::SVGFEConvolveMatrixElement::build):
* svg/SVGParserUtilities.cpp:
(WebCore::pointsListFromSVGData):
* svg/SVGParserUtilities.h:
* svg/SVGPathElement.cpp:
* svg/SVGPathElement.h:
* svg/SVGPathSegListBuilder.cpp:
* svg/SVGPathSegListBuilder.h:
* svg/SVGPathSegListSource.cpp:
* svg/SVGPathSegListSource.h:
* svg/SVGPathUtilities.cpp:
(WebCore::buildSVGPathByteStreamFromSVGPathSegListValues):
(WebCore::appendSVGPathByteStreamFromSVGPathSeg):
(WebCore::buildSVGPathSegListValuesFromByteStream):
(WebCore::buildStringFromSVGPathSegListValues):
(WebCore::buildSVGPathByteStreamFromSVGPathSegList): Deleted.
(WebCore::buildSVGPathSegListFromByteStream): Deleted.
(WebCore::buildStringFromSVGPathSegList): Deleted.
* svg/SVGPathUtilities.h:
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::parseAttribute):
(WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
(WebCore::SVGPolyElement::points):
(WebCore::SVGPolyElement::animatedPoints):
* svg/SVGPolyElement.h:
(WebCore::SVGPolyElement::pointList):
* svg/SVGTextPositioningElement.cpp:
(WebCore::SVGTextPositioningElement::parseAttribute):
* svg/SVGTransformable.cpp:
(WebCore::SVGTransformable::parseTransformAttribute):
* svg/SVGTransformable.h:
* svg/SVGViewElement.cpp:
(WebCore::SVGViewElement::viewTarget):
(WebCore::SVGViewElement::parseAttribute):
* svg/SVGViewElement.h:
* svg/SVGViewElement.idl:
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::transformString):
(WebCore::SVGViewSpec::transform):
(WebCore::SVGViewSpec::lookupOrCreateTransformWrapper):
(WebCore::SVGViewSpec::reset):
* svg/SVGViewSpec.h:
Update for name changes.

* svg/SVGAngle.h:
(WebCore::SVGAngle::create):
(WebCore::SVGAngle::SVGAngle):
* svg/SVGLength.h:
(WebCore::SVGLength::create):
(WebCore::SVGLength::SVGLength):
* svg/SVGMatrix.h:
(WebCore::SVGMatrix::create):
(WebCore::SVGMatrix::SVGMatrix):
* svg/SVGNumber.h:
(WebCore::SVGNumber::create):
(WebCore::SVGNumber::SVGNumber):
* svg/SVGPoint.h:
(WebCore::SVGPoint::create):
(WebCore::SVGPoint::SVGPoint):
* svg/SVGPreserveAspectRatio.h:
(WebCore::SVGPreserveAspectRatio::create):
(WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio):
* svg/SVGRect.h:
(WebCore::SVGRect::create):
(WebCore::SVGRect::SVGRect):
* svg/SVGTransform.h:
(WebCore::SVGTransform::create):
(WebCore::SVGTransform::SVGTransform):
* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::create):
Pass the SVGAnimatedProperty parameter by reference.

* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::requiredFeatures):
(WebCore::SVGAnimationElement::requiredExtensions):
(WebCore::SVGAnimationElement::systemLanguage):
* svg/SVGAnimationElement.h:
* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::requiredFeatures):
(WebCore::SVGCursorElement::requiredExtensions):
(WebCore::SVGCursorElement::systemLanguage):
* svg/SVGCursorElement.h:
* svg/SVGGradientElement.cpp:
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::requiredFeatures):
(WebCore::SVGGraphicsElement::requiredExtensions):
(WebCore::SVGGraphicsElement::systemLanguage):
* svg/SVGGraphicsElement.h:
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::requiredFeatures):
(WebCore::SVGMaskElement::requiredExtensions):
(WebCore::SVGMaskElement::systemLanguage):
* svg/SVGMaskElement.h:
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::parseAttribute):
(WebCore::SVGPatternElement::requiredFeatures):
(WebCore::SVGPatternElement::requiredExtensions):
(WebCore::SVGPatternElement::systemLanguage):
* svg/SVGPatternElement.h:
* svg/SVGTests.cpp:
(WebCore::SVGTests::synchronizeAttribute):
(WebCore::SVGTests::synchronizeRequiredFeatures):
(WebCore::SVGTests::synchronizeRequiredExtensions):
(WebCore::SVGTests::synchronizeSystemLanguage):
(WebCore::SVGTests::requiredFeatures):
(WebCore::SVGTests::requiredExtensions):
(WebCore::SVGTests::systemLanguage):
* svg/SVGTests.h:
* svg/SVGTests.idl:
Make SVGTests SVGStringLists work by adding implementations of functions
on the SVGElements that implement SVGTests, passing *this down to SVGTests.

* svg/SVGLengthList.cpp: Removed.
* svg/SVGLengthList.h:
* svg/SVGLengthList.idl:
* svg/SVGLengthListValues.cpp: Copied from svg/SVGLengthList.cpp.
* svg/SVGLengthListValues.h: Copied from svg/SVGLengthList.h.
Rename SVGLengthList to SVGLengthListValues and add an explicit implementation of
the SVGLengthList interface inheriting from SVGListPropertyTearOff<SVGLengthListValues>.

* svg/SVGNumberList.cpp: Removed.
* svg/SVGNumberList.h:
* svg/SVGNumberListValues.cpp: Copied from svg/SVGNumberList.cpp.
* svg/SVGNumberListValues.h: Copied from svg/SVGNumberList.h.
Rename SVGNumberList to SVGNumberListValues and add an explicit implementation of
the SVGNumberList interface inheriting from SVGListPropertyTearOff<SVGNumberListValues>.

* svg/SVGPathSegList.cpp:
* svg/SVGPathSegList.h:
* svg/SVGPathSegListValues.cpp: Copied from svg/SVGPathSegList.cpp.
* svg/SVGPathSegListValues.h: Copied from svg/SVGPathSegList.h.
* svg/properties/SVGPathSegListPropertyTearOff.cpp: Removed.
* svg/properties/SVGPathSegListPropertyTearOff.h: Removed.
Rename SVGPathSegList to SVGPathSegListValues and add an explicit implementation of
the SVGPathSegList interface inheriting from SVGListProperty<SVGPathSegListValues>.

* svg/SVGPointList.cpp: Removed.
* svg/SVGPointList.h:
* svg/SVGPointListValues.cpp: Copied from svg/SVGPointList.cpp.
* svg/SVGPointListValues.h: Copied from svg/SVGPointList.h.
Rename SVGPointList to SVGPointListValues and add an explicit implementation of
the SVGPointList interface inheriting from SVGListPropertyTearOff<SVGPointListValues>.

* svg/SVGStringList.cpp: Removed.
* svg/SVGStringList.h:
* svg/SVGStringListValues.cpp: Copied from svg/SVGStringList.cpp.
* svg/SVGStringListValues.h: Copied from svg/SVGStringList.h.
Rename SVGStringList to SVGStringListValues and add an explicit implementation of
the SVGStringList interface inheriting from SVGStaticListPropertyTearOff<SVGStringListValues>.

* svg/SVGTransformList.cpp: Removed.
* svg/SVGTransformList.h:
* svg/SVGTransformListValues.cpp: Copied from svg/SVGTransformList.cpp.
* svg/SVGTransformListValues.h: Copied from svg/SVGTransformList.h.
* svg/properties/SVGTransformListPropertyTearOff.h: Removed.
Rename SVGTransformList to SVGTransformListValues and add an explicit implementation of
the SVGTransformList interface inheriting from SVGListPropertyTearOff<SVGTransformListValues>.

* svg/properties/SVGAnimatedListPropertyTearOff.h:
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGAnimatedPropertyTearOff.h:
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
* svg/properties/SVGStaticListPropertyTearOff.h:
Convert to return fully specialized types for baseVal and animVal, removing many unnecessary casts
around the codebase. Also add some uses of Ref.

* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::getItemValuesAndWrappers):
(WebCore::SVGListProperty::removeItemValuesAndWrappers):
* svg/properties/SVGListPropertyTearOff.h:
(WebCore::SVGListPropertyTearOff::create):
(WebCore::SVGListPropertyTearOff::SVGListPropertyTearOff):
(WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff):
Store the AnimatedListPropertyTearOff as a Ref, and pass it around by reference.

* svg/properties/SVGStaticPropertyTearOff.h:
Update to take the ContextElement by reference.

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

2 years agoCorrect a typo in a TestExpectations file.
ryanhaddad@apple.com [Thu, 17 Nov 2016 23:54:01 +0000 (23:54 +0000)]
Correct a typo in a TestExpectations file.

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoImprove URL length handling
bfulgham@apple.com [Thu, 17 Nov 2016 23:05:37 +0000 (23:05 +0000)]
Improve URL length handling
https://bugs.webkit.org/show_bug.cgi?id=164884
<rdar://problem/5909143>

Reviewed by David Kilzer.

Make sure the result of re-encoding and other fix-up stays within
expected parameters.

No new tests. No change in behavior.

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

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

2 years agoSpeculatively disable eager object zero-fill on not-x86 to let the bots decide if...
fpizlo@apple.com [Thu, 17 Nov 2016 21:37:05 +0000 (21:37 +0000)]
Speculatively disable eager object zero-fill on not-x86 to let the bots decide if that's a problem
https://bugs.webkit.org/show_bug.cgi?id=164885

Reviewed by Mark Lam.

This adds a useGCFences() function that we use to guard all eager object zero-fill and the
related fences. It currently returns true only on x86().

The goal here is to get the bots to tell us if this code is responsible for perf issues on
any non-x86 platforms. We have a few different paths that we can pursue if this turns out
to be the case. Eager zero-fill is merely the easiest way to optimize out some fences, but
we could get rid of it and instead teach B3 how to think about fences.

* assembler/CPU.h:
(JSC::useGCFences):
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::generateImpl):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::reallocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::allocateObject):
(JSC::FTL::DFG::LowerDFGToB3::mutatorFence):
(JSC::FTL::DFG::LowerDFGToB3::setButterfly):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::mutatorFence):
(JSC::AssemblyHelpers::storeButterfly):
(JSC::AssemblyHelpers::emitInitializeInlineStorage):
(JSC::AssemblyHelpers::emitInitializeOutOfLineStorage):

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

2 years agoRender tree should be all clean by the end of FrameView::layout().
zalan@apple.com [Thu, 17 Nov 2016 21:23:45 +0000 (21:23 +0000)]
Render tree should be all clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=162834

Reviewed by Simon Fraser.

Source/WebCore:

This is a preventive patch to ensure we don't introduce new bugs through
dirty renderers. There are still 3 failing cases and they are skipped for now (debug only).

* page/FrameView.cpp:
(WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):

LayoutTests:

* TestExpectations:

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

2 years agokeygen element should not support < 2048 RSA key lengths
bfulgham@apple.com [Thu, 17 Nov 2016 21:20:20 +0000 (21:20 +0000)]
keygen element should not support < 2048 RSA key lengths
https://bugs.webkit.org/show_bug.cgi?id=164874
<rdar://problem/22618141>

Reviewed by Dean Jackson.

Source/WebCore:

Remove the two insecure RSA choices (512-bit and 1024-bit) so that users
do not accidentally select a bad key length.

Tested by fast/html/keygen.html

* platform/LocalizedStrings.cpp:
(WebCore::keygenMenuItem512): Deleted.
(WebCore::keygenMenuItem1024): Deleted.
* platform/LocalizedStrings.h:
* platform/mac/SSLKeyGeneratorMac.mm:
(WebCore::signedPublicKeyAndChallengeString): ASSERT on bad key size.
(WebCore::getSupportedKeySizes): Remove bad key sizes.
(WebCore::signedPublicKeyAndChallengeString): Ditto.
* platform/win/SSLKeyGeneratorWin.cpp:
(WebCore::WebCore::getSupportedKeySizes): Ditto.

LayoutTests:

* platform/mac/fast/html/keygen-expected.txt:
* platform/mac-elcapitan/fast/html/keygen-expected.txt:

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

2 years agoWeb Inspector: Shift clicking on named color value only shows its hex form
commit-queue@webkit.org [Thu, 17 Nov 2016 20:25:24 +0000 (20:25 +0000)]
Web Inspector: Shift clicking on named color value only shows its hex form
https://bugs.webkit.org/show_bug.cgi?id=162758

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-11-17
Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

* UserInterface/Models/Color.js:
(WebInspector.Color.prototype.nextFormat):
Reworked the logic for the formatting order to be the following:
 - Long HEX and Long HEXAlpha
 - RGB and RGBA
 - HSL and HSLA
 - Keyword (if applicable)
 - Short HEX (if applicable)
 - Short HEXAlpha (if applicable)
It will only show formats with alpha values if the color value has an alpha that is not 1.
If the alpha is not 1, it will not show formats with non-alpha values.

The changes to this function have no effect on the context menu items of InlineSwatch
elements.  The purpose of each of those items is to allow the user to change the format to
a specified type, whereas WebInspector.Color.prototype.nextFormat is used to cycle through
all of the relevant formats.

(WebInspector.Color.prototype._toRGBString):
(WebInspector.Color.prototype._toRGBAString):
(WebInspector.Color.prototype._toHSLString):
(WebInspector.Color.prototype._toHSLAString):
Unrelated fix of extra decimals when converting from HEX to RGB and HSL.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor._inlineSwatchValueChanged):
Removed assertion for `_hasActiveInlineSwatchEditor` since the value may change from
switching the format of a color swatch (Shift-Click).

LayoutTests:

* inspector/model/color.html:
Updated the WebInspector.Color.prototype.nextFormat test for the new nextFormat logic.

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

2 years ago[JSC] remove leftover references to ES2017_ASYNCFUNCTION_SYNTAX flag
caitp@igalia.com [Thu, 17 Nov 2016 20:15:51 +0000 (20:15 +0000)]
[JSC] remove leftover references to ES2017_ASYNCFUNCTION_SYNTAX flag
https://bugs.webkit.org/show_bug.cgi?id=164879

Reviewed by Alex Christensen.

The flag was referenced in FeatureList.pm and in one of the
FeatureDefines.xcconfig files, despite being removed.

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

2 years agoAdd rotate to Wasm
keith_miller@apple.com [Thu, 17 Nov 2016 19:21:42 +0000 (19:21 +0000)]
Add rotate to Wasm
https://bugs.webkit.org/show_bug.cgi?id=164871

Reviewed by Filip Pizlo.

JSTests:

* wasm/wasm.json:

Source/JavaScriptCore:

Add rotate left and rotate right to Wasm. These directly map to B3 opcodes.
This also moves arm specific transformations of rotate left to lower macros
after optimization. It's a bad idea to have platform specific canonicalizations
in reduce strength since other optimizations may not be aware of it.

Add a bug to do pure CSE after lower macros after optimization since we want to
clean up RotL(value, Neg(Neg(shift))).

* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* b3/B3LowerMacrosAfterOptimizations.cpp:
* b3/B3ReduceStrength.cpp:
* wasm/wasm.json:

Websites/webkit.org:

Update docs for new rotate instructions.

* docs/b3/intermediate-representation.html:

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

2 years agoAdd sqrt to Wasm
keith_miller@apple.com [Thu, 17 Nov 2016 19:07:31 +0000 (19:07 +0000)]
Add sqrt to Wasm
https://bugs.webkit.org/show_bug.cgi?id=164877

Reviewed by Mark Lam.

B3 already has a Sqrt opcode we just need to map Wasm to it.

* wasm/wasm.json:

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

2 years agoMarking http/tests/media/modern-media-controls/skip-back-support/skip-back-support...
ryanhaddad@apple.com [Thu, 17 Nov 2016 18:57:10 +0000 (18:57 +0000)]
Marking http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=164616

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMarking inspector/worker/debugger-multiple-targets-pause.html as flaky.
ryanhaddad@apple.com [Thu, 17 Nov 2016 18:50:47 +0000 (18:50 +0000)]
Marking inspector/worker/debugger-multiple-targets-pause.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=164872

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years ago[MediaStream][Mac] Use AVCapturePreview object for camera/microphone rendering
eric.carlson@apple.com [Thu, 17 Nov 2016 18:43:40 +0000 (18:43 +0000)]
[MediaStream][Mac] Use AVCapturePreview object for camera/microphone rendering
https://bugs.webkit.org/show_bug.cgi?id=164837
<rdar://problem/29297727>

Reviewed by Jer Noble.

No new tests, the real capture devices can not be used in layout tests.

* WebCore.xcodeproj/project.pbxproj:

Drive-by fix: clear m_settingMediaStreamSrcObject when the media player is destroyed unless
that happens as a side effect of setting video.srcObject.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setSrcObject):
(WebCore::HTMLMediaElement::clearMediaPlayer):
* html/HTMLMediaElement.h:

Add support for realtime media source that vend a preview interface, while keeping support
for those that do not (e.g. the mock capture devices).
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBuffer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareVideoSampleBufferFromTrack):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::internalSetVolume):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):

* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::platformLayer): Deleted, no longer used.
* platform/mediastream/MediaStreamPrivate.h:

Enable/disable the preview when available.
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::setEnabled):
(WebCore::MediaStreamTrackPrivate::endTrack):
(WebCore::MediaStreamTrackPrivate::preview):
* platform/mediastream/MediaStreamTrackPrivate.h:

* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::preview):
(WebCore::RealtimeMediaSource::createWeakPtr):
(WebCore::RealtimeMediaSource::platformLayer): Deleted.

Define a realtime media source preview interface.
* platform/mediastream/RealtimeMediaSourcePreview.h: Added.
(WebCore::RealtimeMediaSourcePreview::~RealtimeMediaSourcePreview):
(WebCore::RealtimeMediaSourcePreview::invalidate):
(WebCore::RealtimeMediaSourcePreview::createWeakPtr):
(WebCore::RealtimeMediaSourcePreview::RealtimeMediaSourcePreview):

Implement the preview interface.
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioSourcePreview::create):
(WebCore::AVAudioSourcePreview::AVAudioSourcePreview):
(WebCore::AVAudioSourcePreview::invalidate):
(WebCore::AVAudioSourcePreview::play):
(WebCore::AVAudioSourcePreview::pause):
(WebCore::AVAudioSourcePreview::setEnabled):
(WebCore::AVAudioSourcePreview::setVolume):
(WebCore::AVAudioSourcePreview::updateState):
(WebCore::AVAudioCaptureSource::createPreview):
* platform/mediastream/mac/AVMediaCaptureSource.h:
(WebCore::AVMediaCaptureSource::createWeakPtr):
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
(WebCore::AVMediaCaptureSource::reset):
(WebCore::AVMediaCaptureSource::preview):
(WebCore::AVMediaCaptureSource::removePreview):
(WebCore::AVMediaSourcePreview::AVMediaSourcePreview):
(WebCore::AVMediaSourcePreview::~AVMediaSourcePreview):
(WebCore::AVMediaSourcePreview::invalidate):
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoSourcePreview::create):
(WebCore::AVVideoSourcePreview::AVVideoSourcePreview):
(WebCore::AVVideoSourcePreview::invalidate):
(WebCore::AVVideoSourcePreview::play):
(WebCore::AVVideoSourcePreview::pause):
(WebCore::AVVideoSourcePreview::setPaused):
(WebCore::AVVideoSourcePreview::setEnabled):
(WebCore::AVVideoCaptureSource::shutdownCaptureSession):
(WebCore::AVVideoCaptureSource::processNewFrame):
(WebCore::AVVideoCaptureSource::createPreview):
(WebCore::AVVideoCaptureSource::platformLayer): Deleted.

* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::platformLayer): Deleted.
(WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer): Deleted.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::applyFrameRate):
(WebCore::MockRealtimeVideoSource::applySize):
(WebCore::MockRealtimeVideoSource::generateFrame):
* platform/mock/MockRealtimeVideoSource.h:
(WebCore::MockRealtimeVideoSource::updatePlatformLayer): Deleted.

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

2 years agoMarking imported/w3c/web-platform-tests/IndexedDB/idbcursor_iterating.htm as flaky...
ryanhaddad@apple.com [Thu, 17 Nov 2016 18:19:55 +0000 (18:19 +0000)]
Marking imported/w3c/web-platform-tests/IndexedDB/idbcursor_iterating.htm as flaky on mac-wk2 debug.
https://bugs.webkit.org/show_bug.cgi?id=164870

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoUnreviewed, fix build after r208839.
cdumez@apple.com [Thu, 17 Nov 2016 18:08:28 +0000 (18:08 +0000)]
Unreviewed, fix build after r208839.

* dom/Node.h:
(WebCore::Node::isDescendantOf):

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

2 years agoAdd support for rotate in B3 and the relevant assemblers
keith_miller@apple.com [Thu, 17 Nov 2016 17:52:03 +0000 (17:52 +0000)]
Add support for rotate in B3 and the relevant assemblers
https://bugs.webkit.org/show_bug.cgi?id=164869

Reviewed by Geoffrey Garen.

This patch runs RotR and RotL (rotate right and left respectively)
through B3 and B3's assemblers. One thing of note is that ARM64 does
not support rotate left instead it allows negative right rotations.

This patch also fixes a theoretical bug in the assembler where
on X86 doing someShiftOp(reg, edx) would instead shift the shift
amount by the value. Additionally, this patch refactors some
of the X86 assembler to use templates when deciding how to format
the appropriate shift instruction.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::rotateRight32):
(JSC::MacroAssemblerARM64::rotateRight64):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::rotateRight32):
(JSC::MacroAssemblerX86Common::rotateLeft32):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::lshift64):
(JSC::MacroAssemblerX86_64::rshift64):
(JSC::MacroAssemblerX86_64::urshift64):
(JSC::MacroAssemblerX86_64::rotateRight64):
(JSC::MacroAssemblerX86_64::rotateLeft64):
(JSC::MacroAssemblerX86_64::or64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::xorq_rm):
(JSC::X86Assembler::shiftInstruction32):
(JSC::X86Assembler::sarl_i8r):
(JSC::X86Assembler::shrl_i8r):
(JSC::X86Assembler::shll_i8r):
(JSC::X86Assembler::rorl_i8r):
(JSC::X86Assembler::rorl_CLr):
(JSC::X86Assembler::roll_i8r):
(JSC::X86Assembler::roll_CLr):
(JSC::X86Assembler::shiftInstruction64):
(JSC::X86Assembler::sarq_CLr):
(JSC::X86Assembler::sarq_i8r):
(JSC::X86Assembler::shrq_i8r):
(JSC::X86Assembler::shlq_i8r):
(JSC::X86Assembler::rorq_i8r):
(JSC::X86Assembler::rorq_CLr):
(JSC::X86Assembler::rolq_i8r):
(JSC::X86Assembler::rolq_CLr):
* b3/B3Common.h:
(JSC::B3::rotateRight):
(JSC::B3::rotateLeft):
* b3/B3Const32Value.cpp:
(JSC::B3::Const32Value::rotRConstant):
(JSC::B3::Const32Value::rotLConstant):
* b3/B3Const32Value.h:
* b3/B3Const64Value.cpp:
(JSC::B3::Const64Value::rotRConstant):
(JSC::B3::Const64Value::rotLConstant):
* b3/B3Const64Value.h:
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::lower):
* b3/B3Opcode.cpp:
(WTF::printInternal):
* b3/B3Opcode.h:
* b3/B3ReduceStrength.cpp:
* b3/B3Validate.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::rotRConstant):
(JSC::B3::Value::rotLConstant):
(JSC::B3::Value::effects):
(JSC::B3::Value::key):
(JSC::B3::Value::typeFor):
* b3/B3Value.h:
* b3/B3ValueKey.cpp:
(JSC::B3::ValueKey::materialize):
* b3/air/AirInstInlines.h:
(JSC::B3::Air::isRotateRight32Valid):
(JSC::B3::Air::isRotateLeft32Valid):
(JSC::B3::Air::isRotateRight64Valid):
(JSC::B3::Air::isRotateLeft64Valid):
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::testRotR):
(JSC::B3::testRotL):
(JSC::B3::testRotRWithImmShift):
(JSC::B3::testRotLWithImmShift):
(JSC::B3::run):

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

2 years ago[CSS Parser] Add @supports, @keyframe and media query parsing options
hyatt@apple.com [Thu, 17 Nov 2016 17:28:52 +0000 (17:28 +0000)]
[CSS Parser] Add @supports, @keyframe and media query parsing options
https://bugs.webkit.org/show_bug.cgi?id=164821

Reviewed by Sam Weinig and Zalan Bujtas.

Source/WebCore:

* css/CSSKeyframeRule.cpp:
(WebCore::StyleKeyframe::setKeyText):
* css/CSSKeyframeRule.h:
* css/CSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::findKeyframeIndex):
Changed to call into CSSParserImpls implementation. The new parser
is now always used when parsing the key list.

* css/MediaList.cpp:
(WebCore::MediaQuerySet::create):
(WebCore::MediaQuerySet::MediaQuerySet):
(WebCore::MediaQuerySet::set):
(WebCore::MediaQuerySet::add):
(WebCore::MediaQuerySet::remove):
(WebCore::MediaList::setMediaText):
(WebCore::parseMediaDescriptor): Deleted.
(WebCore::MediaQuerySet::internalParse): Deleted.
(WebCore::MediaQuerySet::parse): Deleted.
* css/MediaList.h:
Rewritten to remove fallback descriptor support/parsing, since no other
browser supports it, and this was part of our initial 2005 landing that
nobody else appears to use.  Media queries now call into the new parser always.

* css/MediaQueryExp.cpp:
(WebCore::featureWithValidDensity):
(WebCore::featureWithPositiveNumber):
(WebCore::MediaQueryExpression::MediaQueryExpression):
Make sure to support transform2d, animation and transition.

* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium):
Call the normal create now that fallback descriptor syntax is gone.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseKeyframeRule):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::parseInlineStyleDeclaration):
(WebCore::CSSParser::parseDeclarationDeprecated):
(WebCore::CSSParser::parseDeclaration):
(WebCore::CSSParser::parseKeyframeKeyList):
(WebCore::CSSParser::parseMediaQuery): Deleted.
(WebCore::CSSParser::parseKeyframeSelector): Deleted.
* css/parser/CSSParser.h:
Patched the old parser to have flags to call into the new parser
for supports conditions and keyframes. Rename the parseDeclaration that
is only used by the old parser to have the word Deprecated in it. Removed
the media query and key list parsing functions, since the new parser
now does it always.

* css/parser/CSSParserIdioms.cpp:
(WebCore::convertToASCIILowercaseInPlace): Deleted.
* css/parser/CSSParserIdioms.h:
* css/parser/CSSParserToken.cpp:
(WebCore::convertToASCIILowercaseInPlace):
(WebCore::CSSParserToken::convertToASCIILowercaseInPlace):
* css/parser/CSSParserToken.h:
(WebCore::CSSParserToken::value):
(WebCore::CSSParserToken::initValueFromStringView):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoElementSelectorFromStringView):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAttr):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeId):
(WebCore::CSSSelectorParser::consumeClass):
(WebCore::CSSSelectorParser::consumePseudo):
Moving convertToASCIILowercase to be a CSSParserToken member function instead
of operating on StringView. This saves an extra step, since the token itself
already had all the correct members. Note that converting in-place is bad,
and we'll be removing it once the new parser turns on.

* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::readMediaType):
(WebCore::MediaQueryParser::readFeature):
(WebCore::MediaQueryParser::readFeatureEnd):
Require the closing ")" on features. Fix the in-place lowercasing to only
be done for features, not for types. This matches the old parser.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createCSSStyleSheet):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::initializeStyleSheet):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::parseAttribute):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::mediaAttributeMatches):
Patched to call the normal MediaQuerySet::create and not the one that had fallback
descriptor support.

Source/WebKit/mac:

Fix up the create call now that fallback descriptor syntax is gone.

* DOM/DOM.mm:
(-[DOMHTMLLinkElement _mediaQueryMatches]):

LayoutTests:

Delete the fallback descriptor tests, since that feature has been
removed. Update some of the other tests based off some parsing changes
from using the new parser always.

* fast/media/media-descriptor-syntax-01-expected.html: Removed.
* fast/media/media-descriptor-syntax-01.html: Removed.
* fast/media/media-descriptor-syntax-02-expected.html: Removed.
* fast/media/media-descriptor-syntax-02.html: Removed.
* fast/media/media-descriptor-syntax-03-expected.html: Removed.
* fast/media/media-descriptor-syntax-03.html: Removed.
* fast/media/media-descriptor-syntax-04-expected.html: Removed.
* fast/media/media-descriptor-syntax-04.html: Removed.
* fast/media/media-descriptor-syntax-06-expected.html: Removed.
* fast/media/media-descriptor-syntax-06.html: Removed.
* fast/media/media-query-list-02-expected.txt:
* fast/media/media-query-list-03-expected.txt:
* fast/media/media-query-list-04-expected.txt:
* fast/media/media-query-list-05-expected.txt:
* fast/media/media-query-list-06-expected.txt:
* fast/media/mq-pointer-expected.txt:
* fast/media/w3c/test_media_queries-expected.txt:

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

2 years agoRemove pass expectation for custom-elements tests on ios-sim because CEReactions...
ryanhaddad@apple.com [Thu, 17 Nov 2016 17:21:43 +0000 (17:21 +0000)]
Remove pass expectation for custom-elements tests on ios-sim because CEReactions were disabled in r208837.
https://bugs.webkit.org/show_bug.cgi?id=164852

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

2 years agoUnreviewed, attempt to fix link error after r208841 part2
utatane.tea@gmail.com [Thu, 17 Nov 2016 10:59:38 +0000 (10:59 +0000)]
Unreviewed, attempt to fix link error after r208841 part2

Use static_cast to avoid referencing static storage.

* storage/StorageMap.cpp:
(WebCore::StorageMap::setItemIgnoringQuota):

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

2 years agoUnreviewed, attempt to fix link error after r208841
utatane.tea@gmail.com [Thu, 17 Nov 2016 10:53:16 +0000 (10:53 +0000)]
Unreviewed, attempt to fix link error after r208841

* storage/StorageMap.h:

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

2 years agoRemove async/await compile time flag and enable tests
sbarati@apple.com [Thu, 17 Nov 2016 09:05:11 +0000 (09:05 +0000)]
Remove async/await compile time flag and enable tests
https://bugs.webkit.org/show_bug.cgi?id=164828
<rdar://problem/28639334>

Reviewed by Yusuke Suzuki.

.:

* Source/cmake/WebKitFeatures.cmake:

JSTests:

* stress/async-arrow-functions-lexical-arguments-binding.js:
* stress/async-arrow-functions-lexical-new.target-binding.js:
* stress/async-arrow-functions-lexical-super-binding.js:
* stress/async-arrow-functions-lexical-this-binding.js:
* stress/async-await-basic.js:
* stress/async-await-long-loop.js:
* stress/async-await-module-reserved-word.js:
* stress/async-await-mozilla.js:
(mozSyntaxErrors):
* stress/async-await-reserved-word.js:
* stress/async-await-syntax.js:
* stress/async-await-throw-loop.js:
* stress/async-function-create-nobaseline.js:
* stress/async-function-create-optimized.js:
* stress/async-function-declaration-sinking-no-double-allocate.js:
* stress/async-function-declaration-sinking-osrexit.js:
* stress/async-function-declaration-sinking-put.js:
* stress/async-function-expression-sinking-no-double-allocate.js:
* stress/async-function-expression-sinking-osrexit.js:
* stress/async-function-expression-sinking-put.js:
* test262.yaml:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseStatementListItem):
(JSC::Parser<LexerType>::parseStatement):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseExportDeclaration):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseMemberExpression):
(JSC::Parser<LexerType>::parseUnaryExpression):

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

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

2 years ago[Win] run-api-tests is failing.
pvollan@apple.com [Thu, 17 Nov 2016 09:04:24 +0000 (09:04 +0000)]
[Win] run-api-tests is failing.
https://bugs.webkit.org/show_bug.cgi?id=164818

Reviewed by Alexey Proskuryakov.

Make sure Visual Studio interprets string literal as utf8.

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

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

2 years ago[JSC] WTF::TemporaryChange with WTF::SetForScope
utatane.tea@gmail.com [Thu, 17 Nov 2016 08:48:34 +0000 (08:48 +0000)]
[JSC] WTF::TemporaryChange with WTF::SetForScope
https://bugs.webkit.org/show_bug.cgi?id=164761

Reviewed by Saam Barati.

Source/JavaScriptCore:

* bytecompiler/BytecodeGenerator.h:
* bytecompiler/SetForScope.h: Removed.
* debugger/Debugger.cpp:
* inspector/InspectorBackendDispatcher.cpp:
(Inspector::BackendDispatcher::dispatch):
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::dispatchBreakpointActionLog):
(Inspector::ScriptDebugServer::dispatchBreakpointActionSound):
(Inspector::ScriptDebugServer::dispatchBreakpointActionProbe):
(Inspector::ScriptDebugServer::sourceParsed):
(Inspector::ScriptDebugServer::dispatchFunctionToListeners):
* parser/Parser.cpp:

Source/WebCore:

No behavior change.

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateModule):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
* css/StyleResolver.cpp:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFillShorthand):
(WebCore::CSSParser::parseShorthand):
(WebCore::CSSParser::parse4Values):
(WebCore::CSSParser::parseBorderRadius):
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
* dom/CustomElementRegistry.h:
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
(WebCore::Document::destroyRenderTree):
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* dom/Microtasks.cpp:
(WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
* history/PageCache.cpp:
(WebCore::PageCache::pruneToSizeNow):
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::scan):
* html/parser/HTMLConstructionSite.h:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::handleProvisionalLoadFailure):
* loader/SubresourceLoader.cpp:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
(WebCore::MemoryCache::pruneDeadResourcesToSize):
* page/Chrome.cpp:
(WebCore::Chrome::runModal):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::applyRecursivelyWithVisibleRect):
(WebCore::FrameView::autoSizeIfEnabled):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::didReceiveHeaders):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::commitLayerChangesAfterSublayers):
* platform/graphics/opengl/TemporaryOpenGLSetting.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawTexture):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::writeClipboardContents):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paint):
* rendering/RenderBlock.cpp:
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::pushMappingsToAncestor):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
* rendering/RenderView.cpp:
(WebCore::RenderView::hitTest):
* replay/EventLoopInputDispatcher.cpp:
(WebCore::EventLoopInputDispatcher::dispatchInput):
* storage/StorageMap.cpp:
(WebCore::StorageMap::setItemIgnoringQuota):
* svg/SVGPathBlender.cpp:
(WebCore::SVGPathBlender::addAnimatedPath):

Source/WebKit:

* WebCoreSupport/WebResourceLoadScheduler.cpp:

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView updateTextTouchBar]):

Source/WebKit2:

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::initialize):
* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::didReceiveMessage):
(WebKit::WebProcessConnection::didReceiveSyncMessage):
* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(createEncodedObject):
(decodeObject):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateTextTouchBar):
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
* UIProcess/gtk/WebPasteboardProxyGtk.cpp:
(WebKit::WebPasteboardProxy::writeToClipboard):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::flushPendingLayerChanges):
(WebKit::CompositingCoordinator::purgeBackingStores):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::dispatchTouchEvent):
(WebKit::WebPage::setInitialFocus):
(WebKit::WebPage::insertTextAsync):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
* WebProcess/WebPage/mac/WebPageMac.mm:

Source/WTF:

JavaScriptCore's bytecompiler/SetForScope.h is completely the same
to WTF::TemporaryChange. SetForScope sounds better name since it
says that this object works as Scope.

We rename WTF::TemporaryChange to WTF::SetForScope. And replace
all the use to this WTF::SetForScope.

* WTF.xcodeproj/project.pbxproj:
* wtf/SetForScope.h: Renamed from Source/WTF/wtf/TemporaryChange.h.
(WTF::SetForScope::SetForScope):
(WTF::SetForScope::~SetForScope):

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/SetForScope.cpp: Renamed from Tools/TestWebKitAPI/Tests/WTF/TemporaryChange.cpp.
(TestWebKitAPI::TEST):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):

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

2 years ago[WebCore] Clean up script loading code in XML
utatane.tea@gmail.com [Thu, 17 Nov 2016 06:47:31 +0000 (06:47 +0000)]
[WebCore] Clean up script loading code in XML
https://bugs.webkit.org/show_bug.cgi?id=161651

Reviewed by Ryosuke Niwa.

Source/WebCore:

This patch cleans up XML document script handling by using PendingScript.
Previously, we directly used CachedScript. But it is not good since we
have PendingScript wrapper.

We also disable ES6 modules for non HTML document. While ES6 modules tag
requires "defer" semantics, "defer" semantics is not implemented in non
HTML documents. And ES6 module tag is only specified in whatwg HTML spec.

* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::execute):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::determineScriptType):
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::executeClassicScript):
(WebCore::ScriptElement::executePendingScript):
(WebCore::ScriptElement::executeScript): Deleted.
(WebCore::ScriptElement::executeScriptForScriptRunner): Deleted.
* dom/ScriptElement.h:
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::timerFired):
* html/parser/HTMLDocumentParser.cpp:
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
(WebCore::HTMLScriptRunner::runScript):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished):
* xml/parser/XMLDocumentParser.h:
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser):
(WebCore::XMLDocumentParser::~XMLDocumentParser):
(WebCore::XMLDocumentParser::endElementNs):

LayoutTests:

Add tests that ensure modules are not executed in XHTML documents.

* js/dom/modules/module-inline-dynamic-in-xhtml-expected.txt: Added.
* js/dom/modules/module-inline-dynamic-in-xhtml.xhtml: Added.
* js/dom/modules/module-inline-simple-in-xhtml-expected.txt: Added.
* js/dom/modules/module-inline-simple-in-xhtml.xhtml: Added.
* js/dom/modules/module-src-dynamic-in-xhtml-expected.txt: Added.
* js/dom/modules/module-src-dynamic-in-xhtml.xhtml: Added.
* js/dom/modules/module-src-simple-in-xhtml-expected.txt: Added.
* js/dom/modules/module-src-simple-in-xhtml.xhtml: Added.

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

2 years agoAdd Node::isDescendantOf() overload that takes in a reference
cdumez@apple.com [Thu, 17 Nov 2016 06:24:13 +0000 (06:24 +0000)]
Add Node::isDescendantOf() overload that takes in a reference
https://bugs.webkit.org/show_bug.cgi?id=164854

Reviewed by Ryosuke Niwa.

Add Node::isDescendantOf() overload that takes in a reference as a lot
of call sites have a reference or a pointer they know is not null.

No new tests, no Web-exposed behavior change.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
* dom/Document.cpp:
(WebCore::isNodeInSubtree):
(WebCore::Document::removeFullScreenElementOfSubtree):
(WebCore::Document::setAnimatingFullScreen):
* dom/Node.cpp:
(WebCore::Node::isDescendantOf):
(WebCore::Node::isDescendantOrShadowDescendantOf):
(WebCore::Node::contains):
* dom/Node.h:
(WebCore::Node::isDescendantOf):
* dom/NodeIterator.cpp:
(WebCore::NodeIterator::updateForNodeRemoval):
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::executeFastPathForIdSelector):
(WebCore::filterRootById):
* dom/TypedElementDescendantIterator.h:
(WebCore::TypedElementDescendantIteratorAdapter<ElementType>::beginAt):
(WebCore::TypedElementDescendantIteratorAdapter<ElementType>::from):
(WebCore::TypedElementDescendantConstIteratorAdapter<ElementType>::beginAt):
(WebCore::TypedElementDescendantConstIteratorAdapter<ElementType>::from):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
* editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
(WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
(WebCore::DeleteSelectionCommand::doApply):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::textDirectionForSelection):
* editing/FormatBlockCommand.cpp:
(WebCore::FormatBlockCommand::formatRange):
* editing/TextIterator.cpp:
(WebCore::TextIterator::advance):
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::honorEditingBoundaryAtOrBefore):
(WebCore::VisiblePosition::honorEditingBoundaryAtOrAfter):
* editing/htmlediting.cpp:
(WebCore::firstEditablePositionAfterPositionInRoot):
(WebCore::lastEditablePositionBeforePositionInRoot):
(WebCore::selectionForParagraphIteration):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
* html/CachedHTMLCollection.h:
(WebCore::traversalType>::namedItem):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::formElementIndex):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
* page/EventHandler.cpp:
(WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::getElementById):

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

2 years agoFix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
rniwa@webkit.org [Thu, 17 Nov 2016 05:46:32 +0000 (05:46 +0000)]
Fix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
https://bugs.webkit.org/show_bug.cgi?id=164845

Reviewed by Dan Bernstein.

Revert r208833 and fix the build by declaring AVFunctionBarMediaSelectionOption and AVThumbnail in AVKitSPI.h

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager generateFunctionBarAudioAmplitudeSamples:completionHandler:]):
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
(WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
* platform/spi/cocoa/AVKitSPI.h:

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

2 years agoREGRESSION(r208082): 1% Speedometer regression on iOS
rniwa@webkit.org [Thu, 17 Nov 2016 04:32:49 +0000 (04:32 +0000)]
REGRESSION(r208082): 1% Speedometer regression on iOS
https://bugs.webkit.org/show_bug.cgi?id=164852

Reviewed by Chris Dumez.

Source/WebCore:

Temporarily disable CEReactions entirely to recover the regression in Speedometer since
reverting r208082 wouldn't remove CEReactions from other DOM APIs and if r208082 was a regression,
then they're likely causing a regression on Speedometer as well.

* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::add): Removed the release assert added in r208785
since reactions can be inserted into the backup queue while the queue is running.
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll): Ditto.
* dom/CustomElementReactionQueue.h:
(WebCore::CustomElementReactionStack::CustomElementReactionStack): Removed all the code so that this
constructor would be optimized away by clang.
(WebCore::CustomElementReactionStack::~CustomElementReactionStack): Ditto.

LayoutTests:

Add failing test expectations for various custom elements now that CEReactions is not working.

* TestExpectations:

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

2 years agoUnreviewed build fix after r208589
bfulgham@apple.com [Thu, 17 Nov 2016 02:23:16 +0000 (02:23 +0000)]
Unreviewed build fix after r208589

The generated com.apple.WebKit.plugin-common.sb file was not getting copied into
the Resources folder, so was not deployed with WebKit. We need to treat it like
com.apple.WebProcess.sb and the other generated files.

* WebKit2.xcodeproj/project.pbxproj: Tell Xcode to include the generated file in
the framework Resources.

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

2 years agoExceptionFuzz needs to placate exception check verification before overwriting a...
mark.lam@apple.com [Thu, 17 Nov 2016 01:34:32 +0000 (01:34 +0000)]
ExceptionFuzz needs to placate exception check verification before overwriting a thrown exception.
https://bugs.webkit.org/show_bug.cgi?id=164843

Reviewed by Keith Miller.

The ThrowScope will check for unchecked simulated exceptions before throwing a
new exception.  This ensures that we don't quietly overwrite a pending exception
(which should never happen, with the only exception being to rethrow the same
exception).  However, ExceptionFuzz works by intentionally throwing its own
exception even when one may already exist thereby potentially overwriting an
existing exception.  This is ok for ExceptionFuzz testing, but we need to placate
the exception check verifier before ExceptionFuzz throws its own exception.

* runtime/ExceptionFuzz.cpp:
(JSC::doExceptionFuzzing):

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

2 years agoFix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
rniwa@webkit.org [Thu, 17 Nov 2016 01:26:33 +0000 (01:26 +0000)]
Fix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
https://bugs.webkit.org/show_bug.cgi?id=164845

Reviewed by Wenson Hsieh.

Fix builds after r208802 by wrapping code inside USE(APPLE_INTERNAL_SDK).

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
(WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):

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

2 years agoWeb Inspector: Background tabs are often updating non-stop because they think they...
commit-queue@webkit.org [Thu, 17 Nov 2016 01:15:43 +0000 (01:15 +0000)]
Web Inspector: Background tabs are often updating non-stop because they think they are visible
https://bugs.webkit.org/show_bug.cgi?id=164841
<rdar://problem/29298658>

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

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView.prototype._networkTimelineRecordAdded):
* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._update):
Don't constantly update when this tab is not in the foreground.

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

2 years agoREGRESSION (r208455): LayoutTests swipe/pushState-cached-back-swipe.html and swipe...
ap@apple.com [Thu, 17 Nov 2016 01:14:35 +0000 (01:14 +0000)]
REGRESSION (r208455): LayoutTests swipe/pushState-cached-back-swipe.html and swipe/main-frame-pinning-requirement.html are failing
https://bugs.webkit.org/show_bug.cgi?id=164572

Reviewed by Tim Horton.

Tools:

* WebKitTestRunner/mac/TestControllerMac.mm: (WTR::TestController::platformResetStateToConsistentValues):
Use the correct constant.

LayoutTests:

* platform/mac-wk2/TestExpectations: Remove flakiness expectations.

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

2 years agoUnlinkedCodeBlock should not have a starting line number
ggaren@apple.com [Thu, 17 Nov 2016 01:02:06 +0000 (01:02 +0000)]
UnlinkedCodeBlock should not have a starting line number
https://bugs.webkit.org/show_bug.cgi?id=164838

Reviewed by Mark Lam.

Here's how the starting line number in UnlinkedCodeBlock used to work:

(1) Assign the source code starting line number to the parser starting
line number.

(2) Assign (1) to the AST.

(3) Subtract (1) from (2) and assign to UnlinkedCodeBlock.

Then, when linking:

(4) Add (3) to (1).

This was an awesome no-op.

Generally, unlinked code is code that is not tied to any particular
web page or resource. So, it's inappropriate to think of it having a
starting line number.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::recordParse):
(JSC::UnlinkedCodeBlock::hasCapturedVariables):
(JSC::UnlinkedCodeBlock::firstLine): Deleted.
* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedGlobalCodeBlock):
* runtime/CodeCache.h:
(JSC::generateUnlinkedCodeBlock):

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

2 years agoScriptExecutionContext::processMessagePortMessagesSoon() should only post task when...
cdumez@apple.com [Thu, 17 Nov 2016 00:59:04 +0000 (00:59 +0000)]
ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary
https://bugs.webkit.org/show_bug.cgi?id=164812
<rdar://problem/29148465>

Reviewed by Geoffrey Garen.

ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary,
meaning when there is not already one pending.

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::processMessagePortMessagesSoon):
(WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
* dom/ScriptExecutionContext.h:

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

2 years agoUse more references in TreeScope / TreeScopeAdopter
cdumez@apple.com [Thu, 17 Nov 2016 00:39:55 +0000 (00:39 +0000)]
Use more references in TreeScope / TreeScopeAdopter
https://bugs.webkit.org/show_bug.cgi?id=164836

Reviewed by Ryosuke Niwa.

Use more references in TreeScope / TreeScopeAdopter and avoid some
unnecessary null checks.

No new tests, no Web-exposed behavior change.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::removeBetween):
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
(WebCore::ContainerNode::parserAppendChild):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::addChildNodesToDeletionQueue):
* dom/Document.cpp:
(WebCore::Document::adoptNode):
(WebCore::Document::moveNodeIteratorsToNewDocument):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::didMoveToNewDocument):
(WebCore::Element::addShadowRoot):
(WebCore::Element::removeShadowRoot):
(WebCore::Element::setAttributeNode):
(WebCore::Element::setAttributeNodeNS):
(WebCore::Element::ensureAttr):
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::didMoveToNewDocument):
* dom/Node.h:
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::adoptDocument):
* dom/TreeScope.cpp:
(WebCore::TreeScope::TreeScope):
(WebCore::TreeScope::setParentTreeScope):
(WebCore::TreeScope::adoptIfNeeded):
* dom/TreeScope.h:
(WebCore::TreeScope::documentScope):
(WebCore::TreeScope::setDocumentScope):
* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveTreeToNewScope):
(WebCore::TreeScopeAdopter::moveShadowTreeToNewDocument):
(WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
(WebCore::TreeScopeAdopter::updateTreeScope):
(WebCore::TreeScopeAdopter::moveNodeToNewDocument):
* dom/TreeScopeAdopter.h:
(WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
(WebCore::TreeScopeAdopter::TreeScopeAdopter):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::didMoveToNewDocument):
* html/FormAssociatedElement.h:
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::didMoveToNewDocument):
* html/HTMLFieldSetElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::didMoveToNewDocument):
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::didMoveToNewDocument):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::didMoveToNewDocument):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didMoveToNewDocument):
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didMoveToNewDocument):
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::didMoveToNewDocument):
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::didMoveToNewDocument):
* html/HTMLPictureElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didMoveToNewDocument):
* html/HTMLPlugInImageElement.h:
* html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::didMoveToNewDocument):
* html/HTMLTemplateElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::didMoveToNewDocument):
* html/HTMLVideoElement.h:
* html/ImageDocument.cpp:
(WebCore::ImageDocumentElement::didMoveToNewDocument):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::didMoveToNewDocument):
* svg/SVGImageElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::didMoveToNewDocument):
* svg/SVGSVGElement.h:

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

2 years agoAdded Web App Manifest to the Feature Status page.
jond@apple.com [Thu, 17 Nov 2016 00:37:15 +0000 (00:37 +0000)]
Added Web App Manifest to the Feature Status page.
https://bugs.webkit.org/show_bug.cgi?id=162675

Reviewed by Timothy Hatcher.

* features.json:

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

2 years agoUse more references for Document::removeFocusedNodeOfSubtree()
cdumez@apple.com [Thu, 17 Nov 2016 00:35:57 +0000 (00:35 +0000)]
Use more references for Document::removeFocusedNodeOfSubtree()
https://bugs.webkit.org/show_bug.cgi?id=164839

Reviewed by Andreas Kling.

Use more references for Document::removeFocusedNodeOfSubtree().

No new tests, no Web-exposed behavior change.

* dom/Document.cpp:
(WebCore::isNodeInSubtree):
(WebCore::Document::removeFocusedNodeOfSubtree):
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
(WebCore::Document::removeFocusNavigationNodeOfSubtree):
(WebCore::Document::removeFullScreenElementOfSubtree):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::removeShadowRoot):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):

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

2 years agoClear track client when removing a track
bfulgham@apple.com [Thu, 17 Nov 2016 00:35:32 +0000 (00:35 +0000)]
Clear track client when removing a track
https://bugs.webkit.org/show_bug.cgi?id=164842
<rdar://problem/29213621>

Reviewed by Eric Carlson.

Source/WebCore:

Call 'clearClient' when removing a track from an HTMLMediaElement.

Test: media/track/audio-track-add-remove.html
      media/track/video-track-add-remove.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removeAudioTrack): Call 'clearClient'
(WebCore::HTMLMediaElement::removeVideoTrack): Ditto.

LayoutTests:

* media/track/audio-track-add-remove-expected.txt: Added.
* media/track/audio-track-add-remove.html: Added.
* media/track/video-track-add-remove-expected.txt: Added.
* media/track/video-track-add-remove.html: Added.

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

2 years ago[ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
utatane.tea@gmail.com [Thu, 17 Nov 2016 00:24:37 +0000 (00:24 +0000)]
[ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
https://bugs.webkit.org/show_bug.cgi?id=164827

Reviewed by Ryosuke Niwa.

.:

* 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:

Use Settings.in. And intentionally do not use RuntimeEnabledFeatures.
According to the pointer lock's issue[1], we should use Settings.

[1]: https://bugs.webkit.org/show_bug.cgi?id=163801

* Configurations/FeatureDefines.xcconfig:
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::determineScriptType):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* page/Settings.in:
A bit unfortunate thing is that the setter is named `setEs6ModulesEnabled`
if we use `es6ModulesEnabled` here.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences es6ModulesEnabled]):
(-[WebPreferences setES6ModulesEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit/win:

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::setES6ModulesEnabled):
(WebPreferences::es6ModulesEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
Annotated ES6 Modules option with DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetES6ModulesEnabled):
(WKPreferencesGetES6ModulesEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

Enabled ES6 Modules in test runners.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebPreferencesToConsistentValues):
* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setES6ModulesEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

LayoutTests:

* TestExpectations:

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