WebKit-https.git
3 years agoUnreviewed, rolling out r205344.
commit-queue@webkit.org [Fri, 2 Sep 2016 16:26:40 +0000 (16:26 +0000)]
Unreviewed, rolling out r205344.
https://bugs.webkit.org/show_bug.cgi?id=161533

Hitting assertions under CachedResource::removeClient in a few
tests (Requested by anttik on #webkit).

Reverted changeset:

"Reverse ownership relation of StyleCachedImage and
CSSImageValue"
https://bugs.webkit.org/show_bug.cgi?id=161447
http://trac.webkit.org/changeset/205344

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

3 years agoUnreviewed: moved myself to the reviewers list.
jbedard@apple.com [Fri, 2 Sep 2016 15:54:20 +0000 (15:54 +0000)]
Unreviewed: moved myself to the reviewers list.

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

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

3 years agoReverse ownership relation of StyleCachedImage and CSSImageValue
antti@apple.com [Fri, 2 Sep 2016 14:27:58 +0000 (14:27 +0000)]
Reverse ownership relation of StyleCachedImage and CSSImageValue
https://bugs.webkit.org/show_bug.cgi?id=161447

Reviewed by Andreas Kling.

Currently StyleCachedImage (which represents an image in RenderStyle) has a weak ref to the
underlying CSSImageValue/CSSImageSetValue which actually owns it. This is awkwards especially since
StyleGeneratedImage, the other StyleImage subclass has reversed relationship where it refs
the underlying CSSImageGeneratorValue.

This patch makes StyleCachedImage similar to StyleGeneratedImage. StyleCachedImage now refs the
underlying CSSImageValue/CSSImageSetValue. CSSImageValues no longer need to know about StyleCachedImage.
Instead they reference CachedImages (memory cache objects) directly. StyleCachedImage instances are now
conceptually unique to RenderStyle instances. Actual resources are shared as before by sharing CachedImages.

* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::loadImage):
(WebCore::CSSCursorImageValue::cachedImage):
(WebCore::CSSCursorImageValue::styleImage): Deleted.
* css/CSSCursorImageValue.h:
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::~CSSImageSetValue):
(WebCore::CSSImageSetValue::loadBestFitImage):
(WebCore::CSSImageSetValue::traverseSubresources):
(WebCore::CSSImageSetValue::styleImage): Deleted.
* css/CSSImageSetValue.h:
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::CSSImageValue):
(WebCore::CSSImageValue::~CSSImageValue):
(WebCore::CSSImageValue::isPending):
(WebCore::CSSImageValue::loadImage):
(WebCore::CSSImageValue::traverseSubresources):
(WebCore::CSSImageValue::knownToBeOpaque):
(WebCore::CSSImageValue::styleImage): Deleted.
* css/CSSImageValue.h:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueContent):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleImage):
(WebCore::StyleResolver::styleCachedImageFromValue):
(WebCore::StyleResolver::styleGeneratedImageFromValue):
(WebCore::StyleResolver::cachedOrPendingFromValue): Deleted.
(WebCore::StyleResolver::generatedOrPendingFromValue): Deleted.
(WebCore::StyleResolver::setOrPendingFromValue): Deleted.
(WebCore::StyleResolver::cursorOrPendingFromValue): Deleted.
* css/StyleResolver.h:
* editing/TextIterator.cpp:
(WebCore::fullyClipsContents):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::retrieveResourcesForProperties):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::imagesIdentical):

    Compare data equality instead of pointer equality for StyleImages (since StyleImages are no longer shared).

(WebCore::layerImagesIdentical): Deleted.
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::StyleCachedImage):
(WebCore::StyleCachedImage::~StyleCachedImage):
(WebCore::StyleCachedImage::cachedImage):
(WebCore::StyleCachedImage::cssValue):
(WebCore::StyleCachedImage::canRender):
(WebCore::StyleCachedImage::isPending):
(WebCore::StyleCachedImage::isLoaded):
(WebCore::StyleCachedImage::errorOccurred):
(WebCore::StyleCachedImage::imageSize):
(WebCore::StyleCachedImage::imageHasRelativeWidth):
(WebCore::StyleCachedImage::imageHasRelativeHeight):
(WebCore::StyleCachedImage::computeIntrinsicDimensions):
(WebCore::StyleCachedImage::usesImageContainerSize):
(WebCore::StyleCachedImage::setContainerSizeForRenderer):
(WebCore::StyleCachedImage::addClient):
(WebCore::StyleCachedImage::removeClient):
(WebCore::StyleCachedImage::image):
(WebCore::StyleCachedImage::knownToBeOpaque):
(WebCore::StyleCachedImage::setCachedImage): Deleted.
* rendering/style/StyleCachedImage.h:

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

3 years ago[GTK] Fix compiler warning in MiniBrowser
commit-queue@webkit.org [Fri, 2 Sep 2016 08:54:25 +0000 (08:54 +0000)]
[GTK] Fix compiler warning in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=161529

We were missing a return statement in decidePermissionRequest() and
also there was unused variable in browserWindowConstructed().

Patch by Tomas Popela <tpopela@redhat.com> on 2016-09-02
Reviewed by Carlos Garcia Campos.

* MiniBrowser/gtk/BrowserTab.c:
(decidePermissionRequest):
* MiniBrowser/gtk/BrowserWindow.c:
(browserWindowConstructed):

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

3 years agoFix GObject bindings build breakage when compiling with ENABLE_USER_TIMING disabled.
zandobersek@gmail.com [Fri, 2 Sep 2016 07:23:48 +0000 (07:23 +0000)]
Fix GObject bindings build breakage when compiling with ENABLE_USER_TIMING disabled.

Rubber-stamped by Carlos Garcia Campos.

Add additional ENABLE(USER_TIMING) build guards to WebKitDOMPerformance bindings,
avoiding build errors when building with that feature disabled. Previously this
wasn't a problem because the four amended binding functions weren't generated
when the feature was disabled due to the similar use of guards in the Performance.idl
file.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPerformance.cpp:
(webkit_dom_performance_webkit_mark):
(webkit_dom_performance_webkit_clear_marks):
(webkit_dom_performance_webkit_measure):
(webkit_dom_performance_webkit_clear_measures):

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

3 years agoUnreviewed GTK+ build fix when compiling with Clang.
zandobersek@gmail.com [Fri, 2 Sep 2016 07:17:26 +0000 (07:17 +0000)]
Unreviewed GTK+ build fix when compiling with Clang.

* WebProcess/WebPage/gtk/AcceleratedSurface.cpp: Include WebPage.h.

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

3 years agoOnly update connected custom elements
rniwa@webkit.org [Fri, 2 Sep 2016 06:17:17 +0000 (06:17 +0000)]
Only update connected custom elements
https://bugs.webkit.org/show_bug.cgi?id=161480

Reviewed by Yusuke Suzuki.

Source/WebCore:

In the latest specs, creating an element only upgrades an element if the custom element had already been defined:
https://dom.spec.whatwg.org/#concept-create-element

Otherwise, an element remains unresolved until it gets connected to the document associated with the global object:
https://dom.spec.whatwg.org/#concept-node-insert

This patch removes the upgrade candidate map in CustomElementRegistry, and traverses the entire document associated
with global object (DOMWindow) in addElementDefinition: https://html.spec.whatwg.org/#dom-customelementregistry-define

The traversal is done in the shadow-including tree order (different from depth-first preorder traversal of flat tree)
since it doesn't enter slots and children of shadow hosts are always visited even if they are not assigned to a slot:
https://dom.spec.whatwg.org/#concept-shadow-including-tree-order

Test: fast/custom-elements/enqueue-custom-element-upgrade-reaction.html

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement): Assert that the element being upgraded as the same qualified name
as the custom element interface.
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define): Moved the code to resolve the promise from here to addElementDefinition.
Also cleaned up the code to extract callbacks a little.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Added an assertion.
(WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Added. Upgrade an element if the custom element
had already been defined.
* dom/CustomElementReactionQueue.h:
* dom/CustomElementRegistry.cpp:
(WebCore::CustomElementRegistry::create): Stores the reference to DOMWindow to find its document in addElementDefinition.
(WebCore::CustomElementRegistry::CustomElementRegistry): Ditto.
(WebCore::enqueueUpgradeInShadowIncludingTreeOrder): Added. Enqueue upgrade reactions in shadow-including tree order.
(WebCore::CustomElementRegistry::addElementDefinition): Upgrade all unresolved elements that matches this definition and
resolve the the promise returned by "whenDefined" if there is any.
(WebCore::CustomElementRegistry::addUpgradeCandidate): Deleted.
(WebCore::CustomElementRegistry::findInterface): Added a new variant that takes an element.
* dom/CustomElementRegistry.h:
* dom/Document.cpp:
(WebCore::createUpgradeCandidateElement): No longer takes DOMWindow since we don't upgrade synchronously here. It's also
wrong not to mark the element as unresolved custom element in a document without a browsing context per new semantics.
(WebCore::createHTMLElementWithNameValidation): Ditto.
(WebCore::createFallbackHTMLElement): Ditto.
* dom/Element.cpp:
(WebCore::Element::insertedInto): Enqueue an upgrade reaction if this is an unsolved custom element and there is now
a definition for it (the latter condition is checked in enqueueElementUpgradeIfDefined).
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Don't upgrade this element until it gets
connected to a document in Element::insertedInto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::ensureCustomElementRegistry):

LayoutTests:

Added a W3c-style testharness.js test for https://html.spec.whatwg.org/#enqueue-a-custom-element-upgrade-reaction
and added more test cases for :defined and customElements.define.

* fast/custom-elements/CustomElementRegistry.html: Revised descriptions for "get" and "whenDefined" test cases consistent
with ones for "define".
* fast/custom-elements/defined-pseudo-class-expected.txt:
* fast/custom-elements/defined-pseudo-class.html:
* fast/custom-elements/enqueue-custom-element-upgrade-reaction-expected.txt: Added.
* fast/custom-elements/enqueue-custom-element-upgrade-reaction.html: Added.
* fast/custom-elements/resources/document-types.js:
(create):

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

3 years ago[EFL] Mark failing tests to failure
gyuyoung.kim@webkit.org [Fri, 2 Sep 2016 04:41:11 +0000 (04:41 +0000)]
[EFL] Mark failing tests to failure

Unreviewed EFL gardening.

Failing tests of security, hyphenation, and form are marked to failure.

* platform/efl/TestExpectations:

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

3 years agoAdd toJS for JSC::PrivateName
utatane.tea@gmail.com [Fri, 2 Sep 2016 03:42:09 +0000 (03:42 +0000)]
Add toJS for JSC::PrivateName
https://bugs.webkit.org/show_bug.cgi?id=161522

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

Add the export annotation.
And we perform refactoring RefPtr<SymbolImpl> => Ref<SymbolImpl> for PrivateName,
since PrivateName never holds null SymbolImpl pointer. And along with this change,
we changed SymbolImpl* to SymbolImpl& in PrivateName::uid() callers.

* runtime/Completion.cpp:
(JSC::createSymbolForEntryPointModule):
* runtime/IdentifierInlines.h:
(JSC::Identifier::fromUid):
* runtime/JSFunction.cpp:
(JSC::JSFunction::setFunctionName):
* runtime/PrivateName.h:
(JSC::PrivateName::PrivateName):
(JSC::PrivateName::uid): Ugly const_cast. But const annotation is meaningless for SymbolImpl.
StringImpl should be observed as an immutable object. (Of course, its hash members etc. are mutable.
But most of the users (One of the exceptions is the concurrent JIT compiling thread!) should not care about this.)
(JSC::PrivateName::operator==):
(JSC::PrivateName::operator!=):
* runtime/PropertyName.h:
(JSC::PropertyName::PropertyName):
* runtime/Symbol.cpp:
(JSC::Symbol::finishCreation):
* runtime/Symbol.h:
* runtime/SymbolConstructor.cpp:
(JSC::symbolConstructorKeyFor):

Source/WebCore:

JSC::PrivateName is the wrapper to create and hold the ES6 Symbol instance.
This patch adds toJS support for JSC::PrivateName.
Later, the module integration patch will use this feature to call
DeferredWrapper::{resolve,reject} with JSC::PrivateName.

* bindings/js/JSDOMBinding.h:
(WebCore::toJS):

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

3 years agoUnreviewed, build fix after r205327
utatane.tea@gmail.com [Fri, 2 Sep 2016 03:37:58 +0000 (03:37 +0000)]
Unreviewed, build fix after r205327

* UIProcess/API/gtk/WebKitUIClient.cpp:

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

3 years agoBuild fix.
mitz@apple.com [Fri, 2 Sep 2016 03:25:08 +0000 (03:25 +0000)]
Build fix.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* Configurations/WebCore.xcconfig:
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

3 years agojsc: fix cmake build missing symbol getPropertySlot
commit-queue@webkit.org [Fri, 2 Sep 2016 02:43:52 +0000 (02:43 +0000)]
jsc: fix cmake build missing symbol getPropertySlot
https://bugs.webkit.org/show_bug.cgi?id=161521

Patch by JF Bastien <jfbastien@apple.com> on 2016-09-01
Reviewed by Saam Barati.

* runtime/IntlDateTimeFormat.cpp: include JSCInlines.h
* runtime/IntlNumberFormat.cpp: include JSCInlines.h

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

3 years ago[EFL] Gardening faliure and timeout tests on 2th Sep.
gyuyoung.kim@webkit.org [Fri, 2 Sep 2016 01:22:37 +0000 (01:22 +0000)]
[EFL] Gardening faliure and timeout tests on 2th Sep.

Unreviewed EFL gardening.

* platform/efl/TestExpectations:

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

3 years agojsc: provide printErr()
keith_miller@apple.com [Fri, 2 Sep 2016 01:19:42 +0000 (01:19 +0000)]
jsc: provide printErr()
https://bugs.webkit.org/show_bug.cgi?id=161513

Patch by JF Bastien <jfbastien@apple.com> on 2016-09-01
Reviewed by Mark Lam.

* jsc.cpp:
(GlobalObject::finishCreation):
(printInternal): renamed from functionPrint, add error checking
(functionPrintStdOut): punt to printInternal
(functionPrintStdErr): punt to printInternal
(functionPrint): Deleted.

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

3 years agoProvide a TestWebKitAPI-wide WKNavigationDelegate to simplify tests
timothy_horton@apple.com [Fri, 2 Sep 2016 01:16:56 +0000 (01:16 +0000)]
Provide a TestWebKitAPI-wide WKNavigationDelegate to simplify tests
https://bugs.webkit.org/show_bug.cgi?id=161413

Reviewed by Simon Fraser.

Add TestNavigationDelegate, which provides block properties to make
writing tests feel a little more natural (the callbacks can be inline),
and also add WKWebView _test_waitForDidFinishNavigation, so that many
tests don't even need to manually allocate a navigation delegate at all.

