WebKit-https.git
4 years agoCMake clean build fix after r189971.
achristensen@apple.com [Fri, 18 Sep 2015 22:26:17 +0000 (22:26 +0000)]
CMake clean build fix after r189971.

* CMakeLists.txt:
Remove Entity.idl.

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

4 years agoSupport style isolation in shadow trees
antti@apple.com [Fri, 18 Sep 2015 22:25:08 +0000 (22:25 +0000)]
Support style isolation in shadow trees
https://bugs.webkit.org/show_bug.cgi?id=149353

Reviewed by Ryosuke Niwa.

Allow ShadowRoots to have their own StyleResolvers.

This patch just adds the mechanism, all shadow roots still use the document resolver.

* css/StyleResolver.h:
(WebCore::StyleResolverParentPusher::push):
(WebCore::StyleResolverParentPusher::~StyleResolverParentPusher):
* dom/Element.cpp:
(WebCore::Element::absoluteLinkURL):
(WebCore::Element::styleResolver):

    Helper function for getting the right StyleResolver for the element.

(WebCore::Element::resolveStyle):

    Helper function for resolving element style.

* dom/Element.h:
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::~ShadowRoot):
(WebCore::ShadowRoot::styleResolver):
(WebCore::ShadowRoot::cloneNode):
* dom/ShadowRoot.h:
(WebCore::ShadowRoot::resetStyleInheritance):
* editing/EditingStyle.cpp:
(WebCore::styleFromMatchedRulesForElement):
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::computedTextWithDirection):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setFont):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getMatchedStylesForNode):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getUncachedPseudoStyle):
(WebCore::RenderElement::containingBlockForFixedPosition):
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::checkRegionStyle):
(WebCore::RenderNamedFlowFragment::computeStyleInRegion):
* style/StyleResolveTree.cpp:
(WebCore::Style::styleForElement):
* svg/SVGElement.cpp:
(WebCore::SVGElement::customStyleForRenderer):
(WebCore::SVGElement::animatedSMILStyleProperties):
* svg/SVGElementRareData.h:
(WebCore::SVGElementRareData::overrideComputedStyle):

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

4 years agoSnapshots broken on iOS
bdakin@apple.com [Fri, 18 Sep 2015 21:37:17 +0000 (21:37 +0000)]
Snapshots broken on iOS
https://bugs.webkit.org/show_bug.cgi?id=149354

Reviewed by Tim Horton.

We need to send the IOSurface to ViewSnapshot::create() for this to work.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):

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

4 years ago[Win] Fix bindings tests after r189934.
achristensen@apple.com [Fri, 18 Sep 2015 21:30:28 +0000 (21:30 +0000)]
[Win] Fix bindings tests after r189934.

Reviewed by Brent Fulgham.

* bindings/scripts/preprocessor.pm:
(applyPreprocessor):
Bindings tests use /usr/bin/gcc from cygwin, which requires different flags.
If we're using gcc to preprocess, use it like we did before r189934.

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

4 years agoImplement type conversion instructions in WebAssembly
commit-queue@webkit.org [Fri, 18 Sep 2015 21:29:54 +0000 (21:29 +0000)]
Implement type conversion instructions in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=149340

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-09-18
Reviewed by Mark Lam.

This patch implements some type conversion instructions in WebAssembly.
The WebAssembly spec has a lot more type conversion instructions than
what are available in asm.js.[1] We only implement the ones that are in
asm.js for now because we can only test those.

[1]: https://github.com/WebAssembly/design/blob/master/AstSemantics.md

* tests/stress/wasm-type-conversion.js:
* tests/stress/wasm/type-conversion.wasm:
* wasm/WASMConstants.h:
* wasm/WASMFunctionCompiler.h:
(JSC::operationConvertUnsignedInt32ToDouble):
(JSC::WASMFunctionCompiler::buildConvertType):
(JSC::WASMFunctionCompiler::callOperation):
* wasm/WASMFunctionParser.cpp:
(JSC::WASMFunctionParser::parseExpressionI32):
(JSC::WASMFunctionParser::parseExpressionF32):
(JSC::WASMFunctionParser::parseExpressionF64):
(JSC::WASMFunctionParser::parseConvertType):
* wasm/WASMFunctionParser.h:
* wasm/WASMFunctionSyntaxChecker.h:
(JSC::WASMFunctionSyntaxChecker::buildConvertType):

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

4 years agoline-break-language-sensitive tests should be marked as flaky
jacob_nielsen@apple.com [Fri, 18 Sep 2015 21:08:02 +0000 (21:08 +0000)]
line-break-language-sensitive tests should be marked as flaky
https://bugs.webkit.org/show_bug.cgi?id=149349

* platform/ios-simulator/TestExpectations:

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

4 years ago[MediaStream] Finish implementing MediaDevices.enumerateDevices
eric.carlson@apple.com [Fri, 18 Sep 2015 21:05:37 +0000 (21:05 +0000)]
[MediaStream] Finish implementing MediaDevices.enumerateDevices
https://bugs.webkit.org/show_bug.cgi?id=149322
<rdar://problem/22750866>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: fast/mediastream/MediaDevices-enumerateDevices.html

* CMakeLists.txt: Add MediaDevicesRequest.cpp

* Modules/mediastream/MediaDeviceInfo.h: Add MediaDeviceInfoVector typedef.

* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::enumerateDevices): Use MediaDevicesRequest.
* Modules/mediastream/MediaDevices.h: EnumerateDevicePromise -> EnumerateDevicesPromise.
* Modules/mediastream/MediaDevices.idl:

* Modules/mediastream/MediaDevicesRequest.cpp: Added.
(WebCore::MediaDevicesRequest::create):
(WebCore::MediaDevicesRequest::MediaDevicesRequest):
(WebCore::MediaDevicesRequest::~MediaDevicesRequest):
(WebCore::MediaDevicesRequest::securityOrigin):
(WebCore::MediaDevicesRequest::contextDestroyed):
(WebCore::MediaDevicesRequest::start):
(WebCore::MediaDevicesRequest::didCompleteRequest):
(WebCore::MediaDevicesRequest::requestOrigin):
* Modules/mediastream/MediaDevicesRequest.h: Added.

* Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
(WebCore::MediaStreamTrackSourcesRequest::MediaStreamTrackSourcesRequest):
(WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
* Modules/mediastream/MediaStreamTrackSourcesRequest.h:

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::enumerateDevices): Deleted.
* Modules/mediastream/UserMediaRequest.h:

* WebCore.xcodeproj/project.pbxproj: Add MediaDevicesRequest.cpp

* platform/mediastream/MediaDevicesPrivate.cpp: Removed.
* platform/mediastream/MediaDevicesPrivate.h: Removed.

* platform/mediastream/MediaStreamCreationClient.h:
* platform/mediastream/MediaStreamTrackSourcesRequestClient.h:
(WebCore::MediaStreamTrackSourcesRequestClient::~MediaStreamTrackSourcesRequestClient):

* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optionally take an
  AVCaptureSession instead of always allocating one.
(WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): Pass the AVCaptureSession
  to verifyConstraintsForMediaType.

* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources):

* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources):

LayoutTests:

* fast/mediastream/MediaDevices-enumerateDevices-expected.txt: Added.
* fast/mediastream/MediaDevices-enumerateDevices.html: Added.

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

4 years agoiOS WebKitTestRunner frequently crashes in WKContextGetIconDatabase
ap@apple.com [Fri, 18 Sep 2015 20:57:31 +0000 (20:57 +0000)]
iOS WebKitTestRunner frequently crashes in WKContextGetIconDatabase
https://bugs.webkit.org/show_bug.cgi?id=149352

Reviewed by Simon Fraser.

* WebKitTestRunner/TestController.cpp: (WTR::TestController::~TestController):
m_context can be null. This may indicate a bug in webkitpy too, but
WebKitTestRunner should handle this situation nicely, there is nothing intrinsically
wrong with opening and immediately closing it.

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

4 years agoUpdates to include change to iOS test expectations after bug 149187
jacob_nielsen@apple.com [Fri, 18 Sep 2015 20:55:17 +0000 (20:55 +0000)]
Updates to include change to iOS test expectations after bug 149187

* platform/ios-simulator/js/dom/constructor-length-expected.txt:

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

4 years agoWebContent crash in WebCore::MemoryPressureHandler::releaseCriticalMemory() with...
cdumez@apple.com [Fri, 18 Sep 2015 20:37:41 +0000 (20:37 +0000)]
WebContent crash in WebCore::MemoryPressureHandler::releaseCriticalMemory() with GuardMalloc when preparing to suspend
https://bugs.webkit.org/show_bug.cgi?id=149350

Reviewed by Antti Koivisto.

in MemoryPressureHandler::releaseCriticalMemory(), iterate over a copy of
Document::allDocuments() instead of iterating over allDocuments() directly.
Also make sure the Documents are ref'd inside the copy.

This is needed because clearing the StyleResolver of a Document may cause
Documents to be unref'd and removed from the allDocument() HashSet.

No new tests, already covered by existing tests.

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseCriticalMemory):

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

4 years ago[Win] Unreviewed build fix.
bfulgham@apple.com [Fri, 18 Sep 2015 20:31:43 +0000 (20:31 +0000)]
[Win] Unreviewed build fix.

Non-cmake build does not include quotes in the file path, so a search
operation always failed.

* bindings/scripts/preprocessor.pm:
(applyPreprocessor):

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

4 years agoisGitSVNDirectory() returns true when Git is not installed
dbates@webkit.org [Fri, 18 Sep 2015 20:00:49 +0000 (20:00 +0000)]
isGitSVNDirectory() returns true when Git is not installed
https://bugs.webkit.org/show_bug.cgi?id=149351

Reviewed by Alexey Proskuryakov.

Fixes an issue where VCSUtils::isGitSVNDirectory() returns true for any arbitrary directory if
Git is not installed on the machine.

* Scripts/VCSUtils.pm:
(isGitSVNDirectory): Ensure that `git config --get svn-remote.svn.fetch 2>& 1` exits with
status code 0 (success).

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

4 years agoREGRESSION (r182449, Mavericks ONLY): Pages re-open empty after swiping back and...
cdumez@apple.com [Fri, 18 Sep 2015 19:31:45 +0000 (19:31 +0000)]
REGRESSION (r182449, Mavericks ONLY): Pages re-open empty after swiping back and scrolling on them
https://bugs.webkit.org/show_bug.cgi?id=149317
<rdar://problem/22521514>

Reviewed by Tim Horton.

Source/WebCore:

Disable on Mavericks a PageCache optimization from r182449 which lets
into PageCache pages that only have certain types of pending loads
(images and XHR). This is because it has been determined via bisection
that this change is the one that introduced the bug on Mavericks.

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

LayoutTests:

Skip a couple of PageCache layout tests on Mavericks now that a PageCache
optimization has been disabled.

* platform/mac/TestExpectations:

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

4 years agoUnreviewed iOS gardening.
zalan@apple.com [Fri, 18 Sep 2015 18:35:45 +0000 (18:35 +0000)]
Unreviewed iOS gardening.

* platform/ios-simulator/TestExpectations:

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

4 years ago[Win] Use tiled drawing for main background layer
bfulgham@apple.com [Fri, 18 Sep 2015 18:23:29 +0000 (18:23 +0000)]
[Win] Use tiled drawing for main background layer
https://bugs.webkit.org/show_bug.cgi?id=149347
<rdar://problem/22759632>

Reviewed by Alex Christensen.

Source/WebCore:

Turn on tiled drawing for the root layer when using
accelerated compositing on Windows.

* page/Frame.h: Export the 'isMainFrame' method so that
it can be used by WebKit.dll.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::getDebugBorderInfo): Use a full
pixel width on Windows, since it doesn't support High DPI (yet).
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::create): Use nullptr.
(toCACFFilterType): Ditto.
(layerTreeHostForLayer): Ditto.
(PlatformCALayer::platformCALayer): Ditto.
 (PlatformCALayerWin::PlatformCALayerWin): Use the correct contents scaling
factor for new layers.
(PlatformCALayerWin::animationForKey): Use nullptr.
* platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
(WebTiledBackingLayerWin::displayCallback): Update assertion to
recognize LayerTypePageTiledBackingLayer as a valid layer to be used
in this display routine.

Source/WebKit/win:

Instruct WebCore to use tiled drawing for the root layer
of the display.

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::shouldUseTiledBackingForFrameView): Added.
* WebCoreSupport/WebChromeClient.h:

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

4 years agoPrevent build-webkit from building four times on Windows
achristensen@apple.com [Fri, 18 Sep 2015 18:00:32 +0000 (18:00 +0000)]
Prevent build-webkit from building four times on Windows
https://bugs.webkit.org/show_bug.cgi?id=149336

Reviewed by Brent Fulgham.

* Scripts/build-webkit:
Move the Windows code out of the for loop iterating over each subdirectory to be build.
They're built all at once.
* Scripts/webkitdirs.pm:
(buildVisualStudioProject):
(cmakeGeneratedBuildfile):
Don't generate the Visual Studio solution if it already exists.
It will run CMake again if necessary.

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

4 years agoFix tests on Windows after switching to CMake.
achristensen@apple.com [Fri, 18 Sep 2015 18:00:16 +0000 (18:00 +0000)]
Fix tests on Windows after switching to CMake.
https://bugs.webkit.org/show_bug.cgi?id=149339

Reviewed by Brent Fulgham.

.:

* Source/PlatformWin.cmake: Added to copy WebInspectorUI.

Source/JavaScriptCore:

* shell/PlatformWin.cmake:
Build testapi and testRegExp (which doesn't seem to be used any more).

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

4 years agoDrop support for Entity Node type
cdumez@apple.com [Fri, 18 Sep 2015 17:23:17 +0000 (17:23 +0000)]
Drop support for Entity Node type
https://bugs.webkit.org/show_bug.cgi?id=149239

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C DOM test now that a new check is passing.

* web-platform-tests/dom/historical-expected.txt:

Source/WebCore:

Drop support for Entity DOM type. This legacy type has been dropped in
DOM4:
- https://dom.spec.whatwg.org/#dom-core-changes

Chrome [1] and Firefox [2] already dropped it. There is currently no
way to construct an Entity Node in WebKit.

[1] https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/k3tZGP2EANc
[2] https://developer.mozilla.org/en-US/docs/Web/API/Entity

No new tests, already covered by existing W3C test.

* DerivedSources.cpp:
* WebCore.xcodeproj/project.pbxproj:
* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap): Deleted.
* bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline): Deleted.
* bindings/objc/DOM.mm:
(kitClass): Deleted.
* dom/Document.cpp:
(WebCore::Document::importNode): Deleted.
(WebCore::Document::adoptNode): Deleted.
(WebCore::Document::childTypeAllowed): Deleted.
(WebCore::Document::canAcceptChild): Deleted.
* dom/Entity.h:
* dom/Entity.idl:
* dom/Node.cpp:
(WebCore::Node::isDefaultNamespace): Deleted.
(WebCore::Node::lookupPrefix): Deleted.
(WebCore::Node::lookupNamespaceURI): Deleted.
(WebCore::appendTextContent): Deleted.
(WebCore::Node::setTextContent): Deleted.
* dom/Node.h:
* dom/Range.cpp:
(WebCore::lengthOfContentsInNode): Deleted.
(WebCore::Range::processContentsBetweenOffsets): Deleted.
(WebCore::Range::insertNode): Deleted.
(WebCore::Range::checkNodeWOffset): Deleted.
(WebCore::Range::checkNodeBA): Deleted.
(WebCore::Range::selectNode): Deleted.
(WebCore::Range::selectNodeContents): Deleted.
(WebCore::Range::surroundContents): Deleted.
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendStartMarkup): Deleted.
* xml/XPathUtil.cpp:
(WebCore::XPath::isValidContextNode): Deleted.

Source/WebKit2:

Stop handling the Entity node type.

* WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:

LayoutTests:

Rebaseline / update layout tests now that we no longer expose the
Entity type to the Web.

* fast/dom/Window/get-set-properties-expected.txt:
* fast/dom/Window/get-set-properties.html:
* fast/dom/Window/resources/window-properties.js:
* fast/dom/Window/window-lookup-precedence-expected.txt:
* fast/dom/dom-constructors-expected.txt:
* fast/dom/dom-constructors.html:
* platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt:
* platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:

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

4 years agoASSERT(!m_frontendRouter->hasLocalFrontend()) when running Web Inspector tests
bburg@apple.com [Fri, 18 Sep 2015 17:16:24 +0000 (17:16 +0000)]
ASSERT(!m_frontendRouter->hasLocalFrontend()) when running Web Inspector tests
https://bugs.webkit.org/show_bug.cgi?id=149006
Source/JavaScriptCore:

Reviewed by Joseph Pecoraro.

Prior to disconnecting, we need to know how many frontends remain connected.

* inspector/InspectorFrontendRouter.h: Add frontendCount().

Source/WebCore:

Reviewed by Joseph Pecoraro.

The patch fixes two defects:

    (1) the stub inspector frontend is not closed reliably when a test times out
    (2) frontend clients and channels are sometimes connected to the wrong controllers

When an inspector test times out, the test runner requests (via the inspected page's controller)
that the inspector close. But, the stub frontend works independently of InspectorClient,
so the inspected page's InspectorController cannot close the stub frontend. The assertion
failed because the stub frontend's channel was still connected to the inspected page's controller.

The fix is to route requests for the inspector window to close through the FrontendClient's
closeWindow() method rather than InspectorClient, so that the stub frontend can react.
The other code paths (i.e., through close() and closeLocalFrontend()) have been removed.

Now that the stub frontend eagerly closes its channel before the Page gets GC'd, several
methods invoked during test teardown must be reordered to avoid using dangling pointers.

The stub frontend in Internals has been rewritten to properly disconnect itself
from both the frontend and inspected page's inspector controllers.

While fixing this bug, I noticed that we are inconsistent about which inspector controller
(the inspected page's or the frontend page's) receives the FrontendClient and which takes
FrontendChannels. It is now the case for all configurations that the FrontendClient is
connected to the frontend page's inspector controller, and FrontendChannels are connected
to the inspected page's inspector controller. In the WK2 case, the Inspector Process
has an attached frontend client, and its inspected Web Process has frontend channels.

No new tests, covered by existing tests.

* inspector/InspectorClient.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::~InspectorController):
(WebCore::InspectorController::inspectedPageDestroyed):

    This method is called from Page::~Page, so we should disconnect all frontends now
    before subframes are detached from the page, making InspectorController inaccessible.

(WebCore::InspectorController::disconnectFrontend):

    The teardown branch was never being run before, because we never disconnected the
    frontend's channel correctly. Some agents use the overlay during teardown, so notify
    agents before releasing the overlay page.

(WebCore::InspectorController::disconnectAllFrontends):

    The actions from close() are inlined and rearranged here, similar to disconnectFrontend.
    We have to notify agents before removing InspectorClient as some agents make use of it.

(WebCore::InspectorController::close): Deleted.
(WebCore::InspectorController::show): This assertion is vacuously true now.
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::inspectedPage): Added. Used by stub frontend.
* inspector/InspectorFrontendClientLocal.h:
(WebCore::InspectorFrontendClientLocal::frontendPage): Added.
* loader/EmptyClients.h:
* page/Page.cpp:
(WebCore::Page::~Page):

    Notify inspector before detaching frames, otherwise it will not be possible to
    cleanly disconnect the stub frontend's channel.