Adopt in some of the simpler tests; there are a few navigation delegates
left behind, which we can move to the new model in the future.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/WKBackForwardList.mm:
(TEST):
(-[WKBackForwardListTestNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/AlwaysRevalidatedURLSchemes.mm:
(TEST):
(-[AlwaysRevalidatedURLSchemesDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm:
(animatedResizeWebView):
(-[AnimatedResizeNavigationDelegate _webView:renderingProgressDidChange:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm:
(-[AutoLayoutWKWebView initWithFrame:configuration:]):
(-[AutoLayoutWKWebView load:withWidth:expectingContentSize:resettingWidth:]):
(TEST):
(-[AutoLayoutNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/CancelFontSubresource.mm:
(TEST):
(-[CancelFontSubresourceNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/CommandBackForward.mm:
(WebKit2_CommandBackForwardTestWKWebView::SetUp):
(WebKit2_CommandBackForwardTestWKWebView::loadFiles):
(TEST_F):
(-[CommandBackForwardNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm:
(expectLinkCount):
(TEST):
(-[DataDetectionNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/FindInPage.mm:
(TEST):
(-[FindInPageNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/FixedLayoutSize.mm:
(TEST):
(-[FixedLayoutSizeNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBDatabaseProcessKill.mm:
(TEST):
(-[DatabaseProcessKillNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBPersistence.mm:
(-[IndexedDBNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLNotChange.mm:
(TEST):
(-[ProvisionalURLNotChangeController webView:didFinishNavigation:]): Deleted.
(-[ProvisionalURLNotChangeController webView:didFailProvisionalNavigation:withError:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/RequiresUserActionForPlayback.mm:
(RequiresUserActionForPlaybackTest::createWebView):
(RequiresUserActionForPlaybackTest::testVideoWithAudio):
(RequiresUserActionForPlaybackTest::testVideoWithoutAudio):
(RequiresUserActionForPlaybackTest::testAudioOnly):
(-[RequiresUserActionForPlaybackNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/ShrinkToFit.mm:
(TEST):
(-[ShrinkToFitNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/UserContentController.mm:
(TEST):
(webViewForScriptMessageHandlerMultipleHandlerRemovalTest):
* TestWebKitAPI/Tests/WebKit2Cocoa/UserContentWorld.mm:
(TEST):
(-[SimpleDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/WKPDFViewResizeCrash.mm:
(TEST):
(-[WKPDFViewResizeNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewEvaluateJavaScript.mm:
(TEST):
(-[EvaluateJavaScriptNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewTextInput.mm:
(TEST):
(-[DummyNavigationDelegate webView:didFinishNavigation:]): Deleted.
* TestWebKitAPI/cocoa/TestNavigationDelegate.h: Added.
* TestWebKitAPI/cocoa/TestNavigationDelegate.mm: Added.
(-[TestNavigationDelegate webView:didFailProvisionalNavigation:withError:]):
(-[TestNavigationDelegate webView:didFinishNavigation:]):
(-[TestNavigationDelegate _webView:renderingProgressDidChange:]):
(-[TestNavigationDelegate waitForDidFinishNavigation]):
(-[WKWebView _test_waitForDidFinishNavigation]):

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

3 years agojsc: provide printErr()
commit-queue@webkit.org [Fri, 2 Sep 2016 01:01:29 +0000 (01:01 +0000)]
jsc: provide printErr()
https://bugs.webkit.org/show_bug.cgi?id=161513

Patch by JF Bastien <jfbastien@apple.com> on 2016-09-01
Reviewed by Mark Lam.

* jsc.cpp:
(GlobalObject::finishCreation):
(printInternal): renamed from functionPrint, add error checking
(functionPrintStdOut): punt to printInternal
(functionPrintStdErr): punt to printInternal
(functionPrint): Deleted.

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

3 years agoUse WTF::Function for completion handlers in API::UIClient
andersca@apple.com [Thu, 1 Sep 2016 23:43:39 +0000 (23:43 +0000)]
Use WTF::Function for completion handlers in API::UIClient
https://bugs.webkit.org/show_bug.cgi?id=161516

Reviewed by Tim Horton.

* UIProcess/API/APIUIClient.h:
(API::UIClient::runJavaScriptAlert):
(API::UIClient::runJavaScriptConfirm):
(API::UIClient::runJavaScriptPrompt):
(API::UIClient::runBeforeUnloadConfirmPanel):
(API::UIClient::exceededDatabaseQuota):
(API::UIClient::reachedApplicationCacheOriginQuota):
* UIProcess/API/C/WKPage.cpp:
(WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
(WebKit::RunBeforeUnloadConfirmPanelResultListener::RunBeforeUnloadConfirmPanelResultListener):
(WebKit::RunJavaScriptAlertResultListener::create):
(WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
(WebKit::RunJavaScriptConfirmResultListener::create):
(WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
(WebKit::RunJavaScriptPromptResultListener::create):
(WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
(WKPageSetPageUIClient):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::runJavaScriptAlert):
(WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
(WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
(WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
(WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):

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

3 years agoYouTube Flash plug-in replacement facility should not insert showinfo=0 into iframe...
commit-queue@webkit.org [Thu, 1 Sep 2016 23:04:23 +0000 (23:04 +0000)]
YouTube Flash plug-in replacement facility should not insert showinfo=0 into iframe URLs
https://bugs.webkit.org/show_bug.cgi?id=161478
<rdar://problem/28050847>

Patch by Ricky Mondello <rmondello@apple.com> on 2016-09-01
Reviewed by Eric Carlson.

Source/WebCore:

* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL): Stop adding the query parameter.

Tools:

* TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp:
(TestWebKitAPI::TEST_F): Update expected results.

LayoutTests:

* platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-expected.txt: Update the URL that was blocked.
* platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe-no-height-or-width-expected.txt: Ditto.
* security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement-expected.txt: Ditto.

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

3 years agoUse BlockPtr::fromCallable in WorkQueue::dispatch and WorkQueue::dispatchAfter
andersca@apple.com [Thu, 1 Sep 2016 22:45:52 +0000 (22:45 +0000)]
Use BlockPtr::fromCallable in WorkQueue::dispatch and WorkQueue::dispatchAfter
https://bugs.webkit.org/show_bug.cgi?id=161512

Reviewed by Chris Dumez.

This lets us get rid of leakCallable and adoptCallable.

* wtf/BlockPtr.h:
* wtf/Function.h:
* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueue::dispatch):
(WTF::WorkQueue::dispatchAfter):

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

3 years agoMove some JSObject and JSArray inline functions to their respective Inlines.h files.
mark.lam@apple.com [Thu, 1 Sep 2016 22:34:27 +0000 (22:34 +0000)]
Move some JSObject and JSArray inline functions to their respective Inlines.h files.
https://bugs.webkit.org/show_bug.cgi?id=161499

Reviewed by Saam Barati.

Source/JavaScriptCore:

This is just a refactoring patch to move some inline functions to their Inlines.h
files.  This will be needed to enable https://bugs.webkit.org/show_bug.cgi?id=161498
later.

* bindings/ScriptValue.cpp:
* interpreter/Interpreter.cpp:
* runtime/IntlDateTimeFormatPrototype.cpp:
* runtime/IntlNumberFormatPrototype.cpp:
* runtime/JSArray.cpp:
* runtime/JSArray.h:
(JSC::getLength): Deleted.
(JSC::toLength): Deleted.
* runtime/JSArrayInlines.h:
(JSC::JSArray::mergeIndexingTypeForCopying):
(JSC::JSArray::canFastCopy):
(JSC::getLength):
(JSC::toLength):
* runtime/JSInternalPromise.cpp:
* runtime/JSInternalPromiseDeferred.cpp:
* runtime/JSJob.cpp:
* runtime/JSModuleRecord.cpp:
* runtime/JSObject.h:
(JSC::JSObject::getPropertySlot): Deleted.
(JSC::JSObject::getNonIndexPropertySlot): Deleted.
* runtime/JSObjectInlines.h:
(JSC::JSObject::getPropertySlot):
(JSC::JSObject::getNonIndexPropertySlot):
* runtime/JSPromiseDeferred.cpp:
* runtime/JSTypedArrayViewPrototype.cpp:
* runtime/MapConstructor.cpp:
* runtime/SamplingProfiler.cpp:
* runtime/SetConstructor.cpp:
* runtime/WeakMapConstructor.cpp:
* runtime/WeakSetConstructor.cpp:

Source/WebCore:

No new tests because there is no behavior change.

* ForwardingHeaders/runtime/JSObjectInlines.h: Added.
* bindings/js/JSDOMBinding.h:
* bindings/js/JSSQLTransactionCustom.cpp:
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
* contentextensions/ContentExtensionParser.cpp:

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

3 years agoFix ENABLE(CSS_GRID_LAYOUT) guards harder after r205102/r205292
mcatanzaro@igalia.com [Thu, 1 Sep 2016 22:13:58 +0000 (22:13 +0000)]
Fix ENABLE(CSS_GRID_LAYOUT) guards harder after r205102/r205292

Unreviewed. Silence unused function warning.

* css/CSSComputedStyleDeclaration.cpp:

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

3 years agoWeb Inspector: Add visual indicator for shadow content in DOM tree
commit-queue@webkit.org [Thu, 1 Sep 2016 22:11:01 +0000 (22:11 +0000)]
Web Inspector: Add visual indicator for shadow content in DOM tree
https://bugs.webkit.org/show_bug.cgi?id=160874

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-09-01
Reviewed by Brian Burg.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._nodeTitleInfo):
(WebInspector.DOMTreeElement.prototype._buildTagDOM):
Moved "shadow" class to parent element to allow easier styling.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom):
(.tree-outline.dom li):
(.tree-outline.dom .shadow):
(.tree-outline.dom li.parent.shadow::after):
(.tree-outline.dom li.parent.shadow + ol.children.expanded):
(.tree-outline.dom .html-fragment.shadow): Deleted.

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

3 years agoGetByIdWithThis/GetByValWithThis should have ValueProfiles so that they can predict...
commit-queue@webkit.org [Thu, 1 Sep 2016 22:08:22 +0000 (22:08 +0000)]
GetByIdWithThis/GetByValWithThis should have ValueProfiles so that they can predict their result types
https://bugs.webkit.org/show_bug.cgi?id=160922

Patch by JF Bastien <jfbastien@apple.com> on 2016-09-01
Reviewed by Keith Miller.

JSTests:

Benchmark GetBy{Id,Val}WithThis in monomorphic and polymorphic uses.
The value profile is used by the calc functions, which do some mild math with the result.
These benchmarks get ~4% faster with value profiling.

* microbenchmarks/super-get-by-id-with-this-monomorphic.js: Added.
(A):
(A.prototype.set value):
(A.prototype.get value):
(B.prototype.set value):
(B.prototype.get value):
(B):
(const.bench):
* microbenchmarks/super-get-by-id-with-this-polymorphic.js: Added.
(A):
(A.prototype.set value):
(A.prototype.get value):
(B.prototype.set value):
(B.prototype.get value):
(B):
(const.bench):
* microbenchmarks/super-get-by-val-with-this-monomorphic.js: Added.
(value):
(A):
(A.prototype.set v):
(A.prototype.get v):
(B.prototype.set v):
(B.prototype.get v):
(B):
(const.bench):
* microbenchmarks/super-get-by-val-with-this-polymorphic.js: Added.
(value):
(A):
(A.prototype.set v):
(A.prototype.get v):
(B.prototype.set v):
(B.prototype.get v):
(B):
(const.bench):

Source/JavaScriptCore:

Add value profiling to GetBy{Id,Val}WithThis.

* bytecode/BytecodeList.json:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::finishCreation):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitGetById):
(JSC::BytecodeGenerator::emitGetByVal):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction):
* dfg/DFGPredictionPropagationPhase.cpp:
* llint/LowLevelInterpreter.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):

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

3 years agoWeb Inspector: Value checks of secondsPerPixel cause errors
mattbaker@apple.com [Thu, 1 Sep 2016 22:05:00 +0000 (22:05 +0000)]
Web Inspector: Value checks of secondsPerPixel cause errors
https://bugs.webkit.org/show_bug.cgi?id=161304
<rdar://problem/28050070>

Reviewed by Brian Burg.

* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype.reset):
Clear resource node map, which is used to determine which nodes
to refresh during layout.

(WebInspector.NetworkTimelineView.prototype.layout):
Like OverviewTimelineView, only refresh node graphs when times change.
This prevents refreshing nodes when (endTime - startTime) === 0.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._recordingReset):
TimelineViews must be cleared before calling _updateTimes to avoid
doing layouts in timeline views containing stale data.

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

3 years agoWeb Inspector: add Object.awaitEvent which is like singleFireEventListener but return...
commit-queue@webkit.org [Thu, 1 Sep 2016 22:03:10 +0000 (22:03 +0000)]
Web Inspector: add Object.awaitEvent which is like singleFireEventListener but returns a promise
https://bugs.webkit.org/show_bug.cgi?id=161451

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-09-01
Reviewed by Brian Burg.

Source/WebInspectorUI:

* UserInterface/Base/Object.js:
(WebInspector.Object.awaitEvent):
(WebInspector.Object.prototype.awaitEvent):

LayoutTests:

* inspector/unit-tests/object-expected.txt:
* inspector/unit-tests/object.html:

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

3 years agoAvoid unneeded string copy when parsing URL hosts
achristensen@apple.com [Thu, 1 Sep 2016 21:50:32 +0000 (21:50 +0000)]
Avoid unneeded string copy when parsing URL hosts
https://bugs.webkit.org/show_bug.cgi?id=161511

Reviewed by Tim Horton.

No change in behavior.  Covered by existing API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::parseAuthority):
(WebCore::URLParser::parseHost):
(WebCore::URLParser::authorityEndReached): Deleted.
(WebCore::URLParser::hostEndReached): Deleted.
* platform/URLParser.h:

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

3 years agoarith-abs-on-various-types.js is flaky
benjamin@webkit.org [Thu, 1 Sep 2016 21:45:52 +0000 (21:45 +0000)]
arith-abs-on-various-types.js is flaky

Unreviewed.

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-09-01

* stress/arith-abs-on-various-types.js:
Two compilation is too small for the worst case.
Math.abs() can be typed integer->number->untyped if we are very unlucky.

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

3 years agoFix a typo in the previous commit. I didn't mean to comment out this test case I...
rniwa@webkit.org [Thu, 1 Sep 2016 21:18:44 +0000 (21:18 +0000)]
Fix a typo in the previous commit. I didn't mean to comment out this test case I added per a review comment.

* fast/custom-elements/CustomElementRegistry-expected.txt:
* fast/custom-elements/CustomElementRegistry.html:

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

3 years agoAdd "whenDefined" to CustomElementRegistry
rniwa@webkit.org [Thu, 1 Sep 2016 21:16:40 +0000 (21:16 +0000)]
Add "whenDefined" to CustomElementRegistry
https://bugs.webkit.org/show_bug.cgi?id=161425

Reviewed by Yusuke Suzuki.

Source/WebCore:

Add the support for "whenDefined" method on CustomElementRegistry:
https://html.spec.whatwg.org/#dom-customelementregistry-whendefined

Because it needs to store the newly created promise when the queried custom element has not been defined yet,
we need to write custom binding code instead of relying on the binding generator.

Tests: fast/custom-elements/CustomElementRegistry.html

* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::validateCustomElementNameAndThrowIfNeeded): Extracted out of JSCustomElementRegistry::define.
(WebCore::JSCustomElementRegistry::define): Fulfill the "whenDefined" promise when the definition succeeds.
(WebCore::whenDefinedPromise): Added. Return an existing promise if there is one, or create a new promise.
We cache the created promise only if the custom element had not been defined yet since we'll indefinitely
retain the resolved promise otherwise.
(WebCore::JSCustomElementRegistry::whenDefined): Added. Calls whenDefinedPromise and returns a rejected
promise when there was an exception.
* dom/CustomElementRegistry.cpp:
* dom/CustomElementRegistry.h:
(WebCore::CustomElementRegistry::promiseMap): Added.
* dom/CustomElementRegistry.idl:

LayoutTests:

Added test cases for "whenDefined" method.

* fast/custom-elements/CustomElementRegistry-expected.txt:
* fast/custom-elements/CustomElementRegistry.html:

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

3 years agoWeb Inspector: Minification detection produces false positives for small resources
nvasilyev@apple.com [Thu, 1 Sep 2016 21:04:49 +0000 (21:04 +0000)]
Web Inspector: Minification detection produces false positives for small resources
https://bugs.webkit.org/show_bug.cgi?id=161159
<rdar://problem/27995306>

Reviewed by Brian Burg.

Source/WebInspectorUI:

Improve minification detection algorithm. Minified resources rarely have tabs and usually
have a very few line breaks. Counting tabs as 4 spaces and line breaks as 8 makes minification
detection heuristic more accurate. Increase ratio thresholds to accommodate for the changes in
whitespaceScore.

* UserInterface/Base/Utilities.js:
(isTextLikelyMinified):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._prepareEditorForInitialContent):
(WebInspector.SourceCodeTextEditor.prototype._isLikelyMinified): Deleted.

LayoutTests:

* inspector/formatting/is-text-likely-minified-expected.txt: Added.
* inspector/formatting/is-text-likely-minified.html: Added.

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

3 years agoadd BlockPtr::fromCallable
andersca@apple.com [Thu, 1 Sep 2016 20:40:23 +0000 (20:40 +0000)]
add BlockPtr::fromCallable
https://bugs.webkit.org/show_bug.cgi?id=161504

Reviewed by Tim Horton.

Source/WTF:

BlockPtr::fromCallable lets you create an Objective-C block from any callable object - including lambdas that contain move-only types.
The block will be allocated on the heap so it doesn't ever need to be copied (which is how it can work with move-only types).

* wtf/BlockPtr.h:

Tools:

Add a test.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/BlockPtr.mm: Added.
(TestWebKitAPI::TEST):

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

3 years agoURLParser should handle . and .. in URL paths
achristensen@apple.com [Thu, 1 Sep 2016 20:33:31 +0000 (20:33 +0000)]
URLParser should handle . and .. in URL paths
https://bugs.webkit.org/show_bug.cgi?id=161443

Reviewed by Brady Eidson.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::isSingleDotPathSegment):
(WebCore::isDoubleDotPathSegment):
(WebCore::consumeSingleDotPathSegment):
(WebCore::consumeDoubleDotPathSegment):
(WebCore::URLParser::parse):
(WebCore::URLParser::copyURLPartsUntil): Deleted.

Tools:

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

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

3 years agoUnreviewed, rolling out r205295 and r205303.
ryanhaddad@apple.com [Thu, 1 Sep 2016 20:17:02 +0000 (20:17 +0000)]
Unreviewed, rolling out r205295 and r205303.
https://bugs.webkit.org/show_bug.cgi?id=161505

Broke the iOS build (Requested by ryanhaddad on #webkit).

Reverted changesets:

"Refactor MobileMiniBrowser into an application framework to
allow external XCTesting"
https://bugs.webkit.org/show_bug.cgi?id=161462
http://trac.webkit.org/changeset/205295

"Unreviewed build-fix; don't specify an explicit deployment
target."
http://trac.webkit.org/changeset/205303

Patch by Commit Queue <commit-queue@webkit.org> on 2016-09-01

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

3 years agoUpdate root .gitignore for latest WebKitLibraries
bburg@apple.com [Thu, 1 Sep 2016 20:14:14 +0000 (20:14 +0000)]
Update root .gitignore for latest WebKitLibraries
https://bugs.webkit.org/show_bug.cgi?id=161501

Reviewed by Alex Christensen.

* .gitignore:

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

3 years agoRename WASM classes dropping the WASM prefix
keith_miller@apple.com [Thu, 1 Sep 2016 20:04:02 +0000 (20:04 +0000)]
Rename WASM classes dropping the WASM prefix
https://bugs.webkit.org/show_bug.cgi?id=161500

Reviewed by Mark Lam.

Having to write WASM::WASMModule seems silly. Also, this patch
merges WASMFunctionReturnType and WASMValueType into one type
that is a typedef of B3::Type. Using B3::Type as the WASM
primitive type makes it trivial to convert a Vector of WASM
types into a Vector of B3 types.

* b3/B3Type.h:
* wasm/JSWASMModule.h:
(JSC::JSWASMModule::signatures):
(JSC::JSWASMModule::functionImports):
(JSC::JSWASMModule::functionImportSignatures):
(JSC::JSWASMModule::globalVariableTypes):
(JSC::JSWASMModule::functionDeclarations):
(JSC::JSWASMModule::functionPointerTables):
* wasm/WASMB3IRGenerator.cpp:
(JSC::WASM::toB3Op):
(JSC::WASM::B3IRGenerator::addLocal):
(JSC::WASM::B3IRGenerator::unaryOp):
(JSC::WASM::B3IRGenerator::binaryOp):
(JSC::WASM::B3IRGenerator::addConstant):
(JSC::WASM::parseAndCompile):
* wasm/WASMB3IRGenerator.h:
* wasm/WASMFormat.h:
* wasm/WASMFunctionParser.h:
(JSC::WASM::FunctionParser<Context>::FunctionParser):
(JSC::WASM::FunctionParser<Context>::parse):
(JSC::WASM::FunctionParser<Context>::parseBlock):
(JSC::WASM::FunctionParser<Context>::parseExpression):
(JSC::WASM::WASMFunctionParser<Context>::WASMFunctionParser): Deleted.
(JSC::WASM::WASMFunctionParser<Context>::parse): Deleted.
(JSC::WASM::WASMFunctionParser<Context>::parseBlock): Deleted.
(JSC::WASM::WASMFunctionParser<Context>::parseExpression): Deleted.
* wasm/WASMModuleParser.cpp:
(JSC::WASM::ModuleParser::parse):
(JSC::WASM::ModuleParser::parseFunctionTypes):
(JSC::WASM::ModuleParser::parseFunctionSignatures):
(JSC::WASM::ModuleParser::parseFunctionDefinitions):
(JSC::WASM::WASMModuleParser::parse): Deleted.
(JSC::WASM::WASMModuleParser::parseFunctionTypes): Deleted.
(JSC::WASM::WASMModuleParser::parseFunctionSignatures): Deleted.
(JSC::WASM::WASMModuleParser::parseFunctionDefinitions): Deleted.
* wasm/WASMModuleParser.h:
(JSC::WASM::ModuleParser::ModuleParser):
(JSC::WASM::ModuleParser::functionInformation):
(JSC::WASM::WASMModuleParser::WASMModuleParser): Deleted.
(JSC::WASM::WASMModuleParser::functionInformation): Deleted.
* wasm/WASMOps.h:
* wasm/WASMParser.h:
(JSC::WASM::Parser::Parser):
(JSC::WASM::Parser::consumeCharacter):
(JSC::WASM::Parser::consumeString):
(JSC::WASM::Parser::parseUInt32):
(JSC::WASM::Parser::parseUInt7):
(JSC::WASM::Parser::parseVarUInt1):
(JSC::WASM::Parser::parseValueType):
(JSC::WASM::WASMParser::WASMParser): Deleted.
(JSC::WASM::WASMParser::consumeCharacter): Deleted.
(JSC::WASM::WASMParser::consumeString): Deleted.
(JSC::WASM::WASMParser::parseUInt32): Deleted.
(JSC::WASM::WASMParser::parseUInt7): Deleted.
(JSC::WASM::WASMParser::parseVarUInt1): Deleted.
(JSC::WASM::WASMParser::parseValueType): Deleted.
* wasm/WASMPlan.cpp:
(JSC::WASM::Plan::Plan):
* wasm/WASMSections.cpp:
(JSC::WASM::Sections::lookup):
(JSC::WASM::WASMSections::lookup): Deleted.
* wasm/WASMSections.h:
(JSC::WASM::Sections::validateOrder):
(JSC::WASM::WASMSections::validateOrder): Deleted.

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

3 years agoFix Mac CMake build.
achristensen@apple.com [Thu, 1 Sep 2016 19:48:36 +0000 (19:48 +0000)]
Fix Mac CMake build.

* PlatformMac.cmake:

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

3 years agoREGRESSION (r201454): Web Inspector: Text caret isn't visible when editing an attribute
nvasilyev@apple.com [Thu, 1 Sep 2016 19:32:46 +0000 (19:32 +0000)]
REGRESSION (r201454): Web Inspector: Text caret isn't visible when editing an attribute
https://bugs.webkit.org/show_bug.cgi?id=160986
<rdar://problem/27916207>

Reviewed by Brian Burg.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li .selection-area):
(.tree-outline.dom li > span):
Place selection area under the edited field, the way it was before r201454.

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

3 years agoYouTube Flash plug-in replacement facility should more gracefully handle malformed...
commit-queue@webkit.org [Thu, 1 Sep 2016 19:27:57 +0000 (19:27 +0000)]
YouTube Flash plug-in replacement facility should more gracefully handle malformed queries
https://bugs.webkit.org/show_bug.cgi?id=161476
<rdar://problem/28050847>

Patch by Ricky Mondello <rmondello@apple.com> on 2016-09-01
Reviewed by Eric Carlson.

Source/WebCore:

Some YouTube Flash embeds use '&' instead of '?' to start the query portion of the URL. Before this patch,
our implementation discards all parts of the path after the '&', which could drop important query information
like the start time for the video. This patch treats anything after that '&' as a "malformed query" and uses
it as the query to restore to the transformed URL if there was no actual query in the original URL.

* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::processAndCreateYouTubeURL): Add an out-parameter for the path after the first ampersand.
(WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL): If the input URL had no query, append
    the possibly malformed one found after the first ampersand to the replacement URL.

Tools:

* TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp:
(TestWebKitAPI::TEST_F): New tests. The first two and second-to-last test cases cover the "malformed" query
    logic. A few other tests are added, too.

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

3 years agoFix cmake build, missing SecItemShim.messages.in
commit-queue@webkit.org [Thu, 1 Sep 2016 19:23:24 +0000 (19:23 +0000)]
Fix cmake build, missing SecItemShim.messages.in
https://bugs.webkit.org/show_bug.cgi?id=161496

Patch by JF Bastien <jfbastien@apple.com> on 2016-09-01
Reviewed by Alex Christensen.

* PlatformMac.cmake:

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

3 years agoObjectAllocationSinkingPhase::insertOSRHintsForUpdate() fails to emit updated hints...
fpizlo@apple.com [Thu, 1 Sep 2016 18:55:50 +0000 (18:55 +0000)]
ObjectAllocationSinkingPhase::insertOSRHintsForUpdate() fails to emit updated hints in some cases
https://bugs.webkit.org/show_bug.cgi?id=161492

Reviewed by Mark Lam.

JSTests:

This bug affected function->activation references but not object->object field references,
because object->object field references are !neededForMaterialization(). So, the object
test always passed but the activation/function test used to always fail. It passes now.

* stress/materialize-activation-referenced-from-phantom-function.js: Added.
(bar):
(inc):
(dec):
(foo):
(test):
* stress/materialize-object-referenced-from-phantom-object.js: Added.
(bar):
(foo):
(test):

Source/JavaScriptCore:

If you materialize a sunken object that is referenced from another sunken object, then you
have to emit a PutHint to tell OSR that the latter object now refers to a materialized
object rather than to the old sunken one.

The ObjectAllocationSinkingPhase totally knows how to do this, but for some reason it only
did it when the PromotedLocationDescriptor for the field used for referring to the other
object is !neededForMaterialization(), i.e. it's a NamedPropertyPLoc or a ClosureVarPLoc.
I can sort of imagine why we thought that would be right - neededForMaterialization() means
it's a special meta-data field initialized on construction. But just because it's immutable
and special doesn't mean that materialization can't change its physical representation.
Removing the requirement that it's !neededForMaterialization() fixes the test and doesn't
regress anything.

* dfg/DFGObjectAllocationSinkingPhase.cpp:

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

3 years agoUnreviewed build-fix; don't specify an explicit deployment target.
jer.noble@apple.com [Thu, 1 Sep 2016 18:44:50 +0000 (18:44 +0000)]
Unreviewed build-fix; don't specify an explicit deployment target.

* MobileMiniBrowser/MobileMiniBrowser.xcodeproj/project.pbxproj:

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

3 years agoFix Mac CMake build after r205266.
achristensen@apple.com [Thu, 1 Sep 2016 18:38:06 +0000 (18:38 +0000)]
Fix Mac CMake build after r205266.

* PlatformMac.cmake:
* platform/cocoa/URLParserCocoa.mm: Removed.

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

3 years agoUnreviewed, rolling out r205297.
cdumez@apple.com [Thu, 1 Sep 2016 18:34:12 +0000 (18:34 +0000)]
Unreviewed, rolling out r205297.

Caused some JSC test failures

Reverted changeset:

"Align cross-origin proto getter / setter behavior with the
specification"
https://bugs.webkit.org/show_bug.cgi?id=161455
http://trac.webkit.org/changeset/205297

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

3 years agoWeb Inspector: tweak one UIString for "reasons for compositing"
bburg@apple.com [Thu, 1 Sep 2016 18:19:34 +0000 (18:19 +0000)]
Web Inspector: tweak one UIString for "reasons for compositing"
https://bugs.webkit.org/show_bug.cgi?id=161495
<rdar://problem/13718387>

Reviewed by Simon Fraser.

Change "Element establishes a stacking context" to "Element may overlap other compositing element".

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._populateListOfCompositingReasons):
(WebInspector.LayerTreeDetailsSidebarPanel):

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

3 years ago[Mac] Web Inspector: Remove stale inspector process termination code
commit-queue@webkit.org [Thu, 1 Sep 2016 18:08:54 +0000 (18:08 +0000)]
[Mac] Web Inspector: Remove stale inspector process termination code
https://bugs.webkit.org/show_bug.cgi?id=161465
<rdar://problem/28106584>

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

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::didRelaunchInspectorPageProcess): Deleted.
* UIProcess/WebInspectorProxy.h:
* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorProxyObjCAdapter didRelaunchProcess]): Deleted.
(-[WKWebInspectorWKWebView _didRelaunchProcess]): Deleted.
This code doesn't appear to be run when the WebContent process inside
of an Inspector process crashes. The general WebInspectorProxy has its
own handling of when the page inside an inspector process crashes, so
this Mac specific path appears to be unused and stale.

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

3 years agoUnreviewed, update iOS simulator WK1 flaky tests.
jiewen_tan@apple.com [Thu, 1 Sep 2016 18:00:55 +0000 (18:00 +0000)]
Unreviewed, update iOS simulator WK1 flaky tests.

* platform/ios-simulator-wk1/TestExpectations:

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

3 years agoAlign cross-origin proto getter / setter behavior with the specification
cdumez@apple.com [Thu, 1 Sep 2016 17:48:25 +0000 (17:48 +0000)]
Align cross-origin proto getter / setter behavior with the specification
https://bugs.webkit.org/show_bug.cgi?id=161455

Reviewed by Mark Lam.

Source/JavaScriptCore:

Align cross-origin proto getter / setter behavior with the specification:

The setter should throw a TypeError:
- https://html.spec.whatwg.org/#windowproxy-setprototypeof
- https://html.spec.whatwg.org/#location-setprototypeof
- https://tc39.github.io/ecma262/#sec-object.setprototypeof (step 5)

The getter should return null:
- https://html.spec.whatwg.org/#windowproxy-getprototypeof
- https://html.spec.whatwg.org/#location-getprototypeof

I have verified that this aligns our behavior with Firefox and Chrome.

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::GlobalFuncProtoGetterFunctor::operator()):
(JSC::globalFuncProtoSetter):

LayoutTests:

Add layout test coverage.

* http/tests/security/cross-frame-access-object-getPrototypeOf-expected.txt:
* http/tests/security/cross-frame-access-object-getPrototypeOf.html:
* http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt:
* http/tests/security/cross-frame-access-object-setPrototypeOf.html:

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

3 years agoMarking media/video-main-content-allow-then-scroll.html as flaky on ios-simulator...
ryanhaddad@apple.com [Thu, 1 Sep 2016 17:33:50 +0000 (17:33 +0000)]
Marking media/video-main-content-allow-then-scroll.html as flaky on ios-simulator-wk2.
https://bugs.webkit.org/show_bug.cgi?id=161491

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

3 years agoRefactor MobileMiniBrowser into an application framework to allow external XCTesting
jer.noble@apple.com [Thu, 1 Sep 2016 17:32:32 +0000 (17:32 +0000)]
Refactor MobileMiniBrowser into an application framework to allow external XCTesting
https://bugs.webkit.org/show_bug.cgi?id=161462

Reviewed by Eric Carlson.

XCTest targets need to be in the same project as the application which they're testing. To facilitate
having external projects with XCTest targets, move the application's implementation into a framework
that can be included with a bare-bones application shell for testing.

Simultaneously, add the ability to load files from within the new framework's bundle by using a
'bundle:/' URL scheme. Update the tests to use this new bundle URL and remove the dependency on
an external server for testing.

* MobileMiniBrowser/MobileMiniBrowser.xcodeproj/project.pbxproj:
* MobileMiniBrowser/MobileMiniBrowser/Base.lproj/LaunchScreen.storyboard:
* MobileMiniBrowser/MobileMiniBrowser/Info.plist:
* MobileMiniBrowser/MobileMiniBrowser/main.m:
* MobileMiniBrowser/MobileMiniBrowserFramework/AppDelegate.h: Renamed from Tools/MobileMiniBrowser/MobileMiniBrowser/AppDelegate.h.
* MobileMiniBrowser/MobileMiniBrowserFramework/AppDelegate.m: Renamed from Tools/MobileMiniBrowser/MobileMiniBrowser/AppDelegate.m.
(-[AppDelegate application:didFinishLaunchingWithOptions:]): Manually instantiate the main view
    controller from the framework's bundle.
* MobileMiniBrowser/MobileMiniBrowserFramework/Assets.xcassets/AppIcon.appiconset/Contents.json: Renamed from Tools/MobileMiniBrowser/MobileMiniBrowser/Assets.xcassets/AppIcon.appiconset/Contents.json.
* MobileMiniBrowser/MobileMiniBrowserFramework/Base.lproj/Main.storyboard: Renamed from Tools/MobileMiniBrowser/MobileMiniBrowser/Base.lproj/Main.storyboard.
* MobileMiniBrowser/MobileMiniBrowserFramework/Info.plist: Added.
* MobileMiniBrowser/MobileMiniBrowserFramework/MobileMiniBrowser.h: Renamed from Tools/MobileMiniBrowser/MobileMiniBrowser/AppDelegate.h.
* MobileMiniBrowser/MobileMiniBrowserFramework/TabViewController.h: Renamed from Tools/MobileMiniBrowser/MobileMiniBrowser/TabViewController.h.
* MobileMiniBrowser/MobileMiniBrowserFramework/TabViewController.m: Renamed from Tools/MobileMiniBrowser/MobileMiniBrowser/TabViewController.m.
* MobileMiniBrowser/MobileMiniBrowserFramework/WebViewController.h: Renamed from Tools/MobileMiniBrowser/MobileMiniBrowser/WebViewController.h.
* MobileMiniBrowser/MobileMiniBrowserFramework/WebViewController.m: Renamed from Tools/MobileMiniBrowser/MobileMiniBrowser/WebViewController.m.
(+[NSURL __bundleURLForFileURL:bundle:]): Add utility method.
(+[NSURL __fileURLForBundleURL:bundle:]): Ditto.
(-[WebViewController navigateTo:]): Support loading "bundle:/" URLs which are really just "file:" URLs
    pointing to the framework's resources directory.
(-[WebViewController observeValueForKeyPath:ofObject:change:context:]): Ditto.
* MobileMiniBrowser/MobileMiniBrowserUITests/MobileMiniBrowserUITests.m:
(-[MobileMiniBrowserUITests testBasicVideoPlayback]):

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

3 years ago[GTK] Fix configuration without wayland support
commit-queue@webkit.org [Thu, 1 Sep 2016 17:31:59 +0000 (17:31 +0000)]
[GTK] Fix configuration without wayland support
https://bugs.webkit.org/show_bug.cgi?id=161475

WebKit2WaylandClientProtocol.c is a derived source that is created
conditionally on ENABLE_WAYLAND_TARGET.  It was being included
in the sources list unconditionally, so configure failed whenever
wayland support was unavailable.

Patch by Jeremy Huddleston Sequoia <jeremyhu@apple.com> on 2016-09-01
Reviewed by Žan Doberšek.

* PlatformGTK.cmake: Include WebKit2WaylandClientProtocol.c in source list conditional on ENABLE_WAYLAND_TARGET

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

3 years agoAdd ios-simulator baseline for compositing/layer-creation/will-change-on-normal-flow...
ryanhaddad@apple.com [Thu, 1 Sep 2016 17:10:45 +0000 (17:10 +0000)]
Add ios-simulator baseline for compositing/layer-creation/will-change-on-normal-flow-content.html.
https://bugs.webkit.org/show_bug.cgi?id=161490

Unreviewed test gardening.

* platform/ios-simulator/compositing/layer-creation/will-change-on-normal-flow-content-expected.txt:
* Added.

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

3 years agoUnreviewed build fix after r205102.
jfernandez@igalia.com [Thu, 1 Sep 2016 16:51:08 +0000 (16:51 +0000)]
Unreviewed build fix after r205102.

The change made in r205102 caused compilation failures on
builds with the CSS_GRID_LAYOUT compilation flag disabled.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::resolveJustifySelfAuto): Deleted.
* css/CSSPropertyNames.in:
* css/parser/CSSParser.cpp:
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::parseValue):

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

3 years agoFix the Mac cmake clean build issue
commit-queue@webkit.org [Thu, 1 Sep 2016 14:54:55 +0000 (14:54 +0000)]
Fix the Mac cmake clean build issue
https://bugs.webkit.org/show_bug.cgi?id=157261

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-09-01
Reviewed by Michael Catanzaro.

Building WebCoreDerivedSources target failed due to the race
condition with building ForwardingHeaders of JavaScriptCore.

* CMakeLists.txt: Make WebCoreDerivedSources depends on JavaScriptCore.

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

3 years agoFocusController should pass KeyboardEvent around by reference.
akling@apple.com [Thu, 1 Sep 2016 14:22:33 +0000 (14:22 +0000)]
FocusController should pass KeyboardEvent around by reference.
<https://webkit.org/b/161461>

Reviewed by Sam Weinig.

Clean up FocusController to pass KeyboardEvent& around internally.

Also make FocusController::setInitialFocus() synthesize a dummy KeyboardEvent
if one isn't provided, just like nextFocusableElement()/previousFocusableElement() does.
This way we can feel confident about dereferencing the formerly KeyboardEvent* everywhere.

* page/EventHandler.cpp:
(WebCore::EventHandler::defaultArrowEventHandler):
(WebCore::EventHandler::defaultTabEventHandler):
* page/FocusController.cpp:
(WebCore::isFocusableElementOrScopeOwner):
(WebCore::isNonFocusableScopeOwner):
(WebCore::isFocusableScopeOwner):
(WebCore::shadowAdjustedTabIndex):
(WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
(WebCore::FocusController::setInitialFocus):
(WebCore::FocusController::advanceFocus):
(WebCore::FocusController::advanceFocusInDocumentOrder):
(WebCore::FocusController::findFocusableElementAcrossFocusScope):
(WebCore::FocusController::findFocusableElementWithinScope):
(WebCore::FocusController::nextFocusableElementWithinScope):
(WebCore::FocusController::previousFocusableElementWithinScope):
(WebCore::FocusController::findFocusableElementOrScopeOwner):
(WebCore::FocusController::findElementWithExactTabIndex):
(WebCore::nextElementWithGreaterTabIndex):
(WebCore::previousElementWithLowerTabIndex):
(WebCore::FocusController::nextFocusableElement):
(WebCore::FocusController::previousFocusableElement):
(WebCore::FocusController::nextFocusableElementOrScopeOwner):
(WebCore::FocusController::previousFocusableElementOrScopeOwner):
(WebCore::FocusController::findFocusCandidateInContainer):
(WebCore::FocusController::advanceFocusDirectionallyInContainer):
(WebCore::FocusController::advanceFocusDirectionally):
* page/FocusController.h:

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

3 years ago[Streams API] Align internal structure of ReadableStream with spec
commit-queue@webkit.org [Thu, 1 Sep 2016 14:14:05 +0000 (14:14 +0000)]
[Streams API] Align internal structure of ReadableStream with spec
https://bugs.webkit.org/show_bug.cgi?id=160299

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2016-09-01
Reviewed by Xabier Rodriguez-Calvar.

LayoutTests/imported/w3c:

Aligned internal structure of ReadableStream with spec. Fixed one expectation
that was set to FAIL while it is now PASSing.

* web-platform-tests/streams/readable-streams/general.https-expected.txt:

Source/WebCore:

Aligned internal structure of ReadableStream with spec. Various
internal properties have been moved to ReadableStreamDefaultController.
In addition, various behaviors had to be updated. Several other changes
will have to be performed in order to align with spec, e.g. changing
functions names. This patch does not change them in order to make the
structural changes easier to follow.

No change in functionality except support for 1 specific case where
an error was not thrown while it should have been. Changed corresponding
test expectation (now PASS instead of FAIL).
Modified test expectation: web-platform-tests/streams/readable-streams/general.https-expected.txt

* Modules/fetch/FetchResponse.js:
(initializeFetchResponse): Replaced reference to underlyingSource as no
more a property of readableStream (use readableStreamController instead,
as defined by spec).
* Modules/streams/ReadableStream.js:
(initializeReadableStream): Removed various properties now hanlded by
ReadableStreamDefaultController.
* Modules/streams/ReadableStreamDefaultController.js:
(enqueue): Updated based on new properties repartition between reader and controller.
(error): Updated based on new properties repartition between reader and controller.
(close): Updated based on new properties repartition between reader and controller.
(desiredSize): Updated based on new properties repartition between reader and controller.
* Modules/streams/ReadableStreamInternals.js:
(privateInitializeReadableStreamDefaultController): Added various properties now handled by
ReadableStreamDefaultController, as well as an internal pull function defined by spec.
(readableStreamDefaultControllerError): Added based on spec (error handling at controller level).
(teeReadableStream): Fixed typo and use readableStreamDefaultControllerError instead of errorReadableStream.
(doStructuredClone): Added "use strict";.
(teeReadableStreamPullFunction): Use readableStreamDefaultControllerClose instead of closeReadableStream.
(isReadableStream): Replaced check of underlyingSource by check that object is actually an instance of
ReadableStream (spec requires checking that readableStreamController slot is present, but this cannot
be checked).
(isReadableStreamDefaultReader): Replaced check of ownerReadableStream presence by check of readRequests,
in line with spec.
(isReadableStreamDefaultController): Replaced check of controlledReadableStream presence by check of unerlyingSource,
in line with spec.
(errorReadableStream): Updated based on new properties repartition between reader and controller.
(requestReadableStreamPull): Updated based on new properties repartition between reader and controller.
(readableStreamDefaultControllerGetDesiredSize): Replaces getReadableStreamDesiredSize (size now depends
on controller; new function name aligned with spec).
(cancelReadableStream): Updated based on new properties repartition between reader and controller.
(readableStreamDefaultControllerClose): Added based on spec (closing controller).
(closeReadableStream): Updated based on new properties repartition between reader and controller.
(enqueueInReadableStream): Updated based on new properties repartition between reader and controller.
(readFromReadableStreamDefaultReader): Updated based on new properties repartition between reader and controller.
* bindings/js/WebCoreBuiltinNames.h: Added pull (internal function of ReadableStreamDefaultController)
and readableStreamController (defined by spec)

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

3 years agoUnreviewed. Skip fixed layout tests in GTK+
carlosgc@webkit.org [Thu, 1 Sep 2016 12:01:00 +0000 (12:01 +0000)]
Unreviewed. Skip fixed layout tests in GTK+

They are causing a lot of flaky tests because of changes in the viewport controller that are never reset. Once
the actual bug is properly fixed I'll unskip these tests again.

* platform/gtk/TestExpectations:

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

3 years agoUnreviewed, fix the !ENABLE(SVG_FONTS) and !ENABLE(XSLT) build after r205269.
ossy@webkit.org [Thu, 1 Sep 2016 10:37:55 +0000 (10:37 +0000)]
Unreviewed, fix the !ENABLE(SVG_FONTS) and !ENABLE(XSLT) build after r205269.

* loader/LinkLoader.cpp:
(WebCore::createLinkPreloadResourceClient):

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

3 years agoURTBF after r205161 to fix !ENABLE(WEB_TIMING) build.
ossy@webkit.org [Thu, 1 Sep 2016 10:11:05 +0000 (10:11 +0000)]
URTBF after r205161 to fix !ENABLE(WEB_TIMING) build.

* bindings/js/JSPerformanceTimingCustom.cpp:

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

3 years agoUnreviewed ARM buildfix after r205283.
ossy@webkit.org [Thu, 1 Sep 2016 09:10:33 +0000 (09:10 +0000)]
Unreviewed ARM buildfix after r205283.

* assembler/ARMAssembler.h:
(JSC::ARMAssembler::patchableJumpSize):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::patchableJumpSize):

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

3 years agoCalling then on promise in Workers may crash in Debug builds
commit-queue@webkit.org [Thu, 1 Sep 2016 08:26:44 +0000 (08:26 +0000)]
Calling then on promise in Workers may crash in Debug builds
https://bugs.webkit.org/show_bug.cgi?id=156737

Unreviewed.

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

* TestExpectations: Activating previously skipped fetch api tests in Debug bots

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

3 years agoJITMathIC was misusing maxJumpReplacementSize
sbarati@apple.com [Thu, 1 Sep 2016 08:22:21 +0000 (08:22 +0000)]
JITMathIC was misusing maxJumpReplacementSize
https://bugs.webkit.org/show_bug.cgi?id=161356
<rdar://problem/28065560>

Reviewed by Benjamin Poulain.

JITMathIC was assuming that maxJumpReplacementSize is the size
you'd get if you emitted a patchableJump() using the macro assembler.
This is not true, however. It happens to be true on arm64, x86 and x86-64,
however, it is not true on armv7. This patch introduces an alternative to
maxJumpReplacementSize called patchableJumpSize, and switches JITMathIC
to use that number instead.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::patchableJumpSize):
(JSC::ARM64Assembler::maxJumpReplacementSize): Deleted.
* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::patchableJumpSize):
(JSC::ARMv7Assembler::maxJumpReplacementSize): Deleted.
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::patchableJumpSize):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::patchableJumpSize):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::patchableJumpSize):
* assembler/X86Assembler.h:
(JSC::X86Assembler::patchableJumpSize):
(JSC::X86Assembler::maxJumpReplacementSize): Deleted.
* jit/JITMathIC.h:
(JSC::JITMathIC::generateInline):

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

3 years agoClean up TextRun-related code
mmaxfield@apple.com [Thu, 1 Sep 2016 07:37:19 +0000 (07:37 +0000)]
Clean up TextRun-related code
https://bugs.webkit.org/show_bug.cgi?id=161473

Reviewed by Simon Fraser.

Source/WebCore:

Some assorted cleanup, including:
- Renaming "AllowTrailingExpansion | ForbidLeadingExpansion" to "DefaultExpansion"
- Migrating from pointers to references
- Migrating from ints to unsigneds
- Using proper character names from CharacterNames.h
- Simplifying CoreTextSPI.h

No new tests because there is no behavior change.

* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::TextLayout::isNeeded):
(WebCore::TextLayout::constructTextRun):
* platform/spi/cocoa/CoreTextSPI.h:
* platform/text/TextFlags.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::constructTextRun):
* rendering/RenderBlock.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::computePreferredLogicalWidths):
(WebCore::RenderListMarker::getRelativeMarkerRect):
* rendering/RenderMenuList.cpp:
(RenderMenuList::updateOptionsWidth):
* rendering/RenderText.cpp:
(WebCore::RenderText::widthFromCache):
(WebCore::RenderText::trimmedPrefWidths):
(WebCore::hyphenWidth):
(WebCore::maxWordFragmentWidth):
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::RenderText::width):
* rendering/RenderText.h:
* rendering/RenderThemeIOS.mm:
* rendering/line/BreakingContext.h:
(WebCore::textWidth):
(WebCore::tryHyphenating):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::offsetForPositionInFragment):
(WebCore::SVGInlineTextBox::selectionRectForTextFragment):
(WebCore::SVGInlineTextBox::localSelectionRect):
(WebCore::SVGInlineTextBox::paintSelectionBackground):
(WebCore::SVGInlineTextBox::paint):
(WebCore::SVGInlineTextBox::acquirePaintingResource):
(WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
(WebCore::SVGInlineTextBox::constructTextRun):
(WebCore::SVGInlineTextBox::paintDecorationWithStyle):
(WebCore::SVGInlineTextBox::paintTextWithShadows):
(WebCore::SVGInlineTextBox::paintText):
* rendering/svg/SVGInlineTextBox.h:

Source/WebKit/mac:

Remove unused #includes.

* WebCoreSupport/WebDragClient.mm:
* WebView/WebView.mm:

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

3 years agoUnreviewed. Fix webkitpy unit tests after r205280.
carlosgc@webkit.org [Thu, 1 Sep 2016 07:31:42 +0000 (07:31 +0000)]
Unreviewed. Fix webkitpy unit tests after r205280.

* Scripts/webkitpy/style/checker_unittest.py:
(GlobalVariablesTest.test_path_rules_specifier):

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

3 years ago[GTK] Move GObject DOM bindings to WebKit2 layer and stop auto generating them
carlosgc@webkit.org [Thu, 1 Sep 2016 06:45:40 +0000 (06:45 +0000)]
[GTK] Move GObject DOM bindings to WebKit2 layer and stop auto generating them
https://bugs.webkit.org/show_bug.cgi?id=161438

Reviewed by Michael Catanzaro.

.:

* Source/PlatformGTK.cmake:
* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

Remove the scripts to generate GObject DOM bindings and the tests. Also remove all GObject ifdefs from the idl files.

* PlatformGTK.cmake:
* bindings/gobject: Removed.
* bindings/scripts/CodeGeneratorGObject.pm: Removed.
* bindings/scripts/test/GObject: Removed.
* css/CSSStyleSheet.idl:
* css/RGBColor.idl:
* dom/DOMCoreException.idl:
* dom/DOMImplementation.idl:
* dom/Document.idl:
* dom/DocumentType.idl:
* dom/Element.idl:
* dom/Event.idl:
* dom/EventTarget.idl:
* dom/KeyboardEvent.idl:
* dom/MessageEvent.idl:
* dom/MessagePort.idl:
* dom/MouseEvent.idl:
* dom/NamedNodeMap.idl:
* dom/Node.idl:
* dom/Range.idl:
* dom/Slotable.idl:
* dom/WheelEvent.idl:
* fileapi/FileException.idl:
* html/HTMLAppletElement.idl:
* html/HTMLCanvasElement.idl:
* html/HTMLCollection.idl:
* html/HTMLDocument.idl:
* html/HTMLElement.idl:
* html/HTMLEmbedElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLIFrameElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLOptionElement.idl:
* html/HTMLOptionsCollection.idl:
* html/HTMLSelectElement.idl:
* html/HTMLTableCellElement.idl:
* html/HTMLTableColElement.idl:
* html/HTMLTextAreaElement.idl:
* html/HTMLVideoElement.idl:
* html/ImageData.idl:
* html/URLUtils.idl:
* html/track/TextTrack.idl:
* page/DOMSelection.idl:
* page/DOMWindow.idl:
* svg/SVGDocument.idl:
* svg/SVGElement.idl:
* svg/SVGException.idl:
* workers/DedicatedWorkerGlobalScope.idl:
* workers/Worker.idl:
* workers/WorkerGlobalScope.idl:
* xml/XPathException.idl:

Source/WebKit2:

Move all GObject bindings code to WebProcess/InjectedBundle/API/gtk/DOM.

* PlatformGTK.cmake:
* WebProcess/InjectedBundle/API/gtk/DOM:

Tools:

Remove scripts related to the GObject DOM bindings auto-generation.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunGtkAPITests.getText2):
(TestFactory.__init__):
(RunWebKit1Tests): Deleted.
(RunWebKit1Tests.start): Deleted.
(RunWebKit1LeakTests): Deleted.
(RunWebKit1LeakTests.start): Deleted.
(RunAndUploadPerfTests): Deleted.
(RunAndUploadPerfTests.start): Deleted.
(BuildAndRemoteJSCTestsFactory.__init__): Deleted.
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py:
(BuildStepsTest.test_unnecessary_expected_results):
(RunAndUploadPerfTestsTest): Deleted.
(RunAndUploadPerfTestsTest.assertResults): Deleted.
(RunAndUploadPerfTestsTest.test_success): Deleted.
(RunAndUploadPerfTestsTest.test_tests_failed): Deleted.
(RunAndUploadPerfTestsTest.test_build_bad_build): Deleted.
(RunAndUploadPerfTestsTest.test_build_bad_source_json): Deleted.
(RunAndUploadPerfTestsTest.test_build_bad_marge): Deleted.
(RunAndUploadPerfTestsTest.test_build_bad_failed_uploading): Deleted.
(RunAndUploadPerfTestsTest.test_build_bad_preparation): Deleted.
(RunAndUploadPerfTestsTest.test_buildbot_timeout): Deleted.
(RunBenchmarkTest): Deleted.
(RunBenchmarkTest.assertResults): Deleted.
(RunBenchmarkTest.test_success): Deleted.
* Scripts/run-bindings-tests:
(main):
* Scripts/webkitpy/style/checker.py:
* gtk/check-for-webkitdom-api-breaks: Removed.
* gtk/generate-gtkdoc:
* gtk/webkitdom.py: Removed.

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

3 years ago[EFL] Small clean up in MiniBrowser
gyuyoung.kim@webkit.org [Thu, 1 Sep 2016 05:47:16 +0000 (05:47 +0000)]
[EFL] Small clean up in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=161428

Reviewed by Yusuke Suzuki.

This patch resizes MiniBrowser, add *char* constants for scheme,
does line breaking, and remove unnecessary spaces.

* MiniBrowser/efl/main.c:
(on_mouse_wheel):
(history_list_hide):
(script_execute_callback):
(on_key_down):
(on_url_changed):
(on_error):
(on_color_picker_request):
(url_from_user_input):
(url_load_from_user_input):
(on_back_button_clicked):
(on_search_case_option_changed):
(on_search_word_start_option_changed):
(on_list_item_select):
(navigation_button_longpress_process):
(on_navigation_policy_decision):
(window_create):
(parse_cookies_policy):

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

3 years ago[JSC] Add initiator parameter to module pipeline
utatane.tea@gmail.com [Thu, 1 Sep 2016 03:48:34 +0000 (03:48 +0000)]
[JSC] Add initiator parameter to module pipeline
https://bugs.webkit.org/show_bug.cgi?id=161470

Reviewed by Saam Barati.

Source/JavaScriptCore:

The fetching semantics of the <script type="module"> tag has per module-tag context.
For example, "nonce", "crossorigin" etc. attributes are shared in the fetching requests
issued from the module-tag. To transfer this information, we add a new parameter "initiator"
to the module loader pipeline. We are planning to transfer information by this parameter.

At the same time, we also perform some clean up.

- Use arrow function in ModuleLoaderPrototype.js.
- Rename "ResolveDependencies" to "Satisfy" to align to the loader spec.

* builtins/ModuleLoaderPrototype.js:
(newRegistryEntry):
(commitInstantiated):
(requestFetch):
(requestTranslate):
(requestInstantiate):
(requestSatisfy):
(requestInstantiateAll):
(requestLink):
(moduleEvaluation):
(provide):
(loadAndEvaluateModule):
(requestResolveDependencies.): Deleted.
(requestResolveDependencies): Deleted.
(requestReady): Deleted.
(link): Deleted.
(loadModule): Deleted.
(linkAndEvaluateModule): Deleted.
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* bytecode/BytecodeIntrinsicRegistry.h:
* jsc.cpp:
(GlobalObject::moduleLoaderResolve):
(GlobalObject::moduleLoaderFetch):
* runtime/Completion.cpp:
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
(JSC::linkAndEvaluateModule):
* runtime/Completion.h:
* runtime/JSGlobalObject.h:
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::loadAndEvaluateModule):
(JSC::JSModuleLoader::loadModule):
(JSC::JSModuleLoader::linkAndEvaluateModule):
(JSC::JSModuleLoader::resolve):
(JSC::JSModuleLoader::fetch):
(JSC::JSModuleLoader::translate):
(JSC::JSModuleLoader::instantiate):
(JSC::JSModuleLoader::evaluate):
* runtime/JSModuleLoader.h:
* runtime/ModuleLoaderPrototype.cpp:
(JSC::moduleLoaderPrototypeResolve):
(JSC::moduleLoaderPrototypeFetch):
(JSC::moduleLoaderPrototypeTranslate):
(JSC::moduleLoaderPrototypeInstantiate):
(JSC::moduleLoaderPrototypeEvaluate):

Source/WebCore:

No user-observable behavior change.

We rename JSModuleLoader to ScriptModuleLoader.
The name "JSModuleLoader" is misleading since it seems like this is a JS object.
"ModuleLoader" is not good since there is CSS modules.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::moduleLoaderResolve):
(WebCore::JSDOMWindowBase::moduleLoaderFetch):
(WebCore::JSDOMWindowBase::moduleLoaderEvaluate):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::loadModule):
(WebCore::JSMainThreadExecState::linkAndEvaluateModule):
* bindings/js/JSModuleLoader.cpp:
(WebCore::JSModuleLoader::JSModuleLoader): Deleted.
(WebCore::JSModuleLoader::resolve): Deleted.
(WebCore::JSModuleLoader::fetch): Deleted.
(WebCore::JSModuleLoader::evaluate): Deleted.
* bindings/js/JSModuleLoader.h:
(WebCore::JSModuleLoader::document): Deleted.
* bindings/js/ScriptModuleLoader.cpp: Renamed from Source/WebCore/bindings/js/JSModuleLoader.cpp.
(WebCore::ScriptModuleLoader::ScriptModuleLoader):
(WebCore::ScriptModuleLoader::resolve):
(WebCore::ScriptModuleLoader::fetch):
(WebCore::ScriptModuleLoader::evaluate):
* bindings/js/ScriptModuleLoader.h: Renamed from Source/WebCore/bindings/js/JSModuleLoader.h.
(WebCore::ScriptModuleLoader::document):
* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(WebCore::Document::moduleLoader):

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

3 years agoASSERTION FAILED: !flow->layer() && !flow->isInlineElementContinuation() in WebCore...
zalan@apple.com [Thu, 1 Sep 2016 03:34:36 +0000 (03:34 +0000)]
ASSERTION FAILED: !flow->layer() && !flow->isInlineElementContinuation() in WebCore::RenderBlock::addContinuationWithOutline
https://bugs.webkit.org/show_bug.cgi?id=151022
<rdar://problem/27710993>

Reviewed by Simon Fraser.

Source/WebCore:

Certain CSS properties like opacity, mask etc (graphical group members) require the layer to be a non-normal flow,
self painting layer so that we can manage painting properly. However in addition to those CSS properties, some of the will-change
values (again, graphical group members) also require the layer to be non-normal flow, self painting.
This patch ensures that when deciding whether a layer should be a normal flow layer, we take the will-change values into account as well.

Tests: compositing/layer-creation/assert-on-inline-element-with-will-change.html
       compositing/layer-creation/will-change-on-normal-flow-content.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/style/WillChangeData.cpp:
(WebCore::propertyCreatesGraphicalGroup):
(WebCore::WillChangeData::addFeature):
* rendering/style/WillChangeData.h:
(WebCore::WillChangeData::canCreateGraphicalGroup):
(WebCore::WillChangeData::canTriggerCompositingOnInline): Deleted.

LayoutTests:

* compositing/layer-creation/assert-on-inline-element-with-will-change-expected.txt: Added.
* compositing/layer-creation/assert-on-inline-element-with-will-change.html: Added.
* compositing/layer-creation/will-change-on-normal-flow-content-expected.txt: Added.
* compositing/layer-creation/will-change-on-normal-flow-content.html: Added.

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

3 years ago[JSC] linking and evaluating the modules are done in a sync manner
utatane.tea@gmail.com [Thu, 1 Sep 2016 02:11:43 +0000 (02:11 +0000)]
[JSC] linking and evaluating the modules are done in a sync manner
https://bugs.webkit.org/show_bug.cgi?id=161467

Reviewed by Saam Barati.

While the fetching and the other stages are done in an asynchronous manner,
linking and evaluating are done in a sync manner.
Just return the result value and do not wrap them with the internal promise.

* builtins/ModuleLoaderPrototype.js:
(linkAndEvaluateModule):
* runtime/Completion.cpp:
(JSC::linkAndEvaluateModule):
* runtime/Completion.h:
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::linkAndEvaluateModule):
* runtime/JSModuleLoader.h:

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

3 years agoWebKit should set a subsystem for os_log so it's easier to filter for WebKit log...
krollin@apple.com [Thu, 1 Sep 2016 01:33:40 +0000 (01:33 +0000)]
WebKit should set a subsystem for os_log so it's easier to filter for WebKit log messages
https://bugs.webkit.org/show_bug.cgi?id=160969
<rdar://problem/26068734>

Reviewed by Simon Fraser.

Source/WebCore:

- Specify a channel when using RELEASE_LOG macros
- Add a new channel so that we have something to pass to the
  RELEASE_LOG macros (Layers).
- Enable subsystem- and channel-related data and functions when using
  RELEASE_LOG macros.
- Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL, and
  LOG_CHANNEL_ADDRESS macros that are now defined in WTF.

No new tests. There are no tests for logging.

* loader/FrameLoader.cpp:
* platform/LogInitialization.h:
* platform/LogMacros.h:
* platform/Logging.cpp:
* platform/Logging.h:
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawNativeImage):
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::IOSurface):
* platform/mac/LoggingMac.mm:
* platform/unix/LoggingUnix.cpp:
* platform/win/LoggingWin.cpp:
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::initializeLogChannelsIfNecessary):

Source/WebKit/mac:

Enable subsystem- and channel-related data and functions when using
RELEASE_LOG macros. Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL,
and LOG_CHANNEL_ADDRESS macros that are now defined in WTF.

* Misc/WebKitLogging.h:
* Misc/WebKitLogging.m:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

Source/WebKit/win:

Enable subsystem- and channel-related data and functions when using
RELEASE_LOG macros. Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL,
and LOG_CHANNEL_ADDRESS macros that are now defined in WTF.

* WebKitLogging.cpp:
* WebKitLogging.h:
* WebView.cpp:
(WebView::initWithFrame):

Source/WebKit2:

- Specify a channel when using RELEASE_LOG macros.
- Add some new channels so that we have something to pass to the
  RELEASE_LOG macros (ProcessSuspension, IPC, Layers).
- Enable subsystem- and channel-related data and functions when using
  RELEASE_LOG macros.
- Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL, and
  LOG_CHANNEL_ADDRESS macros that are now defined in WTF.

* NetworkProcess/Downloads/Download.cpp:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::prepareToSuspend):
(WebKit::NetworkProcess::cancelPrepareToSuspend):
(WebKit::NetworkProcess::processDidResume):
* NetworkProcess/NetworkResourceLoader.cpp:
* Platform/IPC/Connection.cpp:
(IPC::Connection::waitForSyncReply):
* Platform/LogInitialization.h:
* Platform/Logging.cpp:
(WebKit::initializeLogChannelsIfNecessary):
* Platform/Logging.h:
* Platform/foundation/LoggingFoundation.mm:
* Platform/unix/LoggingUnix.cpp:
* Shared/ChildProcess.cpp:
(WebKit::didCloseOnConnectionWorkQueue):
* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::releaseNetworkActivityToken):
(WebKit::NavigationState::didChangeIsLoading):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::fetchWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteData):
(WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertionNow):
(WebKit::ProcessThrottler::updateAssertion):
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebProcessPool.cpp:
(WebKit::m_hiddenPageThrottlingTimer):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::fetchWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
(WebKit::WebProcessProxy::didSetAssertionState):
(WebKit::WebProcessProxy::setIsHoldingLockedFiles):
* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
(WebKit::ProcessAssertion::ProcessAssertion):
* WebProcess/Network/WebLoaderStrategy.cpp:
* WebProcess/Network/WebResourceLoader.cpp:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::layerVolatilityTimerFired):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::processWillSuspendImminently):
(WebKit::WebProcess::prepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::markAllLayersVolatile):
(WebKit::WebProcess::processDidResume):

Source/WTF:

Add support for attaching a subsystem and category when logging via
the RELEASE_LOG macros. This support is provided by adding subsystem
and category information to WTFLogChannel. An os_log_t object is then
created to enacpsulate that information. When using RELEASE_LOG to log
through that channel, the associated log object is used when calling
os_log.

To help support the inclusion of the subsystem and category
information in WTFLogChannel, the DECLARE_LOG_CHANNEL,
DEFINE_LOG_CHANNEL, and LOG_CHANNEL_ADDRESS macros that were defined
in various modules are consolidated and moved to Assertions.h.
DEFINE_LOG_CHANNEL is now defined to initialize the subsystem and
category.

* wtf/Assertions.cpp:
* wtf/Assertions.h:
* wtf/RefCountedLeakCounter.cpp:

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

3 years agoEnable the YouTube Flash plug-in replacement behavior on all Cocoa ports
commit-queue@webkit.org [Thu, 1 Sep 2016 01:23:56 +0000 (01:23 +0000)]
Enable the YouTube Flash plug-in replacement behavior on all Cocoa ports
https://bugs.webkit.org/show_bug.cgi?id=161453
<rdar://problem/28050847>

Patch by Ricky Mondello <rmondello@apple.com> on 2016-08-31
Reviewed by Eric Carlson.