* testing/Internals.cpp:

    Rewrite the stub frontend to better encapsulate its setup and teardown logic.

(WebCore::InspectorStubFrontend::frontendPage): Added.
(WebCore::InspectorStubFrontend::InspectorStubFrontend): Added.
(WebCore::InspectorStubFrontend::~InspectorStubFrontend): Added.
(WebCore::InspectorStubFrontend::closeWindow): Added.
(WebCore::InspectorStubFrontend::sendMessageToFrontend): Added.
(WebCore::Internals::openDummyInspectorFrontend):
(WebCore::Internals::closeDummyInspectorFrontend):
(WebCore::InspectorFrontendClientDummy::~InspectorFrontendClientDummy): Deleted.
(WebCore::InspectorFrontendClientDummy::InspectorFrontendClientDummy): Deleted.
(WebCore::InspectorFrontendChannelDummy::~InspectorFrontendChannelDummy): Deleted.
(WebCore::InspectorFrontendChannelDummy::InspectorFrontendChannelDummy): Deleted.
(WebCore::InspectorFrontendChannelDummy::sendMessageToFrontend): Deleted.
* testing/Internals.h:

Source/WebKit/ios:

Reviewed by Joseph Pecoraro.

* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorClient::closeLocalFrontend): Deleted.
(WebInspectorFrontendClient::disconnectFromBackend): Deleted.

Source/WebKit/mac:

Reviewed by Joseph Pecoraro.

WK1 WebInspectorClient was connecting to the wrong controllers. Fix this, and
remove extra code paths for closing the frontend.

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController destroyInspectorView]):

    Disconnect the FrontendClient from the frontend page's inspector controller.
    Do this teardown before releasing the frontend, otherwise we can't use it.

(WebInspectorClient::inspectedPageDestroyed): Deleted.
(WebInspectorClient::closeLocalFrontend): Deleted.
(WebInspectorFrontendClient::disconnectFromBackend): Deleted.
* WebInspector/WebInspector.mm:
(-[WebInspector inspectedWebViewClosed]):

    Make sure to close ourself if the inspected page closes.

(-[WebInspector close:]):

    Go through the frontend instead of InspectorController.

* WebInspector/WebInspectorFrontend.h:
* WebInspector/WebInspectorFrontend.mm:
(-[WebInspectorFrontend close]):

Source/WebKit/win:

Reviewed by Joseph Pecoraro.

* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::destroyInspectorView):

    Disconnect the FrontendClient from the frontend page's inspector controller.
    Do this teardown before releasing the frontend, otherwise we can't use it.

(WebInspectorFrontendClient::onClose):
(WebInspectorClient::inspectedPageDestroyed): Deleted.
(WebInspectorClient::closeLocalFrontend): Deleted.
* WebCoreSupport/WebInspectorClient.h: Drive-by cleanup for class declarations.
* WebInspector.cpp:
(WebInspector::close):

    Go through the frontend instead of InspectorController.

Source/WebKit2:

<rdar://problem/22654257>
<rdar://problem/22631369>

Reviewed by Joseph Pecoraro.

Stop using InspectorController to close the frontend page. Go through
the FrontendClient instead. Reduce redundant code paths.

This change seems to fix some recent crashes that were seen when
closing Safari with Web Inspector open. These were caused by the frontend
channel not being disconnected at the right time.

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::inspectedPageDestroyed):
(WebKit::WebInspectorClient::closeLocalFrontend): Deleted.
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::close):
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::establishConnection):

    Save a pointer to the frontend's InspectorController since we may
    need to use it while the page is being destructed and its getter
    is no longer accessible.

(WebKit::WebInspectorUI::closeWindow):

    Explicitly remove the frontend client when closing the frontend.

* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::inspector):

    Allow clients to specify whether an inspector should be eagerly created.
    Without this, we may accidentally create an instance during teardown.

* WebProcess/WebPage/WebPage.h:

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

4 years agoclassList.toggle(name, force) treats undefined `force` argument as false
cdumez@apple.com [Fri, 18 Sep 2015 16:53:10 +0000 (16:53 +0000)]
classList.toggle(name, force) treats undefined `force` argument as false
https://bugs.webkit.org/show_bug.cgi?id=148582
<rdar://problem/22545600>

Reviewed by Ryosuke Niwa.

Source/WebCore:

classList.toggle(name, force) treats undefined `force` argument as false.
However, according to the Web IDL specification, we should treat undefined
as if the value was missing for optional parameters that do not have a
default value:
https://heycam.github.io/webidl/#dfn-overload-resolution-algorithm (Step 14.4).

For optional parameters that have a default value, undefined should be
converted into the default value. This is supported as of r189957.