Now that we have some tests for the URL transformation logic (r205212) and the ability to enable the YouTube
Flash plug-in replacement behavior independently from the QuickTime plug-in replacement behavior (r205214 and
r205271), enable the YouTube Flash plug-in replacement behavior for Cocoa ports. We can and will continue to
improve it.

* page/Settings.cpp: Enable the feature for PLATFORM(COCOA), rather than just PLATFORM(IOS).

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

3 years agoImplement IPv6 parsing in URLParser
achristensen@apple.com [Thu, 1 Sep 2016 00:23:47 +0000 (00:23 +0000)]
Implement IPv6 parsing in URLParser
https://bugs.webkit.org/show_bug.cgi?id=161390

Reviewed by Darin Adler.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::zeroSequenceLength):
(WebCore::findLongestZeroSequence):
(WebCore::nibbleToHex):
(WebCore::serializeIPv6Piece):
(WebCore::serializeIPv6):
(WebCore::parseIPv6Host):
(WebCore::URLParser::hostEndReached):

Source/WTF:

* wtf/ASCIICType.h:
(WTF::lowerNibbleToLowercaseASCIIHexDigit):
(WTF::upperNibbleToLowercaseASCIIHexDigit):

Tools:

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

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

3 years agoBreak pluginReplacementEnabled into youTubeFlashPluginReplacementEnabled and quickTim...
commit-queue@webkit.org [Wed, 31 Aug 2016 23:59:00 +0000 (23:59 +0000)]
Break pluginReplacementEnabled into youTubeFlashPluginReplacementEnabled and quickTimePluginReplacementEnabled
https://bugs.webkit.org/show_bug.cgi?id=161424
<rdar://problem/28050847>

Patch by Ricky Mondello <rmondello@apple.com> on 2016-08-31
Reviewed by Dean Jackson.

Source/WebCore:

Replace the single pluginReplacementEnabled setting with individual settings for the YouTube Flash plug-in
behavior and the QuickTime plug-in behavior. Unless otherwise noted, this change copies the existing plumbing
for pluginReplacementEnabled and renames it twice. The default values for these settings remain the same.

* Modules/plugins/PluginReplacement.h:
(WebCore::ReplacementPlugin::ReplacementPlugin): Augment the constructor.
(WebCore::ReplacementPlugin::isEnabledBySettings): Added.
* Modules/plugins/QuickTimePluginReplacement.h: Declare a static member function.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::registerPluginReplacement): Properly create a ReplacementPlugin instance.
(WebCore::QuickTimePluginReplacement::isEnabledBySettings): Added.
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::registerPluginReplacement): Properly create a ReplacementPlugin instance.
(WebCore::YouTubePluginReplacement::isEnabledBySettings): Added.
* Modules/plugins/YouTubePluginReplacement.h: Declare a static member function.
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::requestObject): Ask the ReplacementPlugin whether it's enabled, rather than assume
    all plug-in replacement is guarded by a single run-time setting.
* page/Settings.cpp: Declare values for defaults for both settings.
* page/Settings.in: Declare two settings.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup): Handle both settings.
(WebCore::InternalSettings::Backup::restoreTo): Ditto.
(WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Added.
(WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Added.
(WebCore::InternalSettings::setPluginReplacementEnabled): Deleted.
* testing/InternalSettings.h: Duplicate and rename.
* testing/InternalSettings.idl: Ditto.

LayoutTests:

* plugins/quicktime-plugin-replacement.html: Updated for the internal setting rename.
* security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html: Ditto.

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

3 years agoGardening: skipping a flaky test from the JSC test suite.
mark.lam@apple.com [Wed, 31 Aug 2016 23:58:21 +0000 (23:58 +0000)]
Gardening: skipping a flaky test from the JSC test suite.
https://bugs.webkit.org/show_bug.cgi?id=161437

Not reviewed.

* js/script-tests/regress-141098.js:

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

3 years agoAdd event support for link preload.
yoav@yoav.ws [Wed, 31 Aug 2016 22:41:44 +0000 (22:41 +0000)]
Add event support for link preload.
https://bugs.webkit.org/show_bug.cgi?id=158466

Reviewed by Alex Christensen.

Source/WebCore:

Add onload/onerror support for link rel preload to align it with the spec
and enable various resource loading use-cases.
This patch also fixes XHR matching issues by replacing LinkPreload with RawResource.

Tests: http/tests/misc/script_onload_delays_window_onload.html
       http/tests/preload/delaying_onload_link_preload_after_discovery.html
       http/tests/preload/delaying_onload_link_preload_after_discovery_image.html
       http/tests/preload/not_delaying_window_onload_before_discovery.html
       http/tests/preload/onerror_event.html
       http/tests/preload/onload_event.html

* CMakeLists.txt: Add LinkPreloadResourceClients.{h,cpp}
* WebCore.xcodeproj/project.pbxproj: Add LinkPreloadResourceClients.{h,cpp}.
* html/HTMlLinkElement.cpp:
(WebCore::linkErrorEventSender): Add an eventSender for the error event.
(WebCore::HTMLLinkElement::HTMLLinkElement): s/m_loadedSheet/m_loadedResource/
(WebCore::HTMLLinkElement::~HTMLLinkElement): Cancel the error event when the element gets destructed.
(WebCore::HTMLLinkElement::linkLoaded): dispatch the event in an async manner.
(WebCore::HTMLLinkElement::linkLoadingErrored): dispatch the event in an async manner.
(WebCore::HTMLLinkElement::dispatchPendingEvent): Call dispatchEvent directly.
(WebCore::HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources): s/m_loadedSheet/m_loadedResource/
* html/HTMLLinkElement.h: s/m_loadedSheet/m_loadedResource/
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::HTMLResourcePreloader::preload): Call preload as ImplicitPreload, to distinguish it from declarative preload.
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::LinkLoader): Get rid of unnecessary event timers and add a weakPtrFactory.
(WebCore::LinkLoader::triggerEvents): Add a triggerEvents function that can be called from notifyFinished as well as the
LinkPreloadResourceClients.
(WebCore::LinkLoader::notifyFinished): Call the triggerEvents function.
(WebCore::LinkLoader::resourceTypeFromAsAttribute): Replace LinkPreload with RawResource to avoid XHR resource matching issues.
(WebCore::createLinkPreloadResourceClient): Create a resource client for link preload.
(WebCore::LinkLoader::preloadIfNeeded): Trigger an error when `as` is unknown. Make sure that preload resources don't delay window.onload
before discovery. Get the resource back from calling preload and create a client for that resource.
(WebCore::LinkLoader::linkLoadTimerFired): Deleted.
(WebCore::LinkLoader::linkLoadingErrorTimerFired): Deleted.
(WebCore::preloadIfNeeded): Deleted.
* loader/LinkLoader.h:
(WebCore::LinkLoader::createWeakPtr):
* loader/LinkPreloadResourceClients.cpp: Added.
(WebCore::LinkPreloadResourceClient::LinkPreloadResourceClient): Create a LinkPreloadResourceClient and assign with with a weakPtr of
LinkLoader.
(WebCore::LinkPreloadResourceClient::triggerEvents): Call LinkLoader's triggerEvents.
* loader/LinkPreloadResourceClients.h: Added.
(WebCore::LinkPreloadResourceClient::~LinkPreloadResourceClient):
(WebCore::LinkPreloadResourceClient::addResource): Add as resource's client.
(WebCore::LinkPreloadResourceClient::clearResource): Remove as resource's client and clear ref to resource.
(WebCore::LinkPreloadResourceClient::ownedResource): Return ref to resource.
* loader/ResourceLoadInfo.cpp:
(WebCore::toResourceType): Removed LinkPreload.
* loader/SubresourceLoader.cpp:
(WebCore::logResourceLoaded): Removed LinkPreload.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::defaultPriorityForResourceType): Removed LinkPreload.
* loader/cache/CachedResource.h: Removed LinkPreload.
(WebCore::CachedResource::ignoreForRequestCount): Don't delay window.onload for requests that opted out of that.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::checkInsecureContent): Removed LinkPreload.
(WebCore::CachedResourceLoader::requestResource): Make sure that discovered preload resources do block window.onload.
(WebCore::CachedResourceLoader::preload): Make sure that explicitly preloaded subresources can be fetched even if there are parser
blocking resources still in flight. Return the preloaded resource.
(WebCore::CachedResourceLoader::requestPreload): Make sure that preloaded fonts get requested. Return preloaded resource.
(WebCore::createResource): Removed LinkPreload.
(WebCore::contentTypeFromResourceType): Removed LinkPreload.
(WebCore::CachedResourceLoader::canRequest): Removed LinkPreload.
* loader/cache/CachedResourceLoader.h:
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::ignoreForRequestCount): Get the flag saying if a resource should block window.onload.
(WebCore::ResourceRequestBase::setIgnoreForRequestCount): Set the flag saying if a resource should block window.onload.