In this patch, we use custom bindings to provide a spec-compliant version
of DOMTokenList.toggle(). Unfortunately, adding such support in the
bindings generator would be a non-trivial task (I guess, we would have to
generalize using WTF::Optional<> type for all optional parameters in our
implementation. Also we cannot use the default value support added in
r189957 because the toggle() implementation needs to be able to
distinguish all 3 states for the 'force' parameter: true, false or
missing.

The new behavior matches the behavior of Firefox and the specification.

Test: fast/dom/Element/class-list-toggle.html

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMTokenListCustom.cpp: Added.
(WebCore::JSDOMTokenList::toggle):
* html/DOMTokenList.h:
* html/DOMTokenList.idl:

LayoutTests:

Add decent test coverage for DOMTokenList.toggle() via Element.classList.

* fast/dom/Element/class-list-toggle-expected.txt: Added.
* fast/dom/Element/class-list-toggle.html: Added.

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

4 years agoExplicitly specify builtin JS files dependency
utatane.tea@gmail.com [Fri, 18 Sep 2015 16:38:09 +0000 (16:38 +0000)]
Explicitly specify builtin JS files dependency
https://bugs.webkit.org/show_bug.cgi?id=149323

Reviewed by Alex Christensen.

JSCBuiltins.{h,cpp} in CMakeLists.txt and DerivedSources.make just depend on the builtins directory.
As a result, even if we modify builtins/*.js code, regenerating JSCBuiltins.{h,cpp} does not occur.
As the same to the cpp sources, let's list up the JS files explicitly.

* CMakeLists.txt:
* DerivedSources.make:

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

4 years agoRemove register preservation and restoration stub code
msaboff@apple.com [Fri, 18 Sep 2015 16:21:08 +0000 (16:21 +0000)]
Remove register preservation and restoration stub code
https://bugs.webkit.org/show_bug.cgi?id=149335

Reviewed by Mark Lam.

Delete the register preservation and restoration thunks and related plumbing.

Much of this change is removing the unneeded RegisterPreservationMode parameter
from various functions.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CallLinkInfo.h:
(JSC::CallLinkInfo::isVarargsCallType):
(JSC::CallLinkInfo::CallLinkInfo):
(JSC::CallLinkInfo::isVarargs):
(JSC::CallLinkInfo::isLinked):
(JSC::CallLinkInfo::setUpCallFromFTL):
(JSC::CallLinkInfo::registerPreservationMode): Deleted.
* ftl/FTLJITCode.cpp:
(JSC::FTL::JITCode::initializeAddressForCall):
(JSC::FTL::JITCode::addressForCall):
* ftl/FTLJITCode.h:
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* jit/JITCode.cpp:
(JSC::JITCode::execute):
(JSC::DirectJITCode::initializeCodeRef):
(JSC::DirectJITCode::addressForCall):
(JSC::NativeJITCode::initializeCodeRef):
(JSC::NativeJITCode::addressForCall):
(JSC::DirectJITCode::ensureWrappers): Deleted.
* jit/JITCode.h:
(JSC::JITCode::jitTypeFor):
(JSC::JITCode::executableAddress):
* jit/JITOperations.cpp:
* jit/RegisterPreservationWrapperGenerator.cpp: Removed.
* jit/RegisterPreservationWrapperGenerator.h: Removed.
* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
* jit/ThunkGenerators.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::entryOSR):
(JSC::LLInt::setUpCall):
* runtime/Executable.cpp:
(JSC::ExecutableBase::clearCode):
(JSC::ScriptExecutable::installCode):
(JSC::WebAssemblyExecutable::prepareForExecution):
* runtime/Executable.h:
(JSC::ExecutableBase::generatedJITCodeFor):
(JSC::ExecutableBase::entrypointFor):
(JSC::ExecutableBase::offsetOfJITCodeWithArityCheckFor):
* runtime/RegisterPreservationMode.h: Removed.

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

4 years agoFix build with --no-indexed-database after r189831
commit-queue@webkit.org [Fri, 18 Sep 2015 13:27:52 +0000 (13:27 +0000)]
Fix build with --no-indexed-database after r189831
https://bugs.webkit.org/show_bug.cgi?id=149342

Patch by Emanuele Aina <emanuele.aina@collabora.com> on 2015-09-18
Reviewed by Csaba Osztrogonác.

* WebProcess/Databases/WebDatabaseProvider.h:
Add ENABLE(INDEXED_DATABASE) guard around supportsModernIDB().

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

4 years agoWeb Inspector: Simplify some functional callbacks
commit-queue@webkit.org [Fri, 18 Sep 2015 06:04:41 +0000 (06:04 +0000)]
Web Inspector: Simplify some functional callbacks
https://bugs.webkit.org/show_bug.cgi?id=149333

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

* UserInterface/Controllers/LogManager.js:
(WebInspector.LogManager.prototype.messageWasAdded):
* UserInterface/Models/Color.js:
(WebInspector.Color):
* UserInterface/Models/Geometry.js:
(WebInspector.CubicBezier.fromCoordinates):
* UserInterface/Models/ObjectPreview.js:
(WebInspector.ObjectPreview.fromPayload):
* UserInterface/Models/TypeDescription.js:
(WebInspector.TypeDescription.fromPayload):
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.prototype.getCollectionEntries):
(WebInspector.RemoteObject.prototype.getCollectionEntries.): Deleted.
* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor.prototype.get markers):
(WebInspector.TextEditor.prototype.markersAtPosition):

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

4 years agoWeb Inspector: Remove unused canClearBrowserCookies / canClearBrowserCache protocol...
commit-queue@webkit.org [Fri, 18 Sep 2015 05:06:20 +0000 (05:06 +0000)]
Web Inspector: Remove unused canClearBrowserCookies / canClearBrowserCache protocol methods
https://bugs.webkit.org/show_bug.cgi?id=149307

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

Source/JavaScriptCore:

* inspector/protocol/Network.json:
Remove unused protocol methods.

Source/WebCore:

* inspector/InspectorClient.h:
(WebCore::InspectorClient::canClearBrowserCache): Deleted.
(WebCore::InspectorClient::clearBrowserCache): Deleted.
(WebCore::InspectorClient::canClearBrowserCookies): Deleted.
(WebCore::InspectorClient::clearBrowserCookies): Deleted.
These were unimplemented by any ports.

* inspector/CommandLineAPIHost.cpp:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::InspectorResourceAgent):
(WebCore::InspectorResourceAgent::canClearBrowserCache): Deleted.
(WebCore::InspectorResourceAgent::clearBrowserCache): Deleted.
(WebCore::InspectorResourceAgent::canClearBrowserCookies): Deleted.
(WebCore::InspectorResourceAgent::clearBrowserCookies): Deleted.
* inspector/InspectorResourceAgent.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
* inspector/InspectorTimelineAgent.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Remove uses of InspectorClient where it is no longer needed.

Source/WebInspectorUI:

* UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/9.0/InspectorBackendCommands.js:
* Versions/Inspector-iOS-7.0.json:
* Versions/Inspector-iOS-8.0.json:
* Versions/Inspector-iOS-9.0.json:
Retroactively remove the protocol methods as they were unused
in these earlier versions as well.

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

4 years agoUnreviewed, rolling out r189962.
commit-queue@webkit.org [Fri, 18 Sep 2015 04:48:19 +0000 (04:48 +0000)]
Unreviewed, rolling out r189962.
https://bugs.webkit.org/show_bug.cgi?id=149334

These new tests uncovered a crash (Requested by ap on
#webkit).

Reverted changeset:

"Add some tests for shadow DOM rendering"
https://bugs.webkit.org/show_bug.cgi?id=149330
http://trac.webkit.org/changeset/189962

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

4 years agoAdd some tests for shadow DOM rendering
rniwa@webkit.org [Fri, 18 Sep 2015 03:08:09 +0000 (03:08 +0000)]
Add some tests for shadow DOM rendering
https://bugs.webkit.org/show_bug.cgi?id=149330

Reviewed by Antti Koivisto.

Added some ref tests for new shadow DOM API rendering with failing expectations everywhere.

* fast/shadow-dom/css-scoping-shadow-invisible-slot-expected.html: Added.
* fast/shadow-dom/css-scoping-shadow-invisible-slot.html: Added.
* fast/shadow-dom/css-scoping-shadow-rendering-expected.html: Added.
* fast/shadow-dom/css-scoping-shadow-rendering.html: Added.
* fast/shadow-dom/css-scoping-shadow-slot-expected.html: Added.
* fast/shadow-dom/css-scoping-shadow-slot.html: Added.
* fast/shadow-dom/css-scoping-shadow-with-rules-expected.html: Added.
* fast/shadow-dom/css-scoping-shadow-with-rules.html: Added.
* platform/mac/TestExpectations:

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

4 years agoUnreviewed, rolling out r189938, r189952, and r189956.
commit-queue@webkit.org [Fri, 18 Sep 2015 02:56:29 +0000 (02:56 +0000)]
Unreviewed, rolling out r189938, r189952, and r189956.
https://bugs.webkit.org/show_bug.cgi?id=149329

Broke Web Workers (Requested by ap on #webkit).

Reverted changesets:

"Implement try/catch in the DFG."
https://bugs.webkit.org/show_bug.cgi?id=147374
http://trac.webkit.org/changeset/189938

"CLoop build fix after r189938."
http://trac.webkit.org/changeset/189952

"add a regress test for richards with try/catch."
https://bugs.webkit.org/show_bug.cgi?id=149301
http://trac.webkit.org/changeset/189956

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

4 years agoUpdate features.json for Shadow DOM and Web Components
rniwa@webkit.org [Fri, 18 Sep 2015 02:55:45 +0000 (02:55 +0000)]
Update features.json for Shadow DOM and Web Components
https://bugs.webkit.org/show_bug.cgi?id=149249

Reviewed by Antti Koivisto.

Updated the status of Shadow DOM and made myself the point of contact for shadow DOM and web components.

* features.json:

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

4 years ago[iOS WK2] WTR fails to set the key window in the UIKit sense
simon.fraser@apple.com [Fri, 18 Sep 2015 01:58:40 +0000 (01:58 +0000)]
[iOS WK2] WTR fails to set the key window in the UIKit sense
https://bugs.webkit.org/show_bug.cgi?id=149325

Reviewed by Tim Horton.

-[WebKitTestRunnerWindow isKeyWindow] just returned _platformWebView->windowIsKey().
This causes UIKit to bypass code that actually sets the key window, resulting in
[UIAppliation sharedApplication].keyWindow always being nil.

Fix by PlatformWebView::setWindowIsKey() actually call -makeKeyWindow, and having
-[WebKitTestRunnerWindow isKeyWindow] call super.

* WebKitTestRunner/PlatformWebView.h:
(WTR::PlatformWebView::setWindowIsKey): Deleted.
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::setWindowIsKey):
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::setWindowIsKey):
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(-[WebKitTestRunnerWindow isKeyWindow]):
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::~PlatformWebView):
(WTR::PlatformWebView::setWindowIsKey):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::setWindowIsKey):

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

4 years ago[iOS WK2] When loading viewport tests, use the normal web page viewport configuration
simon.fraser@apple.com [Fri, 18 Sep 2015 01:58:37 +0000 (01:58 +0000)]
[iOS WK2] When loading viewport tests, use the normal web page viewport configuration
https://bugs.webkit.org/show_bug.cgi?id=149321

Reviewed by Tim Horton.

InjectedBundlePage::platformDidStartProvisionalLoadForFrame() unconditionally
enabled the "testing" viewport configuration, which disables page scaling.

If we're running viewport tests, we want the normal web page configuration.
Do that by passing a flag in the dictionary sent to InjectedBundle::beginTesting(),
based on whether the test is in a "viewport" directory.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm:
(WTR::InjectedBundlePage::platformDidStartProvisionalLoadForFrame): Deleted.
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::shouldLogFrameLoadDelegates):
(WTR::TestInvocation::shouldLogHistoryClientCallbacks):
(WTR::TestInvocation::shouldMakeViewportFlexible):
(WTR::TestInvocation::invoke):
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformConfigureViewForTest):
(WTR::shouldMakeViewportFlexible): Deleted.

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

4 years ago[WebIDL] Add support for default parameter values
cdumez@apple.com [Fri, 18 Sep 2015 01:48:17 +0000 (01:48 +0000)]
[WebIDL] Add support for default parameter values
https://bugs.webkit.org/show_bug.cgi?id=149263
<rdar://problem/22545600>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more NodeIterator / TreeWalker
checks are passing.

* web-platform-tests/dom/traversal/NodeIterator-expected.txt:
* web-platform-tests/dom/traversal/TreeWalker-basic-expected.txt:

Source/WebCore:

Add support for default parameter values to our Web IDL parser and JS
bindings generator. This allows the bindings to convert undefined to
the parameter's default value for optional parameters:
https://heycam.github.io/webidl/#dfn-optional-argument-default-value

Previously, our bindings generator would just convert undefined to
0 / false / "undefined" for optional parameters, depending on the
parameter type.

This patch uses the new default parameter support to fix a bug in
document.createNodeIterator() / document.createTreeWalker()'s handling
of the whatToShow parameter:
https://dom.spec.whatwg.org/#document

WebKit currently was undefined to 0 in this case, even though it should
use the parameter's default value: OxFFFFFFFF.

I am planning to go through other optional parameters in a follow-up
patch and add default values where needed.

No new tests, already covered by existing layout tests and
added bindings tests coverage.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
* bindings/scripts/IDLParser.pm:
(parseOptionalOrRequiredArgument):
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_method_with_optional_arg_and_default_value):
(webkit_dom_test_obj_method_with_optional_string_and_default_value):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj methodWithOptionalArgAndDefaultValue:]):
(-[DOMTestObj methodWithOptionalStringAndDefaultValue:]):
* bindings/scripts/test/TestObj.idl:
* dom/Document.idl:

LayoutTests:

Rebaseline several NodeIterator / TreeWalker tests now that more checks
are passing.

* fast/dom/createNodeIterator-parameters-expected.txt:
* fast/dom/createTreeWalker-parameters-expected.txt:

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

4 years agoadd a regress test for richards with try/catch.
sbarati@apple.com [Fri, 18 Sep 2015 01:34:58 +0000 (01:34 +0000)]
add a regress test for richards with try/catch.
https://bugs.webkit.org/show_bug.cgi?id=149301

Reviewed by Filip Pizlo.

This adds two variants of Octane/richards benchmark using
try/catch. One try/catch variant that actually throws.
Another that never throws. I've included try/catch inside
every function and every loop.

* js/regress/richards-empty-try-catch-expected.txt: Added.
* js/regress/richards-empty-try-catch.html: Added.
* js/regress/richards-try-catch-expected.txt: Added.
* js/regress/richards-try-catch.html: Added.
* js/regress/script-tests/richards-empty-try-catch.js: Added.
(runRichards):
(Scheduler):
(Scheduler.prototype.addIdleTask):
(Scheduler.prototype.addWorkerTask):
(Scheduler.prototype.addHandlerTask):
(Scheduler.prototype.addDeviceTask):
(Scheduler.prototype.addRunningTask):
(Scheduler.prototype.addTask):
(Scheduler.prototype.schedule):
(Scheduler.prototype.release):
(Scheduler.prototype.holdCurrent):
(Scheduler.prototype.suspendCurrent):
(Scheduler.prototype.queue):
(TaskControlBlock):
(TaskControlBlock.prototype.setRunning):
(TaskControlBlock.prototype.markAsNotHeld):
(TaskControlBlock.prototype.markAsHeld):
(TaskControlBlock.prototype.isHeldOrSuspended):
(TaskControlBlock.prototype.markAsSuspended):
(TaskControlBlock.prototype.markAsRunnable):
(TaskControlBlock.prototype.run):
(TaskControlBlock.prototype.checkPriorityAdd):
(TaskControlBlock.prototype.toString):
(IdleTask):
(IdleTask.prototype.run):
(IdleTask.prototype.toString):
(DeviceTask):
(DeviceTask.prototype.run):
(DeviceTask.prototype.toString):
(WorkerTask):
(WorkerTask.prototype.run):
(WorkerTask.prototype.toString):
(HandlerTask):
(HandlerTask.prototype.run):
(HandlerTask.prototype.toString):
(Packet):
(Packet.prototype.addTo):
(Packet.prototype.toString):
* js/regress/script-tests/richards-try-catch.js: Added.
(randomException):
(runRichards):
(Scheduler):
(Scheduler.prototype.addIdleTask):
(Scheduler.prototype.addWorkerTask):
(Scheduler.prototype.addHandlerTask):
(Scheduler.prototype.addDeviceTask):
(Scheduler.prototype.addRunningTask):
(Scheduler.prototype.addTask):
(Scheduler.prototype.schedule):
(Scheduler.prototype.release):
(Scheduler.prototype.holdCurrent):
(Scheduler.prototype.suspendCurrent):
(Scheduler.prototype.queue):
(TaskControlBlock):
(TaskControlBlock.prototype.setRunning):
(TaskControlBlock.prototype.markAsNotHeld):
(TaskControlBlock.prototype.markAsHeld):
(TaskControlBlock.prototype.isHeldOrSuspended):
(TaskControlBlock.prototype.markAsSuspended):
(TaskControlBlock.prototype.markAsRunnable):
(TaskControlBlock.prototype.run):
(TaskControlBlock.prototype.checkPriorityAdd):
(TaskControlBlock.prototype.toString):
(IdleTask):
(IdleTask.prototype.run):
(IdleTask.prototype.toString):
(DeviceTask):
(DeviceTask.prototype.run):
(DeviceTask.prototype.toString):
(WorkerTask):
(WorkerTask.prototype.run):
(WorkerTask.prototype.toString):
(HandlerTask):
(HandlerTask.prototype.run):
(HandlerTask.prototype.toString):
(Packet):
(Packet.prototype.addTo):
(Packet.prototype.toString):

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

4 years agoSpell Jon's name correctly. I expect payback for this mistake.
dino@apple.com [Fri, 18 Sep 2015 01:12:43 +0000 (01:12 +0000)]
Spell Jon's name correctly. I expect payback for this mistake.

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

4 years agoMulti-hop reference cycles not detected.
dino@apple.com [Fri, 18 Sep 2015 01:09:57 +0000 (01:09 +0000)]
Multi-hop reference cycles not detected.
https://bugs.webkit.org/show_bug.cgi?id=149181

Reviewed by John Honeycutt.

Source/WebCore:

SVG's cycle detection was not picking up a
case where an element was drawing a pattern, that
referenced another pattern, that referenced another
pattern, that referenced the original pattern.

The issue was that we were forgetting to check the
children of the renderer itself, rather than just
the children of the referenced renderers.

Found by running a test from Blink.

I also took the opportunity to clean up the debugging
code that logs cycle detection.

Test: svg/custom/pattern-3-step-cycle.html

* platform/Logging.h: Add a new SVG channel. I can't believe we
didn't already have one!
* rendering/svg/SVGResourcesCycleSolver.cpp:
(WebCore::SVGResourcesCycleSolver::resourceContainsCycles): Check the referenced
resources for cycles.
(WebCore::SVGResourcesCycleSolver::resolveCycles): Logging update.

LayoutTests:

Test comes from:
https://chromium.googlesource.com/chromium/blink/+/master/LayoutTests/svg/custom/pattern-3-step-cycle.html

* svg/custom/pattern-3-step-cycle-expected.txt: Added.
* svg/custom/pattern-3-step-cycle.html: Added.

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

4 years agoCyclic resources were not detected if the reference had deep containers
dino@apple.com [Fri, 18 Sep 2015 01:09:23 +0000 (01:09 +0000)]
Cyclic resources were not detected if the reference had deep containers
https://bugs.webkit.org/show_bug.cgi?id=149182

Reviewed by John Honeycutt.

Source/WebCore:

During our examination of the SVG rendering tree looking for cycles,
if a resource pointed to something that had a nested structure, and
one of the parent nodes in that structure was a container object
without resources itself, we were not looking into the children.

Test: svg/custom/pattern-content-cycle-w-resourceless-container.html

* rendering/svg/SVGResourcesCycleSolver.cpp:
(WebCore::SVGResourcesCycleSolver::resourceContainsCycles): We should still
check all children resources, but not exit early if there are none. Instead
we should recurse into any children.
(WebCore::SVGResourcesCycleSolver::resolveCycles): Changes to some debug
code that no longer compiled (it's still off by default, but at least
it will work now).

LayoutTests:

This test was ported from Blink. I believe it originally
came from:
https://code.google.com/p/chromium/issues/detail?id=351713

* svg/custom/pattern-content-cycle-w-resourceless-container-expected.txt: Added.
* svg/custom/pattern-content-cycle-w-resourceless-container.html: Added.

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

4 years agoCLoop build fix after r189938.
rniwa@webkit.org [Fri, 18 Sep 2015 00:55:41 +0000 (00:55 +0000)]
CLoop build fix after r189938.

* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::unwindToMachineCodeBlockFrame):

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

4 years agoREGRESSION(r188871): 50% regression in page load time of Wikipedia home page
mmaxfield@apple.com [Fri, 18 Sep 2015 00:50:05 +0000 (00:50 +0000)]
REGRESSION(r188871): 50% regression in page load time of Wikipedia home page
https://bugs.webkit.org/show_bug.cgi?id=149320

Reviewed by Daniel Bates.

This is due to <rdar://problem/22144016> about how language-specific
font fallback is an order of magnitude slower than regular non-language-
specific font-fallback. This performance problem has been fixed, but not
for iOS 9.

No new tests because there is no correctness change.

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformLookupFallbackFont):

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

4 years agoSource/WebCore:
rniwa@webkit.org [Fri, 18 Sep 2015 00:47:09 +0000 (00:47 +0000)]
Source/WebCore:
Add HTMLSlotElement, Element.slot, and NonDocumentTypeChildNode.assignedSlot
https://bugs.webkit.org/show_bug.cgi?id=149241

Reviewed by Antti Koivisto.

Implement the slotting algorithm and related features: slot element, slot attribute, and assignedSlot
as specified by https://w3c.github.io/webcomponents/spec/shadow/#slotting-algorithm
as of 8bf56e8ea5521a7a911efd1cabeb2be0d5c3ca74.

The slotting algorithm is implemented by the newly introduced SlotAssignment class which is created on
demand by ShadowRoot when a HTMLSlotElement is inserted into the shadow root. SlotAssignment contains
a HashMap of a slot name to SlotInfo structure, which holds the number of slot elements of the said name,
the first element if it's known, and an ordered list of the assigned nodes.

When there is exactly one slot element of a given name, "element" returns the slot element in O(1).
When another slot of the same name is inserted into the same shadow tree, we increment "elementCount" and
set "element" to nullptr since we don't know which slot element comes first in the tree order without O(n)
tree traversal, which is lazily done in resolveAllSlotElements.

Observe that SlotInfo's "element" can be nullptr in two occasions: (1) when there is no slot element of
the given name (SlotAssignment::assignSlots may insert such an entry), and (2) when there are more than
one slot elements of the same name and we haven't run resolveAllSlotElements.

Resolving assigned nodes, on the other hand, is always O(n) unless all assignments are up to date, and
lazily computed by assignSlots. This is because inserting or removing a node doesn't tell us the relative
ordering of the node with respect to other nodes assigned to the same slot. For example, let's say we have
child nodes (A, B, C, D) and (A, D) are assigned to slot Alpha and (B, C) are assigned to slot Beta. If we
insert a new node E between nodes B and C and this node is assigned to slot Alpha, then we must create an
ordered list (A, E, D) for slot Alpha. Unfortunately, determining where to insert E in this list can cost
O(n) child traversal in the worst case.

Tests: fast/shadow-dom/HTMLSlotElement-interface.html
       fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::attributeChanged): Invalidate the slot assignments when slot attribute is changed.
(WebCore::Element::childrenChanged): Ditto for when a child node is inserted or removed. We can avoid it
when there is no default slot and only text nodes are removed or added in the future.
* dom/Element.idl: Added slot attribute on Element.
* dom/Node.cpp:
(WebCore::Node::assignedSlot): Added. Returns the assigned slot if the slot is in an open shadow tree.
* dom/Node.h:
* dom/NonDocumentTypeChildNode.idl: Added assignedSlot. Only expose in JS for now to avoid generating
the binding code for HTMLSlotElement in other languages.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::findAssignedSlot): Added. Forwards it to the implementation in SlotAssignment.
(WebCore::ShadowRoot::addSlotElementByName): Ditto.
(WebCore::ShadowRoot::removeSlotElementByName): Ditto.
(WebCore::ShadowRoot::invalidateSlotAssignments): Ditto.
(WebCore::ShadowRoot::assignedNodesForSlot): Ditto.
* dom/ShadowRoot.h:
(WebCore::ShadowRoot): Added m_slotAssignments as a member.
* dom/SlotAssignment.cpp: Added.
(WebCore::treatNullAsEmpty): Added. See https://w3c.github.io/webcomponents/spec/shadow/#dfn-default-slot
(WebCore::SlotAssignment::findAssignedSlot): Find the slot element to which a given node is assigned.
Since there could be multiple slot elements of the same name (or lack thereof), call findFirstSlotElement
to find the first slot element.
(WebCore::SlotAssignment::addSlotElementByName): Added. Called when a new slot element is inserted into
the associated shadow tree. When a slot element's name is changed, removeSlotElementByName is called on
with the old name before addSlotElementByName is called with the new name.
(WebCore::SlotAssignment::removeSlotElementByName): Ditto for removal.
(WebCore::SlotAssignment::assignedNodesForSlot): Added. Finds the ordered list of assigned nodes for
a given slot element. When there are multiple slot elements of the same name, we return the list only if
SlotInfo::element matches the argument.
(WebCore::SlotAssignment::findFirstSlotElement): Added. Resolves SlotInfo::element if needed.
(WebCore::SlotAssignment::resolveAllSlotElements): Finds SlotInfo::element for all slots. We resolve all
slots simultaneously to avoid doing O(number of nodes) tree traversal for O(number of slots) to avoid
the worst case O(n^2) behavior when all nodes in the shadow tree are slot elements of the same name.
(WebCore::SlotAssignment::assignSlots): Added. Computes the slot assignments by traversing each child
of the shadow host and adding to the appropriate SlotInfo::assignedNodes, creating a new entry if needed.
* dom/SlotAssignment.h: Added.
(WebCore::SlotAssignment::SlotAssignment):
(WebCore::SlotAssignment::invalidate):
(WebCore::SlotAssignment::SlotInfo::SlotInfo):
(WebCore::SlotAssignment::SlotInfo::hasSlotElements):
(WebCore::SlotAssignment::SlotInfo::hasDuplicatedSlotElements):
(WebCore::SlotAssignment::SlotInfo::shouldResolveSlotElement):
* html/HTMLAttributeNames.in: Added slot attribute.
* html/HTMLSlotElement.cpp: Added.
(WebCore::HTMLSlotElement::create):
(WebCore::HTMLSlotElement::HTMLSlotElement):
(WebCore::HTMLSlotElement::insertedInto): Calls addSlotElementByName.
(WebCore::HTMLSlotElement::removedFrom): Calls removeSlotElementByName. Because the element had already
been removed from the shadow tree, we can't use containingShadowRoot() to find the ShadowRoot here.
(WebCore::HTMLSlotElement::attributeChanged): Calls removeSlotElementByName and addSlotElementByName.
(WebCore::HTMLSlotElement::getDistributedNodes): Returns an ordered list of the assigned nodes.
* html/HTMLSlotElement.h: Added.
* html/HTMLSlotElement.idl: Added.
* html/HTMLTagNames.in: Added slot element.

LayoutTests:
Add HTMLSlotElement and NonDocumentTypeChildNode.assignedSlot
https://bugs.webkit.org/show_bug.cgi?id=149241

Reviewed by Antti Koivisto.

Added new conformance tests and rebaselined tests as needed.

In particular, inspector/model/remote-object.html was rebaselined since "assignedSlot" now appears as one of the first five
properties on Comment node that this test outputs.

* fast/shadow-dom/HTMLSlotElement-interface-expected.txt: Added.
* fast/shadow-dom/HTMLSlotElement-interface.html: Added.
* fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot-expected.txt: Added.
* fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html: Added.
* js/dom/dom-static-property-for-in-iteration-expected.txt:
* platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/inspector/model: Added.
* platform/mac/inspector/model/remote-object-expected.txt: Copied from LayoutTests/inspector/model/remote-object-expected.txt.
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

4 years agoRegression(r189881): release assertion hit in toJS(ExecState*, JSDOMGlobalObject...
cdumez@apple.com [Fri, 18 Sep 2015 00:46:12 +0000 (00:46 +0000)]
Regression(r189881): release assertion hit in toJS(ExecState*, JSDOMGlobalObject*, DocumentFragment*)
https://bugs.webkit.org/show_bug.cgi?id=149281

Reviewed by Ryosuke Niwa.

After r189881, we started generating a toJS() function for DocumentFragment
as an optimization. DocumentFragment has a subclass (ShadowRoot) but the
default toJS() implementation should have still been acceptable given that
the subclass is not web-exposed and therefore does not have a JS wrapper.

However, the ShadowRoot interface was introduced shortly after in r189841
and to toJS() implementation for DocumentFragment is now invalid. This
patch introduces a ShadowRoot-aware custom implementation of toJS() for
DocumentFragment to address the problem.

No new tests, already covered by:
plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html

* bindings/js/JSDocumentFragmentCustom.cpp:
(WebCore::createNewDocumentFragmentWrapper):
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
Provide a ShadowRoot-aware custom implementation of toJS() /
toJSNewlyCreated() for DocumentFragment.

* bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline):
Fix bug in toJS() implementation for Node as it was not handling
ShadowRoots properly either.

* dom/DocumentFragment.idl:
Use [CustomToJSObject] so we can provide our own custom implementation
of toJS().

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

4 years agoGive iOS WebKitTestRunner a launch storyboard
simon.fraser@apple.com [Fri, 18 Sep 2015 00:44:56 +0000 (00:44 +0000)]
Give iOS WebKitTestRunner a launch storyboard
https://bugs.webkit.org/show_bug.cgi?id=149314

Reviewed by Dan Bates.

Add a launch storyboard to iOS WebKitTestRunner so that Springboard recognizes
that it's been built for specific device configurations, and puts the window
at the top of the screen. This simplifies coordinate conversions in a future patch.

* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/WebKitTestRunnerApp/WebKitTestRunnerApp-Info.plist:
* WebKitTestRunner/ios/Launch.storyboard: Added.

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

4 years agoCSS WG multicol-1 tests failures with 1px differences due to baseline difference.
zalan@apple.com [Fri, 18 Sep 2015 00:16:09 +0000 (00:16 +0000)]
CSS WG multicol-1 tests failures with 1px differences due to baseline difference.
https://bugs.webkit.org/show_bug.cgi?id=149245

Reviewed by Ryosuke Niwa.

Turn off font-aliasing for multicol tests where the reference tests' inline content
end up on a different baseline (fractional difference). (It's not considered a bug, they don't
necessarily match.)

LayoutTests/imported/w3c:

* css/css-multicol-1/multicol-basic-001-expected.html:
* css/css-multicol-1/multicol-basic-001.html:
* css/css-multicol-1/multicol-basic-002-expected.html:
* css/css-multicol-1/multicol-basic-002.html:
* css/css-multicol-1/multicol-basic-003-expected.html:
* css/css-multicol-1/multicol-basic-003.html:
* css/css-multicol-1/multicol-basic-004-expected.html:
* css/css-multicol-1/multicol-basic-004.html:
* css/css-multicol-1/multicol-rule-002-expected.xht:
* css/css-multicol-1/multicol-rule-002.xht:
* css/css-multicol-1/multicol-rule-px-001-expected.xht:
* css/css-multicol-1/multicol-rule-px-001.xht:
* css/css-multicol-1/multicol-rule-stacking-001-expected.xht:
* css/css-multicol-1/multicol-rule-stacking-001.xht:
* css/css-multicol-1/multicol-shorthand-001-expected.xht:
* css/css-multicol-1/multicol-shorthand-001.xht:
* css/css-multicol-1/multicol-span-all-block-sibling-003-expected.xht:
* css/css-multicol-1/multicol-span-all-block-sibling-003.xht:
* css/css-multicol-1/multicol-span-all-margin-nested-firstchild-001-expected.xht:
* css/css-multicol-1/multicol-span-all-margin-nested-firstchild-001.xht:

LayoutTests:

* TestExpectations:

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

4 years agoConvert return values from JavaScript functions to the expected types in WebAssembly
commit-queue@webkit.org [Fri, 18 Sep 2015 00:03:49 +0000 (00:03 +0000)]
Convert return values from JavaScript functions to the expected types in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=149200

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-09-17
Reviewed by Mark Lam.

When a WebAssembly function calls a JavaScript function, there is no
guarantee that the JavaScript function will always return values of the
type we expect. This patch converts the return values to the expected
types.

(The reverse is also true: When a WebAssembly function is called from a
JavaScript function, there is no guarantee that the arguments to the
WebAssembly function will always be of the types we expect. We have
fixed this in Bug 149033.)

We don't need to type check the return values if the callee is a
WebAssembly function. We don't need to type check the arguments if the
caller is a WebAssembly function. This optimization will be
implemented in the future. See https://bugs.webkit.org/show_bug.cgi?id=149310

* tests/stress/wasm-type-conversion.js:
* tests/stress/wasm/type-conversion.wasm:
* wasm/WASMFunctionCompiler.h:
(JSC::WASMFunctionCompiler::startFunction):
(JSC::WASMFunctionCompiler::buildReturn):
(JSC::WASMFunctionCompiler::boxArgumentsAndAdjustStackPointer):
(JSC::WASMFunctionCompiler::callAndUnboxResult):
(JSC::WASMFunctionCompiler::convertValueToInt32):
(JSC::WASMFunctionCompiler::convertValueToDouble):
(JSC::WASMFunctionCompiler::convertDoubleToValue):
(JSC::WASMFunctionCompiler::loadValueAndConvertToInt32): Deleted.
(JSC::WASMFunctionCompiler::loadValueAndConvertToDouble): Deleted.
* wasm/WASMFunctionParser.cpp:
(JSC::WASMFunctionParser::parseExpressionI32):
(JSC::WASMFunctionParser::parseExpressionF32):
(JSC::WASMFunctionParser::parseExpressionF64):
(JSC::WASMFunctionParser::parseCallInternalExpressionI32): Deleted.
* wasm/WASMFunctionParser.h:

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

4 years agoDe-template ContainerNodeAlgorithms
antti@apple.com [Thu, 17 Sep 2015 23:53:58 +0000 (23:53 +0000)]
De-template ContainerNodeAlgorithms
https://bugs.webkit.org/show_bug.cgi?id=149286

Reviewed by Andreas Kling.

These are always used with ContainerNode/Node.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeDetachedChildren):
(WebCore::destroyRenderTreeIfNeeded):
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::insertBeforeCommon):
(WebCore::ContainerNode::appendChildCommon):

    Make append a member for consistency with insert.

(WebCore::ContainerNode::notifyChildInserted):
(WebCore::ContainerNode::notifyChildRemoved):
(WebCore::ContainerNode::parserInsertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::appendChild):
(WebCore::ContainerNode::parserAppendChild):

    Also make rest of these ownership-taking functions take Ref<>&&.

* dom/ContainerNode.h:
(WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion):
(WebCore::ContainerNode::setFirstChild):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeRemoved):
(WebCore::addChildNodesToDeletionQueue):
(WebCore::removeDetachedChildrenInContainer):
(WebCore::collectFrameOwners):
(WebCore::assertConnectedSubrameCountIsConsistent):
(WebCore::disconnectSubframes):
* dom/ContainerNodeAlgorithms.h:
(WebCore::removeDetachedChildrenInContainer): Deleted.
(WebCore::appendChildToContainer): Deleted.
(WebCore::Private::NodeRemovalDispatcher::dispatch): Deleted.
(WebCore::Private::addChildNodesToDeletionQueue): Deleted.
* html/parser/HTMLConstructionSite.cpp:
(WebCore::insert):
(WebCore::executeInsertTask):
(WebCore::executeReparentTask):
(WebCore::executeInsertAlreadyParsedChildTask):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTTreeBuilder::constructTreeFromToken):
* xml/XMLErrors.cpp:
(WebCore::XMLErrors::appendErrorMessage):
(WebCore::createXHTMLParserErrorHeader):
(WebCore::XMLErrors::insertErrorMessageBlock):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::enterText):
(WebCore::toString):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::startElementNs):
(WebCore::XMLDocumentParser::processingInstruction):
(WebCore::XMLDocumentParser::cdataBlock):
(WebCore::XMLDocumentParser::comment):

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

4 years agoHeavy taps on links are sometimes interpreted as the preview gesture
bdakin@apple.com [Thu, 17 Sep 2015 23:30:19 +0000 (23:30 +0000)]
Heavy taps on links are sometimes interpreted as the preview gesture
https://bugs.webkit.org/show_bug.cgi?id=149304
-and corresponding-
rdar://problem/22689258

Reviewed by Tim Horton.

If the preview gesture starts and stop and less than 250 milliseconds have
passed, then call _attemptClickAtLocation to treat it as a normal tap.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _interactionStartedFromPreviewItemController:]):
(-[WKContentView _interactionStoppedFromPreviewItemController:]):

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

4 years agoUpdate licence in r189890
mmaxfield@apple.com [Thu, 17 Sep 2015 23:28:20 +0000 (23:28 +0000)]
Update licence in r189890
https://bugs.webkit.org/show_bug.cgi?id=149306

Reviewed by Dean Jackson.

* FontWithFeatures/FontWithFeatures/FontCreator.cpp:
* FontWithFeatures/FontWithFeatures/FontCreator.h:
* FontWithFeatures/FontWithFeatures/main.cpp:

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

4 years agoBlock Objective-C exceptions in DictionaryLookup
timothy_horton@apple.com [Thu, 17 Sep 2015 23:22:52 +0000 (23:22 +0000)]
Block Objective-C exceptions in DictionaryLookup
https://bugs.webkit.org/show_bug.cgi?id=149256

Reviewed by Anders Carlsson.

* editing/mac/DictionaryLookup.mm:
(WebCore::DictionaryLookup::rangeForSelection):
(WebCore::DictionaryLookup::rangeAtHitTestResult):
(WebCore::expandSelectionByCharacters):
(WebCore::DictionaryLookup::stringForPDFSelection):
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::hidePopup):
It is possible for Lookup to throw an exception if one of its
related services dies for some reason. This shouldn't take down
our UI process, so block the exceptions.

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

4 years ago[ES6] Add more fine-grained APIs and additional hooks to control module loader from...
utatane.tea@gmail.com [Thu, 17 Sep 2015 22:26:18 +0000 (22:26 +0000)]
[ES6] Add more fine-grained APIs and additional hooks to control module loader from WebCore
https://bugs.webkit.org/show_bug.cgi?id=149129

Reviewed by Saam Barati.

No behavior change.

Source/JavaScriptCore:

Module tag `<script type="module>` will be executed asynchronously.
But we would like to fetch the resources before when the postTask-ed task is performed.
So instead of 1 API that fetch, instantiate and execute the module,
we need 2 fine-grained APIs.

1. Fetch and initialize a module, but not execute it yet.
2. Link and execute a module specified by the key (this will be invoked asynchronously).

And to instrument the script execution (like reporting the execution time of the module to
the inspector), we need a hook to inject code around an execution of a module body.

* builtins/ModuleLoaderObject.js:
(moduleEvaluation):
(loadAndEvaluateModule):
(loadModule):
(linkAndEvaluateModule):
* jsc.cpp:
(functionLoadModule):
(runWithScripts):
* runtime/Completion.cpp:
(JSC::identifierToJSValue):
(JSC::createSymbolForEntryPointModule):
(JSC::rejectPromise):
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
(JSC::linkAndEvaluateModule):
(JSC::evaluateModule): Deleted.
* runtime/Completion.h:
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::evaluate):
(JSC::JSModuleRecord::execute): Deleted.
* runtime/JSModuleRecord.h:
* runtime/ModuleLoaderObject.cpp:
(JSC::ModuleLoaderObject::loadAndEvaluateModule):
(JSC::ModuleLoaderObject::linkAndEvaluateModule):
(JSC::ModuleLoaderObject::evaluate):
(JSC::moduleLoaderObjectEvaluate):
* runtime/ModuleLoaderObject.h:

Source/WebCore:

* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:

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

4 years agoImplement try/catch in the DFG.
sbarati@apple.com [Thu, 17 Sep 2015 22:02:54 +0000 (22:02 +0000)]
Implement try/catch in the DFG.
https://bugs.webkit.org/show_bug.cgi?id=147374

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This patch implements try/catch inside the DFG JIT.
It also prevents tier up to the FTL for any functions
that have an op_catch in them that are DFG compiled.

This patch accomplishes implementing try/catch inside
the DFG by OSR exiting to op_catch when an exception is thrown.
We can OSR exit from an exception inside the DFG in two ways:
1) We have a JS call (can also be via implicit getter/setter in GetById/PutById)
2) We have an exception when returing from a callOperation

In the case of (1), we get to the OSR exit from genericUnwind because
the exception was thrown in a child call frame. This means these
OSR exits must act as defacto op_catches (even though we will still OSR
exit to a baseline op_catch). That means they must restore the stack pointer
and call frame.

In the case of (2), we can skip genericUnwind because we know the exception
check will take us to a particular OSR exit. Instead, we link these
exception checks as jumps to a particular OSR exit.

Both types of OSR exits will exit into op_catch inside the baseline JIT.
Because they exit to op_catch, these OSR exits must set callFrameForCatch
to the proper call frame pointer.

We "handle" all exceptions inside the machine frame of the DFG code
block. This means the machine code block is responsible for "catching"
exceptions of any inlined frames' try/catch. OSR exit will then exit to
the proper baseline CodeBlock after reifying the inlined frames
(DFG::OSRExit::m_codeOrigin corresponds to the op_catch we will exit to).
Also, genericUnwind will never consult an inlined call frame's CodeBlock to
see if they can catch the exception because they can't. We always unwind to the
next machine code block frame. The DFG CodeBlock changes how the exception
handler table is keyed: it is now keyed by CallSiteIndex for DFG code blocks.

So, when consulting call sites that throw, we keep track of the CallSiteIndex,
and the HandlerInfo for the corresponding baseline exception handler for
that particular CallSiteIndex (if an exception at that call site will be caught).
Then, when we're inside DFG::JITCompiler::link(), we install new HandlerInfo's
inside the DFG CodeBlock and key it by the corresponding CallSiteIndex.
(The CodeBlock only has HandlerInfos for the OSR exits that are to be arrived
at from genericUnwind).

Also, each OSR exit will know if it acting as an exception handler, and
whether or not it will be arrived at from genericUnwind. When we know we
will arrive at an OSR exit from genericUnwind, we set the corresponding
HandlerInfo's nativeCode CodeLocationLabel field to be the OSR exit.

This patch also introduces a new Phase inside the DFG that ensures
that DFG CodeBlocks that handle exceptions take the necessary
steps to keep live variables at "op_catch" live according the
OSR exit value recovery machinery. We accomplish this by flushing
all live op_catch variables to the stack when inside a "try" block.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::handlerForBytecodeOffset):
(JSC::CodeBlock::handlerForIndex):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::clearExceptionHandlers):
(JSC::CodeBlock::appendExceptionHandler):
* bytecode/PreciseJumpTargets.cpp:
(JSC::computePreciseJumpTargets):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::getLocal):
(JSC::DFG::ByteCodeParser::setLocal):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGCommonData.cpp:
(JSC::DFG::CommonData::addCodeOrigin):
(JSC::DFG::CommonData::lastCallSite):
(JSC::DFG::CommonData::shrinkToFit):
* dfg/DFGCommonData.h:
* dfg/DFGGraph.h:
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::linkOSRExits):
(JSC::DFG::JITCompiler::link):
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::noticeOSREntry):
(JSC::DFG::JITCompiler::appendExceptionHandlingOSRExit):
(JSC::DFG::JITCompiler::willCatchExceptionInMachineFrame):
(JSC::DFG::JITCompiler::exceptionCheck):
(JSC::DFG::JITCompiler::recordCallSiteAndGenerateExceptionHandlingOSRExitIfNeeded):
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::emitStoreCodeOrigin):
(JSC::DFG::JITCompiler::emitStoreCallSiteIndex):
(JSC::DFG::JITCompiler::appendCall):
(JSC::DFG::JITCompiler::exceptionCheckWithCallFrameRollback):
(JSC::DFG::JITCompiler::blockHeads):
(JSC::DFG::JITCompiler::exceptionCheck): Deleted.
* dfg/DFGLiveCatchVariablePreservationPhase.cpp: Added.
(JSC::DFG::FlushLiveCatchVariablesInsertionPhase::FlushLiveCatchVariablesInsertionPhase):
(JSC::DFG::FlushLiveCatchVariablesInsertionPhase::run):
(JSC::DFG::FlushLiveCatchVariablesInsertionPhase::willCatchException):
(JSC::DFG::FlushLiveCatchVariablesInsertionPhase::handleBlock):
(JSC::DFG::FlushLiveCatchVariablesInsertionPhase::newVariableAccessData):
(JSC::DFG::performLiveCatchVariablePreservationPhase):
* dfg/DFGLiveCatchVariablePreservationPhase.h: Added.
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::OSRExit):
(JSC::DFG::OSRExit::setPatchableCodeOffset):
* dfg/DFGOSRExit.h:
(JSC::DFG::OSRExit::considerAddingAsFrequentExitSite):
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::osrWriteBarrier):
(JSC::DFG::adjustAndJumpToTarget):
* dfg/DFGOSRExitCompilerCommon.h:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* dfg/DFGSlowPathGenerator.h:
(JSC::DFG::SlowPathGenerator::SlowPathGenerator):
(JSC::DFG::SlowPathGenerator::~SlowPathGenerator):
(JSC::DFG::SlowPathGenerator::generate):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::emitCall):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
(JSC::DFG::SpeculativeJIT::cachedPutById):
(JSC::DFG::SpeculativeJIT::emitCall):
* dfg/DFGTierUpCheckInjectionPhase.cpp:
(JSC::DFG::TierUpCheckInjectionPhase::run):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* interpreter/Interpreter.cpp:
(JSC::GetCatchHandlerFunctor::operator()):
(JSC::UnwindFunctor::operator()):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::gotoNextFrame):
(JSC::StackVisitor::unwindToMachineCodeBlockFrame):
(JSC::StackVisitor::readFrame):
* interpreter/StackVisitor.h:
(JSC::StackVisitor::operator*):
(JSC::StackVisitor::operator->):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitExceptionCheck):
(JSC::AssemblyHelpers::emitNonPatchableExceptionCheck):
(JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitCount):
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_catch):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_catch):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/VM.h:
(JSC::VM::clearException):
(JSC::VM::clearLastException):
(JSC::VM::addressOfCallFrameForCatch):
(JSC::VM::exception):
(JSC::VM::addressOfException):
* tests/stress/dfg-exception-try-catch-in-constructor-with-inlined-throw.js: Added.
(f):
(bar):
(Foo):
* tests/stress/es6-for-of-loop-exception.js: Added.
(assert):
(shouldThrowInvalidConstAssignment):
(baz):
(foo):
* tests/stress/exception-dfg-inlined-frame-not-strict-equal.js: Added.
(assert):
(o.valueOf):
(o.toString):
(read):
(bar):
(foo):
* tests/stress/exception-dfg-not-strict-equal.js: Added.
(foo):
(o.valueOf):
(o.toString):
(assert):
(shouldDoSomethingInFinally):
(catch):
* tests/stress/exception-dfg-operation-read-value.js: Added.
(assert):
(o.valueOf):
(o.toString):
(read):
(foo):
* tests/stress/exception-dfg-throw-from-catch-block.js: Added.
(assert):
(baz):
(bar):
(foo):

LayoutTests:

* js/regress/raytrace-with-empty-try-catch-expected.txt: Added.
* js/regress/raytrace-with-empty-try-catch.html: Added.
* js/regress/raytrace-with-try-catch-expected.txt: Added.
* js/regress/raytrace-with-try-catch.html: Added.
* js/regress/script-tests/raytrace-with-empty-try-catch.js: Added.
(createVector):
(sqrLengthVector):
(lengthVector):
(addVector):
(subVector):
(scaleVector):
(normaliseVector):
(add):
(sub):
(scalev):
(dot):
(scale):
(cross):
(normalise):
(transformMatrix):
(invertMatrix):
(Triangle):
(Triangle.prototype.intersect):
(Scene):
(Scene.prototype.intersect):
(Scene.prototype.blocked):
(Camera):
(Camera.prototype.generateRayPair):
(renderRows):
(Camera.prototype.render):
(raytraceScene.floorShader):
(raytraceScene):
(arrayToCanvasCommands):
* js/regress/script-tests/raytrace-with-try-catch.js: Added.
(randomException):
(createVector):
(sqrLengthVector):
(lengthVector):
(addVector):
(subVector):
(scaleVector):
(normaliseVector):
(add):
(sub):
(scalev):
(dot):
(scale):
(cross):
(normalise):
(transformMatrix):
(invertMatrix):
(Triangle):
(Triangle.prototype.intersect):
(Scene):
(Scene.prototype.intersect):
(Scene.prototype.blocked):
(Camera):
(Camera.prototype.generateRayPair):
(renderRows):
(Camera.prototype.render):
(raytraceScene.floorShader):
(raytraceScene):
(arrayToCanvasCommands):
* js/regress/script-tests/v8-raytrace-with-empty-try-catch.js: Added.
(Class.create):
(Object.extend):
(Flog.RayTracer.Color.prototype.initialize):
(Flog.RayTracer.Color.prototype.add):
(Flog.RayTracer.Color.prototype.addScalar):
(Flog.RayTracer.Color.prototype.subtract):
(Flog.RayTracer.Color.prototype.multiply):
(Flog.RayTracer.Color.prototype.multiplyScalar):
(Flog.RayTracer.Color.prototype.divideFactor):
(Flog.RayTracer.Color.prototype.limit):
(Flog.RayTracer.Color.prototype.distance):
(Flog.RayTracer.Color.prototype.blend):
(Flog.RayTracer.Color.prototype.brightness):
(Flog.RayTracer.Color.prototype.toString):
(Flog.RayTracer.Light.prototype.initialize):
(Flog.RayTracer.Light.prototype.toString):
(Flog.RayTracer.Vector.prototype.initialize):
(Flog.RayTracer.Vector.prototype.copy):
(Flog.RayTracer.Vector.prototype.normalize):
(Flog.RayTracer.Vector.prototype.magnitude):
(Flog.RayTracer.Vector.prototype.cross):
(Flog.RayTracer.Vector.prototype.dot):
(Flog.RayTracer.Vector.prototype.add):
(Flog.RayTracer.Vector.prototype.subtract):
(Flog.RayTracer.Vector.prototype.multiplyVector):
(Flog.RayTracer.Vector.prototype.multiplyScalar):
(Flog.RayTracer.Vector.prototype.toString):
(Flog.RayTracer.Ray.prototype.initialize):
(Flog.RayTracer.Ray.prototype.toString):
(Flog.RayTracer.Scene.prototype.initialize):
(Flog.RayTracer.Material.BaseMaterial.prototype.initialize):
(Flog.RayTracer.Material.BaseMaterial.prototype.getColor):
(Flog.RayTracer.Material.BaseMaterial.prototype.wrapUp):
(Flog.RayTracer.Material.BaseMaterial.prototype.toString):
(Flog.RayTracer.Material.Solid.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.initialize):
(Flog.RayTracer.Material.Solid.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.getColor):
(Flog.RayTracer.Material.Solid.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.toString):
(Flog.RayTracer.Material.Solid.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial):
(Flog.RayTracer.Material.Chessboard.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.initialize):
(Flog.RayTracer.Material.Chessboard.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.getColor):
(Flog.RayTracer.Material.Chessboard.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.toString):
(Flog.RayTracer.Material.Chessboard.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial):
(Flog.RayTracer.Shape.Sphere.prototype.initialize):
(Flog.RayTracer.Shape.Sphere.prototype.intersect):
(Flog.RayTracer.Shape.Sphere.prototype.toString):
(Flog.RayTracer.Shape.Plane.prototype.initialize):
(Flog.RayTracer.Shape.Plane.prototype.intersect):
(Flog.RayTracer.Shape.Plane.prototype.toString):
(Flog.RayTracer.IntersectionInfo.prototype.initialize):
(Flog.RayTracer.IntersectionInfo.prototype.toString):
(Flog.RayTracer.Camera.prototype.initialize):
(Flog.RayTracer.Camera.prototype.getRay):
(Flog.RayTracer.Camera.prototype.toString):
(Flog.RayTracer.Background.prototype.initialize):
(Flog.RayTracer.Engine.prototype.initialize):
(Flog.RayTracer.Engine.prototype.setPixel):
(Flog.RayTracer.Engine.prototype.renderScene):
(Flog.RayTracer.Engine.prototype.getPixelColor):
(Flog.RayTracer.Engine.prototype.testIntersection):
(Flog.RayTracer.Engine.prototype.getReflectionRay):
(Flog.RayTracer.Engine.prototype.rayTrace):
(renderScene):
* js/regress/script-tests/v8-raytrace-with-try-catch.js: Added.
(randomException):
(Class.create):
(Object.extend):
(Flog.RayTracer.Color.prototype.initialize):
(Flog.RayTracer.Color.prototype.add):
(Flog.RayTracer.Color.prototype.addScalar):
(Flog.RayTracer.Color.prototype.subtract):
(Flog.RayTracer.Color.prototype.multiply):
(Flog.RayTracer.Color.prototype.multiplyScalar):
(Flog.RayTracer.Color.prototype.divideFactor):
(Flog.RayTracer.Color.prototype.limit):
(Flog.RayTracer.Color.prototype.distance):
(Flog.RayTracer.Color.prototype.blend):
(Flog.RayTracer.Color.prototype.brightness):
(Flog.RayTracer.Color.prototype.toString):
(Flog.RayTracer.Light.prototype.initialize):
(Flog.RayTracer.Light.prototype.toString):
(Flog.RayTracer.Vector.prototype.initialize):
(Flog.RayTracer.Vector.prototype.copy):
(Flog.RayTracer.Vector.prototype.normalize):
(Flog.RayTracer.Vector.prototype.magnitude):
(Flog.RayTracer.Vector.prototype.cross):
(Flog.RayTracer.Vector.prototype.dot):
(Flog.RayTracer.Vector.prototype.add):
(Flog.RayTracer.Vector.prototype.subtract):
(Flog.RayTracer.Vector.prototype.multiplyVector):
(Flog.RayTracer.Vector.prototype.multiplyScalar):
(Flog.RayTracer.Vector.prototype.toString):
(Flog.RayTracer.Ray.prototype.initialize):
(Flog.RayTracer.Ray.prototype.toString):
(Flog.RayTracer.Scene.prototype.initialize):
(Flog.RayTracer.Material.BaseMaterial.prototype.initialize):
(Flog.RayTracer.Material.BaseMaterial.prototype.getColor):
(Flog.RayTracer.Material.BaseMaterial.prototype.wrapUp):
(Flog.RayTracer.Material.BaseMaterial.prototype.toString):
(Flog.RayTracer.Material.Solid.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.initialize):
(Flog.RayTracer.Material.Solid.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.getColor):
(Flog.RayTracer.Material.Solid.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.toString):
(Flog.RayTracer.Material.Solid.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial):
(Flog.RayTracer.Material.Chessboard.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.initialize):
(Flog.RayTracer.Material.Chessboard.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.getColor):
(Flog.RayTracer.Material.Chessboard.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial.toString):
(Flog.RayTracer.Material.Chessboard.prototype.Object.extend.new.Flog.RayTracer.Material.BaseMaterial):
(Flog.RayTracer.Shape.Sphere.prototype.initialize):
(Flog.RayTracer.Shape.Sphere.prototype.intersect):
(Flog.RayTracer.Shape.Sphere.prototype.toString):
(Flog.RayTracer.Shape.Plane.prototype.initialize):
(Flog.RayTracer.Shape.Plane.prototype.intersect):
(Flog.RayTracer.Shape.Plane.prototype.toString):
(Flog.RayTracer.IntersectionInfo.prototype.initialize):
(Flog.RayTracer.IntersectionInfo.prototype.toString):
(Flog.RayTracer.Camera.prototype.initialize):
(Flog.RayTracer.Camera.prototype.getRay):
(Flog.RayTracer.Camera.prototype.toString):
(Flog.RayTracer.Background.prototype.initialize):
(Flog.RayTracer.Engine.prototype.initialize):
(Flog.RayTracer.Engine.prototype.setPixel):
(Flog.RayTracer.Engine.prototype.renderScene):
(Flog.RayTracer.Engine.prototype.getPixelColor):
(Flog.RayTracer.Engine.prototype.testIntersection):
(Flog.RayTracer.Engine.prototype.getReflectionRay):
(Flog.RayTracer.Engine.prototype.rayTrace):
(renderScene):
* js/regress/v8-raytrace-with-empty-try-catch-expected.txt: Added.
* js/regress/v8-raytrace-with-empty-try-catch.html: Added.
* js/regress/v8-raytrace-with-try-catch-expected.txt: Added.
* js/regress/v8-raytrace-with-try-catch.html: Added.

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

4 years agoAdd the ability to skip JIT stress tests in run-javascriptcore-tests.
mark.lam@apple.com [Thu, 17 Sep 2015 22:02:49 +0000 (22:02 +0000)]
Add the ability to skip JIT stress tests in run-javascriptcore-tests.
https://bugs.webkit.org/show_bug.cgi?id=149285

Reviewed by Saam Barati.

Just need to add an option to pass --no-jit to run-jsc-stress-test.

* Scripts/run-javascriptcore-tests:
(runJSCStressTests):

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

4 years agoFix Windows EWS build after r189934.
achristensen@apple.com [Thu, 17 Sep 2015 21:48:55 +0000 (21:48 +0000)]
Fix Windows EWS build after r189934.

* Source/cmake/OptionsWin.cmake:
Use WEBKIT_LIBRARIES environment variable if it exists.
We have the WebKitLibraries directory separate from the repository copy on the EWS bots.

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

4 years agoUnreviewed, revert unintended change.
fpizlo@apple.com [Thu, 17 Sep 2015 21:27:04 +0000 (21:27 +0000)]
Unreviewed, revert unintended change.

* benchmarks/LockSpeedTest.cpp:
(main):

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

4 years agoSwitch AppleWin build to use CMake
commit-queue@webkit.org [Thu, 17 Sep 2015 21:26:49 +0000 (21:26 +0000)]
Switch AppleWin build to use CMake
https://bugs.webkit.org/show_bug.cgi?id=149163

Patch by Alex Christensen <achristensen@webkit.org> on 2015-09-17
Reviewed by Brent Fulgham.

Source/WebCore:

* bindings/scripts/preprocess-idls.pl:
(CygwinPathIfNeeded):
(WriteFileIfChanged):
* bindings/scripts/preprocessor.pm:
(applyPreprocessor):
Fix new cygwin quirks.  Cygwin is now using some paths from CMake.

Tools:

* Scripts/build-webkit:
* Scripts/run-api-tests:
(runTest):
(listAllTests):
(prepareEnvironmentForRunningTestTool):
(testToolPaths):
(testToolPath): Deleted.
Run the API tests as separate executables on Windows.
It used to be TestWebKitAPI.exe, and it is now TestWTF.exe, TestWebCore.exe, and TestWebKit.exe.
* Scripts/webkitdirs.pm:
(checkRequiredSystemConfig):
(jhbuildWrapperPrefixIfNeeded):
(generateBuildSystemFromCMakeProject):
Fix configuration quirks.

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

4 years agoREGRESSION: Web Inspector: Double clicking on an attribute second time doesn't work
commit-queue@webkit.org [Thu, 17 Sep 2015 21:26:33 +0000 (21:26 +0000)]
REGRESSION: Web Inspector: Double clicking on an attribute second time doesn't work
https://bugs.webkit.org/show_bug.cgi?id=149259

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-09-17
Reviewed by Timothy Hatcher.

* UserInterface/Views/DOMTreeElement.js:
Be sure to clear the editing state when committed, even if the value did not change.

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

4 years agoAfter restoring tabs, swipes back to fast loading pages hang for 3 seconds
timothy_horton@apple.com [Thu, 17 Sep 2015 21:23:06 +0000 (21:23 +0000)]
After restoring tabs, swipes back to fast loading pages hang for 3 seconds
https://bugs.webkit.org/show_bug.cgi?id=148764
<rdar://problem/22568860>

Reviewed by Beth Dakin.

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::endSwipeGesture):
Don't wait for the render tree size threshold if we don't have one.

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

4 years agoRemove integral snapping functions from InlineBox class.
zalan@apple.com [Thu, 17 Sep 2015 21:22:05 +0000 (21:22 +0000)]
Remove integral snapping functions from InlineBox class.
https://bugs.webkit.org/show_bug.cgi?id=136419

Reviewed by Simon Fraser.

We should not integral snap inlines during layout time.

Covered by existing tests.

* rendering/InlineBox.h:
(WebCore::InlineBox::pixelSnappedLogicalLeft): Deleted.
(WebCore::InlineBox::pixelSnappedLogicalRight): Deleted.
(WebCore::InlineBox::pixelSnappedLogicalTop): Deleted.
(WebCore::InlineBox::pixelSnappedLogicalBottom): Deleted.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::addBoxShadowVisualOverflow):
(WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):

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

4 years agoSkip a media test that fails when an AppleTV is around.
ap@apple.com [Thu, 17 Sep 2015 21:15:00 +0000 (21:15 +0000)]
Skip a media test that fails when an AppleTV is around.

This will be fixed soon by https://bugs.webkit.org/show_bug.cgi?id=148912

* platform/mac/TestExpectations:

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

4 years ago0.0 should really be 0.0
fpizlo@apple.com [Thu, 17 Sep 2015 20:39:31 +0000 (20:39 +0000)]
0.0 should really be 0.0
https://bugs.webkit.org/show_bug.cgi?id=149283

Reviewed by Mark Lam.

A while ago (http://trac.webkit.org/changeset/180813) we introduced the idea that if the
user wrote a number with a decimal point (like "0.0") then we should treat that number as
a double. That's probably a pretty good idea. But, we ended up doing it inconsistently.
The DFG would indeed treat such a number as a double by consulting the
SourceCodeRepresentation, but the other execution engines would still see Int32:0.

This patch makes it consistent.

This is necessary for property type inference to perform well. Otherwise, a store of a
constant would change type from the baseline engine to the DFG, which would then cause
a storm of property type invalidations and recompilations.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addConstantValue):

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

4 years agostress/exit-from-getter.js.ftl-eager occasionally traps in debug
fpizlo@apple.com [Thu, 17 Sep 2015 20:26:16 +0000 (20:26 +0000)]
stress/exit-from-getter.js.ftl-eager occasionally traps in debug
https://bugs.webkit.org/show_bug.cgi?id=149096

Reviewed by Geoffrey Garen.

JS calls to getters/setters in get/put inline caches need to reset SP after the call, as our
calling convention requires.

* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::generate): Fix the bug.
* ftl/FTLLink.cpp:
(JSC::FTL::link): Adds some verbiage about why the FTL stack offset logic is correct.
* tests/stress/getter-arity.js: Added. Other tests would flaky crash before the patch. This test instacrashes before the patch.

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

4 years ago[WinCairo] Compile error, include file not found.
achristensen@apple.com [Thu, 17 Sep 2015 20:18:10 +0000 (20:18 +0000)]
[WinCairo] Compile error, include file not found.
https://bugs.webkit.org/show_bug.cgi?id=149282

Patch by Per Arne Vollan <peavo@outlook.com> on 2015-09-17
Reviewed by Alex Christensen.

* PlatformWin.cmake:
Copy forwarding headers from new legacy directory, fixing CMake clean builds since r189746.

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

4 years agoREGRESSION (r189287): 2.5% PLT regression
timothy_horton@apple.com [Thu, 17 Sep 2015 19:46:12 +0000 (19:46 +0000)]
REGRESSION (r189287): 2.5% PLT regression
https://bugs.webkit.org/show_bug.cgi?id=149277
<rdar://problem/22657219>

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView _takeViewSnapshot]):
Don't take an extra unused snapshot.

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

4 years agoAdded toggle options for hiding and showing certain platform families on the dashboard.
commit-queue@webkit.org [Thu, 17 Sep 2015 19:42:37 +0000 (19:42 +0000)]
Added toggle options for hiding and showing certain platform families on the dashboard.
https://bugs.webkit.org/show_bug.cgi?id=148403

Patch by Dean Johnson <dean_johnson@apple.com> on 2015-09-17
Reviewed by David Kilzer.

This patch removes "hiddenPlatforms" from use in the code and local storage. We also removed
individual hide/show buttons for platforms because we've added toggle options to hide/show entire
families. Examples of these are "mac", "ios", and "linux". "Show All Platforms" was also removed
in lieu of an "all" button in the toggle menu.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Main.js:
(parsePlatformFamily): Helper function to parse out a platform family.
(initPlatformsByFamily): Initializes platformsByFamily, which organizes platforms on the
page by platformsByFamily[<family>] = <list of platforms belonging to that family>.
(updateToggleButtons): Updates the status of the toggle buttons.
(updateHiddenPlatforms): Changed to work with the new implementation of hiding/showing platforms.
(documentReady): Added creation of toggle buttons.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsMain.js:
(unhiddenQueues): Updated to search by platform family instead of the individual platform name.
(documentReady): Changed hiddenPlatforms => hiddenPlatformFamilies.
(updateHiddenPlatforms): Deleted. After removing the individual hide button code,
this did the exact same thing as the updateHiddenPlatforms in Scripts/Main.js so it was removed.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/QueueView.js:
(QueueView): Updated to use hiddenPlatformFamilies.
(QueueView.prototype._updateHiddenState): Updated to use hiddenPlatformFamilies.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Settings.js:
(Settings.prototype.toggleHiddenPlatformFamily): Renamed function and some variables.
(Settings.prototype.clearHiddenPlatformFamilies): Now uses hiddenPlatformFamilies for events.
(Settings.prototype.toggleHiddenPlatform): Deleted.
(Settings.prototype.clearHiddenPlatforms): Deleted.
(Settings.prototype.toggleShowPlatformFamily): Deleted.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
(div.cellButton, div.accessibilityButton, div.platformFamilyToggleButton):
(div.cellButton.unhide, div.accessibilityButton.unhide, div.platformFamilyToggleButton.unhide):
(.settings-visible div.settingsWrapper.hide, .settings-visible div.settingsWrapper):
(table.queue-grid tr.headers th):
(div.settingsWrapper.hide):
(div.settingsWrapper):
(div.familyToggleWrapper):
(div.platformFamilyToggleButton):
(div.platformFamilyShowToggleButton:not(:last-child)):
(div.familyShown):
(div.accessibilityButton):
(div.cellButton, div.accessibilityButton): Added platformFamilyToggleButton class.
(div.cellButton.unhide, div.accessibilityButton.unhide): Added platformFamilyToggleButton class.
(.settings-visible div.accessibilityButton.hide, .settings-visible div.accessibilityButton.unhide): Added
platformFamilyToggleButton and settingsWrapper class.
(.accessibilityButton): Deleted.

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

4 years agoWeb Inspector: Make Find / Save keyboard shortcuts work better globally
commit-queue@webkit.org [Thu, 17 Sep 2015 19:29:38 +0000 (19:29 +0000)]
Web Inspector: Make Find / Save keyboard shortcuts work better globally
https://bugs.webkit.org/show_bug.cgi?id=149198

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

Previously find/save keyboard shortcuts required the user have the
ContentView in the ContentBrowser focused. That means nothing would
happen if you clicked / focused in the Sidebars. This change considers
the keyboard shortcuts globally, like Copy.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
Add global find and save keyboard shortcuts.

(WebInspector._focusChanged):
It is often useful to have the currentFocusedElement know if it is
in a TextEditor or other CodeMirror editor. When editable the <textarea>
is selected and not updating focused element.

(WebInspector._focusedContentBrowser):
(WebInspector._focusedContentView):
Provide helpers for getting a good approximation of the current focused
or visible content view that users would expect to be interacting with.
Since the focus event may not fire when clicking around to elements
like the <body>. Rather than make it explicitly focusable, check the
document.activeElement, and if it is body aim for the main content
browser instead of the currentFocusedElement which may be stale.
Likewise, if the QuickConsole is focused and the split console is
showing, treat it like the split browser is focused.

(WebInspector._focusedOrVisibleContentBrowser):
(WebInspector._focusedOrVisibleContentView):
If nothing is focused, default to the main content browser.

(WebInspector._find):
Pass on to the ContentView which typically handles Find
by showing its find banner.

(WebInspector._save):
(WebInspector._saveAs):
Check and save the current ContentView if supported.

* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype.get supportsSearch):
(WebInspector.LogContentView.prototype.handleFindEvent):
Add custom find handling for LogContentView from the routed through the
BrowserController instead of special event handlers in the controller.

(WebInspector.LogContentView.prototype.get supportsSave):
(WebInspector.LogContentView.prototype.save): Deleted.
(WebInspector.LogContentView.prototype.saveAs): Deleted.
* UserInterface/Controllers/JavaScriptLogViewController.js:
(WebInspector.JavaScriptLogViewController): Deleted.
(WebInspector.JavaScriptLogViewController.prototype._handleFindShortcut): Deleted.
(WebInspector.JavaScriptLogViewController.prototype._save): Deleted.
(WebInspector.JavaScriptLogViewController.prototype._saveAs): Deleted.
Special save handling is no longer needed in the log view controller.

* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser.prototype.handleFindEvent):
(WebInspector.ContentBrowser): Deleted.
(WebInspector.ContentBrowser.prototype._save): Deleted.
(WebInspector.ContentBrowser.prototype._saveAs): Deleted.
(WebInspector.ContentBrowser.prototype._showFindBanner): Deleted.
Save functionality moved globally, find functionality moved to a
public method called like copy event handling.

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

4 years agoWeb Inspector: Inactive window may cause many layers to be created due to Dashboard...
commit-queue@webkit.org [Thu, 17 Sep 2015 19:28:33 +0000 (19:28 +0000)]
Web Inspector: Inactive window may cause many layers to be created due to Dashboard opacity
https://bugs.webkit.org/show_bug.cgi?id=149274

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

The dashboard container gets an opacity when the window is inactive. Combined
with the animating debugger continue button this caused a cascade of slightly
overlapping content causing a cascade of a lot of small layers. The simple
approach taken here is to stop the slight pulse animation when the window
is inactive.

* UserInterface/Views/DebuggerDashboardView.css:
(body.window-inactive .dashboard.debugger .navigation-bar .item.button > .glyph):

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

4 years agoAdd a test ensuring that scrolling in the middle of a page can't start a swipe gesture
timothy_horton@apple.com [Thu, 17 Sep 2015 19:22:01 +0000 (19:22 +0000)]
Add a test ensuring that scrolling in the middle of a page can't start a swipe gesture
https://bugs.webkit.org/show_bug.cgi?id=148904

Reviewed by Myles Maxfield.

* swipe/main-frame-pinning-requirement.html: Added.

* WebKitTestRunner/TestController.cpp:
(WTR::parseBooleanTestHeaderValue):
(WTR::updateViewOptionsFromTestHeader):
Check for the key "useThreadedScrolling".
Add some code to check for "true" and "false" for boolean options.

(WTR::TestController::viewOptionsForTest):
Apply the test's overrides last, even after the platform's.

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

4 years agoDelete some dead code
timothy_horton@apple.com [Thu, 17 Sep 2015 19:00:13 +0000 (19:00 +0000)]
Delete some dead code
https://bugs.webkit.org/show_bug.cgi?id=149255

Reviewed by Dan Bernstein.

No new tests, just cleanup.

* platform/RuntimeApplicationChecksIOS.h:
* platform/RuntimeApplicationChecksIOS.mm:
(WebCore::applicationIsEpicurious): Deleted.
(WebCore::applicationIsMASH): Deleted.
Nothing uses these application checks anymore.

* platform/ios/SoundIOS.mm:
(WebCore::systemBeep):
What a beep should be on iOS, I don't know.
What it should not be is a NSLog.

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

4 years agoInterpreter::unwind() shouldn't be responsible for filtering out uncatchable exceptions
saambarati1@gmail.com [Thu, 17 Sep 2015 18:30:04 +0000 (18:30 +0000)]
Interpreter::unwind() shouldn't be responsible for filtering out uncatchable exceptions
https://bugs.webkit.org/show_bug.cgi?id=149228

Reviewed by Mark Lam.

Source/JavaScriptCore:

op_catch is now responsible for filtering exceptions that
aren't catchable. When op_catch encounters an uncatchable
exception, it will call back into genericUnwind and throw
the exception further down the call stack. This is necessary
in a later patch that will implement exception handling
in the DFG, and part of that patch includes exception
handling that doesn't go through genericUnwind. The DFG try/catch
patch will not go through genericUnwind when it knows that
an exception check after a callOperation will be caught inside the
machine frame or any inlined frames. This patch enables that
patch by destroying the notion that all exception handling must
filter through genericUnwind.

This patch maintains compatibility with the debugger and
profiler by ensuring we notify the debugger when an
exception is thrown inside VM::throwException and not
in genericUnwind. It also notifies the profiler that we've
potentially changed call frames inside op_catch.

* debugger/Debugger.cpp:
(JSC::Debugger::pauseIfNeeded):
* interpreter/Interpreter.cpp:
(JSC::unwindCallFrame):
(JSC::getStackFrameCodeType):
(JSC::UnwindFunctor::operator()):
(JSC::Interpreter::unwind):
(JSC::Interpreter::notifyDebuggerOfExceptionToBeThrown):
(JSC::checkedReturn):
* interpreter/Interpreter.h:
(JSC::SuspendExceptionScope::SuspendExceptionScope):
(JSC::SuspendExceptionScope::~SuspendExceptionScope):
(JSC::Interpreter::sampler):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
(JSC::JIT::callOperationNoExceptionCheck):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_catch):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_catch):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::llint_throw_stack_overflow_error):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/ExceptionHelpers.cpp:
(JSC::isTerminatedExecutionException):
* runtime/VM.cpp:
(JSC::VM::throwException):
* runtime/VM.h:
(JSC::VM::targetMachinePCForThrowOffset):
(JSC::VM::restorePreviousException):
(JSC::VM::clearException):
(JSC::VM::clearLastException):
(JSC::VM::exception):
(JSC::VM::addressOfException):
(JSC::VM::setException):

Source/WebCore:

No new tests, already covered by current tests. This is not an observable behavior change.

* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):

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

4 years ago[Win][HighDPI] Windowed plugins have incorrect placement.
peavo@outlook.com [Thu, 17 Sep 2015 18:22:56 +0000 (18:22 +0000)]
[Win][HighDPI] Windowed plugins have incorrect placement.
https://bugs.webkit.org/show_bug.cgi?id=149090

Reviewed by Alex Christensen.

We have to scale plugin dimensions with device scale factor.

* Plugins/PluginView.cpp:
(WebCore::PluginView::windowClipRect):
* Plugins/PluginView.h:
* Plugins/PluginViewWin.cpp:
(WebCore::PluginView::updatePluginWidget):
(WebCore::PluginView::setNPWindowRect):
(WebCore::PluginView::snapshot):
(WebCore::PluginView::deviceScaleFactor):

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

4 years agoCalling a float function on x86 in WebAssembly incorrectly returns a double
commit-queue@webkit.org [Thu, 17 Sep 2015 17:40:07 +0000 (17:40 +0000)]
Calling a float function on x86 in WebAssembly incorrectly returns a double
https://bugs.webkit.org/show_bug.cgi?id=149254

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-09-17
Reviewed by Michael Saboff.

In WebAssembly on x86 (32-bit), when we call a function that returns a
float or a double, we use the FSTP instruction to read the return value
from the FPU register stack. The FSTP instruction converts the value to
single-precision or double-precision floating-point format, depending on
the destination operand. Currently, we always use double as the
destination, which is wrong. This patch uses the correct return type.
This should fix the test errors in tests/stress/wasm-arithmetic-float32.js

* assembler/X86Assembler.h:
(JSC::X86Assembler::fstps):
* wasm/WASMFunctionCompiler.h:
(JSC::WASMFunctionCompiler::appendCallSetResult):
(JSC::WASMFunctionCompiler::callOperation):

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

4 years agoSave and restore callee save registers in WebAssembly
commit-queue@webkit.org [Thu, 17 Sep 2015 17:38:08 +0000 (17:38 +0000)]
Save and restore callee save registers in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=149247

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-09-17
Reviewed by Michael Saboff.

Save callee save registers when entering WebAssembly functions
and restore them when returning.

* jit/RegisterSet.cpp:
(JSC::RegisterSet::webAssemblyCalleeSaveRegisters):
* jit/RegisterSet.h:
* wasm/WASMFunctionCompiler.h:
(JSC::WASMFunctionCompiler::startFunction):
(JSC::WASMFunctionCompiler::endFunction):
(JSC::WASMFunctionCompiler::buildReturn):
(JSC::WASMFunctionCompiler::localAddress):
(JSC::WASMFunctionCompiler::temporaryAddress):
(JSC::WASMFunctionCompiler::boxArgumentsAndAdjustStackPointer):
(JSC::WASMFunctionCompiler::callAndUnboxResult):

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

4 years agocolumn-rule-style: outset/inset doesn't work
zalan@apple.com [Thu, 17 Sep 2015 17:03:27 +0000 (17:03 +0000)]
column-rule-style: outset/inset doesn't work
https://bugs.webkit.org/show_bug.cgi?id=148815
Source/WebCore:

<rdar://problem/22582644>

Reviewed by David Hyatt.

https://drafts.csswg.org/css-multicol-1/#crs
The <‘border-style’> values are interpreted as in the collapsing border model.

Unskipped 4 multicolumn tests,

* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::paintColumnRules):
* rendering/RenderTableCell.cpp:
(WebCore::collapsedBorderStyle): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::collapsedBorderStyle):

LayoutTests:

Reviewed by David Hyatt.

https://drafts.csswg.org/css-multicol-1/#crs
The <‘border-style’> values are interpreted as in the collapsing border model.

* TestExpectations:

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

4 years agoMake Windows tests green.
achristensen@apple.com [Thu, 17 Sep 2015 16:51:31 +0000 (16:51 +0000)]
Make Windows tests green.

* platform/win/TestExpectations:
Skip new IndexedDB test on Windows after r189879 because IndexedDB is not enabled on Windows yet.
Also skip new accessibility test after r189862 because stringValue is not implemented.

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

4 years agoRange.deleteContents cannot delete DocType
cdumez@apple.com [Thu, 17 Sep 2015 15:51:08 +0000 (15:51 +0000)]
Range.deleteContents cannot delete DocType
https://bugs.webkit.org/show_bug.cgi?id=148773
<rdar://problem/22571280>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C DOM test now that more checks are passing.

* web-platform-tests/dom/ranges/Range-deleteContents-expected.txt:

Source/WebCore:

Range.deleteContents() was not able to delete a DocumentType Node, and
was throwing a HIERARCHY_REQUEST_ERR. The DOM specification does not
say we should throw in such case:
https://dom.spec.whatwg.org/#dom-range-deletecontents

However, Range.extractContents() should still throw an exception
if any of the contained children in a DocumentType Node:
https://dom.spec.whatwg.org/#concept-range-extract (Step 12)

No new tests, already covered by existing test.

* dom/Range.cpp:
(WebCore::Range::deleteContents):
(WebCore::Range::extractContents):
(WebCore::Range::checkDeleteExtract):
* dom/Range.h:

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

4 years ago[Mac MediaStream] Cleanup capture source classes
eric.carlson@apple.com [Thu, 17 Sep 2015 15:33:29 +0000 (15:33 +0000)]
[Mac MediaStream] Cleanup capture source classes
https://bugs.webkit.org/show_bug.cgi?id=149233

Reviewed by Jer Noble.

* platform/cf/CoreMediaSoftLink.cpp: Soft-link CMAudioFormatDescriptionGetStreamBasicDescription,
  CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer, and CMSampleBufferGetNumSamples.
* platform/cf/CoreMediaSoftLink.h:

* platform/mediastream/mac/AVAudioCaptureSource.h:
(WebCore::AVAudioCaptureSource::Observer::~Observer):
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::AVAudioCaptureSource): Initialize m_inputDescription.
(WebCore::AVAudioCaptureSource::capabilities): 0 -> nullptr.
(WebCore::AVAudioCaptureSource::addObserver): New, add an observer and tell it to prepare.
(WebCore::AVAudioCaptureSource::removeObserver): New.
(WebCore::operator==): Compare AudioStreamBasicDescription.
(WebCore::operator!=):
(WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Call
  observer->prepare when passed a new stream description, call observer->process.

* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::refreshCaptureDeviceList): Set m_groupID and m_localizedName.
(WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Invalid constraint names should
  be ignored, so return true when passed one.
(WebCore::AVCaptureDeviceManager::getSourcesInfo): This just didn't work, fix it.
(WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optional constraints are
  optional so they don't need to be validated.
(WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): m_audioSource -> m_audioAVMediaCaptureSource,
  m_videoSource -> m_videoAVMediaCaptureSource.
(WebCore::AVCaptureDeviceManager::sourceWithUID): Ditto.

* platform/mediastream/mac/AVMediaCaptureSource.h:
(WebCore::AVMediaCaptureSource::session):
(WebCore::AVMediaCaptureSource::device):
(WebCore::AVMediaCaptureSource::currentStates):
(WebCore::AVMediaCaptureSource::constraints):
(WebCore::AVMediaCaptureSource::statesDidChanged):
(WebCore::AVMediaCaptureSource::createWeakPtr):
(WebCore::AVMediaCaptureSource::buffer): Deleted.
(WebCore::AVMediaCaptureSource::setBuffer): Deleted.
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Initilize m_weakPtrFactory.
(WebCore::AVMediaCaptureSource::scheduleDeferredTask): New, call a function asynchronously on
  the main thread.
(-[WebCoreAVMediaCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]): Don't
  dispatch calls to the main thread, let the derived classes do that if necessary.

* platform/mediastream/mac/AVVideoCaptureSource.h:
(WebCore::AVVideoCaptureSource::width):
(WebCore::AVVideoCaptureSource::height):
(WebCore::AVVideoCaptureSource::previewLayer):
(WebCore::AVVideoCaptureSource::currentFrameSampleBuffer):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setFrameRateConstraint): Remove unwanted logging.
(WebCore::AVVideoCaptureSource::setupCaptureSession): Configure the AVCaptureVideoDataOutput so
  it delivers 32-bit BGRA samples.
(WebCore::AVVideoCaptureSource::calculateFramerate): Return bool to signal if the frame rate
  changed.
(WebCore::AVVideoCaptureSource::processNewFrame): New. Process sample buffer, invalidate cached
  image, signal when characteristics change.
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Schedule
  call to processNewFrame on the main thread so we do all video processing on main thread.
(WebCore::AVVideoCaptureSource::currentFrameImage): Create and return a CVImageBuffer of the
  current video frame.
(WebCore::AVVideoCaptureSource::paintCurrentFrameInContext): Draw the current frame to a context.

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

4 years ago[GTK] Crash in WebKit::BackingStore::createBackend running under Wayland
mcatanzaro@igalia.com [Thu, 17 Sep 2015 13:00:48 +0000 (13:00 +0000)]
[GTK] Crash in WebKit::BackingStore::createBackend running under Wayland
https://bugs.webkit.org/show_bug.cgi?id=147453

Reviewed by Carlos Garcia Campos.

Except when running on X11, this function always crashes if called before the web view is
realized, as gdk_window_create_similar_surface will return null in that case. Avoid this by
simply realizing the widget before calling that.

Thanks to Carlos Garnacho for some debugging help.

* UIProcess/cairo/BackingStoreCairo.cpp:
(WebKit::BackingStore::createBackend):

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

4 years ago[CSS Grid Layout] Using automatic (instead of min-content) minimums for 'auto' tracks
svillar@igalia.com [Thu, 17 Sep 2015 12:13:30 +0000 (12:13 +0000)]
[CSS Grid Layout]  Using automatic (instead of min-content) minimums for 'auto' tracks
https://bugs.webkit.org/show_bug.cgi?id=142329

Reviewed by Darin Adler.

Based on Blink's r198697 by <svillar@igalia.com> and r200478 by <jfernandez@igalia.com>

Source/WebCore:

More precisely (syntax-wise), this would allow 'auto' to be used within the
minmax() function (it's currently forbidden) and have the 'auto' keyword map
to minmax(auto, auto) instead of minmax(min-content, max-content).
- As a minimum, 'auto' would mean "use the specified minimum size, or if
that is auto, treat as 0 or min-content per Flexbox rules".
- As a maximum, 'auto' would mean "use the max-content size".

Regarding the implementation, a new phase is added to the track sizing
algorithm called ResolveIntrinsicMinimums (the former ResolveIntrinsicMinimums
is now called ResolveContentBasedMinimums which does not include 'auto'
resolution) which will be run before any other. This phase uses the minimum
size of grid items (as specified by min-width/height).

Tests: fast/css-grid-layout/grid-automatic-minimum-for-auto-columns.html
       fast/css-grid-layout/grid-automatic-minimum-for-auto-rows.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridBreadth):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeUsedBreadthOfMinLength):
(WebCore::RenderGrid::computeUsedBreadthOfMaxLength):
(WebCore::RenderGrid::minSizeForChild):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
(WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase):
(WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase):
(WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase):
(WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase):
(WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase):
(WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
* rendering/RenderGrid.h:
* rendering/style/GridTrackSize.h:
(WebCore::GridTrackSize::minTrackBreadth):
(WebCore::GridTrackSize::maxTrackBreadth):
(WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
(WebCore::GridTrackSize::hasIntrinsicMinTrackBreadth):
(WebCore::GridTrackSize::hasAutoMinTrackBreadth):
(WebCore::GridTrackSize::hasAutoMaxTrackBreadth):
(WebCore::GridTrackSize::hasMaxContentOrAutoMaxTrackBreadth):
(WebCore::GridTrackSize::hasAutoOrMinContentMinTrackBreadthAndIntrinsicMaxTrackBreadth):
(WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth): Deleted.

LayoutTests:

New tests to verify that auto is a valid keyword inside
minmax. Updated the expectations of existing tests to
reflect the new status of auto.

* fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt:
* fast/css-grid-layout/grid-auto-columns-rows-get-set.html:
* fast/css-grid-layout/grid-automatic-minimum-for-auto-columns-expected.txt: Added.
* fast/css-grid-layout/grid-automatic-minimum-for-auto-columns.html: Added.
* fast/css-grid-layout/grid-automatic-minimum-for-auto-rows-expected.txt: Added.
* fast/css-grid-layout/grid-automatic-minimum-for-auto-rows.html: Added.
* fast/css-grid-layout/grid-columns-rows-get-set-expected.txt:
* fast/css-grid-layout/grid-columns-rows-get-set-multiple-expected.txt:
* fast/css-grid-layout/grid-columns-rows-get-set-multiple.html:
* fast/css-grid-layout/grid-columns-rows-get-set.html:
* fast/css-grid-layout/non-grid-columns-rows-get-set-expected.txt:
* fast/css-grid-layout/non-grid-columns-rows-get-set-multiple-expected.txt:
* fast/css-grid-layout/non-grid-columns-rows-get-set-multiple.html:
* fast/css-grid-layout/non-grid-columns-rows-get-set.html:
* fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js:
* fast/css-grid-layout/resources/grid-columns-rows-get-set.js:
* fast/css-grid-layout/resources/non-grid-columns-rows-get-set-multiple.js:
* fast/css-grid-layout/resources/non-grid-columns-rows-get-set.js:

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

4 years ago[CSS Grid Layout] Relayout whenever Box Alignment properties change
jfernandez@igalia.com [Thu, 17 Sep 2015 09:13:35 +0000 (09:13 +0000)]
[CSS Grid Layout] Relayout whenever Box Alignment properties change
https://bugs.webkit.org/show_bug.cgi?id=148070

Reviewed by Darin Adler.

Source/WebCore:

We were Reattaching the styles to the RenderTree whenever Content Alignment
properties (align-items and justify-items) changed their values, since the
Self Alignment properties depend on such values to resolve 'auto' values
during layout.

This patch removes such restriction, since we resolve the auto values
whenever we access the alignment properties. The only thing we need to
do is to mark a grid item for layout whenever the Default Alignment
properties change from/to stretch, since it implies a resize of the grid
items using 'auto' values for the Self Alignment properties.

Tests: fast/css-grid-layout/relayout-align-items-changed.html
       fast/css-grid-layout/relayout-align-self-changed.html
       fast/css-grid-layout/relayout-justify-items-changed.html
       fast/css-grid-layout/relayout-justify-self-changed.html
       fast/repaint/align-items-change.html
       fast/repaint/align-items-overflow-change.html
       fast/repaint/align-self-change.html
       fast/repaint/align-self-overflow-change.html
       fast/repaint/justify-items-change.html
       fast/repaint/justify-items-legacy-change.html
       fast/repaint/justify-items-overflow-change.html
       fast/repaint/justify-self-change.html
       fast/repaint/justify-self-overflow-change.html

* rendering/RenderGrid.cpp:
(WebCore::defaultAlignmentIsStretch):
(WebCore::RenderGrid::styleDidChange):
* rendering/RenderGrid.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::resolveAlignmentOverflow):
(WebCore::RenderStyle::changeRequiresLayout):
* style/StyleResolveTree.cpp:
(WebCore::Style::determineChange): Deleted.

LayoutTests:

Tests to verify we force a layout of grid container or grid items, as appropriated,
whenever Box Alignment properties change their value.

This patch also adds some repaint tests, so we can ensure we generate the correct
repaint rects as well.

* fast/css-grid-layout/relayout-align-items-changed-expected.txt: Added.
* fast/css-grid-layout/relayout-align-items-changed.html: Added.
* fast/css-grid-layout/relayout-align-self-changed-expected.txt: Added.
* fast/css-grid-layout/relayout-align-self-changed.html: Added.
* fast/css-grid-layout/relayout-justify-items-changed-expected.txt: Added.
* fast/css-grid-layout/relayout-justify-items-changed.html: Added.
* fast/css-grid-layout/relayout-justify-self-changed-expected.txt: Added.
* fast/css-grid-layout/relayout-justify-self-changed.html: Added.
* fast/repaint/align-items-change-expected.txt: Added.
* fast/repaint/align-items-change.html: Added.
* fast/repaint/align-items-overflow-change-expected.txt: Added.
* fast/repaint/align-items-overflow-change.html: Added.
* fast/repaint/align-self-change-expected.txt: Added.
* fast/repaint/align-self-change.html: Added.
* fast/repaint/align-self-overflow-change-expected.txt: Added.
* fast/repaint/align-self-overflow-change.html: Added.
* fast/repaint/justify-items-change-expected.txt: Added.
* fast/repaint/justify-items-change.html: Added.
* fast/repaint/justify-items-legacy-change-expected.txt: Added.
* fast/repaint/justify-items-legacy-change.html: Added.
* fast/repaint/justify-items-overflow-change-expected.txt: Added.
* fast/repaint/justify-items-overflow-change.html: Added.
* fast/repaint/justify-self-change-expected.txt: Added.
* fast/repaint/justify-self-change.html: Added.
* fast/repaint/justify-self-overflow-change-expected.txt: Added.
* fast/repaint/justify-self-overflow-change.html: Added.

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

4 years agoREGRESSION(r188427): Web Inspector: Extra whitespace left behind in styles sidebar...
commit-queue@webkit.org [Thu, 17 Sep 2015 07:28:52 +0000 (07:28 +0000)]
REGRESSION(r188427): Web Inspector: Extra whitespace left behind in styles sidebar after clicking in and out
https://bugs.webkit.org/show_bug.cgi?id=149197

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

In r188427, logic was added to preserve the leading whitespace of styles in a CSS file.
An unfortunate side effect of this was that extra newlines in between CSS properties
were treated as valid and left where they were.  This is undesired behaviour and often
clutters the styles sidebar.  These changes remove the extra newlines.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype._formattedContent):

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

4 years agoprinting does not use minimum page zoom factor
carlosgc@webkit.org [Thu, 17 Sep 2015 07:24:50 +0000 (07:24 +0000)]
printing does not use minimum page zoom factor
https://bugs.webkit.org/show_bug.cgi?id=108507

Reviewed by Darin Adler.

Source/WebCore:

* page/PrintContext.cpp:
(WebCore::PrintContext::beginAndComputePageRectsWithPageSize):
Helper function to share common code from numberOfPages() and
spoolAllPagesWithBoundaries().
(WebCore::PrintContext::numberOfPages): Use beginAndComputePageRectsWithPageSize().
(WebCore::PrintContext::spoolAllPagesWithBoundaries): Use
beginAndComputePageRectsWithPageSize() and don't flip the Y axis
for non Cocoa platforms.
* page/PrintContext.h:

Source/WebKit/mac:

Pass a the frame as a reference instead of using pointers.

* Misc/WebCoreStatistics.mm:
(-[WebFrame numberOfPagesWithPageWidth:pageHeight:]):
(-[WebFrame printToCGContext:pageWidth:pageHeight:]):

Source/WebKit2:

Add kWKSnapshotOptionsPrinting flag to indicate the snapshot
should be generated in printing mode.

* Shared/API/c/WKImage.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toSnapshotOptions):
* Shared/ImageOptions.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::numberOfPages): Pass the frame as a
reference instead of a pointer.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scaledSnapshotWithOptions): In case of printing,
calculate the bitmap height based on the number of pages.
(WebKit::WebPage::snapshotAtSize): In case of printing, use
PrintContext::spoolAllPagesWithBoundaries() and return.

Tools:

WebKitTestRunner always takes the snapshots from the UI process
(expect for IOS), so in the case of printing, the layout in the
web view is not the expected one. When printing, we need to take
the snapshot in the web process and ensure it's rendered with a
PrintContext.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::dump): When dumping pixels, pass
kWKSnapshotOptionsPrinting option to
WKBundlePageCreateSnapshotWithOptions() when printing. When not
printing, don't even create the snapshot, since it will be ignored
by the UI process that always creates its own from the WebView (expect for IOS platform)
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::dumpResults): Use always the snapshot image
received from the web process if any when comparing pixel
results. Now we only receive a snapshot from the web process in
case of printing, or when platform is IOS. Otherwhise, generate
the snapshot from the WebView as usual.
* WebKitTestRunner/TestInvocation.h: Add SnapshotResultType enum
parameter to dumpPixelsAndCompareWithExpected, since the snapshot
is created by the caller now, but the CG implementation needs to
know if it's a Web or UI process snapshot.
* WebKitTestRunner/cairo/TestInvocationCairo.cpp:
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Create a
cairo surface for the given image.
* WebKitTestRunner/cg/TestInvocationCG.cpp:
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Create a
CGContext for the given image.

LayoutTests:

Unskip printing reftests that should pass now.

* platform/gtk/TestExpectations:
* platform/mac-wk2/TestExpectations:

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

4 years agoWeb Inspector: Reduce Annotation Update Frequency
commit-queue@webkit.org [Thu, 17 Sep 2015 06:51:50 +0000 (06:51 +0000)]
Web Inspector: Reduce Annotation Update Frequency
https://bugs.webkit.org/show_bug.cgi?id=149250

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

* UserInterface/Controllers/BasicBlockAnnotator.js:
(WebInspector.BasicBlockAnnotator.prototype._annotateBasicBlockExecutionRanges):
* UserInterface/Controllers/TypeTokenAnnotator.js:
(WebInspector.BasicBlockAnnotator.prototype.insertAnnotations):
Set a lower bound of 500ms on update frequency for both annotators.

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

4 years agoremoveShadow shouldn't call ChildNodeRemovalNotifier with the shadow host as the...
rniwa@webkit.org [Thu, 17 Sep 2015 06:12:06 +0000 (06:12 +0000)]
removeShadow shouldn't call ChildNodeRemovalNotifier with the shadow host as the removal point
https://bugs.webkit.org/show_bug.cgi?id=149244

Reviewed by Antti Koivisto.

Since a shadow host is in a different tree than nodes in its shadow tree, it's incorrect to call
removedFrom with the shadow host as the removal point. This causes HTMLSlotElement::removedFrom
which will be added in the bug 149241 to call methods on a wrong ShadowRoot.

We still keep the ad-hoc behavior of using the shadow host as the insertion/removal point when
calling insertedInto and removedFrom on the shadow root itself to update the InDocument node flag.
We may want to re-visit this design in the future.

No new tests since I couldn't quite create a reduction. However, tests I'm adding in the bug 149241
will crash without this change.

I separated this patch from the bug 149241 to isolate the high-risk code change here.

* dom/Element.cpp:
(WebCore::Element::addShadowRoot): Call insertedInto on ShadowRoot, and then call it on all its
children separately with the insertion point set to the shadow root since insertedInto relies on
insertion point's inDocument flag to be true when the shadow host is in the document.
(WebCore::Element::removeShadowRoot): Ditto in the reverse order.

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

4 years agoRemove all uses of PassRefPtr in WebCore/inspector
gyuyoung.kim@webkit.org [Thu, 17 Sep 2015 05:40:02 +0000 (05:40 +0000)]
Remove all uses of PassRefPtr in WebCore/inspector
https://bugs.webkit.org/show_bug.cgi?id=149156

Reviewed by Darin Adler.

* inspector/DOMEditor.cpp:
(WebCore::DOMEditor::InsertBeforeAction::InsertBeforeAction):
(WebCore::DOMEditor::ReplaceChildNodeAction::ReplaceChildNodeAction):
(WebCore::DOMEditor::insertBefore):
(WebCore::DOMEditor::replaceChild):
* inspector/DOMEditor.h:
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::removeChildAndMoveToNew):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightSelector):
* inspector/InspectorDatabaseAgent.cpp:
(WebCore::InspectorDatabaseAgent::didOpenDatabase):
* inspector/InspectorDatabaseAgent.h:
* inspector/InspectorDatabaseInstrumentation.h:
* inspector/InspectorDatabaseResource.h:
(WebCore::InspectorDatabaseResource::setDatabase):
* inspector/InspectorFrontendHost.cpp:
(WebCore::FrontendMenuProvider::create):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
* inspector/InspectorLayerTreeAgent.h:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::highlightNodeList):
* inspector/InspectorOverlay.h:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::sharedBufferContent):
* inspector/InspectorPageAgent.h:
* inspector/InspectorResourceAgent.cpp:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::startProfiling):
(WebCore::stopProfiling):
(WebCore::InspectorTimelineAgent::stopFromConsole):
* inspector/InspectorTimelineAgent.h:
* inspector/InspectorWorkerResource.h:
(WebCore::InspectorWorkerResource::create):
* inspector/InstrumentingAgents.h:
* inspector/NetworkResourcesData.cpp:
(WebCore::createOtherResourceTextDecoder):
(WebCore::NetworkResourcesData::addResourceSharedBuffer):
* inspector/NetworkResourcesData.h:
* inspector/TimelineRecordFactory.cpp:
(WebCore::createQuad):
* inspector/WebInjectedScriptHost.h:
* inspector/WebInjectedScriptManager.cpp:
(WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
* inspector/WebInjectedScriptManager.h:

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

4 years agoAdd failing expectation to css3/font-feature-settings-rendering-2.html on Mavericks.
rniwa@webkit.org [Thu, 17 Sep 2015 05:22:41 +0000 (05:22 +0000)]
Add failing expectation to css3/font-feature-settings-rendering-2.html on Mavericks.
The test failure is tracked by webkit.org/b/149246.

Also rebaseline js/dom/global-constructors-attributes-idb.html on WK1 after r189879.

* js/dom/global-constructors-attributes-idb-expected.txt: Replaced with LayoutTests/platform/wk2/js/dom/global-constructors-attributes-idb-expected.txt.
* platform/mac/TestExpectations:
* platform/wk2/js/dom/global-constructors-attributes-idb-expected.txt: Removed.

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

4 years agoHave window.indexedDB.open return an IDBOpenDBRequest.
beidson@apple.com [Thu, 17 Sep 2015 04:27:46 +0000 (04:27 +0000)]
Have window.indexedDB.open return an IDBOpenDBRequest.
https://bugs.webkit.org/show_bug.cgi?id=149234

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/opendatabase-request.html

* Modules/indexeddb/client/IDBFactoryImpl.cpp:
(WebCore::IDBClient::IDBFactory::open):
(WebCore::IDBClient::IDBFactory::openInternal):
* Modules/indexeddb/client/IDBFactoryImpl.h:

LayoutTests:

* storage/indexeddb/modern/opendatabase-request-expected.txt: Added.
* storage/indexeddb/modern/opendatabase-request.html: Added.

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

4 years agoTurn ChildNodeInsertion/RemovalNotifier classes into functions
antti@apple.com [Thu, 17 Sep 2015 03:27:11 +0000 (03:27 +0000)]
Turn ChildNodeInsertion/RemovalNotifier classes into functions
https://bugs.webkit.org/show_bug.cgi?id=149236

Reviewed by Ryosuke Niwa.

Less architecture, more readability.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::notifyChildInserted):
(WebCore::ContainerNode::notifyChildRemoved):
(WebCore::ContainerNode::removeChildren):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyDescendantInsertedIntoDocument):
(WebCore::notifyDescendantInsertedIntoTree):
(WebCore::notifyNodeInsertedIntoDocument):
(WebCore::notifyNodeInsertedIntoTree):
(WebCore::notifyChildNodeInserted):
(WebCore::notifyNodeRemovedFromDocument):
(WebCore::notifyNodeRemovedFromTree):
(WebCore::notifyChildNodeRemoved):
(WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument): Deleted.
(WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree): Deleted.
(WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument): Deleted.
(WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree): Deleted.
* dom/ContainerNodeAlgorithms.h:
(WebCore::ChildNodeInsertionNotifier::ChildNodeInsertionNotifier): Deleted.
(WebCore::ChildNodeRemovalNotifier::ChildNodeRemovalNotifier): Deleted.
(WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument): Deleted.
(WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree): Deleted.
(WebCore::ChildNodeInsertionNotifier::notify): Deleted.
(WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument): Deleted.
(WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromTree): Deleted.
(WebCore::ChildNodeRemovalNotifier::notify): Deleted.
* dom/Element.cpp:
(WebCore::Element::addShadowRoot):
(WebCore::Element::removeShadowRoot):
(WebCore::Element::createShadowRoot):

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

4 years agoRemove all uses of PassRefPtr in WebCore/bindings
gyuyoung.kim@webkit.org [Thu, 17 Sep 2015 03:00:30 +0000 (03:00 +0000)]
Remove all uses of PassRefPtr in WebCore/bindings
https://bugs.webkit.org/show_bug.cgi?id=149207

Reviewed by Darin Adler.

If RefPtr<>&& argument is passed to new variable or other function, we use copyRef() or WTF::move().
copyRef() should be used when the argument continues to be used in following code. If it is final use
inside function, we have to use WTF::move().

* bridge/NP_jsobject.cpp:
* bridge/NP_jsobject.h:
* bridge/c/CRuntimeObject.cpp:
(JSC::Bindings::CRuntimeObject::CRuntimeObject):
* bridge/c/CRuntimeObject.h:
(JSC::Bindings::CRuntimeObject::create):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CInstance::CInstance):
* bridge/c/c_instance.h:
(JSC::Bindings::CInstance::create):
* bridge/jsc/BridgeJSC.cpp:
(JSC::Bindings::Array::Array):
(JSC::Bindings::Instance::Instance):
* bridge/jsc/BridgeJSC.h:
* bridge/objc/ObjCRuntimeObject.h:
(JSC::Bindings::ObjCRuntimeObject::create):
* bridge/objc/ObjCRuntimeObject.mm:
(JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
* bridge/objc/WebScriptObjectProtocol.h:
* bridge/objc/objc_instance.h:
* bridge/objc/objc_instance.mm:
(ObjcInstance::ObjcInstance):
(ObjcInstance::create):
* bridge/objc/objc_runtime.h:
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcArray::ObjcArray):
* bridge/runtime_object.cpp:
(JSC::Bindings::RuntimeObject::RuntimeObject):
* bridge/runtime_object.h:
* bridge/runtime_root.cpp:
(JSC::Bindings::RootObject::create):
* bridge/runtime_root.h:

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

4 years agoBuild fix for WebAssembly after r189884
ssakshuwong@apple.com [Thu, 17 Sep 2015 01:35:33 +0000 (01:35 +0000)]
Build fix for WebAssembly after r189884

* jit/JITOperations.cpp

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

4 years agoLayoutTests/imported/w3c:
cdumez@apple.com [Thu, 17 Sep 2015 01:24:58 +0000 (01:24 +0000)]
LayoutTests/imported/w3c:
Element's attribute NS API should treat defined undefined namespace as null
https://bugs.webkit.org/show_bug.cgi?id=149238
<rdar://problem/22562204>

Reviewed by Ryosuke Niwa.

Rebaseline W3C DOM test that one more check is passing.

* web-platform-tests/dom/nodes/attributes-expected.txt:

Source/WebCore:
Element's attribute NS API should defined treat undefined namespace as null
https://bugs.webkit.org/show_bug.cgi?id=149238
<rdar://problem/22562204>

Reviewed by Ryosuke Niwa.

Element's attribute NS API should treat defined undefined namespace as null
instead of converting it to the "undefined" String. This is because the
namespace parameter is a nullable String as per the DOM spec:
- https://dom.spec.whatwg.org/#element

The attribute is nullable and WebIDL says undefined should be converted
to null for nullable parameters:
- https://heycam.github.io/webidl/#es-nullable-type (step 3)

Firefox follows the specification.

No new tests, already covered by existing test.

* dom/Element.idl:

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

4 years agoImplement indirect calls in WebAssembly
commit-queue@webkit.org [Thu, 17 Sep 2015 01:23:20 +0000 (01:23 +0000)]
Implement indirect calls in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=149100

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-09-16
Reviewed by Geoffrey Garen.

This patch implement indirect calls for WebAssembly files generated by
pack-asmjs <https://github.com/WebAssembly/polyfill-prototype-1>.
pack-asmjs uses the same indirect call model as asm.js. In asm.js, an
indirect call looks like this:
    t[i & n](...)
where t is a variable referring to an array of functions with the same
signature, i is an integer expression, n is an integer that is equal to
(t.length - 1), and t.length is a power of two. pack-asmjs does not
use the '&' operator nor n in the WebAssembly output, but the semantics
is still the same as asm.js.

* tests/stress/wasm-calls.js:
* tests/stress/wasm/calls.wasm:
* wasm/WASMFormat.h:
* wasm/WASMFunctionCompiler.h:
(JSC::WASMFunctionCompiler::buildCallIndirect):
* wasm/WASMFunctionParser.cpp:
(JSC::WASMFunctionParser::parseExpressionI32):
(JSC::WASMFunctionParser::parseExpressionF32):
(JSC::WASMFunctionParser::parseExpressionF64):
(JSC::WASMFunctionParser::parseCallIndirect):
* wasm/WASMFunctionParser.h:
* wasm/WASMFunctionSyntaxChecker.h:
(JSC::WASMFunctionSyntaxChecker::buildCallIndirect):
* wasm/WASMModuleParser.cpp:
(JSC::WASMModuleParser::parseFunctionPointerTableSection):
(JSC::WASMModuleParser::parseFunctionDefinitionSection):

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

4 years agoFix 32-bit build issues in WebAssembly
commit-queue@webkit.org [Thu, 17 Sep 2015 01:16:09 +0000 (01:16 +0000)]
Fix 32-bit build issues in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=149240

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-09-16
Reviewed by Geoffrey Garen.

Fix the syntax error and replace the instructions that are not available on
64-bit platforms.

* wasm/WASMFunctionCompiler.h:
(JSC::WASMFunctionCompiler::startFunction):
(JSC::WASMFunctionCompiler::endFunction):
(JSC::WASMFunctionCompiler::buildReturn):
(JSC::WASMFunctionCompiler::callAndUnboxResult):
(JSC::WASMFunctionCompiler::loadValueAndConvertToDouble):

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

4 years agoCreate a font which can be used for testing font features
mmaxfield@apple.com [Thu, 17 Sep 2015 01:15:27 +0000 (01:15 +0000)]
Create a font which can be used for testing font features
https://bugs.webkit.org/show_bug.cgi?id=149237

Reviewed by Simon Fraser.

Tools:

This patch adds a new project in the Tools/ directory which generates a font which can
be used for testing font features. This is a standalone project consisting of two files:
1. A file which actually generates the byte vector representing the font. This file has
a single public function: std::vector<uint8_t> generateFont(). This file is not platform
specific, and only relies on the C++ STL.
2. A file with a main() which calls generateFont() and writes out the font, as well as
uses the font to render some demonstration text into a .png file. This file is platform
specific.

The font itself only supports the following characters:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
However, the shape of these letters are either an X or a check mark.

The letter "A" always is a check mark.
The letter "B" always is an X.
Without any font features turned on, the rest of the letters are shown as X.

Each font feature has an letter associated with it. When the font feature is enabled,
that letter is shown as a check mark. For example, when "smcp" is enabled, "J" is shown
as a check mark.

Here are the mappings of font features to letters:
liga: C
clig: D
dlig: E
hlig: F
calt: G
subs: H
sups: I
smcp: J
c2sc: K
pcap: L
c2pc: M
unic: N
titl: O
onum: P
pnum: Q
tnum: R
frac: S
afrc: T
ordn: U
zero: V
hist: W
jp78: X
jp83: Y
jp90: Z
jp04: a
smpl: b
trad: c
fwid: d
pwid: e
ruby: f

* FontWithFeatures/FontWithFeatures.xcodeproj/project.pbxproj: Added.
* FontWithFeatures/FontWithFeatures/FontCreator.cpp: Added.
(integralLog2):
(roundDownToPowerOfTwo):
(isFourByteAligned):
(clampTo):
(append32):
(writeCFFEncodedNumber):
(CFFBuilder::CFFBuilder):
(CFFBuilder::takeResult):
(CFFBuilder::moveTo):
(CFFBuilder::lineTo):
(CFFBuilder::curveToCubic):
(CFFBuilder::closePath):
(CFFBuilder::writePoint):
(generateBoxCharString):
(generateCheckCharString):
(generateXCharString):
(charStringForGlyph):
(Generator::generate):
(Generator::Placeholder::Placeholder):
(Generator::Placeholder::populate):
(Generator::Placeholder::~Placeholder):
(Generator::placeholder):
(Generator::append16):
(Generator::append32):
(Generator::append32BitCode):
(Generator::overwrite16):
(Generator::overwrite32):
(Generator::appendCFFTable):
(Generator::appendSubstitutionSubtable):
(Generator::appendScriptSubtable):
(Generator::appendGSUBTable):
(Generator::appendOS2Table):
(Generator::appendFormat12CMAPTable):
(Generator::appendFormat4CMAPTable):
(Generator::appendCMAPTable):
(Generator::appendHEADTable):
(Generator::appendHHEATable):
(Generator::appendHMTXTable):
(Generator::appendMAXPTable):
(Generator::appendNAMETable):
(Generator::appendPOSTTable):
(Generator::calculateChecksum):
(Generator::appendTable):
(generateFont):
* FontWithFeatures/FontWithFeatures/FontCreator.h: Added.
* FontWithFeatures/FontWithFeatures/main.cpp: Added.
(drawTextWithFeature):
(main):

LayoutTests:

* css3/font-feature-settings-rendering-2-expected.html: Added.
* css3/font-feature-settings-rendering-2.html: Added.
* css3/resources/FontWithFeatures.otf: Added.
* platform/efl/TestExpectations:
* platform/win/TestExpectations:

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

4 years agoJavaScriptCore should discard baseline code after some time
ggaren@apple.com [Thu, 17 Sep 2015 00:28:34 +0000 (00:28 +0000)]
JavaScriptCore should discard baseline code after some time
https://bugs.webkit.org/show_bug.cgi?id=149220

Reviewed by Saam Barati.

This is a bit more complicated than discarding optimized code because
the engine previously assumed that we would never discard baseline code.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock): Record creation time (and compute time since
creation) instead of install time because CodeBlocks can be installed
more than once, and we don't want to have to worry about edge cases
created by CodeBlocks seeming to get younger.

(JSC::CodeBlock::visitAggregate): Be explicit about only doing the
weak reference fixpoint for optimized CodeBlocks. We used to avoid the
fixpoint for baseline CodeBlocks implicitly, since they would always
visit themselves strongly right away. But now baseline CodeBlocks might
not visit themselves strongly, since they might choose to jettison due
to old age.

(JSC::CodeBlock::shouldVisitStrongly): Add old age as a reason not to
visit ourselves strongly, so that baseline CodeBlocks can jettison due
to old age.

(JSC::CodeBlock::shouldJettisonDueToWeakReference): Be explicit about
only jettisoning optimized CodeBlocks due to weak references so that we
don't confuse ourselves into thinking that we will jettison a baseline
CodeBlock due to weak references.

(JSC::CodeBlock::shouldJettisonDueToOldAge): Updated to use creation time.

(JSC::CodeBlock::visitOSRExitTargets): Clarify a comment and add an
ASSERT to help record some things I discovered while debugging.

(JSC::CodeBlock::jettison): Allow a baseline CodeBlock to jettison. Don't
assume that we have an alternative or a profiler.

(JSC::CodeBlock::install): Deleted.
* bytecode/CodeBlock.h:
(JSC::CodeBlock::releaseAlternative): Deleted.
(JSC::CodeBlock::setInstallTime): Deleted.
(JSC::CodeBlock::timeSinceInstall): Deleted.

* dfg/DFGOSRExitPreparation.cpp:
(JSC::DFG::prepareCodeOriginForOSRExit): Simplified the computation of
baseline CodeBlock.

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::checkLivenessAndVisitChildren): Be sure to strongly
visit our inline callframes because we assume that an optimized CodeBlock
will keep its OSR exit targets alive, but the CodeBlock object won't be
able to mark them for itself until compilation has completed (since it
won't have a JITCode object yet).

* dfg/DFGToFTLDeferredCompilationCallback.cpp:
(JSC::DFG::ToFTLDeferredCompilationCallback::compilationDidComplete):
Updated for interface change.

* jit/JITCode.h:
(JSC::JITCode::timeToLive): Provide a time to live for interpreter and
baseline code, so they will jettison when old. Use seconds in our
code so that we don't need comments. Make DFG 2X interpreter+baseline,
and FTL 2X DFG+interpreter+baseline, also matching the time we allot
before throwing away all code.

* jit/JITToDFGDeferredCompilationCallback.cpp:
(JSC::JITToDFGDeferredCompilationCallback::compilationDidComplete):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::jitCompileAndSetHeuristics): Updated for interface change.

* runtime/Executable.cpp:
(JSC::ScriptExecutable::installCode): Allow our caller to install nullptr,
since we need to do this when jettisoning a baseline CodeBlock. Require
our caller to specify the details of the installation because we can't
rely on a non-null CodeBlock in order to compute them.

(JSC::ScriptExecutable::newCodeBlockFor):
(JSC::ScriptExecutable::prepareForExecutionImpl):
* runtime/Executable.h:
(JSC::ScriptExecutable::recordParse): Updated for interface change.

* runtime/Options.h: Renamed the CodeBlock liveness option since it now
controls baseline and optimized code.

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

4 years agoRemove obsolete code for deleting CodeBlocks
ggaren@apple.com [Thu, 17 Sep 2015 00:16:35 +0000 (00:16 +0000)]
Remove obsolete code for deleting CodeBlocks
https://bugs.webkit.org/show_bug.cgi?id=149231

Reviewed by Mark Lam.

* heap/Heap.cpp:
(JSC::Heap::deleteAllCodeBlocks): ASSERT that we're called in a valid
state, and do the compiler waiting ourselves instead of having our
caller do it. This is more appropriate to our new limited use.

(JSC::Heap::collectImpl):
(JSC::Heap::deleteOldCode): Deleted. Don't call deleteAllCodeBlocks
periodically because it's not such a good idea to delete everything
at once, and CodeBlocks now have a more precise individual policy for
when to delete. Also, this function used to fail all or nearly all of
the time because its invariants that we were not executing or compiling
could not be met.

* heap/Heap.h:

* jsc.cpp:
(GlobalObject::finishCreation):
(functionDeleteAllCompiledCode): Deleted.
* tests/stress/deleteAllCompiledCode.js: Removed. Removed this testing
code because it did not do what it thought it did. All of this code
was guaranteed to no-op since it would run JavaScript to call a function
that would return early because JavaScript was running.

* runtime/VM.cpp:
(JSC::VM::deleteAllCode): This code is simpler now becaue
heap.deleteAllCodeBlocks does some work for us.

* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope): Don't delete code on VM entry. This
policy was old, and it dated back to a time when we

    (a) couldn't run in the interpreter if compilation failed;

    (b) didn't reduce the rate of compilation in response to executable
    memory pressure;

    (c) didn't throw away individual CodeBlocks automatically.

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

4 years agoPossible small iOS PLT regression from r189537
cdumez@apple.com [Thu, 17 Sep 2015 00:10:33 +0000 (00:10 +0000)]
Possible small iOS PLT regression from r189537
https://bugs.webkit.org/show_bug.cgi?id=149232

Reviewed by Ryosuke Niwa.

r189537 may have regressed PLT a bit on iOS. That change added a couple
of extra branches to throw exceptions. This patch marks those branches
as UNLIKELY() as we already do for other similar checks in the JS
bindings.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_get_property):
(webkit_dom_test_obj_class_init):
(webkit_dom_test_obj_get_strict_type_checking_attribute):
(webkit_dom_test_obj_set_strict_type_checking_attribute):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjStrictTypeCheckingAttribute):
(WebCore::setJSTestObjStrictTypeCheckingAttribute):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj strictTypeCheckingAttribute]):
(-[DOMTestObj setStrictTypeCheckingAttribute:]):
* bindings/scripts/test/TestObj.idl:
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::setTHead):
(WebCore::HTMLTableElement::setTFoot):

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

4 years agoVersioning.
bshafiei@apple.com [Wed, 16 Sep 2015 23:54:49 +0000 (23:54 +0000)]
Versioning.

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

4 years ago[ES6] Implement tail calls in the LLInt and Baseline JIT
msaboff@apple.com [Wed, 16 Sep 2015 23:40:35 +0000 (23:40 +0000)]
[ES6] Implement tail calls in the LLInt and Baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=148661

Fix for the breakage of Speedometer/Full.html (https://bugs.webkit.org/show_bug.cgi?id=149162).

Reviewed by Filip Pizlo.
Changed SetupVarargsFrame.cpp::emitSetVarargsFrame to align the callframe size to be a
multiple of stackAlignmentRegisters() in addition to the location of the new frame.

Fixed Reviewed by Filip Pizlo.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/AbortReason.h:
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::Call::Call):
(JSC::AbstractMacroAssembler::repatchNearCall):
(JSC::AbstractMacroAssembler::repatchCompact):
* assembler/CodeLocation.h:
(JSC::CodeLocationNearCall::CodeLocationNearCall):
(JSC::CodeLocationNearCall::callMode):
(JSC::CodeLocationCommon::callAtOffset):
(JSC::CodeLocationCommon::nearCallAtOffset):
(JSC::CodeLocationCommon::dataLabelPtrAtOffset):
* assembler/LinkBuffer.h:
(JSC::LinkBuffer::locationOfNearCall):
(JSC::LinkBuffer::locationOf):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::nearCall):
(JSC::MacroAssemblerARM::nearTailCall):
(JSC::MacroAssemblerARM::call):
(JSC::MacroAssemblerARM::linkCall):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::nearCall):
(JSC::MacroAssemblerARM64::nearTailCall):
(JSC::MacroAssemblerARM64::ret):
(JSC::MacroAssemblerARM64::linkCall):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::nearCall):
(JSC::MacroAssemblerARMv7::nearTailCall):
(JSC::MacroAssemblerARMv7::call):
(JSC::MacroAssemblerARMv7::linkCall):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::nearCall):
(JSC::MacroAssemblerMIPS::nearTailCall):
(JSC::MacroAssemblerMIPS::call):
(JSC::MacroAssemblerMIPS::linkCall):
(JSC::MacroAssemblerMIPS::repatchCall):
* assembler/MacroAssemblerSH4.h:
(JSC::MacroAssemblerSH4::call):
(JSC::MacroAssemblerSH4::nearTailCall):
(JSC::MacroAssemblerSH4::nearCall):
(JSC::MacroAssemblerSH4::linkCall):
(JSC::MacroAssemblerSH4::repatchCall):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::linkCall):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::breakpoint):
(JSC::MacroAssemblerX86Common::nearTailCall):
(JSC::MacroAssemblerX86Common::nearCall):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::linkCall):
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CallLinkInfo.h:
(JSC::CallLinkInfo::callTypeFor):
(JSC::CallLinkInfo::isVarargsCallType):
(JSC::CallLinkInfo::CallLinkInfo):
(JSC::CallLinkInfo::specializationKind):
(JSC::CallLinkInfo::callModeFor):
(JSC::CallLinkInfo::callMode):
(JSC::CallLinkInfo::isTailCall):
(JSC::CallLinkInfo::isVarargs):
(JSC::CallLinkInfo::registerPreservationMode):
* bytecode/CallLinkStatus.cpp:
(JSC::CallLinkStatus::computeFromLLInt):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitCallInTailPosition):
(JSC::BytecodeGenerator::emitCallEval):
(JSC::BytecodeGenerator::emitCall):
(JSC::BytecodeGenerator::emitCallVarargsInTailPosition):
(JSC::BytecodeGenerator::emitConstructVarargs):
* bytecompiler/NodesCodegen.cpp:
(JSC::CallArguments::CallArguments):
(JSC::LabelNode::emitBytecode):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::addCallWithoutSettingResult):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstruct):
* interpreter/Interpreter.h:
(JSC::Interpreter::isCallBytecode):
(JSC::calleeFrameForVarargs):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::jumpToExceptionHandler):
(JSC::CCallHelpers::prepareForTailCallSlow):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITCall.cpp:
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):
(JSC::JIT::emit_op_call):
(JSC::JIT::emit_op_tail_call):
(JSC::JIT::emit_op_call_eval):
(JSC::JIT::emit_op_call_varargs):
(JSC::JIT::emit_op_tail_call_varargs):
(JSC::JIT::emit_op_construct_varargs):
(JSC::JIT::emitSlow_op_call):
(JSC::JIT::emitSlow_op_tail_call):
(JSC::JIT::emitSlow_op_call_eval):
(JSC::JIT::emitSlow_op_call_varargs):
(JSC::JIT::emitSlow_op_tail_call_varargs):
(JSC::JIT::emitSlow_op_construct_varargs):
* jit/JITCall32_64.cpp:
(JSC::JIT::emitSlow_op_call):
(JSC::JIT::emitSlow_op_tail_call):
(JSC::JIT::emitSlow_op_call_eval):
(JSC::JIT::emitSlow_op_call_varargs):
(JSC::JIT::emitSlow_op_tail_call_varargs):
(JSC::JIT::emitSlow_op_construct_varargs):
(JSC::JIT::emit_op_call):
(JSC::JIT::emit_op_tail_call):
(JSC::JIT::emit_op_call_eval):
(JSC::JIT::emit_op_call_varargs):
(JSC::JIT::emit_op_tail_call_varargs):
(JSC::JIT::emit_op_construct_varargs):
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):
* jit/JITInlines.h:
(JSC::JIT::emitNakedCall):
(JSC::JIT::emitNakedTailCall):
(JSC::JIT::updateTopCallFrame):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/Repatch.cpp:
(JSC::linkVirtualFor):
(JSC::linkPolymorphicCall):
* jit/SetupVarargsFrame.cpp:
(JSC::emitSetVarargsFrame):
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::slowPathFor):
(JSC::linkCallThunkGenerator):
(JSC::virtualThunkFor):
(JSC::arityFixupGenerator):
(JSC::unreachableGenerator):
(JSC::baselineGetterReturnThunkGenerator):
* jit/ThunkGenerators.h:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::arityCheckFor):
(JSC::CommonSlowPaths::opIn):

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

4 years agoWeb Inspector: Fix common typo "supress" => "suppress"
commit-queue@webkit.org [Wed, 16 Sep 2015 23:25:22 +0000 (23:25 +0000)]
Web Inspector: Fix common typo "supress" => "suppress"
https://bugs.webkit.org/show_bug.cgi?id=149199

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-09-16
Reviewed by Gyuyoung Kim.

Source/WebCore:

* html/shadow/ContentDistributor.h:
(WebCore::ContentDistributor::needsDistribution):
* page/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation):
* platform/NotImplemented.h:
* platform/graphics/ca/win/LayerChangesFlusher.cpp:
(WebCore::LayerChangesFlusher::hookCallback):
* platform/mac/HIDGamepadProvider.cpp:
(WebCore::HIDGamepadProvider::deviceRemoved):
* platform/win/makesafeseh.asm:

Source/WebInspectorUI:

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGridNode.prototype.select):
(WebInspector.DataGridNode.prototype.deselect):
* UserInterface/Views/SearchBar.js:
(WebInspector.SearchBar):

Source/WebKit2:

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::platformInitializeProcess):

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

4 years agoUnreviewed, rolling out r189875 and r189878.
commit-queue@webkit.org [Wed, 16 Sep 2015 23:05:47 +0000 (23:05 +0000)]
Unreviewed, rolling out r189875 and r189878.
https://bugs.webkit.org/show_bug.cgi?id=149235

cygwin cmake build not ready yet (Requested by alexchristensen
on #webkit).

Reverted changesets:

"Switch AppleWin build to use CMake"
https://bugs.webkit.org/show_bug.cgi?id=149163
http://trac.webkit.org/changeset/189875

"Cygwin build fix after r189875"
http://trac.webkit.org/changeset/189878

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

4 years agoWebIDL: Rename [ReturnNewObject] to [NewObject] and use it more consistently in DOM
cdumez@apple.com [Wed, 16 Sep 2015 23:01:09 +0000 (23:01 +0000)]
WebIDL: Rename [ReturnNewObject] to [NewObject] and use it more consistently in DOM
https://bugs.webkit.org/show_bug.cgi?id=149192

Reviewed by Darin Adler.

Rename [ReturnNewObject] to [NewObject] and use it more consistently in
DOM.

This aligns our IDL extended attribute naming with standard Web IDL:
https://heycam.github.io/webidl/#NewObject

We already have [ReturnNewObject] in most places that the DOM
specification uses [NewObject] but we are missing a few so I'll
fix this as well:
https://dom.spec.whatwg.org/#interface-document

Using [NewObject] lets the bindings generator know that the API in
question always returns new objects and that we can bypass the check
for existing wrappers and directly create a new wrapper for the
returned object.

This patch also adds support for generating the toJSNewlyCreated()
utility function for most types. Previously, to use [ReturnNewObject]
for a new type, you needed to add the type to a hard-coded list in
the bindings generator then provide your own implementation for
toJSNewlyCreated() as custom bindings.

No new-exposed behavior change.

* bindings/js/JSDocumentCustom.cpp:
* bindings/js/JSEventCustom.cpp:
* bindings/js/JSNodeListCustom.cpp:
Add toJSNewlyCreated() custom implementation for Node, Event and
Document, that shares code with the existing toJS() implementation for
those types.

* bindings/js/JSCDATASectionCustom.cpp: Removed.
* bindings/js/JSTextCustom.cpp: Removed.
* bindings/js/JSTouchCustom.cpp: Removed.
* bindings/js/JSTouchListCustom.cpp: Removed.
Drop several custom bindings files as the bindings generator is
now able to generate the toJSNewlyCreated() utility function for
most types.

* bindings/scripts/CodeGeneratorJS.pm:
- Rename [ReturnNewObject] to [NewObject].
- Generate a toJSNewlyCreated() whenever we generate a toJS() already.
  Get rid of the hard-coded list of types that need a
  toJSNewlyCreated().

* bindings/scripts/IDLAttributes.txt:
Rename [ReturnNewObject] to [NewObject].

* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.cpp:
* bindings/scripts/test/JS/JSattribute.h:
* bindings/scripts/test/JS/JSreadonly.cpp:
* bindings/scripts/test/JS/JSreadonly.h:
Rebaseline bindings tests.

* dom/Attr.idl:
* dom/CDATASection.idl:
* dom/Comment.idl:
* dom/DocumentFragment.idl:
* dom/DocumentType.idl:
* dom/EntityReference.idl:
* dom/ProcessingInstruction.idl:
Add [JSGenerateToJSObject] so that the bindings generator generates
a toJS() / toJSNewlyCreated() for this type. While it is not strictly
needed, it avoids falling back to using the toJS() from Node which
calls the virtual nodeType() function to determine the node type.
This change was made for efficiency purposes.

* dom/DOMImplementation.idl:
Rename [ReturnNewObject] to [NewObject] and add it to createHTMLDocument()
as well, as per the specification:
https://dom.spec.whatwg.org/#interface-domimplementation

* dom/Document.idl:
Rename [ReturnNewObject] to [NewObject] and add it to more operations
as per he DOM specification:
https://dom.spec.whatwg.org/#document

* dom/Node.idl:
Add [NewObject] to cloneNode() as per the DOM specification:
https://dom.spec.whatwg.org/#node

* dom/ParentNode.idl:
Add [NewObject] to querySelectorAll() as per the DOM specification:
https://dom.spec.whatwg.org/#parentnode

* dom/Range.idl:
Add [NewObject] for several operations, as per the DOM specification:
https://dom.spec.whatwg.org/#interface-range

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

4 years agoUnreviewed ChangeLog update
mmaxfield@apple.com [Wed, 16 Sep 2015 21:04:43 +0000 (21:04 +0000)]
Unreviewed ChangeLog update

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