Source/WebKit2:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::maximumBufferingTime): Removed LinkPreload.

LayoutTests:

Add tests that make sure that event handling with regarding to link preload
is working as it should.

* http/tests/misc/script_onload_delays_window_onload-expected.txt: Added.
* http/tests/misc/script_onload_delays_window_onload.html: Added.
* http/tests/preload/delaying_onload_link_preload_after_discovery-expected.txt: Added.
* http/tests/preload/delaying_onload_link_preload_after_discovery.html: Added.
* http/tests/preload/delaying_onload_link_preload_after_discovery_image-expected.txt: Added.
* http/tests/preload/delaying_onload_link_preload_after_discovery_image.html: Added.
* http/tests/preload/dynamic_remove_preload_href-expected.txt:
* http/tests/preload/dynamic_remove_preload_href.html:
* http/tests/preload/not_delaying_window_onload_before_discovery-expected.txt: Added.
* http/tests/preload/not_delaying_window_onload_before_discovery.html: Added.
* http/tests/preload/onerror_event-expected.txt: Added.
* http/tests/preload/onerror_event.html: Added.
* http/tests/preload/onload_event-expected.txt: Added.
* http/tests/preload/onload_event.html: Added.
* http/tests/preload/resources/single_download_preload.html:
* http/tests/resources/dummy.css: Added.
* http/tests/resources/dummy.js: Added.
* http/tests/resources/dummy.xml: Added.
* http/tests/resources/slow-image.php: Added.

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

3 years agoWeb Inspector: XHR with text but responseType = "blob" shows blank content
joepeck@webkit.org [Wed, 31 Aug 2016 22:16:23 +0000 (22:16 +0000)]
Web Inspector: XHR with text but responseType = "blob" shows blank content
https://bugs.webkit.org/show_bug.cgi?id=161422
<rdar://problem/28066869>

Reviewed by Brian Burg.

Source/WebCore:

Test: inspector/network/xhr-json-blob-has-content.html

When an XMLHttpRequest finished loading it was always setting the Inspector's
content for that load at the end. However, if the XHR was loading binary data
then it was passing an empty string to the inspector and overwriting the
data the inspector already had for the resource. Avoid this overwriting.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFinishLoading):
When loading binary content we have no decoded text to send to the inspector.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
Switch to an Optional string, and if it is not available don't
call through to the NetworkAgent expecting decoded text.

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didFinishXHRLoading):
* inspector/InspectorNetworkAgent.h:
Improve variable name.

LayoutTests:

* inspector/network/resources/data.json: Added.
* inspector/network/xhr-json-blob-has-content-expected.txt: Added.
* inspector/network/xhr-json-blob-has-content.html: Added.

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

3 years agostress/random-53bit.js.ftl-no-cjit-no-inline-validate sometimes fails
utatane.tea@gmail.com [Wed, 31 Aug 2016 21:03:34 +0000 (21:03 +0000)]
stress/random-53bit.js.ftl-no-cjit-no-inline-validate sometimes fails
https://bugs.webkit.org/show_bug.cgi?id=161436

Reviewed by Filip Pizlo.

JSTests:

The test checks Math.random() correctly produces 53bit random values.
The test can fail by design, but this should be fairly rare.

However, when introducing, we wrap the `test()` with 1e4 to ensure the FTL compilation, and this
increases the failure rate. By increasing the MAX in the test, we make the failures much more rare case.

And we also add getRandomSeed() and setRandomSeed(seed) JSC shell helpers to dump more useful information
and reproduce the situation easily.

* stress/random-53bit.js:
(test):

Source/JavaScriptCore:

* jsc.cpp:
(GlobalObject::finishCreation):
(functionGetRandomSeed):
(functionSetRandomSeed):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::weakRandom):
(JSC::JSGlobalObject::weakRandomInteger): Deleted.

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

3 years agoAdd runtime flag for using URLParser
achristensen@apple.com [Wed, 31 Aug 2016 20:19:39 +0000 (20:19 +0000)]
Add runtime flag for using URLParser
https://bugs.webkit.org/show_bug.cgi?id=161363

Reviewed by Sam Weinig.

Source/WebCore:

No new tests.  No change in default behavior.

* PlatformMac.cmake:
* platform/URL.cpp:
(WebCore::URL::URL):
(WebCore::URL::init):
(WebCore::URL::setProtocol):
(WebCore::URL::setHost):
(WebCore::URL::removePort):
(WebCore::URL::setPort):
(WebCore::URL::setHostAndPort):
(WebCore::URL::setUser):
(WebCore::URL::setPass):
(WebCore::URL::setFragmentIdentifier):
(WebCore::URL::removeFragmentIdentifier):
(WebCore::URL::setQuery):
(WebCore::URL::setPath):
(WebCore::URL::parse):
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::setEnabled):
(WebCore::URLParser::enabled):
* platform/URLParser.h:
* platform/cf/URLCF.cpp:
(WebCore::URL::URL):
* platform/cocoa/URLParserCocoa.mm: Added.
(WebCore::URLParser::URLParserEnabled):
* platform/mac/URLMac.mm:
(WebCore::URL::URL):

Source/WebKit2:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* Shared/Cocoa/WebKit2InitializeCocoa.mm: Added.
(WebKit::platformInitializeWebKit2):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer):
* Shared/WebKit2Initialize.cpp:
(WebKit::InitializeWebKit2):
* Shared/WebKit2Initialize.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/efl/WebKit2InitializeEFL.cpp: Added.
(WebKit::platformInitializeWebKit2):
* Shared/gtk/WebKit2InitializeGTK.cpp: Added.
(WebKit::platformInitializeWebKit2):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
(WebKit::WebProcessPool::createNewWebProcess):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

3 years ago[Fetch API] Fetch API should be able to load data URL in Same Origin mode
commit-queue@webkit.org [Wed, 31 Aug 2016 20:18:44 +0000 (20:18 +0000)]
[Fetch API] Fetch API should be able to load data URL in Same Origin mode
https://bugs.webkit.org/show_bug.cgi?id=161434

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

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/scheme-data-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-data-worker-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-data.js:
(checkFetchResponse):
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl.js: Added.
(redirectDataURL):

Source/WebCore:

Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker.html
       imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl.html
Covered also by added sub-test.

Moving SameDataURLOrigin option from ThreadableLoaderOptions to ResourceLoaderOptions.
This allows doing some of the checks in CachedResourceLoader/CachedResource.
This also allows setting this options in CachedResourceLoader clients, ImageLoader in that case.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start): Setting sameOriginDataURL as ResourceLoader option.
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement): Setting sameOriginDataURL as specificied in
https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element.
* loader/ResourceLoaderOptions.h: Adding sameOriginDataURL as ResourceLoader option.
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Removing sameOriginDataURL option.
* loader/ThreadableLoader.h:
* loader/WorkerThreadableLoader.cpp: Setting sameOriginDataURL as ResourceLoader option.
(WebCore::LoaderTaskOptions::LoaderTaskOptions):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load): If resource URL is a data url, we previously marked the resource as same origin.
We only do that now if the sameOriginDataURL flag is set as per fetch specification.
See https://fetch.spec.whatwg.org/#main-fetch.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::isSameOriginDataURL): Helper function.
(WebCore::CachedResourceLoader::canRequest): Allowing same origin loads of data URLs if flag is set and no redirection happens.
See https://fetch.spec.whatwg.org/#http-redirect-fetch for why we check redirection.

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

3 years agoUse Connection::sendWithReply for the SecItem shim messages
andersca@apple.com [Wed, 31 Aug 2016 19:54:12 +0000 (19:54 +0000)]
Use Connection::sendWithReply for the SecItem shim messages
https://bugs.webkit.org/show_bug.cgi?id=161419

Reviewed by Tim Horton.

* DerivedSources.make:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeConnection):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
* Shared/mac/SecItemShim.cpp:
(WebKit::workQueue):
(WebKit::sendSecItemRequest):
(WebKit::webSecItemCopyMatching):
(WebKit::webSecItemAdd):
(WebKit::webSecItemUpdate):
(WebKit::webSecItemDelete):
(WebKit::initializeSecItemShim):
(WebKit::responseMap): Deleted.
(WebKit::SecItemShim::singleton): Deleted.
(WebKit::SecItemShim::SecItemShim): Deleted.
(WebKit::generateSecItemRequestID): Deleted.
(WebKit::SecItemShim::secItemResponse): Deleted.
(WebKit::SecItemShim::initialize): Deleted.
(WebKit::SecItemShim::initializeConnection): Deleted.
* Shared/mac/SecItemShim.h:
* Shared/mac/SecItemShim.messages.in: Removed.
* UIProcess/mac/SecItemShimProxy.cpp:
(WebKit::SecItemShimProxy::didReceiveMessage):
(WebKit::SecItemShimProxy::secItemRequest):
* UIProcess/mac/SecItemShimProxy.h:
* UIProcess/mac/SecItemShimProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeConnection):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeProcess):

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

3 years agoHTML constructor must throw when newTarget is itself
rniwa@webkit.org [Wed, 31 Aug 2016 19:53:44 +0000 (19:53 +0000)]
HTML constructor must throw when newTarget is itself
https://bugs.webkit.org/show_bug.cgi?id=161430

Reviewed by Antti Koivisto.

Source/WebCore:

Per https://github.com/w3c/webcomponents/issues/541, we must throw a TypeError when the HTMLElement constructor
is called with new.target set to itself (i.e. new HTMLElement after registering it with a custom element).

Note that we can't check this at the time of customElements.define because it could be a Proxy object.

Also see: https://html.spec.whatwg.org/#html-element-constructors

Tests: fast/custom-elements/CustomElementRegistry.html
       fast/custom-elements/HTMLElement-constructor.html

* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement): Throw a TypeError when NewTarget is HTMLElement constructor itself.

LayoutTests:

Added test cases for defining a custom element with the HTMLElement constructor,
and making sure the HTMLElement constructor throws an exception when newTarget is itself.

* fast/custom-elements/CustomElementRegistry-expected.txt:
* fast/custom-elements/CustomElementRegistry.html:
* fast/custom-elements/HTMLElement-constructor-expected.txt:
* fast/custom-elements/HTMLElement-constructor.html:

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

3 years agoRebaseline binding tests after r205257.
rniwa@webkit.org [Wed, 31 Aug 2016 19:39:06 +0000 (19:39 +0000)]
Rebaseline binding tests after r205257.

* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):

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

3 years agoAdd the check for reentrancy to CustomElementRegistry
rniwa@webkit.org [Wed, 31 Aug 2016 19:31:11 +0000 (19:31 +0000)]
Add the check for reentrancy to CustomElementRegistry
https://bugs.webkit.org/show_bug.cgi?id=161423

Reviewed by Antti Koivisto.

Source/WebCore:

Added the "element definition is running" flag to JSCustomElementRegistry:
https://html.spec.whatwg.org/multipage/scripting.html#element-definition-is-running

And added an exception for when this flag is set during JSCustomElementRegistry::define:
https://html.spec.whatwg.org/multipage/scripting.html#dom-customelementregistry-define

Tests: fast/custom-elements/CustomElementRegistry.html

* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define): Throw NotSupportedError when m_elementDefinitionIsRunning is true.
* dom/CustomElementRegistry.h:
(WebCore::CustomElementRegistry::elementDefinitionIsRunning): Added.

LayoutTests:

Add test cases for reentrancy during customElements.define.

* fast/custom-elements/CustomElementRegistry-expected.txt:
* fast/custom-elements/CustomElementRegistry.html:

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

3 years agoVersioning.
bshafiei@apple.com [Wed, 31 Aug 2016 19:15:32 +0000 (19:15 +0000)]
Versioning.

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

3 years agoObject.getPrototypeOf() should return null cross-origin
cdumez@apple.com [Wed, 31 Aug 2016 19:03:53 +0000 (19:03 +0000)]
Object.getPrototypeOf() should return null cross-origin
https://bugs.webkit.org/show_bug.cgi?id=161393

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Object.getPrototypeOf() should return null cross-origin:
- https://html.spec.whatwg.org/#windowproxy-getprototypeof
- https://html.spec.whatwg.org/#location-getprototypeof

Firefox and Chrome return null. However, WebKit was returning undefined.

* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructorGetPrototypeOfFunctor::operator()):

LayoutTests:

Add layout test coverage.

* http/tests/security/cross-frame-access-object-getPrototypeOf-expected.txt:
* http/tests/security/cross-frame-access-object-getPrototypeOf.html:

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

3 years agoAvoid using strong reference in JSDOMPromise’s DeferredWrapper
rniwa@webkit.org [Wed, 31 Aug 2016 18:36:46 +0000 (18:36 +0000)]
Avoid using strong reference in JSDOMPromise’s DeferredWrapper
https://bugs.webkit.org/show_bug.cgi?id=161426
<rdar://problem/28091123>

Reviewed by Geoffrey Garen.

Replace JSC::Strong in DeferredWrapper by JSC::Weak, and make the global object own JSPromiseDeferred.

DeferredWrapper adds itself to JSDOMGlobalObject's newly added HashSet when it's created and clears itself
from the HashSet inside its destructor as well as when the promise is resolved or rejected.
This is so that JSDOMGlobalObject's visitChildren can visit every live DeferredWrapper.

Because this operation is rather expense, this patch turns DeferredWrapper into a RefCounted object to avoid
HashMap churns. Most of code changes in this patch is due to this type change, and the fact lambda cannot
capture Ref<DeferredWrapper> since its copy constructor doesn't exist.

We also create a write barrier from the global object to JSPromiseDeferred so that they won't be collected
during an eden collection when it happens before JSDOMGlobalObject's visitChildren is invoked.

Note that it's possible for the entire DOM wrapper world of the promise to go away before the promise is
resolved or rejected by a ref-counted C++ object. In this case, m_deferred and m_globalObject become dead.
Various member resolve* and reject functions of DeferredWrapper have been modified to check this condition.

Because JSDOMGlobalObject can be finalized before DeferredWrapper is finalized. DeferredWrapper's destructor,
which calls DeferredWrapper::clear, should only remove itself from m_globalObject when m_globalObject is alive.

Finally, this patch makes DeferredWrapper inherit from ActiveDOMCallback so that it won't try to execute scripts
when the active DOM objects have been suspended; e.g. after a page navigation.

No new tests since there should be no author/user visible behavioral change.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
* Modules/applepay/ApplePaySession.h:
* Modules/fetch/DOMWindowFetch.cpp:
(WebCore::DOMWindowFetch::fetch):
* Modules/fetch/DOMWindowFetch.h:
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::arrayBuffer):
(WebCore::FetchBody::blob):
(WebCore::FetchBody::json):
(WebCore::FetchBody::text):
(WebCore::FetchBody::consume):
(WebCore::FetchBody::consumeArrayBuffer):
(WebCore::FetchBody::consumeArrayBufferView):
(WebCore::FetchBody::consumeText):
(WebCore::FetchBody::consumeBlob):
(WebCore::FetchBody::loadingFailed):
(WebCore::FetchBody::loadingSucceeded):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::formData):
(WebCore::FetchBody::cleanConsumePromise):
(WebCore::FetchBody): Use RefPtr<DeferredWrapper> instead of Optional<DeferredWrapper> now that DeferredWrapper
is ref counted. Perhaps we could use Optional<Ref<DeferredWrapper>> here but that seemed rather verbose.
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::resolveWithData):
(WebCore::FetchBodyConsumer::resolve):
* Modules/fetch/FetchBodyConsumer.h:
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::arrayBuffer):
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::json):
(WebCore::FetchBodyOwner::text):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::consume):
(WebCore::FetchResponse::finishConsumingStream):
* Modules/fetch/FetchResponse.h:
* Modules/fetch/WorkerGlobalScopeFetch.cpp:
(WebCore::WorkerGlobalScopeFetch::fetch):
* Modules/fetch/WorkerGlobalScopeFetch.h:
* Modules/mediastream/UserMediaPermissionCheck.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::~JSDOMGlobalObject): Added.
(WebCore::JSDOMGlobalObject::visitChildren): Added visits to each JSPromiseDeferred owned by this global object.
* bindings/js/JSDOMGlobalObject.h:
(WebCore::JSDOMGlobalObject::deferredWrappers): Added. This map is only used by JSDOMGlobalObject's visitChildren.
* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredWrapper::DeferredWrapper):
(WebCore::DeferredWrapper::~DeferredWrapper): Calls clear. When the global object has already been finalized,
m_globalObject is dead. In that case, there is no need to remove itself from the global object. When m_deferred
has been cleared, either clear() has already been called (1) or the callback is dead (2). Since (2) happens only
when the global object itself is dead (as its visitChildren would have visited m_deferred otherwise), again, there
is no need to remove itself from global object.
(WebCore::DeferredWrapper::clear): Added. Clears m_deferred and removes itself from JSDOMGlobalObject.
(WebCore::DeferredWrapper::contextDestroyed): ScriptExecutionContext has been destroyed. We must call clear().
(WebCore::DeferredWrapper::callFunction): Check canInvokeCallback in ActiveDOMCallback.
(WebCore::DeferredWrapper::reject): Exit early when isSuspended() is true. See below.
(WebCore::rejectPromiseWithExceptionIfAny):
(WebCore::fulfillPromiseWithJSON):
(WebCore::fulfillPromiseWithArrayBuffer):
* bindings/js/JSDOMPromise.h:
(WebCore::DeferredWrapper::create): Added.
(WebCore::DeferredWrapper::isSuspended): Added. Returns true iff the DOM wrapper world has gone away or active DOM
objects have been suspended.
(WebCore::DeferredWrapper::globalObject): Made this inline.
(WebCore::DeferredWrapper::visitAggregate): Added. Called by JSDOMGlobalObject::visitChildren.
(WebCore::DOMPromise::resolve):
(WebCore::DOMPromise::reject):
(WebCore::DeferredWrapper::resolveWithValue): Exit early when isSuspended() is true.
(WebCore::DeferredWrapper::resolveWithNewlyCreated): Ditto.
(WebCore::DeferredWrapper::rejectWithValue): Ditto.
(WebCore::DeferredWrapper::resolve): Ditto.
(WebCore::DeferredWrapper::reject): Ditto.
* bindings/js/JSFontFaceCustom.cpp:
(WebCore::JSFontFace::loaded):
* bindings/js/JSFontFaceSetCustom.cpp:
(WebCore::JSFontFaceSet::ready):
* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::JSMediaDevices::getUserMedia):
* bindings/js/JSReadableStreamSourceCustom.cpp:
(WebCore::JSReadableStreamSource::start):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::JSWebKitSubtleCrypto::encrypt):
(WebCore::JSWebKitSubtleCrypto::decrypt):
(WebCore::JSWebKitSubtleCrypto::sign):
(WebCore::JSWebKitSubtleCrypto::verify):
(WebCore::JSWebKitSubtleCrypto::digest):
(WebCore::JSWebKitSubtleCrypto::generateKey):
(WebCore::JSWebKitSubtleCrypto::importKey):
(WebCore::JSWebKitSubtleCrypto::exportKey):
(WebCore::JSWebKitSubtleCrypto::wrapKey):
(WebCore::JSWebKitSubtleCrypto::unwrapKey):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateReturnParameters):

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

3 years agoUnreviewed, update iOS simulator WK1 flaky tests.
jiewen_tan@apple.com [Wed, 31 Aug 2016 17:44:22 +0000 (17:44 +0000)]
Unreviewed, update iOS simulator WK1 flaky tests.

* platform/ios-simulator-wk1/TestExpectations:

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

3 years ago[JSC] AbstractValue can contain padding which is not zero-filled
utatane.tea@gmail.com [Wed, 31 Aug 2016 17:00:18 +0000 (17:00 +0000)]
[JSC] AbstractValue can contain padding which is not zero-filled
https://bugs.webkit.org/show_bug.cgi?id=161427

Reviewed by Saam Barati.

We checked that AbstractValue is zero-filled when initializing it to ensure
that zero-filled memory can be used as the initialized AbstractValue.
However, since the size of SpeculatedType becomes 64bit, AbstractValue can have
padding now. And this padding is not ensured that it is initialized with zeros.
So debug assertion fails when building with GCC.

This patch changes the strategy. Instead of checking the initialized
AbstractValue is zero-filled, we ensure that zero-filled AbstractValue can be
considered to be equal to the initialized AbstractValue.

* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::ensureCanInitializeWithZeros):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::AbstractValue):

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

3 years ago[Fetch API] Request construction failure should not set "bodyUsed"
commit-queue@webkit.org [Wed, 31 Aug 2016 16:44:49 +0000 (16:44 +0000)]
[Fetch API] Request construction failure should not set "bodyUsed"
https://bugs.webkit.org/show_bug.cgi?id=161432

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

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/request/request-disturbed-expected.txt:
* web-platform-tests/fetch/api/request/request-disturbed.html:

Source/WebCore:

Covered by added sub-test coming from chromium fetch test suite.

* Modules/fetch/FetchRequest.cpp:
(WebCore::methodCanHaveBody):
(WebCore::FetchRequest::setBody): Check whether request can have a body before disturbing the passed request.
(WebCore::validateBodyAndMethod): Deleted.

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

3 years agoMarking http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html...
ryanhaddad@apple.com [Wed, 31 Aug 2016 16:44:27 +0000 (16:44 +0000)]
Marking http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=161391

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years ago[Fetch API] Response bodyUsed should check for its body disturbed state
commit-queue@webkit.org [Wed, 31 Aug 2016 16:36:57 +0000 (16:36 +0000)]
[Fetch API] Response bodyUsed should check for its body disturbed state
https://bugs.webkit.org/show_bug.cgi?id=161429

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

Source/WebCore:

Test: http/tests/fetch/bodyUsed-worker.html

Implementing bodyUsed as a JS Builtin.
This allows using directly @isReadableStreamDisturbed if response has a body.

Renaming isDisturbed to isDisturbedOrLocked to better match fetch spec terminology.

* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::isDisturbedOrLocked): Renaming isDisturbed to isDisturbedOrLocked.
(WebCore::FetchBodyOwner::arrayBuffer): Ditto.
(WebCore::FetchBodyOwner::blob): Ditto.
(WebCore::FetchBodyOwner::formData): Ditto.
(WebCore::FetchBodyOwner::json): Ditto.
(WebCore::FetchBodyOwner::text): Ditto.
(WebCore::FetchBodyOwner::isDisturbed): Ditto.
* Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::isDisturbed): Ditto.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith): Ditto.
(WebCore::FetchRequest::clone): Ditto.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::cloneForJS): Ditto.
(WebCore::FetchResponse::createReadableStreamSource): Only asserting for isDisturbed.
* Modules/fetch/FetchResponse.idl: Marking bodyUsed as JS builtin.
* Modules/fetch/FetchResponse.js: Adding bodyUsed.
(bodyUsed):
(clone):

LayoutTests:

* http/tests/fetch/bodyUsed-expected.txt: Added.
* http/tests/fetch/bodyUsed-worker-expected.txt: Added.
* http/tests/fetch/bodyUsed-worker.html: Added.
* http/tests/fetch/bodyUsed.js: Added.
* http/tests/fetch/window/body-mixin-expected.txt:

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

3 years ago[Fetch API] Blob type should be correctly set in case of empty body
commit-queue@webkit.org [Wed, 31 Aug 2016 16:36:35 +0000 (16:36 +0000)]
[Fetch API] Blob type should be correctly set in case of empty body
https://bugs.webkit.org/show_bug.cgi?id=161431

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

Source/WebCore:

Tests: http/tests/fetch/fetch-as-blob-worker.html
       http/tests/fetch/fetch-as-blob.html

* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::takeAsBlob): Set blob type with contentType even if blob has no data.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::blob): Ditto for empty bodies.

LayoutTests:

* http/tests/fetch/fetch-as-blob-expected.txt: Added.
* http/tests/fetch/fetch-as-blob-worker-expected.txt: Added.
* http/tests/fetch/fetch-as-blob-worker.html: Added.
* http/tests/fetch/fetch-as-blob.html: Added.
* http/tests/fetch/fetch-as-blob.js: Added.
(promise_test):

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

3 years agoDOM event handling should pass Event around by reference.
akling@apple.com [Wed, 31 Aug 2016 16:32:44 +0000 (16:32 +0000)]
DOM event handling should pass Event around by reference.
<https://webkit.org/b/161398>

Reviewed by Chris Dumez.

Source/WebCore:

Start with making Node::defaultEventHandler() take an Event& instead of an Event*,
and then spread out from there, propagating the referenceness.

* dom/Element.cpp:
(WebCore::Element::isKeyboardFocusable):
* dom/Element.h:
* dom/EventDispatcher.cpp:
(WebCore::callDefaultEventHandlersInTheBubblingOrder):
* dom/Node.cpp:
(WebCore::Node::dispatchDOMActivateEvent):
(WebCore::Node::defaultEventHandler):
* dom/Node.h:
* editing/Editor.cpp:
(WebCore::Editor::handleKeyboardEvent):
(WebCore::Editor::handleInputMethodKeydown):
(WebCore::Editor::handleTextEvent):
* editing/Editor.h:
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::handleKeydownEvent):
(WebCore::BaseCheckableInputType::handleKeypressEvent):
* html/BaseCheckableInputType.h:
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent):
* html/BaseChooserOnlyDateAndTimeInputType.h:
* html/BaseClickableWithKeyInputType.cpp:
(WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
(WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
(WebCore::BaseClickableWithKeyInputType::handleKeyupEvent):
* html/BaseClickableWithKeyInputType.h:
* html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::isKeyboardFocusable):
* html/BaseDateAndTimeInputType.h:
* html/CheckboxInputType.cpp:
(WebCore::CheckboxInputType::handleKeyupEvent):
* html/CheckboxInputType.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::handleDOMActivateEvent):
* html/ColorInputType.h:
* html/FileInputType.cpp:
(WebCore::FileInputType::handleDOMActivateEvent):
* html/FileInputType.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::isKeyboardFocusable):
(WebCore::HTMLAnchorElement::defaultEventHandler):
(WebCore::HTMLAnchorElement::handleClick):
(WebCore::HTMLAnchorElement::eventType):
(WebCore::isEnterKeyKeydownEvent):
* html/HTMLAnchorElement.h:
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::isKeyboardFocusable):
* html/HTMLAreaElement.h:
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler):
* html/HTMLButtonElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isKeyboardFocusable):
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submitImplicitly):
(WebCore::submitElementFromEvent):
(WebCore::HTMLFormElement::validateInteractively):
(WebCore::HTMLFormElement::prepareForSubmission):
* html/HTMLFormElement.h:
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::isKeyboardFocusable):
* html/HTMLFrameOwnerElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::defaultEventHandler):
* html/HTMLFrameSetElement.h:
* html/HTMLIFrameElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isKeyboardFocusable):
(WebCore::HTMLInputElement::isTextFormControlKeyboardFocusable):
(WebCore::HTMLInputElement::willDispatchEvent):
(WebCore::HTMLInputElement::defaultEventHandler):
* html/HTMLInputElement.h:
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::defaultEventHandler):
* html/HTMLLabelElement.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::defaultEventHandler):
* html/HTMLLinkElement.h:
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::defaultEventHandler):
(WebCore::HTMLPlugInElement::isKeyboardFocusable):
* html/HTMLPlugInElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::defaultEventHandler):
* html/HTMLPlugInImageElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::isKeyboardFocusable):
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
(WebCore::HTMLSelectElement::defaultEventHandler):
* html/HTMLSelectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultEventHandler):
* html/HTMLSummaryElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::isKeyboardFocusable):
(WebCore::HTMLTextAreaElement::defaultEventHandler):
(WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
* html/HTMLTextAreaElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::forwardEvent):
* html/HTMLTextFormControlElement.h:
* html/ImageInputType.cpp:
(WebCore::ImageInputType::handleDOMActivateEvent):
* html/ImageInputType.h:
* html/InputType.cpp:
(WebCore::InputType::handleClickEvent):
(WebCore::InputType::handleMouseDownEvent):
(WebCore::InputType::handleDOMActivateEvent):
(WebCore::InputType::handleKeydownEvent):
(WebCore::InputType::handleKeypressEvent):
(WebCore::InputType::handleKeyupEvent):
(WebCore::InputType::handleBeforeTextInsertedEvent):
(WebCore::InputType::handleTouchEvent):
(WebCore::InputType::forwardEvent):
(WebCore::InputType::shouldSubmitImplicitly):
(WebCore::InputType::dispatchSimulatedClickIfActive):
(WebCore::InputType::isKeyboardFocusable):
* html/InputType.h:
* html/MediaDocument.cpp:
(WebCore::MediaDocument::defaultEventHandler):
* html/MediaDocument.h:
* html/NumberInputType.cpp:
(WebCore::NumberInputType::handleKeydownEvent):
* html/NumberInputType.h:
* html/RadioInputType.cpp:
(WebCore::RadioInputType::handleClickEvent):
(WebCore::RadioInputType::handleKeydownEvent):
(WebCore::RadioInputType::handleKeyupEvent):
(WebCore::RadioInputType::isKeyboardFocusable):
* html/RadioInputType.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleMouseDownEvent):
(WebCore::RangeInputType::handleTouchEvent):
(WebCore::RangeInputType::handleKeydownEvent):
* html/RangeInputType.h:
* html/ResetInputType.cpp:
(WebCore::ResetInputType::handleDOMActivateEvent):
* html/ResetInputType.h:
* html/SearchInputType.cpp:
(WebCore::SearchInputType::handleKeydownEvent):
* html/SearchInputType.h:
* html/SubmitInputType.cpp:
(WebCore::SubmitInputType::handleDOMActivateEvent):
* html/SubmitInputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isKeyboardFocusable):
(WebCore::TextFieldInputType::handleKeydownEvent):
(WebCore::TextFieldInputType::handleKeydownEventForSpinButton):
(WebCore::TextFieldInputType::forwardEvent):
(WebCore::TextFieldInputType::shouldSubmitImplicitly):
(WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
* html/TextFieldInputType.h:
* html/shadow/AutoFillButtonElement.cpp:
(WebCore::AutoFillButtonElement::defaultEventHandler):
* html/shadow/AutoFillButtonElement.h:
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::MediaControlMuteButtonElement::defaultEventHandler):
(WebCore::MediaControlSeekButtonElement::defaultEventHandler):
(WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
* html/shadow/MediaControlElementTypes.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::defaultEventHandler):
(WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
(WebCore::MediaControlPanelMuteButtonElement::defaultEventHandler):
(WebCore::MediaControlPlayButtonElement::defaultEventHandler):
(WebCore::MediaControlOverlayPlayButtonElement::defaultEventHandler):
(WebCore::MediaControlRewindButtonElement::defaultEventHandler):
(WebCore::MediaControlReturnToRealtimeButtonElement::defaultEventHandler):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
(WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
(WebCore::MediaControlTimelineElement::defaultEventHandler):
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
(WebCore::MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler):
(WebCore::MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler):
* html/shadow/MediaControlElements.h:
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::defaultEventHandler):
(WebCore::MediaControls::containsRelatedTarget):
* html/shadow/MediaControls.h:
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::defaultEventHandler):
(WebCore::MediaControlsApple::handleClickEvent):
(WebCore::MediaControlsAppleEventListener::handleEvent):
* html/shadow/MediaControlsApple.h:
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::defaultEventHandler):
(WebCore::SliderThumbElement::handleTouchStart):
(WebCore::SliderThumbElement::handleTouchMove):
(WebCore::SliderThumbElement::handleTouchEndAndCancel):
(WebCore::SliderThumbElement::handleTouchEvent):
* html/shadow/SliderThumbElement.h:
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::defaultEventHandler):
(WebCore::SpinButtonElement::forwardEvent):
* html/shadow/SpinButtonElement.h:
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerTextElement::defaultEventHandler):
(WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
(WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
* html/shadow/TextControlInnerElements.h:
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::defaultEventHandler):
* html/shadow/mac/ImageControlsButtonElementMac.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::defaultEventHandler):
(WebCore::MathMLElement::isKeyboardFocusable):
* mathml/MathMLElement.h:
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::defaultEventHandler):
* mathml/MathMLSelectElement.h:
* page/EventHandler.cpp:
(WebCore::didScrollInScrollableArea):
(WebCore::handleWheelEventInAppropriateEnclosingBox):
(WebCore::EventHandler::defaultWheelEventHandler):
(WebCore::EventHandler::keyEvent):
(WebCore::handleKeyboardSelectionMovement):
(WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
(WebCore::EventHandler::defaultKeyboardEventHandler):
(WebCore::EventHandler::defaultTextInputEventHandler):
(WebCore::EventHandler::defaultSpaceEventHandler):
(WebCore::EventHandler::defaultBackspaceEventHandler):
(WebCore::EventHandler::defaultArrowEventHandler):
(WebCore::EventHandler::defaultTabEventHandler):
* page/EventHandler.h:
* page/FocusController.cpp:
(WebCore::isFocusableElementOrScopeOwner):
(WebCore::isNonFocusableScopeOwner):
(WebCore::isFocusableScopeOwner):
(WebCore::FocusController::advanceFocusInDocumentOrder):
(WebCore::FocusController::findFocusCandidateInContainer):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::userResize):
* rendering/RenderFrameSet.h:
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler):
(WebCore::SVGAElement::isKeyboardFocusable):
* svg/SVGAElement.h:

Source/WebKit2:

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performNonEditingBehaviorForSelector):

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

3 years ago[Streams API] Align getReader() with spec
commit-queue@webkit.org [Wed, 31 Aug 2016 15:36:32 +0000 (15:36 +0000)]
[Streams API] Align getReader() with spec
https://bugs.webkit.org/show_bug.cgi?id=160508

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2016-08-31
Reviewed by Xabier Rodriguez-Calvar.

LayoutTests/imported/w3c:

Changed 2 expectations, 1 that passes thanks to patch, the other that
now fails as getReader() has 1 parameter (0 expected, bug to be filed).

* web-platform-tests/streams/readable-streams/general.https-expected.txt:
* web-platform-tests/streams/readable-streams/templated.https-expected.txt:

Source/WebCore:

Aligned getReader() with spec following replacement of ReadableStreamReader by
ReadableStreamDefaultReader.

Test: streams/readable-stream-getReader.html

* Modules/streams/ReadableStream.js:
(getReader):

LayoutTests:

* streams/readable-stream-getReader-expected.txt: Added.
* streams/readable-stream-getReader.html: Added.

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

3 years agoWK2 Gamepad provider on iOS.
beidson@apple.com [Wed, 31 Aug 2016 14:38:21 +0000 (14:38 +0000)]
WK2 Gamepad provider on iOS.
https://bugs.webkit.org/show_bug.cgi?id=161412

Reviewed by Tim Horton.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

No new tests (Native framework backends not directly testable)

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

* WebView/WebView.mm:
(WebKitInitializeGamepadProviderIfNecessary):

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

* Platform/spi/ios/UIKitSPI.h:

* UIProcess/Gamepad/UIGamepadProvider.cpp:

* UIProcess/Gamepad/ios/UIGamepadProviderIOS.mm: Copied from Source/WebKit2/UIProcess/Gamepad/mac/UIGamepadProviderMac.mm.
(WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):

* UIProcess/Gamepad/mac/UIGamepadProviderMac.mm:

* WebKit2.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

3 years agoREGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins...
antti@apple.com [Wed, 31 Aug 2016 09:12:25 +0000 (09:12 +0000)]
REGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins install website
https://bugs.webkit.org/show_bug.cgi?id=161386
<rdar://problem/27590077>

Reviewed by Dan Bernstein.

Source/WebCore:

This CodeMirror version uses a hidden <textarea> to implement copy/paste. The textarea has width:1px; border-width:1px.
Jenkins page has also has a stylesheet that contains * { box-sizing:border-box } and as a result the textarea content
width gets computed as 0. With r201701 we use content size instead of box size for clipping and the textarea content is
(correctly) considered invisible.

Add a quirk that allows this to continue working.

Test: editing/text-iterator/hidden-textarea-selection-quirk.html

* editing/TextIterator.cpp:
(WebCore::fullyClipsContents):

LayoutTests:

* editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Added.
* editing/text-iterator/hidden-textarea-selection-quirk.html: Added.
* platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Added.

    textarea.select() doesn't select the text content on iOS.

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

3 years agoUnreviewed. Bump GTK+ versions numbers.
carlosgc@webkit.org [Wed, 31 Aug 2016 08:30:58 +0000 (08:30 +0000)]
Unreviewed. Bump GTK+ versions numbers.

* Source/cmake/OptionsGTK.cmake:

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

3 years agoRemove unused member variable in WebCore::File
commit-queue@webkit.org [Wed, 31 Aug 2016 08:26:48 +0000 (08:26 +0000)]
Remove unused member variable in WebCore::File
https://bugs.webkit.org/show_bug.cgi?id=161420

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-08-31
Reviewed by Alex Christensen.

* fileapi/File.h:

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

3 years agoUnreviewed, update iOS simulator WK1 flaky tests.
jiewen_tan@apple.com [Wed, 31 Aug 2016 06:45:34 +0000 (06:45 +0000)]
Unreviewed, update iOS simulator WK1 flaky tests.

* platform/ios-simulator-wk1/TestExpectations:

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

3 years agoWeb Inspector: Remove largest common indentation spacing in debugger popover
commit-queue@webkit.org [Wed, 31 Aug 2016 06:21:05 +0000 (06:21 +0000)]
Web Inspector: Remove largest common indentation spacing in debugger popover
https://bugs.webkit.org/show_bug.cgi?id=161417

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-08-30
Reviewed by Joseph Pecoraro.

* UserInterface/Views/SourceCodeTextEditor.css:
(.popover .debugger-popover-content.function > .body):
(.popover .debugger-popover-content.function > .body .CodeMirror):

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForFunction.didGetDetails):
Use CodeMirror and FormatterWorker to display a non-editable popover.

* UserInterface/Workers/Formatter/FormatterWorker.js:
(FormatterWorker.prototype.formatJavaScript):
Reworked logic to always attempt to format by wrapping content in "(...)".  This is
necessary for unnamed functions, since they are not valid programs by themselves.

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

3 years agoAdd "get" to CustomElementsRegistry
rniwa@webkit.org [Wed, 31 Aug 2016 05:18:54 +0000 (05:18 +0000)]
Add "get" to CustomElementsRegistry
https://bugs.webkit.org/show_bug.cgi?id=161421

Reviewed by Yusuke Suzuki.

Source/WebCore:

Add the support for "get" method on CustomElementsRegistry, which returns the constructor
of the custom element with the given name:
https://html.spec.whatwg.org/multipage/scripting.html#dom-customelementregistry-get

Tests: fast/custom-elements/CustomElementRegistry.html

* dom/CustomElementRegistry.cpp:
(WebCore::CustomElementRegistry::get): Added.
* dom/CustomElementRegistry.h:
* dom/CustomElementRegistry.idl:

LayoutTests:

Added test cases for "get" method on CustomElementsRegistry.

* fast/custom-elements/CustomElementRegistry-expected.txt:
* fast/custom-elements/CustomElementRegistry.html:

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