WebKit-https.git
4 years ago[Modern Media Controls] Implement the pageScaleFactor property
graouts@webkit.org [Fri, 9 Dec 2016 18:28:21 +0000 (18:28 +0000)]
[Modern Media Controls] Implement the pageScaleFactor property
https://bugs.webkit.org/show_bug.cgi?id=165660

Reviewed by Dean Jackson.

Source/WebCore:

We implement the pageScaleFactor property on MediaController. This property is set
by the HTMLMediaElement when the page scale factor changes, and we only choose to handle
it on iOS by setting controlsDependOnPageScaleFactor to true on the MediaControlsHost.

To do so, we now size the media controls by multiplying the layout size of the media by
the page scale factor, and apply an inverse CSS zoom on the media controls themselves.

Test: media/modern-media-controls/media-controller/media-controller-scale-factor.html

* Modules/modern-media-controls/controls/media-controls.css:
(.media-controls-container,):
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.get scaleFactor):
(MediaControls.prototype.set scaleFactor):
(MediaControls.prototype.commitProperty):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
(MediaController.prototype.set pageScaleFactor):
(MediaController.prototype._updateControlsSize):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::setControllerJSProperty):

We no longer hit a JSC assertion when trying to set the pageScaleFactor property before
the JS controller was actually created.

LayoutTests:

Add a new test to check that we correctly zoom and size the media controls when the page
scale factor is a value other than 1.

* media/modern-media-controls/media-controller/media-controller-scale-factor-expected.txt: Added.
* media/modern-media-controls/media-controller/media-controller-scale-factor.html: Added.

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

4 years agoAttempt to fix the Mac CMake build following <http://trac.webkit.org/changeset/209549>
dbates@webkit.org [Fri, 9 Dec 2016 18:27:50 +0000 (18:27 +0000)]
Attempt to fix the Mac CMake build following <trac.webkit.org/changeset/209549>
(https://bugs.webkit.org/show_bug.cgi?id=165572)

Add directory html/canvas to the list of forwarding headers directories so that
the Legacy WebKit Objective-C DOM binding DOMHTMLCanvasElement.mm can ultimately
include header WebGLContextAttributes.h.

* PlatformMac.cmake:

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

4 years agoLinkIconCollector refactoring.
beidson@apple.com [Fri, 9 Dec 2016 18:21:30 +0000 (18:21 +0000)]
LinkIconCollector refactoring.
https://bugs.webkit.org/show_bug.cgi?id=165657

Reviewed by Dean Jackson.

No new tests (Refactor, no behavior change)

* WebCore.xcodeproj/project.pbxproj:

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

* platform/LinkIcon.h: Move outside of LinkIconCollector for future expandability.

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

4 years agoUnreviewed, rolling out r209574.
ryanhaddad@apple.com [Fri, 9 Dec 2016 18:12:31 +0000 (18:12 +0000)]
Unreviewed, rolling out r209574.

This change broke the Windows build.

Reverted changeset:

"[WebIDL] Remove custom bindings for Geolocation"
https://bugs.webkit.org/show_bug.cgi?id=165625
http://trac.webkit.org/changeset/209574

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

4 years agoFedora also needs a PHP7 config file alternative
commit-queue@webkit.org [Fri, 9 Dec 2016 17:57:39 +0000 (17:57 +0000)]
Fedora also needs a PHP7 config file alternative
https://bugs.webkit.org/show_bug.cgi?id=165606

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> on 2016-12-09
Reviewed by Michael Catanzaro.

Tools:

* Scripts/webkitpy/port/base.py:
(Port._is_fedora_php_version_7): check for the php7 library.
(Port._fedora_php_version): get the appropriate filename for Fedora.
(Port._apache_config_file_name_for_platform):

LayoutTests:

* http/conf/fedora-httpd-2.4-php7.conf: Added.

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

4 years agoCustom Elements from a different document are not customized when created with innerHTML
rniwa@webkit.org [Fri, 9 Dec 2016 17:54:56 +0000 (17:54 +0000)]
Custom Elements from a different document are not customized when created with innerHTML
https://bugs.webkit.org/show_bug.cgi?id=165617

Reviewed by Antti Koivisto.

Source/WebCore:

The bug was caused by a superflous null check on window in createHTMLElementOrFindCustomElementInterface.
Removed the nullcheck to fix the bug.

Test: fast/custom-elements/adopting-from-frameless-document.html

* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):

LayoutTests:

Added a W3C style testharness.js test.

* fast/custom-elements/adopting-from-frameless-document-expected.txt: Added.
* fast/custom-elements/adopting-from-frameless-document.html: Added.

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

4 years agoComplete the revert of r208865.
ryanhaddad@apple.com [Fri, 9 Dec 2016 17:45:29 +0000 (17:45 +0000)]
Complete the revert of r208865.
https://bugs.webkit.org/show_bug.cgi?id=164894

Unreviewed build fix.

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

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

4 years ago[CSP] Policy of window opener not applied to about:blank window
dbates@webkit.org [Fri, 9 Dec 2016 17:27:25 +0000 (17:27 +0000)]
[CSP] Policy of window opener not applied to about:blank window
https://bugs.webkit.org/show_bug.cgi?id=165531
<rdar://problem/29426639>

Reviewed by Brent Fulgham.

Source/WebCore:

Fixes an issue where the content security policy of the opener document was not applied to
an about:blank window.

An about:blank window inherits its security origin from its opener document. It should also
copy (inherit) the ContentSecurityPolicy from its opener document. When copying the ContentSecurityPolicy
state from the opener document to the about:blank document we must take care to avoid copying
any upgrade-insecure-request directive because new windows should not inherit it by definition.
With respect to upgrade-insecure-requests, new windows should only inherit the insecure navigation set
from their opener document.

Test: http/tests/security/contentSecurityPolicy/image-blocked-in-about-blank-window.html

* dom/Document.cpp:
(WebCore::Document::initContentSecurityPolicy): Copy the ContentSecurityPolicy state from the
owner document to this document when it inherits its security origin from its owner. An about:blank
window is one example of a document that inherits its security origin from its owner.
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Call ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
to copy the upgrade insecure requests state from the owner document to the worker now that
ContentSecurityPolicy::copyStateFrom() no longer does this.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::copyStateFrom): Do not copy the upgrade insecure request state.
Callers are now responsible for calling ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
to copy this state.
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::parse): Ignore directive upgrade-insecure-requests when
inheriting ContentSecurityPolicy state as this directive as the Upgrade Insecure Requests feature has
its own inheritance semantics that differ from the semantics of copying a ContentSecurityPolicy object.
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource): Call ContentSecurityPolicy::copyUpgradeInsecureRequestStateFrom()
to copy the upgrade insecure requests state from the original document to the transformed document now
that ContentSecurityPolicy::copyStateFrom() no longer does this.

LayoutTests:

Add a test to ensure that an about:blank window inherits the CSP policy of its
opener document.

* http/tests/security/contentSecurityPolicy/image-blocked-in-about-blank-window-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/image-blocked-in-about-blank-window-blocked.html: Added.

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

4 years ago[Modern Media Controls] Remaining time label first appears way to the left
graouts@webkit.org [Fri, 9 Dec 2016 15:31:24 +0000 (15:31 +0000)]
[Modern Media Controls] Remaining time label first appears way to the left
https://bugs.webkit.org/show_bug.cgi?id=165637

Reviewed by Dean Jackson.

Source/WebCore:

We would sometimes see the remaining time label be laid out in an incorrect position
when a video would start playing. This happened because the time label was being committed
from a previous value before, in the same frame, we would call the layout() function
of MacOSInlineMediaControls. This would set the newly computed location for the
remaining time label, but because we would reset the list of dirty properties after
calling all layout functions, the new value set in MacOSInlineMediaControls.layout()
would be disregarded and the wrong, committed value would persist until it was reset
in a much later frame.

We now correctly clear the list of dirty nodes before laying them out, giving all nodes
a chance to become dirty again during layout, and updated again in the next frame.

Test: media/modern-media-controls/layout-node/node-made-dirty-during-layout.html

* Modules/modern-media-controls/controls/layout-node.js:
(performScheduledLayout):

LayoutTests:

Add a new test that checks that marking a property as dirty during a layout correctly commits
that property on the next frame.

* media/modern-media-controls/layout-node/node-made-dirty-during-layout-expected.txt: Added.
* media/modern-media-controls/layout-node/node-made-dirty-during-layout.html: Added.

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

4 years ago[GTK] Force GDK backend to x11 when running with XvfbDriver
gns@gnome.org [Fri, 9 Dec 2016 15:30:34 +0000 (15:30 +0000)]
[GTK] Force GDK backend to x11 when running with XvfbDriver
https://bugs.webkit.org/show_bug.cgi?id=165612

Reviewed by Michael Catanzaro.

When the developer is running a Wayland session, GDK may get confused
and try to use its Wayland backend (which is higher priority) instead.
This ensures it will use the appropriate backend when running under
Xvfb.

* Scripts/webkitpy/port/gtk.py:
(GtkPort.setup_environ_for_server): when running with XvfbDriver,
force GDK_BACKEND to x11.

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

4 years agoUnreviewed build fix. Thanks to Konstantin Tokarev and Csaba Osztrogonác
gns@gnome.org [Fri, 9 Dec 2016 15:23:14 +0000 (15:23 +0000)]
Unreviewed build fix. Thanks to Konstantin Tokarev and Csaba Osztrogonác
for pointing out the fix.

* CMakeLists.txt: add WebCore/html/canvas to include paths.

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

4 years ago[GTK] Fix build after r209558
gns@gnome.org [Fri, 9 Dec 2016 14:05:03 +0000 (14:05 +0000)]
[GTK] Fix build after r209558
https://bugs.webkit.org/show_bug.cgi?id=165653

Unreviewed build fix.

* UIProcess/API/APIPolicyClient.h: include WebsitePolicies.h.
* UIProcess/API/gtk/WebKitPolicyClient.cpp: ditto.
* UIProcess/API/gtk/WebKitPolicyDecision.cpp:
(webkit_policy_decision_use):  pass empty structure to new required argument.

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

4 years agoFix compile errors on Windows when building with .proj files.
pvollan@apple.com [Fri, 9 Dec 2016 11:13:32 +0000 (11:13 +0000)]
Fix compile errors on Windows when building with .proj files.

Unreviewed build fix.

Fix include paths.

* platform/graphics/win/IntPointWin.cpp:
* platform/graphics/win/IntRectWin.cpp:
* platform/graphics/win/IntSizeWin.cpp:

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

4 years agoUnreviewed buildfix after r209570.
ossy@webkit.org [Fri, 9 Dec 2016 10:50:47 +0000 (10:50 +0000)]
Unreviewed buildfix after r209570.

* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):

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

4 years ago[css-grid] Pass Grid as argument to items' placement methods
svillar@igalia.com [Fri, 9 Dec 2016 10:32:22 +0000 (10:32 +0000)]
[css-grid] Pass Grid as argument to items' placement methods
https://bugs.webkit.org/show_bug.cgi?id=165250

Reviewed by Darin Adler.

In order to constify computeIntrinsicLogicalWidths() it is required to constify
placeItemsOnGrid() first, which is the base method of the grid items' positioning logic. The
first step is to constify all the methods invoked by the latter, which basically means to
pass the Grid as argument to all of them instead of directly using the m_grid attribute from
RenderGrid. As this is an intermediate step, a new const_cast<> was required in the
intrinsic size computation. However it will be promptly removed after the const-ification of
placeItemsOnGrid().

After this, only the methods used by the track sizing algorithm will directly access
m_grid. All those would get a reference to the Grid via GridSizingData, but that's a matter
of a follow up patch.

Apart from that, m_gridIsDirty was removed because it was always too confusing. It was
replaced by Grid's m_needsItemsPlacement which is much more concise. The clearGrid() call
was indeed only forcing a new placement of the grid items.

No new tests as this is a refactoring.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::Grid::setNeedsItemsPlacement): New method to flag the Grid whenever
grid items' placement algorithm needs to be run.
(WebCore::RenderGrid::canPerformSimplifiedLayout):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Constified. Got Grid as
argument.
(WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid): Ditto.
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): Ditto.
(WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Ditto.
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): Ditto.
(WebCore::RenderGrid::clearGrid):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::numTracks):
* rendering/RenderGrid.h:

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

4 years agoUnreviewed ARM buildfix after 209570.
ossy@webkit.org [Fri, 9 Dec 2016 09:50:17 +0000 (09:50 +0000)]
Unreviewed ARM buildfix after 209570.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::or32): Added.

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

4 years agoRevert - Add _WKIconLoadingDelegate SPI
barraclough@apple.com [Fri, 9 Dec 2016 08:08:41 +0000 (08:08 +0000)]
Revert - Add _WKIconLoadingDelegate SPI
https://bugs.webkit.org/show_bug.cgi?id=164894

Unreviewed rollout due to performance regression.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::implicitClose):
* html/LinkIconCollector.cpp:
(WebCore::iconSize):
(WebCore::compareIcons):
* html/LinkIconCollector.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading): Deleted.
(WebCore::DocumentLoader::didGetLoadDecisionForIcon): Deleted.
(WebCore::DocumentLoader::finishedLoadingIcon): Deleted.
* loader/DocumentLoader.h:
* loader/FrameLoaderClient.h:
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::IconLoader):
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:
* platform/LinkIcon.h: Removed.

Source/WebKit2:

* PlatformMac.cmake:
* UIProcess/API/APIIconLoadingClient.h: Removed.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _iconLoadingDelegate]): Deleted.
(-[WKWebView _setIconLoadingDelegate:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Removed.
* UIProcess/API/Cocoa/_WKLinkIconParameters.h: Removed.
* UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Removed.
* UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Removed.
* UIProcess/Cocoa/IconLoadingDelegate.h: Removed.
* UIProcess/Cocoa/IconLoadingDelegate.mm: Removed.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setIconLoadingClient): Deleted.
(WebKit::WebPageProxy::getLoadDecisionForIcon): Deleted.
(WebKit::WebPageProxy::finishedLoadingIcon): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::iconLoadingClient): Deleted.
* UIProcess/WebPageProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::useIconLoadingClient): Deleted.
(WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): Deleted.
(WebKit::WebFrameLoaderClient::finishedLoadingIcon): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
(WebKit::WebFrameLoaderClient::setUseIconLoadingClient): Deleted.
(): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didGetLoadDecisionForIcon): Deleted.
(WebKit::WebPage::setUseIconLoadingClient): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

4 years ago[WebCrypto] Remove NoInterfaceObject attribute from SubtleCrypto Interface
jiewen_tan@apple.com [Fri, 9 Dec 2016 07:45:56 +0000 (07:45 +0000)]
[WebCrypto] Remove NoInterfaceObject attribute from SubtleCrypto Interface
https://bugs.webkit.org/show_bug.cgi?id=165629
<rdar://problem/29586203>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

Covered by existing tests.

* crypto/SubtleCrypto.idl:

LayoutTests:

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:

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

4 years agoWebAssembly: JSC::link* shouldn't need a CodeBlock
jfbastien@apple.com [Fri, 9 Dec 2016 06:52:51 +0000 (06:52 +0000)]
WebAssembly: JSC::link* shouldn't need a CodeBlock
https://bugs.webkit.org/show_bug.cgi?id=165591

Reviewed by Keith Miller.

JSTests:

test that wasm -> JS works, including the IC

* wasm/js-api/test_Instance.js:
(const.wasmModuleWhichImportJS):
(MonomorphicImport):
(Polyphic2Import):
(Polyphic3Import):
(VirtualImport):

Source/JavaScriptCore:

Allow linking without a CodeBlock, which WebAssembly's wasm -> JS stubs does. This needs to work for polymorphic and virtual calls. This patch adds corresponding tests for this.

* assembler/LinkBuffer.cpp:
(JSC::shouldDumpDisassemblyFor): don't look at the tier option if there isn't a CodeBlock, only look at the global one. This is a WebAssembly function, so the tier information is irrelevant.
* jit/Repatch.cpp:
(JSC::isWebAssemblyToJSCallee): this is used in the link* functions below
(JSC::linkFor):
(JSC::linkVirtualFor):
(JSC::linkPolymorphicCall):
* runtime/Options.h: add an option to change the maximum number of polymorphic calls in stubs from wasm to JS, which will come in handy when we try to tune performance or try merging some of the WebAssembly stubs
* wasm/WasmBinding.cpp:
(JSC::Wasm::importStubGenerator): remove the breakpoint since the code now works
* wasm/js/WebAssemblyToJSCallee.h:

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

4 years agoGreen the cloop bot by raising this threshold.
fpizlo@apple.com [Fri, 9 Dec 2016 05:10:57 +0000 (05:10 +0000)]
Green the cloop bot by raising this threshold.

* mozilla/js1_5/Array/regress-101964.js:

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

4 years agoMultiPutByOffset should get a barrier if it transitions
fpizlo@apple.com [Fri, 9 Dec 2016 04:53:33 +0000 (04:53 +0000)]
MultiPutByOffset should get a barrier if it transitions
https://bugs.webkit.org/show_bug.cgi?id=165646

Reviewed by Keith Miller.

Previously, if we knew that we were storing a non-cell but we needed to transition, we
would fail to add the barrier but the FTL's lowering expected the barrier to be there.

Strictly, we need to "consider" the barrier on MultiPutByOffset if the value is
possibly a cell or if the MultiPutByOffset may transition. Then "considering" the
barrier implies checking if the base is possibly old.

But because the barrier is so cheap anyway, this patch implements something safer: we
just consider the barrier on MultiPutByOffset unconditionally, which opts it out of any
barrier optimizations other than those based on the predicted state of the base. Those
optimizations are already sound - for example they use doesGC() to detect safepoints
and that function correctly predicts when MultiPutByOffset could GC.

Because the barrier optimizations are only a very small speed-up, I think it's great to
fix bugs by weakening the optimizer without cleverness.

* dfg/DFGFixupPhase.cpp:
* dfg/DFGStoreBarrierInsertionPhase.cpp:
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::assertValidCell):

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

4 years agoEnable concurrent GC on ARM64
fpizlo@apple.com [Fri, 9 Dec 2016 03:30:03 +0000 (03:30 +0000)]
Enable concurrent GC on ARM64
https://bugs.webkit.org/show_bug.cgi?id=165643

Reviewed by Saam Barati.

It looks stable enough to enable.

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

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

4 years agoFileHandle::printf doesn't build on Windows
krollin@apple.com [Fri, 9 Dec 2016 03:10:02 +0000 (03:10 +0000)]
FileHandle::printf doesn't build on Windows
https://bugs.webkit.org/show_bug.cgi?id=165642

Reviewed by Ryosuke Niwa.

Fix the build -- vasprintf does not exist on Windows, so make
FileHandle::printf a no-op on that platform.

No new tests -- affected facility is currently only used in testing
code and is not user reachable.

* platform/FileHandle.cpp:
(WebCore::FileHandle::printf):

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

4 years ago[Modern Media Controls] Exiting fullscreen with paused media shows the start button
commit-queue@webkit.org [Fri, 9 Dec 2016 02:37:45 +0000 (02:37 +0000)]
[Modern Media Controls] Exiting fullscreen with paused media shows the start button
https://bugs.webkit.org/show_bug.cgi?id=165640

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

Source/WebCore:

Like all supporting objects, the StartSupport instance gets recreated when creating controls
for new layout traits, which happens when going from fullscreen to inline. Due to this, the
"_isPlayed" property is not longer set to true, even if the media has played prior to being
paused in fullscreen. We now also check the media's played range to identify whether media
has been played.

* Modules/modern-media-controls/media/start-support.js:
(StartSupport.prototype._shouldShowStartButton):
(StartSupport):

LayoutTests:

Modify the existing test that enters fullscreen and returns to inline controls with paused media
to check that the start button is not shown upon returning to inline controls.

* media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline-expected.txt:
* media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html:

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

4 years agoASSERTION FAILED: locale in WebCore::lastHyphenLocation
mmaxfield@apple.com [Fri, 9 Dec 2016 02:06:04 +0000 (02:06 +0000)]
ASSERTION FAILED: locale in WebCore::lastHyphenLocation
https://bugs.webkit.org/show_bug.cgi?id=164182

Reviewed by Zalan Bujtas.

Source/WebCore:

Our hyphenation code assumes the locale is in a small set of known locales.
However, web content can put whatever string it wants in the locale field.

Test: fast/text/hyphenation-unknown-locale.html

* platform/text/cf/HyphenationCF.cpp:
(WebCore::lastHyphenLocation):
* rendering/RenderText.cpp:
(WebCore::maxWordFragmentWidth): When computing the minimum preferred width of
an element, we want to know the size of the widest nonbreakable unit. When
hyphenation is enabled, we have to measure the width of each fragment of each
word (where "fragment" is determined by a substring between two successive
hyphenation points, appended with a hyphen character). A hyphenation point at
string offset 0 is irrelevant for this purpose, because it would lead to an
empty fragment. Therefore, skip this situation.

LayoutTests:

* fast/text/hyphenation-unknown-locale-expected.txt: Added.
* fast/text/hyphenation-unknown-locale.html: Added.

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

4 years agoAlways check the return value of pthread_key_create()
ddkilzer@apple.com [Fri, 9 Dec 2016 01:54:31 +0000 (01:54 +0000)]
Always check the return value of pthread_key_create()
<https://webkit.org/b/165274>

Reviewed by Darin Adler.

Source/bmalloc:

* bmalloc/PerThread.h:
(bmalloc::PerThreadStorage::init): Call BCRASH() if
pthread_key_create() returns an error.  The error code will be
stored in a register available in a crash log, so no need to log
the value explicitly.

Source/WebCore:

* platform/ios/wak/WebCoreThread.mm:
(InitThreadContextKey): Call CRASH() if pthread_key_create()
returns an error.  The error code will be stored in a register
available in a crash log, so no need to log the value
explicitly.

Source/WTF:

* wtf/ThreadIdentifierDataPthreads.cpp:
(WTF::ThreadIdentifierData::initializeOnce): Make the code more
readable by assigning a variable to the result of
pthread_key_create().  This matches the idiom used elsewhere.

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

4 years agoAdd 64-bit signed LEB decode method
keith_miller@apple.com [Fri, 9 Dec 2016 01:34:05 +0000 (01:34 +0000)]
Add 64-bit signed LEB decode method
https://bugs.webkit.org/show_bug.cgi?id=165630

Reviewed by Ryosuke Niwa.

Source/WTF:

Add int64 LEB decode and fix some 64-bit specific issues
with the decoder. There is also a fix where we would allow
LEBs with canonical length + 1 size that is fixed by this
patch.

* wtf/LEBDecoder.h:
(WTF::LEBDecoder::decodeUInt):
(WTF::LEBDecoder::decodeInt):
(WTF::LEBDecoder::decodeUInt32):
(WTF::LEBDecoder::decodeUInt64):
(WTF::LEBDecoder::decodeInt32):
(WTF::LEBDecoder::decodeInt64):

Tools:

Add tests for LEB int64 and uint64 decode since I guess
I forgot to add tests before.

* TestWebKitAPI/Tests/WTF/LEBDecoder.cpp:
(TestWebKitAPI::testUInt32LEBDecode):
(TestWebKitAPI::TEST):
(TestWebKitAPI::testUInt64LEBDecode):
(TestWebKitAPI::testInt32LEBDecode):
(TestWebKitAPI::testInt64LEBDecode):
(TestWebKitAPI::testUnsignedLEBDecode): Deleted.

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

4 years agoMake it easy to enable --force-collectContinuously
fpizlo@apple.com [Fri, 9 Dec 2016 01:21:15 +0000 (01:21 +0000)]
Make it easy to enable --force-collectContinuously
https://bugs.webkit.org/show_bug.cgi?id=165638

Reviewed by Keith Miller.

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

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

4 years agoReduce PassRefPtr use in platform/graphics
achristensen@apple.com [Fri, 9 Dec 2016 01:21:07 +0000 (01:21 +0000)]
Reduce PassRefPtr use in platform/graphics
https://bugs.webkit.org/show_bug.cgi?id=165636

Reviewed by Dean Jackson.

No change in behavior.

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/mac/DisplayRefreshMonitorMac.h:
(WebCore::DisplayRefreshMonitorMac::create):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::createForCurrentGLContext):
(WebCore::GraphicsContext3D::paintRenderingResultsToImageData):

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

4 years agoMove FileHandle to WebCore FileHandle.h
krollin@apple.com [Fri, 9 Dec 2016 00:56:48 +0000 (00:56 +0000)]
Move FileHandle to WebCore FileHandle.h
https://bugs.webkit.org/show_bug.cgi?id=165562

Reviewed by Alex Christensen.

Source/WebCore:

Add FileHandle, a small wrapper around FileSystem facilities to manage
the lifetime of an open file and give the facilities a C++ interface.

No new tests -- affected facility is currently only used in testing
code and is not user reachable.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/FileHandle.cpp: Added.
(WebCore::FileHandle::FileHandle):
(WebCore::FileHandle::~FileHandle):
(WebCore::FileHandle::operator=):
(WebCore::FileHandle::operator bool):
(WebCore::FileHandle::open):
(WebCore::FileHandle::read):
(WebCore::FileHandle::write):
(WebCore::FileHandle::printf):
(WebCore::FileHandle::close):
* platform/FileHandle.h: Added.

Source/WebKit2:

Move FileHandle from NetworkCaptureTypes.h (which can now be deleted)
to WebCore. Update client code to use the new version.

* NetworkProcess/capture/NetworkCaptureEvent.cpp:
* NetworkProcess/capture/NetworkCaptureEvent.h:
* NetworkProcess/capture/NetworkCaptureManager.cpp:
(WebKit::NetworkCapture::Manager::initialize):
(WebKit::NetworkCapture::Manager::terminate):
(WebKit::NetworkCapture::Manager::logRecordedResource):
(WebKit::NetworkCapture::Manager::logLoadedResource):
(WebKit::NetworkCapture::Manager::logPlayedBackResource):
(WebKit::NetworkCapture::Manager::openCacheFile):
(WebKit::NetworkCapture::Manager::ensureFileHandle): Deleted.
(WebKit::NetworkCapture::Manager::printToFile): Deleted.
* NetworkProcess/capture/NetworkCaptureManager.h:
* NetworkProcess/capture/NetworkCaptureRecorder.cpp:
(WebKit::NetworkCapture::Recorder::writeEvents):
* NetworkProcess/capture/NetworkCaptureTypes.h: Removed.
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoASSERTION FAILED: m_items.isEmpty() in CustomElementReactionQueue destructor
rniwa@webkit.org [Fri, 9 Dec 2016 00:53:32 +0000 (00:53 +0000)]
ASSERTION FAILED: m_items.isEmpty() in CustomElementReactionQueue destructor
https://bugs.webkit.org/show_bug.cgi?id=162029
<rdar://problem/28945851>

Reviewed by Chris Dumez.

Source/WebCore:

The bug was caused by Document::removedLastRef enqueuing disconnectedCallback during a tear down.
Don't enqueue a disconnectedCallback while a document is getting torn down since that should not be
observable to author scripts. The connected, adopted, and attributeChanged callbacks are immune from
this problem since they don't happen during a document destruction.

Note that this was also the case prior to this patch since the disconnectedCallback would have been
added to the current CustomElementReactionQueue which will be destructed without invoking callbacks
(or hit a release assertion added in r208785 and r209426 for now).

Tests: fast/custom-elements/disconnected-callback-in-detached-iframe.html
       fast/custom-elements/element-queue-during-document-destruction.html

* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Added an assertion that
document's refCount hasn't reached zero yet.
(WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Fixed the bug.
(WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Added the same assertion.
(WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Ditto.

LayoutTests:

Added a regression test that reliably reproduces the crash in DumpRenderTree / WebKitTestRunner.

Also added a W3C style testharness.js test for the behavior I broke in an earlier iteration of the patch.

* fast/custom-elements/disconnected-callback-in-detached-iframe-expected.txt: Added.
* fast/custom-elements/disconnected-callback-in-detached-iframe.html: Added.
* fast/custom-elements/element-queue-during-document-destruction-expected.txt: Added.
* fast/custom-elements/element-queue-during-document-destruction.html: Added.

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

4 years agoAttempt to fix the iOS build.
andersca@apple.com [Fri, 9 Dec 2016 00:44:05 +0000 (00:44 +0000)]
Attempt to fix the iOS build.

* Platform/IPC/mac/MachMessage.cpp:

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

4 years agoMarking compositing/rtl/rtl-fixed-overflow.html as failing on mac-wk1.
ryanhaddad@apple.com [Fri, 9 Dec 2016 00:36:13 +0000 (00:36 +0000)]
Marking compositing/rtl/rtl-fixed-overflow.html as failing on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=165541

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

4 years agoDisable the collectContinuously mode until I investigate failures.
fpizlo@apple.com [Fri, 9 Dec 2016 00:32:46 +0000 (00:32 +0000)]
Disable the collectContinuously mode until I investigate failures.

Rubber stamped by Keith Miller.

I'm seeing collectContinuously crashes on some platforms. Disabling that testing mode
while I investigate.

* Scripts/run-jsc-stress-tests:

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

4 years agoAdd Strict Mixed Content Checking and Upgrade Insecure Requests to WebKit Feature...
dbates@webkit.org [Fri, 9 Dec 2016 00:24:02 +0000 (00:24 +0000)]
Add Strict Mixed Content Checking and Upgrade Insecure Requests to WebKit Feature Status dashboard
https://bugs.webkit.org/show_bug.cgi?id=165635

Rubber-stamped by Ryosuke Niwa.

* features.json:

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

4 years agoImplement Strict Mixed Content Checking
dbates@webkit.org [Thu, 8 Dec 2016 23:54:13 +0000 (23:54 +0000)]
Implement Strict Mixed Content Checking
https://bugs.webkit.org/show_bug.cgi?id=165438
<rdar://problem/26103867>

Reviewed by Brent Fulgham and Andy Estes.

Source/WebCore:

Add support for the CSP directive block-all-mixed-content to enable strict mixed content checking
as per <https://www.w3.org/TR/2016/CR-mixed-content-20160802/#strict-checking> (2 August 2016).

Currently WebKit only blocks blockable content as such content can contaminate the security origin
that loaded it. Optionally-blockable content, including images, would be allowed to load as mixed
content. When strict mixed content checking is enabled all mixed content is blocked. That is, both
blockable and optionally-blockable content will be blocked. A web site can opt into strict mixed
content checking by adding the directive block-all-mixed-content to their content security policy.

Tests: http/tests/security/contentSecurityPolicy/block-all-mixed-content/data-url-iframe-in-main-frame.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/duplicate-directive.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-iframe.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-blob-url-iframe-in-iframe.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-enforced-and-report-policies.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-inherited-policy.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-javascript-url-iframe-in-iframe.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-main-frame.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-xslt-document-in-iframe-with-inherited-policy.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-iframe.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-main-frame.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-with-inherited-policy.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-main-frame.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-iframe.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-main-frame.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-in-iframe.html
       http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-redirect-in-iframe.html

* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Inherit strict mixed content checking mode from parent document.
* dom/SecurityContext.h:
(WebCore::SecurityContext::isStrictMixedContentMode): Added.
(WebCore::SecurityContext::setStrictMixedContentMode): Added.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest): Check mixed content policy with respect to the current frame.
The document in the current frame may have opted into strict mixed content checking or inherited it from
its parent document.
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin): Inherit the strict mixed content checking mode from the owner document
when loading a JavaScript URL in a frame (e.g. <iframe src="javascript:...">) because such URLs inherit
the security origin of their parent document.
* loader/MixedContentChecker.cpp:
(WebCore::MixedContentChecker::canDisplayInsecureContent): Check the content security policy of the document
and the strict mixed content checking mode bit on the document (in that order) to determine if we are in
strict mode. Block display of insecure content when in strict mode. Modified to take enum AlwaysDisplayInNonStrictMode (defaults
to AlwaysDisplayInNonStrictMode::No) as to whether to allow our current relaxed behavior of displaying insecure
content in non-strict mode.
(WebCore::MixedContentChecker::canRunInsecureContent): Check the content security policy of the document
and the strict mixed content checking mode bit on the document (in that order) to determine if we are in
strict mode. Block running of insecure content when in strict mode.
* loader/MixedContentChecker.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::checkInsecureContent): Always check mixed content policy with respect to
the current frame. The document in the current frame may have opted into strict mixed content checking or
inherited it from its parent document. Also renamed a local variable f to frame to better describe its
purpose.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowRunningOrDisplayingInsecureContent): Added. Iterate through all the
policies and report violations with respect to policies that have directive block-all-mixed-content.
(WebCore::ContentSecurityPolicy::didReceiveHeader): Move logic to set eval() error message from here...
(WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): ...to here so that we only perform
it once we are ready to apply the CSP policy to the script execution context. Additionally, enable
strict mixed content checking on the script execution context if applicable.
(WebCore::ContentSecurityPolicy::reportViolation): Added overrides that take a string and a directive list
object (ContentSecurityPolicyDirectiveList) for the effective violated directive and its associated directive
list, respectively. We make use of these overrides so as to support reporting block-all-mixed-content
violations, which are not implemented using a ContentSecurityPolicyDirective object as it seemed sufficient
to implement it as a boolean on ContentSecurityPolicyDirectiveList.
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::setBlockAllMixedContentEnabled): Added.
(WebCore::ContentSecurityPolicyDirectiveList::addDirective): Parse the directive block-all-mixed-content.
* page/csp/ContentSecurityPolicyDirectiveList.h:
(WebCore::ContentSecurityPolicyDirectiveList::hasBlockAllMixedContentDirective): Added.
* page/csp/ContentSecurityPolicyDirectiveNames.cpp:
* page/csp/ContentSecurityPolicyDirectiveNames.h: Add constant for "block-all-mixed-content".

LayoutTests:

Add tests to ensure that we do not regress strict mixed content checking.

* http/tests/security/contentSecurityPolicy/block-all-mixed-content/data-url-iframe-in-main-frame-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/data-url-iframe-in-main-frame.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/duplicate-directive-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/duplicate-directive.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe-report-only.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-css-in-main-frame.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-iframe-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-blob-url-iframe-in-iframe-expected.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-blob-url-iframe-in-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-enforced-and-report-policies-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-enforced-and-report-policies.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-inherited-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe-with-inherited-policy.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-javascript-url-iframe-in-iframe-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-javascript-url-iframe-in-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-main-frame-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-main-frame.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-xslt-document-in-iframe-with-inherited-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-image-in-xslt-document-in-iframe-with-inherited-policy.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-iframe-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-main-frame-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-plugin-in-main-frame.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-with-inherited-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe-with-inherited-policy.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-main-frame-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-script-in-main-frame.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-iframe-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-main-frame-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-synchronous-in-main-frame.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/dump-securitypolicyviolation-and-notify-done.js: Added.
(logMessage):
(securityPolicyViolationToString):
(checkNotify):
(recordSecurityPolicyViolation):
(window.onload):
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/fail.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-data-url-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css-report-only.php: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-css.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-image-and-without-policy.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-image-in-blob-url-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-image-in-javascript-url-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-image-with-enforced-and-report-policies.php: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-image.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-plugin.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-script.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-insecure-xhr.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-secure-image-after-upgrade-redirect.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/frame-with-secure-image-after-upgrade.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/red-square.png: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/resources/transform-functions.xsl: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-in-iframe-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-in-iframe.html: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-redirect-in-iframe-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/secure-image-after-upgrade-redirect-in-iframe.html: Added.
* platform/ios-simulator/TestExpectations: Skip plugin tests as plugins are not supported on iOS.

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

4 years agoDisable collectContinuously if not useConcurrentGC
fpizlo@apple.com [Thu, 8 Dec 2016 22:57:12 +0000 (22:57 +0000)]
Disable collectContinuously if not useConcurrentGC

Rubber stamped by Geoffrey Garen.

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

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

4 years agoDefer sending Mach messages if the queue is full
andersca@apple.com [Thu, 8 Dec 2016 22:53:58 +0000 (22:53 +0000)]
Defer sending Mach messages if the queue is full
https://bugs.webkit.org/show_bug.cgi?id=165622
rdar://problem/29518036

Reviewed by Brady Eidson.

Source/WebKit2:

* Platform/IPC/Connection.cpp:
Include MachMessage.h so the Connection destructor can do its thing.

* Platform/IPC/Connection.h:
Add new members.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate):
Null out the pending outgoing mach message.

(IPC::Connection::sendMessage):
New helper that will send a Mach message. If we time out, store the message in m_pendingOutgoingMachMessage.
When our send source will be triggered we'll try to send the message again.

(IPC::Connection::platformCanSendOutgoingMessages):
We can only send messages if we don't have a pending outgoing message.

(IPC::Connection::sendOutgoingMessage):
Call the newly added sendMessage function.

(IPC::Connection::initializeSendSource):
Add the DISPATCH_MACH_SEND_POSSIBLE mask (and DISPATCH_MACH_SEND_DEAD which was previously implicit).
In our event handler, check for DISPATCH_MACH_SEND_POSSIBLE and try to send the pending outgoing message again.

* Platform/IPC/mac/MachMessage.cpp:
(IPC::MachMessage::create):
Rename length to size.

(IPC::MachMessage::MachMessage):
Initialize m_shouldFreeDescriptors.

(IPC::MachMessage::~MachMessage):
Call mach_msg_destroy, which will free the descriptors.

(IPC::MachMessage::leakDescriptors):
Set m_shouldFreeDescriptors to false.

* Platform/IPC/mac/MachMessage.h:
(IPC::MachMessage::size):
(IPC::MachMessage::length): Deleted.

Source/WTF:

Add new SPI.

* wtf/spi/darwin/XPCSPI.h:

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

4 years ago[WebIDL] Remove custom bindings for Geolocation
weinig@apple.com [Thu, 8 Dec 2016 22:52:37 +0000 (22:52 +0000)]
[WebIDL] Remove custom bindings for Geolocation
https://bugs.webkit.org/show_bug.cgi?id=165625

Reviewed by Alex Christensen.

Source/WebCore:

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Add/remove files.

* Modules/geolocation/GeoNotifier.cpp:
(WebCore::GeoNotifier::GeoNotifier):
(WebCore::GeoNotifier::hasZeroTimeout):
(WebCore::GeoNotifier::startTimerIfNeeded):
* Modules/geolocation/GeoNotifier.h:
(WebCore::GeoNotifier::create):
(WebCore::GeoNotifier::options):
Update to store PositionOptions as a value, and pass the PositionCallback
as a Ref, rather than a RefPtr, since it is not optional.

* Modules/geolocation/Geolocation.cpp:
(WebCore::createGeoposition):
Use auto, to get the good type for Coordinates (Ref).

(WebCore::Geolocation::getCurrentPosition):
(WebCore::Geolocation::watchPosition):
(WebCore::Geolocation::haveSuitableCachedPosition):
(WebCore::Geolocation::startUpdating):
* Modules/geolocation/Geolocation.h:
Update to pass PositionOptions itself now that it is a plain struct.

* Modules/geolocation/Geolocation.idl:
Remove [Custom] extended attribute and add FIXME about nullable annotation.

* Modules/geolocation/Geoposition.h:
Pass/store Coordinates as a Ref.

* Modules/geolocation/PositionOptions.h:
Convert to be a simple struct.

* Modules/geolocation/PositionOptions.idl:
Added.

* bindings/js/JSGeolocationCustom.cpp:
Removed.

LayoutTests:

* fast/dom/Geolocation/argument-types-expected.txt:
* fast/dom/Geolocation/not-enough-arguments-expected.txt:
* fast/dom/Geolocation/script-tests/argument-types.js:
Update tests for improved error messages / adherence to WebIDL.

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

4 years ago[iOS] WKWebView should not allow app links to be opened on back or forward navigation
cpugh@apple.com [Thu, 8 Dec 2016 22:50:28 +0000 (22:50 +0000)]
[iOS] WKWebView should not allow app links to be opened on back or forward navigation
https://bugs.webkit.org/show_bug.cgi?id=165502

Reviewed by Dan Bernstein.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction): Add a condition to shouldOpenAppLinks
(which we use when creating a NavigationAction) that the navigationActionData is not a navigation
of type BackForward. This way, we don't open app links when a navigation is done via back or
forward.

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

4 years agoREGRESSION (URL parser): Relative URLs aren’t resolved correctly when the base URL...
achristensen@apple.com [Thu, 8 Dec 2016 22:42:18 +0000 (22:42 +0000)]
REGRESSION (URL parser): Relative URLs aren’t resolved correctly when the base URL is an applewebdata: URL
https://bugs.webkit.org/show_bug.cgi?id=165621

Reviewed by Dan Bernstein.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):
URLs with nonspecial schemes and no slash after the host get no slash as the path to maintain compatibility with all browsers.
This was proposed to the URL spec in https://github.com/whatwg/url/issues/148
When such as URL is used as a base URL with a relative path, in order to maintain compatibility with URL::parse we need to prepend
a slash to the path.  For completeness I added tests with a relative path, a relative query, a relative fragment, and a relative empty string,
and because the fate of the spec is unclear in this case, I decided to maintain compatibility with URL::parse in all these cases.

Tools:

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

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

4 years agoUnreviewed, fix cloop build.
fpizlo@apple.com [Thu, 8 Dec 2016 22:22:52 +0000 (22:22 +0000)]
Unreviewed, fix cloop build.

* runtime/JSObject.h:

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

4 years agoPerformanceTests:
fpizlo@apple.com [Thu, 8 Dec 2016 22:14:50 +0000 (22:14 +0000)]
PerformanceTests:
Concurrent GC should be stable enough to land enabled
https://bugs.webkit.org/show_bug.cgi?id=164990

Reviewed by Geoffrey Garen.

Made CDjs more configurable and refined the "large.js" configuration. I was using that one and
the new "long.js" configuration to tune concurrent eden GCs.

Added a new way of running Splay in browser, which using chartjs to plot the execution times of
2000 iterations. This includes the minified chartjs.

* JetStream/Octane2/splay-detail.html: Added.
* JetStream/cdjs/benchmark.js:
(benchmarkImpl):
(benchmark):
* JetStream/cdjs/long.js: Added.

Source/JavaScriptCore:
Concurrent GC should be stable enough to land enabled on X86_64
https://bugs.webkit.org/show_bug.cgi?id=164990

Reviewed by Geoffrey Garen.

This fixes a ton of performance and correctness bugs revealed by getting the concurrent GC to
be stable enough to land enabled.

I had to redo the JSObject::visitChildren concurrency protocol again. This time I think it's
even more correct than ever!

This is an enormous win on JetStream/splay-latency and Octane/SplayLatency. It looks to be
mostly neutral on everything else, though Speedometer is showing statistically weak signs of a
slight regression.

* API/JSAPIWrapperObject.mm: Added locking.
(JSC::JSAPIWrapperObject::visitChildren):
* API/JSCallbackObject.h: Added locking.
(JSC::JSCallbackObjectData::visitChildren):
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::deletePrivateProperty):
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren):
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::UnconditionalFinalizer::finalizeUnconditionally): This had a TOCTOU race on shouldJettisonDueToOldAge.
(JSC::EvalCodeCache::visitAggregate): Moved to EvalCodeCache.cpp.
* bytecode/DirectEvalCodeCache.cpp: Added. Outlined some functions and made them use locks.
(JSC::DirectEvalCodeCache::setSlow):
(JSC::DirectEvalCodeCache::clear):
(JSC::DirectEvalCodeCache::visitAggregate):
* bytecode/DirectEvalCodeCache.h:
(JSC::DirectEvalCodeCache::set):
(JSC::DirectEvalCodeCache::clear): Deleted.
* bytecode/UnlinkedCodeBlock.cpp: Added locking.
(JSC::UnlinkedCodeBlock::visitChildren):
(JSC::UnlinkedCodeBlock::setInstructions):
(JSC::UnlinkedCodeBlock::shrinkToFit):
* bytecode/UnlinkedCodeBlock.h: Added locking.
(JSC::UnlinkedCodeBlock::addRegExp):
(JSC::UnlinkedCodeBlock::addConstant):
(JSC::UnlinkedCodeBlock::addFunctionDecl):
(JSC::UnlinkedCodeBlock::addFunctionExpr):
(JSC::UnlinkedCodeBlock::createRareDataIfNecessary):
(JSC::UnlinkedCodeBlock::shrinkToFit): Deleted.
* debugger/Debugger.cpp: Use the right delete API.
(JSC::Debugger::recompileAllJSFunctions):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): Fix a pre-existing bug in ToFunction constant folding.
* dfg/DFGClobberize.h: Add support for nuking.
(JSC::DFG::clobberize):
* dfg/DFGClobbersExitState.cpp: Add support for nuking.
(JSC::DFG::clobbersExitState):
* dfg/DFGFixupPhase.cpp: Add support for nuking.
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::indexForChecks):
(JSC::DFG::FixupPhase::originForCheck):
(JSC::DFG::FixupPhase::speculateForBarrier):
(JSC::DFG::FixupPhase::insertCheck):
(JSC::DFG::FixupPhase::fixupChecksInBlock):
* dfg/DFGSpeculativeJIT.cpp: Add support for nuking.
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
* ftl/FTLLowerDFGToB3.cpp: Add support for nuking.
(JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::reallocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::mutatorFence):
(JSC::FTL::DFG::LowerDFGToB3::nukeStructureAndSetButterfly):
(JSC::FTL::DFG::LowerDFGToB3::setButterfly): Deleted.
* heap/CodeBlockSet.cpp: We need to be more careful about the CodeBlockSet workflow during GC, since we will allocate CodeBlocks in eden while collecting.
(JSC::CodeBlockSet::clearMarksForFullCollection):
(JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced):
* heap/Heap.cpp: Added code to measure max pauses. Added a better collectContinuously mode.
(JSC::Heap::lastChanceToFinalize): Stop the collectContinuously thread.
(JSC::Heap::harvestWeakReferences): Inline SlotVisitor::harvestWeakReferences.
(JSC::Heap::finalizeUnconditionalFinalizers): Inline SlotVisitor::finalizeUnconditionalReferences.
(JSC::Heap::markToFixpoint): We need to do some MarkedSpace stuff before every conservative scan, rather than just at the start of marking, so we now call prepareForConservativeScan() before each conservative scan. Also call a less-parallel version of drainInParallel when the mutator is running.
(JSC::Heap::collectInThread): Inline Heap::prepareForAllocation().
(JSC::Heap::stopIfNecessarySlow): We need to be more careful about ensuring that we run finalization before and after stopping. Also, we should sanitize stack when stopping the world.
(JSC::Heap::acquireAccessSlow): Add some optional debug prints.
(JSC::Heap::handleNeedFinalize): Assert that we are running this when the world is not stopped.
(JSC::Heap::finalize): Remove the old collectContinuously code.
(JSC::Heap::requestCollection): We don't need to sanitize stack here anymore.
(JSC::Heap::notifyIsSafeToCollect): Start the collectContinuously thread. It will request collection 1 KHz.
(JSC::Heap::prepareForAllocation): Deleted.
(JSC::Heap::preventCollection): Prevent any new concurrent GCs from being initiated.
(JSC::Heap::allowCollection):
(JSC::Heap::forEachSlotVisitor): Allows us to safely iterate slot visitors.
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::writeBarrier): If the 'to' cell is not NewWhite then it could be AnthraciteOrBlack. During a full collection, objects may be AnthraciteOrBlack from a previous GC. Turns out, we don't benefit from this optimization so we can just kill it.
* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::buildSnapshot): This needs to use PreventCollectionScope to ensure snapshot soundness.
* heap/ListableHandler.h:
(JSC::ListableHandler::isOnList): Useful helper.
* heap/LockDuringMarking.h:
(JSC::lockDuringMarking): It's a locker that only locks while we're marking.
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::addBlock): Hold the bitvector lock while resizing.
* heap/MarkedBlock.cpp: Hold the bitvector lock while accessing the bitvectors while the mutator is running.
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::prepareForConservativeScan): We used to do this in prepareForMarking, but we need to do it before each conservative scan not just before marking.
(JSC::MarkedSpace::prepareForMarking): Remove the logic moved to prepareForConservativeScan.
* heap/MarkedSpace.h:
* heap/PreventCollectionScope.h: Added.
* heap/SlotVisitor.cpp: Refactored drainFromShared so that we can write a similar function called drainInParallelPassively.
(JSC::SlotVisitor::updateMutatorIsStopped): Update whether we can use "fast" scanning.
(JSC::SlotVisitor::mutatorIsStoppedIsUpToDate):
(JSC::SlotVisitor::didReachTermination):
(JSC::SlotVisitor::hasWork):
(JSC::SlotVisitor::drain): This now uses the rightToRun lock to allow the main GC thread to safepoint the workers.
(JSC::SlotVisitor::drainFromShared):
(JSC::SlotVisitor::drainInParallelPassively): This runs marking with one fewer threads than normal. It's useful for when we have resumed the mutator, since then the mutator has a better chance of getting on a core.
(JSC::SlotVisitor::addWeakReferenceHarvester):
(JSC::SlotVisitor::addUnconditionalFinalizer):
(JSC::SlotVisitor::harvestWeakReferences): Deleted.
(JSC::SlotVisitor::finalizeUnconditionalFinalizers): Deleted.
* heap/SlotVisitor.h:
* heap/SlotVisitorInlines.h: Outline stuff.
(JSC::SlotVisitor::addWeakReferenceHarvester): Deleted.
(JSC::SlotVisitor::addUnconditionalFinalizer): Deleted.
* runtime/InferredType.cpp: This needed thread safety.
(JSC::InferredType::visitChildren): This needs to keep its structure finalizer alive until it runs.
(JSC::InferredType::set):
(JSC::InferredType::InferredStructureFinalizer::finalizeUnconditionally):
* runtime/InferredType.h:
* runtime/InferredValue.cpp: This needed thread safety.
(JSC::InferredValue::visitChildren):
(JSC::InferredValue::ValueCleanup::finalizeUnconditionally):
* runtime/JSArray.cpp:
(JSC::JSArray::unshiftCountSlowCase): Update to use new butterfly API.
(JSC::JSArray::unshiftCountWithArrayStorage): Update to use new butterfly API.
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::visitChildren): Thread safety.
* runtime/JSCell.h:
(JSC::JSCell::setStructureIDDirectly): This is used for nuking the structure.
(JSC::JSCell::InternalLocker::InternalLocker): Deleted. The cell is now the lock.
(JSC::JSCell::InternalLocker::~InternalLocker): Deleted. The cell is now the lock.
* runtime/JSCellInlines.h:
(JSC::JSCell::structure): Clean this up.
(JSC::JSCell::lock): The cell is now the lock.
(JSC::JSCell::tryLock):
(JSC::JSCell::unlock):
(JSC::JSCell::isLocked):
(JSC::JSCell::lockInternalLock): Deleted.
(JSC::JSCell::unlockInternalLock): Deleted.
* runtime/JSFunction.cpp:
(JSC::JSFunction::visitChildren): Thread safety.
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::visitChildren): Thread safety.
(JSC::JSGenericTypedArrayView<Adaptor>::slowDownAndWasteMemory): Thread safety.
* runtime/JSObject.cpp:
(JSC::JSObject::markAuxiliaryAndVisitOutOfLineProperties): Factor out this "easy" step of butterfly visiting.
(JSC::JSObject::visitButterfly): Make this achieve 100% precision about structure-butterfly relationships. This relies on the mutator "nuking" the structure prior to "locked" structure-butterfly transitions.
(JSC::JSObject::visitChildren): Use the new, nicer API.
(JSC::JSFinalObject::visitChildren): Use the new, nicer API.
(JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists): Use the new butterfly API.
(JSC::JSObject::createInitialUndecided): Use the new butterfly API.
(JSC::JSObject::createInitialInt32): Use the new butterfly API.
(JSC::JSObject::createInitialDouble): Use the new butterfly API.
(JSC::JSObject::createInitialContiguous): Use the new butterfly API.
(JSC::JSObject::createArrayStorage): Use the new butterfly API.
(JSC::JSObject::convertUndecidedToContiguous): Use the new butterfly API.
(JSC::JSObject::convertUndecidedToArrayStorage): Use the new butterfly API.
(JSC::JSObject::convertInt32ToArrayStorage): Use the new butterfly API.
(JSC::JSObject::convertDoubleToContiguous): Use the new butterfly API.
(JSC::JSObject::convertDoubleToArrayStorage): Use the new butterfly API.
(JSC::JSObject::convertContiguousToArrayStorage): Use the new butterfly API.
(JSC::JSObject::increaseVectorLength): Use the new butterfly API.
(JSC::JSObject::shiftButterflyAfterFlattening): Use the new butterfly API.
* runtime/JSObject.h:
(JSC::JSObject::setButterfly): This now does all of the fences. Only use this when you are not also transitioning the structure or the structure's lastOffset.
(JSC::JSObject::nukeStructureAndSetButterfly): Use this when doing locked structure-butterfly transitions.
* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectWithoutTransition): Use the newly factored out API.
(JSC::JSObject::prepareToPutDirectWithoutTransition): Factor this out!
(JSC::JSObject::putDirectInternal): Use the newly factored out API.
* runtime/JSPropertyNameEnumerator.cpp:
(JSC::JSPropertyNameEnumerator::finishCreation): Locks!
(JSC::JSPropertyNameEnumerator::visitChildren): Locks!
* runtime/JSSegmentedVariableObject.cpp:
(JSC::JSSegmentedVariableObject::visitChildren): Locks!
* runtime/JSString.cpp:
(JSC::JSString::visitChildren): Thread safety.
* runtime/ModuleProgramExecutable.cpp:
(JSC::ModuleProgramExecutable::visitChildren): Thread safety.
* runtime/Options.cpp: For now we disable concurrent GC on not-X86_64.
(JSC::recomputeDependentOptions):
* runtime/Options.h: Change the default max GC parallelism to 8. I don't know why it was still 7.
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::stackTracesAsJSON): This needs to defer GC before grabbing its lock.
* runtime/SparseArrayValueMap.cpp: This needed thread safety.
(JSC::SparseArrayValueMap::add):
(JSC::SparseArrayValueMap::remove):
(JSC::SparseArrayValueMap::visitChildren):
* runtime/SparseArrayValueMap.h:
* runtime/Structure.cpp: This had a race between addNewPropertyTransition and visitChildren.
(JSC::Structure::Structure):
(JSC::Structure::materializePropertyTable):
(JSC::Structure::addNewPropertyTransition):
(JSC::Structure::flattenDictionaryStructure):
(JSC::Structure::add): Help out with nuking support - the m_offset needs to play along.
(JSC::Structure::visitChildren):
* runtime/Structure.h: Make some useful things public - like the notion of a lastOffset.
* runtime/StructureChain.cpp:
(JSC::StructureChain::visitChildren): Thread safety!
* runtime/StructureChain.h: Thread safety!
* runtime/StructureIDTable.cpp:
(JSC::StructureIDTable::allocateID): Ensure that we don't get nuked IDs.
* runtime/StructureIDTable.h: Add the notion of a nuked ID! It's a bit that the runtime never sees except during specific shady actions like locked structure-butterfly transitions. "Nuking" tells the GC to steer clear and rescan once we fire the barrier.
(JSC::nukedStructureIDBit):
(JSC::nuke):
(JSC::isNuked):
(JSC::decontaminate):
* runtime/StructureInlines.h:
(JSC::Structure::hasIndexingHeader): Better API.
(JSC::Structure::add):
* runtime/VM.cpp: Better GC interaction.
(JSC::VM::ensureWatchdog):
(JSC::VM::deleteAllLinkedCode):
(JSC::VM::deleteAllCode):
* runtime/VM.h:
(JSC::VM::getStructure): Why wasn't this always an API!
* runtime/WebAssemblyExecutable.cpp:
(JSC::WebAssemblyExecutable::visitChildren): Thread safety.

Source/WebCore:
Concurrent GC should be stable enough to land enabled on X86_64
https://bugs.webkit.org/show_bug.cgi?id=164990

Reviewed by Geoffrey Garen.

Made WebCore down with concurrent marking by adding some locking and adapting to some new API.

This has new test modes in run-sjc-stress-tests. Also, the way that LayoutTests run is already
a fantastic GC test.

* ForwardingHeaders/heap/DeleteAllCodeEffort.h: Added.
* ForwardingHeaders/heap/LockDuringMarking.h: Added.
* bindings/js/GCController.cpp:
(WebCore::GCController::deleteAllCode):
(WebCore::GCController::deleteAllLinkedCode):
* bindings/js/GCController.h:
* bindings/js/JSDOMBinding.cpp:
(WebCore::getCachedDOMStructure):
(WebCore::cacheDOMStructure):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSDOMGlobalObject.h:
(WebCore::getDOMConstructor):
* bindings/js/JSDOMPromise.cpp:
(WebCore::DeferredPromise::DeferredPromise):
(WebCore::DeferredPromise::clear):
* bindings/js/JSXPathResultCustom.cpp:
(WebCore::JSXPathResult::visitAdditionalChildren):
* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::clear):
(WebCore::EventListenerMap::replace):
(WebCore::EventListenerMap::add):
(WebCore::EventListenerMap::remove):
(WebCore::EventListenerMap::find):
(WebCore::EventListenerMap::removeFirstEventListenerCreatedFromMarkup):
(WebCore::EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget):
(WebCore::EventListenerIterator::EventListenerIterator):
* dom/EventListenerMap.h:
(WebCore::EventListenerMap::lock):
* dom/EventTarget.cpp:
(WebCore::EventTarget::visitJSEventListeners):
* dom/EventTarget.h:
(WebCore::EventTarget::visitJSEventListeners): Deleted.
* dom/Node.cpp:
(WebCore::Node::eventTargetDataConcurrently):
(WebCore::Node::ensureEventTargetData):
(WebCore::Node::clearEventTargetData):
* dom/Node.h:
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
(WebCore::registerMemoryReleaseNotifyCallbacks):

Source/WTF:
Concurrent GC should be stable enough to land enabled on X86_64
https://bugs.webkit.org/show_bug.cgi?id=164990

Reviewed by Geoffrey Garen.

Adds the ability to say:

auto locker = holdLock(any type of lock)

Instead of having to say:

Locker<LockType> locker(locks of type LockType)

I think that we should use "auto locker = holdLock(lock)" as the default way that we acquire
locks unless we need to use a special locker type.

This also adds the ability to safepoint a lock. Safepointing a lock is basically a super fast
way of unlocking it fairly and then immediately relocking it - i.e. letting anyone who is
waiting to run without losing steam of there is noone waiting.

* wtf/Lock.cpp:
(WTF::LockBase::safepointSlow):
* wtf/Lock.h:
(WTF::LockBase::safepoint):
* wtf/LockAlgorithm.h:
(WTF::LockAlgorithm::safepointFast):
(WTF::LockAlgorithm::safepoint):
(WTF::LockAlgorithm::safepointSlow):
* wtf/Locker.h:
(WTF::AbstractLocker::AbstractLocker):
(WTF::Locker::tryLock):
(WTF::Locker::operator bool):
(WTF::Locker::Locker):
(WTF::Locker::operator=):
(WTF::holdLock):
(WTF::tryHoldLock):

Tools:
Concurrent GC should be stable enough to land enabled
https://bugs.webkit.org/show_bug.cgi?id=164990

Reviewed by Geoffrey Garen.

Add a new mode that runs GC continuously. Also made eager modes run GC continuously.

It's clear that this works just fine in release, but I'm still trying to figure out if it's
safe for debug. It might be too slow for debug.

* Scripts/run-jsc-stress-tests:

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

4 years ago[CSS Parser] Unskip passing flexbox tests
hyatt@apple.com [Thu, 8 Dec 2016 21:59:02 +0000 (21:59 +0000)]
[CSS Parser] Unskip passing flexbox tests
https://bugs.webkit.org/show_bug.cgi?id=165626

Reviewed by Dean Jackson.

* TestExpectations:

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

4 years agoEnable SharedArrayBuffer, remove the flag
fpizlo@apple.com [Thu, 8 Dec 2016 21:56:23 +0000 (21:56 +0000)]
Enable SharedArrayBuffer, remove the flag
https://bugs.webkit.org/show_bug.cgi?id=165614

Rubber stamped by Geoffrey Garen.

Source/JavaScriptCore:

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/RuntimeFlags.h:

Source/WebKit/mac:

* WebView/WebPreferencesPrivate.h:

Source/WebKit/win:

* Interfaces/IWebPreferencesPrivate.idl:

Source/WebKit2:

* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

4 years ago@supports fails combinations of conjuctions, disjunctions, and negations of simple...
hyatt@apple.com [Thu, 8 Dec 2016 21:54:21 +0000 (21:54 +0000)]
@supports fails combinations of conjuctions, disjunctions, and negations of simple conditions
https://bugs.webkit.org/show_bug.cgi?id=137566
<rdar://problem/18600949>

Reviewed by Dean Jackson.

* TestExpectations:
Test passes now with new @supports parser.

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

4 years ago[CSS Parser] Add strict checking for right parens to selector functions like :matches...
hyatt@apple.com [Thu, 8 Dec 2016 21:49:18 +0000 (21:49 +0000)]
[CSS Parser] Add strict checking for right parens to selector functions like :matches, :not etc.
https://bugs.webkit.org/show_bug.cgi?id=165624

Reviewed by Dean Jackson.

Source/WebCore:

Unskipped fast/selectors/invalid-functional-pseudo-class.html.

* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
Bail if we don't actually consume a right parenthesis.

LayoutTests:

* TestExpectations:

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

4 years agoExit fullscreen on escape key down, not up.
commit-queue@webkit.org [Thu, 8 Dec 2016 21:46:09 +0000 (21:46 +0000)]
Exit fullscreen on escape key down, not up.
https://bugs.webkit.org/show_bug.cgi?id=165618
rdar://problem/29581688

This problem was introduced by https://bugs.webkit.org/show_bug.cgi?id=165416
The fix to only exit fullscreen on key down, not key up.

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

* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent):

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

4 years ago[WebCrypto] Replace webkitSubtle with subtle for all crypto/workers/subtle/ tests
jiewen_tan@apple.com [Thu, 8 Dec 2016 21:42:53 +0000 (21:42 +0000)]
[WebCrypto] Replace webkitSubtle with subtle for all crypto/workers/subtle/ tests
https://bugs.webkit.org/show_bug.cgi?id=165540

Reviewed by Brent Fulgham.

* crypto/workers/subtle/aes-postMessage-worker.html:
* crypto/workers/subtle/hmac-postMessage-worker.html:
* crypto/workers/subtle/hrsa-postMessage-worker-expected.txt:
* crypto/workers/subtle/hrsa-postMessage-worker.html:
* crypto/workers/subtle/multiple-postMessage-worker.html:
* crypto/workers/subtle/resources/hrsa-postMessage-worker.js:
* crypto/workers/subtle/rsa-postMessage-worker.html:

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

4 years agoRebaseline some css tests for ios-simulator.
ryanhaddad@apple.com [Thu, 8 Dec 2016 21:42:24 +0000 (21:42 +0000)]
Rebaseline some css tests for ios-simulator.

Unreviewed test gardening.

* platform/ios-simulator/fast/css/font_property_normal-expected.txt:
* platform/ios-simulator/fast/css/image-set-unprefixed-expected.txt:

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

4 years ago[CSS Parser] Unskip grid tests
hyatt@apple.com [Thu, 8 Dec 2016 21:25:59 +0000 (21:25 +0000)]
[CSS Parser] Unskip grid tests
https://bugs.webkit.org/show_bug.cgi?id=165623

Reviewed by Zalan Bujtas.

* TestExpectations:
* fast/css-grid-layout/grid-auto-flow-get-set-expected.txt:
* fast/css-grid-layout/grid-auto-flow-get-set.html:
* fast/css-grid-layout/grid-columns-rows-get-set-expected.txt:
* fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt:
* fast/css-grid-layout/grid-template-shorthand-get-set.html:
* fast/css-grid-layout/non-grid-columns-rows-get-set-expected.txt:
* fast/css-grid-layout/resources/grid-columns-rows-get-set.js:
* fast/css-grid-layout/resources/non-grid-columns-rows-get-set.js:

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

4 years agoOverlapping text at AppleSeed forum's footer.
zalan@apple.com [Thu, 8 Dec 2016 21:25:10 +0000 (21:25 +0000)]
Overlapping text at AppleSeed forum's footer.
https://bugs.webkit.org/show_bug.cgi?id=165613

Reviewed by Simon Fraser.

This is a test case for r207219.

* fast/text/float-with-sibling-text-overlaps-when-text-decoration-changes-expected.html: Added.
* fast/text/float-with-sibling-text-overlaps-when-text-decoration-changes.html: Added.

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

4 years agoWebAssembly JS API: wire up Instance imports
jfbastien@apple.com [Thu, 8 Dec 2016 21:09:06 +0000 (21:09 +0000)]
WebAssembly JS API: wire up Instance imports
https://bugs.webkit.org/show_bug.cgi?id=165118

Reviewed by Saam Barati.

JSTests:

* wasm/js-api/test_Instance.js: add the test, disabled for now

Source/JavaScriptCore:

Change a bunch of the WebAssembly object model, and pipe the
necessary changes to be able to call JS imports from
WebAssembly. This will make it easier to call_indirect, and
unblock many other missing features.

As a follow-up I need to teach JSC::linkFor to live without a
CodeBlock: wasm doesn't have one and the IC patching is sad. We'll
switch on the callee (or its type?) and then use that as the owner
(because the callee is alive if the instance is alive, ditto
module, and module owns the CallLinkInfo).

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* interpreter/CallFrame.h:
(JSC::ExecState::callee): give access to the callee as a JSCell
* jit/RegisterSet.cpp: dead code from previous WebAssembly implementation
* jsc.cpp:
(callWasmFunction):
(functionTestWasmModuleFunctions):
* runtime/JSCellInlines.h:
(JSC::ExecState::vm): check callee instead of jsCallee: wasm only has a JSCell and not a JSObject
* runtime/VM.cpp:
(JSC::VM::VM): store the "top" WebAssembly.Instance on entry to WebAssembly (and restore the previous one on exit)
* runtime/VM.h:
* testWasm.cpp:
(runWasmTests):
* wasm/JSWebAssembly.h:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator): pass unlinked calls around to shorten their lifetime: they're ony needed until the Plan is done
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::createJSToWasmWrapper):
(JSC::Wasm::parseAndCompile): also pass in the function index space, so that imports can be signature-checked along with internal functions
* wasm/WasmB3IRGenerator.h:
* wasm/WasmBinding.cpp: Added.
(JSC::Wasm::importStubGenerator): stubs from wasm to JS
* wasm/WasmBinding.h: Copied from Source/JavaScriptCore/wasm/WasmValidate.h.
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConvention::setupFrameInPrologue):
* wasm/WasmFormat.h: fix the object model
(JSC::Wasm::CallableFunction::CallableFunction):
* wasm/WasmFunctionParser.h: simplify some of the failure condition checks
(JSC::Wasm::FunctionParser<Context>::FunctionParser): need function index space, not just internal functions
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmModuleParser.cpp: early-create some of the structures which will be needed later
(JSC::Wasm::ModuleParser::parseImport):
(JSC::Wasm::ModuleParser::parseFunction):
(JSC::Wasm::ModuleParser::parseMemory):
(JSC::Wasm::ModuleParser::parseExport):
(JSC::Wasm::ModuleParser::parseCode):
* wasm/WasmModuleParser.h:
(JSC::Wasm::ModuleParser::functionIndexSpace):
(JSC::Wasm::ModuleParser::functionLocations):
* wasm/WasmParser.h:
(JSC::Wasm::Parser::consumeUTF8String):
* wasm/WasmPlan.cpp: pass around the wasm objects at the right time, reducing their lifetime and making it easier to pass them around when needed
(JSC::Wasm::Plan::run):
(JSC::Wasm::Plan::initializeCallees):
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::exports):
(JSC::Wasm::Plan::internalFunctionCount):
(JSC::Wasm::Plan::jsToWasmEntryPointForFunction):
(JSC::Wasm::Plan::takeModuleInformation):
(JSC::Wasm::Plan::takeCallLinkInfos):
(JSC::Wasm::Plan::takeWasmToJSStubs):
(JSC::Wasm::Plan::takeFunctionIndexSpace):
* wasm/WasmValidate.cpp: check function index space instead of only internal functions
(JSC::Wasm::Validate::addCall):
(JSC::Wasm::validateFunction):
* wasm/WasmValidate.h:
* wasm/js/JSWebAssemblyCallee.cpp:
(JSC::JSWebAssemblyCallee::finishCreation):
* wasm/js/JSWebAssemblyCallee.h:
(JSC::JSWebAssemblyCallee::create):
(JSC::JSWebAssemblyCallee::jsToWasmEntryPoint):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::create):
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/JSWebAssemblyInstance.h: hold the import functions off the end of the Instance
(JSC::JSWebAssemblyInstance::importFunction):
(JSC::JSWebAssemblyInstance::importFunctions):
(JSC::JSWebAssemblyInstance::setImportFunction):
(JSC::JSWebAssemblyInstance::offsetOfImportFunctions):
(JSC::JSWebAssemblyInstance::offsetOfImportFunction):
(JSC::JSWebAssemblyInstance::allocationSize):
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::create):
(JSC::JSWebAssemblyModule::JSWebAssemblyModule):
(JSC::JSWebAssemblyModule::visitChildren):
* wasm/js/JSWebAssemblyModule.h: hold the link call info, the import function stubs, and the function index space
(JSC::JSWebAssemblyModule::signatureForFunctionIndexSpace):
(JSC::JSWebAssemblyModule::importCount):
(JSC::JSWebAssemblyModule::calleeFromFunctionIndexSpace):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction): set top Instance on VM
* wasm/js/WebAssemblyFunction.h:
(JSC::WebAssemblyFunction::instance):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance): handle function imports
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::constructJSWebAssemblyModule): generate the stubs for import functions
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
* wasm/js/WebAssemblyToJSCallee.cpp: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyCallee.cpp.
(JSC::WebAssemblyToJSCallee::create): dummy JSCell singleton which lives on the VM, and is put as the callee in the import stub's frame to identified it when unwinding
(JSC::WebAssemblyToJSCallee::createStructure):
(JSC::WebAssemblyToJSCallee::WebAssemblyToJSCallee):
(JSC::WebAssemblyToJSCallee::finishCreation):
(JSC::WebAssemblyToJSCallee::destroy):
* wasm/js/WebAssemblyToJSCallee.h: Copied from Source/JavaScriptCore/wasm/WasmB3IRGenerator.h.

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

4 years ago[CSS Parser] Unskip background parsing tests
hyatt@apple.com [Thu, 8 Dec 2016 20:57:59 +0000 (20:57 +0000)]
[CSS Parser] Unskip background parsing tests
https://bugs.webkit.org/show_bug.cgi?id=165619

Reviewed by Zalan Bujtas.

Source/WebCore:

Change background-position so that the origin being set is tracked
on a per-x/y basis instead of as a single boolean. The single boolean
caused lousy computed style dumping, since we would switch into verbose
mode for both x and y, even if only one of them had a pair set for it.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createPositionListForLayer):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertPositionComponent):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::FillLayer):
(WebCore::FillLayer::operator=):
(WebCore::FillLayer::fillUnsetProperties):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::isBackgroundXOriginSet):
(WebCore::FillLayer::isBackgroundYOriginSet):
(WebCore::FillLayer::setBackgroundXOrigin):
(WebCore::FillLayer::setBackgroundYOrigin):
(WebCore::FillLayer::clearXPosition):
(WebCore::FillLayer::clearYPosition):
(WebCore::FillLayer::isBackgroundOriginSet): Deleted.

LayoutTests:

* TestExpectations:
* fast/backgrounds/background-position-parsing-2-expected.txt:
* fast/backgrounds/background-position-parsing-2.html:
* fast/backgrounds/background-shorthand-after-set-backgroundSize-expected.txt:
* fast/backgrounds/background-shorthand-after-set-backgroundSize.html:
* fast/backgrounds/background-shorthand-with-backgroundSize-style-expected.txt:
* fast/backgrounds/background-shorthand-with-backgroundSize-style.html:

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

4 years agoAdd SPI for sending WebsiteSettings to WebProcess during navigation
achristensen@apple.com [Thu, 8 Dec 2016 20:52:35 +0000 (20:52 +0000)]
Add SPI for sending WebsiteSettings to WebProcess during navigation
https://bugs.webkit.org/show_bug.cgi?id=165517
<rdar://29341068>

Source/WebKit2:

We add the ability for the navigation client to send settings to the WebProcess
based on the URL of the document being navigated to. This approach adds no new IPC
messages and allows the application to decide what settings to use during navigation
instead of declaratively before navigation. Right now there is only one setting,
whether to disable content blockers, but this infrastructure can be used for more settings.

Reviewed by Anders Carlsson.

* CMakeLists.txt:
* PlatformMac.cmake:
* Shared/API/APIObject.h:
* Shared/API/c/WKBase.h:
* Shared/WebsitePolicies.h: Added.
(WebKit::WebsitePolicies::encode):
(WebKit::WebsitePolicies::decode):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::decidePolicyForNavigationAction):
(API::NavigationClient::decidePolicyForNavigationResponse):
* UIProcess/API/APIPolicyClient.h:
(API::PolicyClient::decidePolicyForNavigationAction):
(API::PolicyClient::decidePolicyForNewWindowAction):
(API::PolicyClient::decidePolicyForResponse):
* UIProcess/API/APIWebsitePolicies.cpp: Added.
(API::WebsitePolicies::create):
* UIProcess/API/APIWebsitePolicies.h: Added.
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKFramePolicyListener.cpp:
(WKFramePolicyListenerUse):
(WKFramePolicyListenerUseWithPolicies):
* UIProcess/API/C/WKFramePolicyListener.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPagePolicyClient):
* UIProcess/API/C/WKWebsitePolicies.cpp: Added.
(WKWebsitePoliciesGetTypeID):
(WKWebsitePoliciesCreate):
(WKWebsitePoliciesSetContentBlockersEnabled):
(WKWebsitePoliciesGetContentBlockersEnabled):
* UIProcess/API/C/WKWebsitePolicies.h: Added.
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h: Added.
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm: Added.
(-[_WKWebsitePolicies dealloc]):
(-[_WKWebsitePolicies init]):
(-[_WKWebsitePolicies setContentBlockersEnabled:]):
(-[_WKWebsitePolicies contentBlockersEnabled]):
(-[_WKWebsitePolicies description]):
(-[_WKWebsitePolicies _apiObject]):
* UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: Added.
(WebKit::wrapper):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::reloadBrowsingContext):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::tryAppLink):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
* UIProcess/WebFormSubmissionListenerProxy.cpp:
(WebKit::WebFormSubmissionListenerProxy::continueSubmission):
* UIProcess/WebFrameListenerProxy.cpp:
(WebKit::WebFrameListenerProxy::receivedPolicyDecision):
* UIProcess/WebFrameListenerProxy.h:
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::use):
(WebKit::WebFramePolicyListenerProxy::download):
(WebKit::WebFramePolicyListenerProxy::ignore):
* UIProcess/WebFramePolicyListenerProxy.h:
(WebKit::WebFramePolicyListenerProxy::create):
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::receivedPolicyDecision):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebInspectorProxy.cpp:
(WebKit::decidePolicyForNavigationAction):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

Tools:

Reviewed by Anders Carlsson.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/contentBlockerCheck.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/WebsitePolicies.mm: Added.
(-[WebsitePoliciesDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[WebsitePoliciesDelegate _webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[WebsitePoliciesDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(TEST):

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

4 years agoWeb Inspector: Unable to delete breakpoint from worker script
joepeck@webkit.org [Thu, 8 Dec 2016 20:23:41 +0000 (20:23 +0000)]
Web Inspector: Unable to delete breakpoint from worker script
https://bugs.webkit.org/show_bug.cgi?id=165578

Reviewed by Matt Baker.

Source/WebInspectorUI:

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype._removeBreakpoint):
Match setting breakpoints. If this is a "URL breakpoint", affect
all targets. If this is a "Script breakpoint", affect just the
single target containing that Script.

LayoutTests:

* inspector/worker/debugger-shared-breakpoint-expected.txt: Added.
* inspector/worker/debugger-shared-breakpoint.html: Added.
Ensure setting / removing a breakpoint affects all Workers that share
a resource with the same URL.

* inspector/worker/resources/worker-debugger-pause.js:
Add an echo command that will be useful to ensure Workers are not paused.

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

4 years agoRebaseline fast/selectors/nth-last-child-bounds.html after r209548.
ryanhaddad@apple.com [Thu, 8 Dec 2016 20:14:26 +0000 (20:14 +0000)]
Rebaseline fast/selectors/nth-last-child-bounds.html after r209548.

Unreviewed test gardening.

* fast/selectors/nth-child-bounds-expected.txt:

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

4 years agopointer lock should exit when a js alert is shown
commit-queue@webkit.org [Thu, 8 Dec 2016 20:01:00 +0000 (20:01 +0000)]
pointer lock should exit when a js alert is shown
https://bugs.webkit.org/show_bug.cgi?id=165423
rdar://problem/29430803

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

Source/WebCore:

Test: pointer-lock/lock-lost-on-alert.html

* page/DOMWindow.cpp:
(WebCore::DOMWindow::alert):
(WebCore::DOMWindow::confirm):
(WebCore::DOMWindow::prompt):

LayoutTests:

* platform/mac/TestExpectations:
* pointer-lock/lock-lost-on-alert-expected.txt: Added.
* pointer-lock/lock-lost-on-alert.html: Added.

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

4 years agoSalt network cache hashes
antti@apple.com [Thu, 8 Dec 2016 19:58:21 +0000 (19:58 +0000)]
Salt network cache hashes
https://bugs.webkit.org/show_bug.cgi?id=164924

Reviewed by Alex Christensen.

To enhance privacy make cache content unidentifiable from file names alone.
This is done by generating a unique persistent salt for each cache instance.
It is used when computing hashes used in file names.

The patch also replaces plain text partition directory names with salted hashes.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::makeCacheKey):
(WebKit::NetworkCache::makeCacheKey): Deleted.
* NetworkProcess/cache/NetworkCache.h:

    Increment cache version.

* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::BlobStorage):
(WebKit::NetworkCache::BlobStorage::add):
(WebKit::NetworkCache::BlobStorage::get):

    Use salt for blob content hash.

* NetworkProcess/cache/NetworkCacheBlobStorage.h:
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::computeSHA1):

    For simplicity all SHA1s are now salted.

(WebKit::NetworkCache::makeSalt):
(WebKit::NetworkCache::readOrMakeSalt):

    Read salt if it exists, generate and persist it otherwise.

* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::Key::Key):

    Remove the "No partition" string and just empty.
    That was only needed to have a directory name of some sort.

(WebKit::NetworkCache::Key::computeHash):

    Use salt for key hash.

(WebKit::NetworkCache::Key::computePartitionHash):

    Separate hash for partition.

* NetworkProcess/cache/NetworkCacheKey.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::makeSubresourcesKey):
(WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeSaltFilePath):
(WebKit::NetworkCache::Storage::open):

    Cache can't be opened if we can't read or persist a salt.

(WebKit::NetworkCache::traverseRecordsFiles):
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::recordDirectoryPathForKey):

    Use the partition hash in the directory name instead of a plain text name.

(WebKit::NetworkCache::decodeRecordHeader):
(WebKit::NetworkCache::Storage::readRecord):
(WebKit::NetworkCache::Storage::encodeRecord):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::salt):

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

4 years agoEnable JSC restricted options by default in the jsc shell.
mark.lam@apple.com [Thu, 8 Dec 2016 19:43:31 +0000 (19:43 +0000)]
Enable JSC restricted options by default in the jsc shell.
https://bugs.webkit.org/show_bug.cgi?id=165615

Reviewed by Keith Miller.

The jsc shell is only used for debugging and development testing.  We should
allow it to use restricted options like JSC_useDollarVM even for release builds.

* jsc.cpp:
(jscmain):
* runtime/Options.cpp:
(JSC::Options::enableRestrictedOptions):
(JSC::Options::isAvailable):
(JSC::allowRestrictedOptions): Deleted.
* runtime/Options.h:

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

4 years ago[WebIDL] WebGLContextAttributes should be a dictionary
weinig@apple.com [Thu, 8 Dec 2016 19:09:35 +0000 (19:09 +0000)]
[WebIDL] WebGLContextAttributes should be a dictionary
https://bugs.webkit.org/show_bug.cgi?id=165572

Reviewed by Dean Jackson.

Source/WebCore:

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Remove unused files.

* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::getContext):
(WebCore::attributesFor3DContext): Deleted.
Re-work getContext to use JSDOMConvert and use the WebGLContextAttributes dictionary.

* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Add missing inclusion of dictionaries.

* html/HTMLCanvasElement.cpp:
(WebCore::maxActivePixelMemory):
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::is2dType):
(WebCore::HTMLCanvasElement::getContext2d):
(WebCore::shouldEnableWebGL):
(WebCore::HTMLCanvasElement::is3dType):
(WebCore::HTMLCanvasElement::getContextWebGL):
* html/HTMLCanvasElement.h:
Refactor context creation of 2d and WebGL contexts into their own functions. Make the
WebGL one take a WebGLContextAttributes struct.

* html/HTMLCanvasElement.idl:
No functionality change. Make IDL match the latest spec.

* html/canvas/CanvasContextAttributes.cpp: Removed.
* html/canvas/CanvasContextAttributes.h: Removed.
Remove unneeded base class.

* html/canvas/WebGLContextAttributes.cpp: Removed.
* html/canvas/WebGLContextAttributes.h:
Instead of a class, we can use a type alias of GraphicsContext3D::Attributes for
WebGLContextAttributes.

* html/canvas/WebGLContextAttributes.idl:
Convert to a dictionary.

* html/canvas/WebGL2RenderingContext.cpp:
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::clearIfComposited):
(WebCore::WebGLRenderingContextBase::getContextAttributes):
(WebCore::WebGLRenderingContextBase::applyStencilTest):
* html/canvas/WebGLRenderingContextBase.h:
Update to WebGLContextAttributes by value, since it is a simple struct now. Update getContextAttributes
to return a std::optional<WebGLContextAttributes>.

* html/canvas/WebGLRenderingContextBase.idl:
Make getContextAttributes return a nullable WebGLContextAttributes, as per spec.

* platform/graphics/GraphicsContext3D.h:
Sort attributes into categories, one that match WebGLContextAttributes, and the remainder.

LayoutTests:

* fast/canvas/webgl/context-creation-attributes-expected.txt:
Update test results.

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

4 years ago[CSS Parser] Unskip/remove more tests
hyatt@apple.com [Thu, 8 Dec 2016 18:57:34 +0000 (18:57 +0000)]
[CSS Parser] Unskip/remove more tests
https://bugs.webkit.org/show_bug.cgi?id=165611

Reviewed by Zalan Bujtas.

* TestExpectations:
* fast/css/parse-color-int-or-percent-crash.html:
* fast/css/string-quote-binary-expected.txt: Removed.
* fast/css/string-quote-binary.html: Removed.
* fast/masking/parsing-mask-expected.txt:
* fast/masking/parsing-mask.html:
* fast/selectors/nth-child-bounds.html:
* fast/selectors/nth-last-child-bounds-expected.txt:
* fast/selectors/nth-last-child-bounds.html:
* fast/text/text-combine-crash.html:

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

4 years ago[CSS Parser] Unskip more tests
hyatt@apple.com [Thu, 8 Dec 2016 18:37:23 +0000 (18:37 +0000)]
[CSS Parser] Unskip more tests
https://bugs.webkit.org/show_bug.cgi?id=165610

Reviewed by Zalan Bujtas.

* TestExpectations:
* fast/css/css-selector-text-expected.txt:
* fast/css/css-selector-text.html:
* fast/css/css-set-selector-text-expected.txt:
* fast/css/css-set-selector-text.html:
* fast/css/parsing-css-nth-child-expected.txt:
* fast/css/parsing-css-nth-child.html:

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

4 years agoDo not create multicolumn context for certain type of renderers.
zalan@apple.com [Thu, 8 Dec 2016 18:20:01 +0000 (18:20 +0000)]
Do not create multicolumn context for certain type of renderers.
https://bugs.webkit.org/show_bug.cgi?id=135601
<rdar://problem/27686300>

Reviewed by David Hyatt.

Source/WebCore:

Certain type of renderers including forms should not initialize multicolumn context for
their inner (shadow) content. It just does not makes sense and is inline with what other browsers do.

Test: fast/multicol/no-multicol-for-textareas.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns):
(WebCore::RenderBlockFlow::requiresColumns):
* rendering/RenderBlockFlow.h:

LayoutTests:

* fast/multicol/no-multicol-for-textareas-expected.txt: Added.
* fast/multicol/no-multicol-for-textareas.html: Added.

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

4 years ago[CSS Parser] Unskip more tests
hyatt@apple.com [Thu, 8 Dec 2016 18:19:14 +0000 (18:19 +0000)]
[CSS Parser] Unskip more tests
https://bugs.webkit.org/show_bug.cgi?id=165609

Reviewed by Zalan Bujtas.

A note on the parsing-css-attribute-* tests. These tests attempted to test namespaces, but
you really can't do that easily. A @namespace rule is only valid within the scope of its
stylesheet, and the test was assuming the namespace would apply outside of the stylesheet
scope.

The old parser would not properly reject prefixes that didn't point to any valid namespace,
and so it was possible to test prefixes. The new parser rejects these invalid prefixes, so just
remove the namespace component of these two tests.

* TestExpectations:
* fast/css/attr-parsing-expected.txt:
* fast/css/attr-parsing.html:
* fast/css/invalid-cursor-property-crash.html:
* fast/css/parsing-css-attribute-case-insensitive-value-1.html:
* fast/css/parsing-css-attribute-case-insensitive-value-2.html:
* fast/shadow-dom/slotted-pseudo-element-css-text-expected.txt:

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

4 years agoUnreviewed, rolling out r209489.
cdumez@apple.com [Thu, 8 Dec 2016 18:06:44 +0000 (18:06 +0000)]
Unreviewed, rolling out r209489.

Likely caused large regressions on JetStream, Sunspider and
Speedometer

Reverted changeset:

"Add system trace points for JavaScript VM entry/exit"
https://bugs.webkit.org/show_bug.cgi?id=165550
http://trac.webkit.org/changeset/209489

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

4 years ago[CSS Parser] Unskip more tests
hyatt@apple.com [Thu, 8 Dec 2016 18:02:29 +0000 (18:02 +0000)]
[CSS Parser] Unskip more tests
https://bugs.webkit.org/show_bug.cgi?id=165608

Reviewed by Zalan Bujtas.

* TestExpectations:
* fast/css/font-property-priority-expected.txt:
* fast/css/image-set-unprefixed.html:
* fast/css/parsing-text-emphasis-expected.txt:
* fast/css/parsing-text-emphasis.html:
* fast/css/uri-token-parsing-expected.txt:
* fast/css/uri-token-parsing.html:
* platform/mac/fast/css/font_property_normal-expected.txt:

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

4 years agoMove LEB tests to API tests
keith_miller@apple.com [Thu, 8 Dec 2016 17:59:52 +0000 (17:59 +0000)]
Move LEB tests to API tests
https://bugs.webkit.org/show_bug.cgi?id=165586

Reviewed by Saam Barati.

Source/JavaScriptCore:

Delete old stuff.

* testWasm.cpp:
(printUsageStatement):
(CommandLine::parseArguments):
(main):
(runLEBTests): Deleted.

Tools:

Move the tests from testWasm.cpp and make them functions
rather than macros.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/LEBDecoder.cpp: Added.
(TestWebKitAPI::testUnsignedLEBDecode):
(TestWebKitAPI::TEST):
(TestWebKitAPI::testInt32LEBDecode):

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

4 years ago[CSS Parser] REGRESSION: Values of 0 should not be allowed for -webkit-aspect-ratio
hyatt@apple.com [Thu, 8 Dec 2016 17:46:41 +0000 (17:46 +0000)]
[CSS Parser] REGRESSION: Values of 0 should not be allowed for -webkit-aspect-ratio
https://bugs.webkit.org/show_bug.cgi?id=165607

Reviewed by Simon Fraser.

Source/WebCore:

Unskipped fast/css/aspect-ratio-parsing-tests.html.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeWebkitAspectRatio):
Don't allow 0 as either the left or right value of the ratio.

LayoutTests:

* TestExpectations:

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

4 years agoSupport running the layout tests offline
cdumez@apple.com [Thu, 8 Dec 2016 17:45:46 +0000 (17:45 +0000)]
Support running the layout tests offline
https://bugs.webkit.org/show_bug.cgi?id=165534

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Commit W3C web-platform-tests modules so that it is now possible to run
layout tests offline.

* resources/web-platform-tests-modules.json:
* resources/web-platform-tests-modules/darobin/webidl2.js/archive/bd216bcd5596d60734450adc938155deab1e1a80.tar.gz: Added.
* resources/web-platform-tests-modules/dontcallmedom/widlproc/archive/4ef8dde69c0ba3d0167bccfa2775eea7f0d6c7fe.tar.gz: Added.
* resources/web-platform-tests-modules/html5lib/html5lib-python/archive/7cce65bbaa78411f98b8b37eeefc9db03c580097.tar.gz: Added.
* resources/web-platform-tests-modules/html5lib/html5lib-tests/archive/a9badff0cd2fe337170769d42ca2df5e96d30f97.tar.gz: Added.
* resources/web-platform-tests-modules/jgraham/six/archive/3b6173c833d217ab0186c355804f5925cbcfca47.tar.gz: Added.
* resources/web-platform-tests-modules/pytest-dev/pytest/archive/168daaa71f4cc5f846064ebebab41b9cf625a89a.tar.gz: Added.
* resources/web-platform-tests-modules/w3c/pywebsocket/archive/8c285d9015121e8c1c40be852439fc03b4a18112.tar.gz: Added.
* resources/web-platform-tests-modules/w3c/testharness.js/archive/873f9680aff66553f84d38f21a038c4534cc2789.tar.gz: Added.
* resources/web-platform-tests-modules/w3c/wdclient/archive/de9b46ec049f0b2a6fe261e27804970535ba8658.tar.gz: Added.
* resources/web-platform-tests-modules/w3c/wpt-tools/archive/cf9748586c2bca14998eda5956be6cf4d6d221d9.tar.gz: Added.
* resources/web-platform-tests-modules/w3c/wptserve/archive/071c51e26a57300979ad53313970d7247979f6d3.tar.gz: Added.

Tools:

* Scripts/webkitpy/common/system/autoinstall.py:
(AutoInstaller._download_to_stream):
getcode() returns None for file URLs so handle this.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(WebPlatformTestServer._install_modules):
Deal with local path in the json file and resolve them into file URLs
before using AutoInstall.

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

4 years ago[CSS Parser] Unskip more tests
hyatt@apple.com [Thu, 8 Dec 2016 17:32:20 +0000 (17:32 +0000)]
[CSS Parser] Unskip more tests
https://bugs.webkit.org/show_bug.cgi?id=165605

Reviewed by Zalan Bujtas.

* TestExpectations:
* fast/dom/Window/getMatchedCSSRules-with-pseudo-elements-complex-expected.txt:
* fast/dom/Window/getMatchedCSSRules-with-pseudo-elements-complex.html:
* fast/selectors/querySelector-pseudo-element-expected.txt:
* fast/selectors/querySelector-pseudo-element-inside-functional-pseudo-class-any-expected.txt:
* fast/selectors/querySelector-pseudo-element-inside-functional-pseudo-class-any.html:
* fast/selectors/querySelector-pseudo-element.html:

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

4 years ago[CSS Parser] Unskip more tests
hyatt@apple.com [Thu, 8 Dec 2016 16:50:51 +0000 (16:50 +0000)]
[CSS Parser] Unskip more tests
https://bugs.webkit.org/show_bug.cgi?id=165604

Reviewed by Zalan Bujtas.

* TestExpectations:

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

4 years ago[CSS Parser] Unskip more tests
hyatt@apple.com [Thu, 8 Dec 2016 16:47:12 +0000 (16:47 +0000)]
[CSS Parser] Unskip more tests
https://bugs.webkit.org/show_bug.cgi?id=165602

Reviewed by Zalan Bujtas.

* TestExpectations:
* fast/css/remove-shorthand-expected.txt:
* fast/css/transform-inline-style-expected.txt:
* fast/regions/region-styling/parsing-region-style-rule.html:
* fast/shapes/parsing/parsing-shape-image-threshold-expected.txt:
* fast/shapes/parsing/parsing-shape-image-threshold.html:
* fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt:
* fast/shapes/shape-outside-floats/shape-outside-animation.html:
* platform/mac/svg/webarchive/svg-cursor-subresources-expected.txt:
* svg/webarchive/svg-cursor-subresources.svg:
* transitions/transitions-parsing-expected.txt:
* transitions/transitions-parsing.html:

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

4 years agoFix the EFL build.
eric.carlson@apple.com [Thu, 8 Dec 2016 14:09:16 +0000 (14:09 +0000)]
Fix the EFL build.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange): Add another ENABLE(MEDIA_STREAM) guard.

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

4 years agoSource/WebCore:
antti@apple.com [Thu, 8 Dec 2016 14:05:27 +0000 (14:05 +0000)]
Source/WebCore:
::after and ::before don't work on :host
https://bugs.webkit.org/show_bug.cgi?id=164675
<rdar://problem/29231874>

Reviewed by Andreas Kling.

We didn't allow combining :host with any other selectors. Pseudo elements should be allowed.

Test: fast/shadow-dom/shadow-host-with-before-after.html

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchAuthorRules):

    Allow pseudo element matching.

(WebCore::ElementRuleCollector::matchHostPseudoClassRules):

    Use the normal collectMatchingRulesForList path instead of a direct call to SelectorChecker::matchHostPseudoClass.
    This path supports pseudo elements.

    Pass the information that we are matching :host rules with m_isMatchingHostPseudoClass bit
    similarly to how this is done with slots.

(WebCore::ElementRuleCollector::ruleMatches):
* css/ElementRuleCollector.h:
* css/RuleSet.cpp:

    Collect :host rules similarly to other rules.

(WebCore::RuleSet::addRule):
* css/SelectorChecker.cpp:

    Rename didMoveToShadowHost->mayMatchHostPseudoClass for clarity.

(WebCore::SelectorChecker::match):

    Enable :host matching in the current context immediately if needed.

(WebCore::SelectorChecker::matchHostPseudoClass):

    The check for illegal combinations with :host is now done in checkOne().

(WebCore::localContextForParent):
(WebCore::SelectorChecker::checkOne):

    In context where :host matches nothing else can match, except pseudo elements.

* css/SelectorChecker.h:

LayoutTests:
:after and :before don't work on :host
https://bugs.webkit.org/show_bug.cgi?id=164675
<rdar://problem/29231874>

Reviewed by Andreas Kling.

* fast/shadow-dom/shadow-host-with-before-after-expected.html: Added.
* fast/shadow-dom/shadow-host-with-before-after.html: Added.

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

4 years ago[GTK] Process accelerated compositing env variables only if they are really enabled
tpopela@redhat.com [Thu, 8 Dec 2016 13:39:46 +0000 (13:39 +0000)]
[GTK] Process accelerated compositing env variables only if they are really enabled
https://bugs.webkit.org/show_bug.cgi?id=165300

Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
(eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).

Reviewed by Michael Catanzaro.

* UIProcess/gtk/WebPreferencesGtk.cpp:
(WebKit::WebPreferences::platformInitializeStore):

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

4 years agoFix CMake build.
achristensen@apple.com [Thu, 8 Dec 2016 09:29:28 +0000 (09:29 +0000)]
Fix CMake build.

Source/WebCore:

* PlatformMac.cmake:
Add PerformanceLoggingCocoa.mm after r209181.

Source/WebKit2:

* CMakeLists.txt:
Add the new NetworkProcess/capture include directory to find new headers from r209498.
* NetworkProcess/capture/NetworkCaptureEvent.cpp:
(WebKit::NetworkCapture::Response::Response):
(WebKit::NetworkCapture::Error::Error):
The String constructor was ambiguous after r209498 because URL has an operator NSString* and String has an NSString constructor.
We should get rid of operator NSString* and operator String on URL.
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
Add some ENABLE(MEDIA_STREAM) macros to fix the build without it enabled after r209512.

Tools:

* DumpRenderTree/PlatformMac.cmake:
Remove CheckedMalloc.cpp after r209516.

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

4 years ago[Win] Some versions of Cygwin Perl generate incorrect C++ code.
pvollan@apple.com [Thu, 8 Dec 2016 09:04:29 +0000 (09:04 +0000)]
[Win] Some versions of Cygwin Perl generate incorrect C++ code.
https://bugs.webkit.org/show_bug.cgi?id=165524
rdar://problem/29508043

Reviewed by Daniel Bates.

Perl strings with variables seems to be handled differently, depending on which version of
Cygwin Perl you are running. To make sure they are handled identically, specify variables
in strings as "${var}" instead of "$var".

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):

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

4 years agoFix EFL build after r209526
achristensen@apple.com [Thu, 8 Dec 2016 08:23:16 +0000 (08:23 +0000)]
Fix EFL build after r209526
https://bugs.webkit.org/show_bug.cgi?id=165594

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
nullptr is being automatically converted to false everywhere but EFL.
It should be false.  This function returns a bool.

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

4 years agoFix iOS debug build after r209498
achristensen@apple.com [Thu, 8 Dec 2016 08:10:36 +0000 (08:10 +0000)]
Fix iOS debug build after r209498
https://bugs.webkit.org/show_bug.cgi?id=164527

* NetworkProcess/capture/NetworkCaptureLogging.h:
Logs were causing compile warnings/errors.  Disable logs for now.

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

4 years agoREGRESSION (r209490): [ios-simulator] LayoutTest fast/shadow-dom/media-shadow-manipul...
rniwa@webkit.org [Thu, 8 Dec 2016 08:07:42 +0000 (08:07 +0000)]
REGRESSION (r209490): [ios-simulator] LayoutTest fast/shadow-dom/media-shadow-manipulation.html is failing
https://bugs.webkit.org/show_bug.cgi?id=165590

Unreviewed. Revert r209490 on this test and make the check conditional
since iOS and Mac implements video element differently.

In any case, these tests aren't testing anything useful after r209486.
We should consider removing them or make them use internals.shadowRoot instead in a near term.

* fast/shadow-dom/media-shadow-manipulation-expected.txt:
* fast/shadow-dom/media-shadow-manipulation.html:

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

4 years agoCleanup WebAssembly's RETURN_IF_EXCEPTION
jfbastien@apple.com [Thu, 8 Dec 2016 07:20:37 +0000 (07:20 +0000)]
Cleanup WebAssembly's RETURN_IF_EXCEPTION
https://bugs.webkit.org/show_bug.cgi?id=165595

Reviewed by Filip Pizlo.

* wasm/js/WebAssemblyCompileErrorConstructor.cpp:
(JSC::constructJSWebAssemblyCompileError):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::constructJSWebAssemblyRuntimeError):

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

4 years ago[CSS Parser] Remove font test that tests something nobody supports
hyatt@apple.com [Thu, 8 Dec 2016 06:47:53 +0000 (06:47 +0000)]
[CSS Parser] Remove font test that tests something nobody supports
https://bugs.webkit.org/show_bug.cgi?id=165596

Reviewed by Zalan Bujtas.

Remove this test that thinks "default" should be a special keyword in fonts. No
other browser treat this as special. Our old parser did, but it's just from some
reading of ancient CSS2 specs and not for any real-world reason.

* TestExpectations:
* fast/css/font-family-parse-keyword.html: Removed.
* fast/css/font-family-parse-keyword-expected.html: Removed.

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

4 years agoREGRESSION: font shorthand parsing is broken
hyatt@apple.com [Thu, 8 Dec 2016 06:29:46 +0000 (06:29 +0000)]
REGRESSION: font shorthand parsing is broken
https://bugs.webkit.org/show_bug.cgi?id=165594

Reviewed by Zalan Bujtas.

Source/WebCore:

Unskipping fast/css/font-calculated-value.html.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontWeight):
The new parser did not support calc() in the font-weight property.
In order to support a positive integer, add new functions to consume
and handle positive integers without making a CSSPrimitiveValue out of
the number. These correspond to consumeNumberRaw but are limited to positive
integers.

(WebCore::CSSPropertyParser::consumeFont):
The implicit bool was incorrectly set to true when properties were
defined because releaseNonNull() cleared the variables being null
checked. Add separate booleans to avoid this.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumePositiveIntegerRaw):
(WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
* css/parser/CSSPropertyParserHelpers.h:
Add the new helpers that consume positive integers without creating
CSSPrimitiveValues out of them.

LayoutTests:

* TestExpectations:
* fast/css/font-shorthand-html-expected.txt:

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

4 years agoExit pointer lock when page goes into page cache.
commit-queue@webkit.org [Thu, 8 Dec 2016 06:19:57 +0000 (06:19 +0000)]
Exit pointer lock when page goes into page cache.
https://bugs.webkit.org/show_bug.cgi?id=165425
rdar://problem/29430834

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

Source/WebCore:

Test: pointer-lock/lock-lost-on-navigation.html

Cancel pointer lock when page goes into page cache and add methods to Internals
so it can be tested.

* dom/Document.cpp:
(WebCore::Document::setPageCacheState):
* page/PointerLockController.h:
* testing/Internals.cpp:
(WebCore::Internals::pageHasPendingPointerLock):
(WebCore::Internals::pageHasPointerLock):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* platform/mac/TestExpectations:
* pointer-lock/lock-lost-on-navigation-expected.txt: Added.
* pointer-lock/lock-lost-on-navigation.html: Added.
* pointer-lock/resources/lock-lost-on-navigation2.html: Added.

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

4 years ago[CSS Parser] Unskip calc() tests
hyatt@apple.com [Thu, 8 Dec 2016 06:14:07 +0000 (06:14 +0000)]
[CSS Parser] Unskip calc() tests
https://bugs.webkit.org/show_bug.cgi?id=165583

Reviewed by Zalan Bujtas.

* TestExpectations:
* fast/css/flex-shrink-calculated-value-expected.txt:
* fast/css/flex-shrink-calculated-value.html:
* fast/css/negative-calc-values-expected.txt:
* fast/css/negative-calc-values.html:
* fast/css/text-shadow-calc-value-expected.txt:
* fast/css/text-shadow-calc-value.html:
* fast/css/webkit-line-clamp-calculated-value-expected.txt:
* fast/css/webkit-line-clamp-calculated-value.html:
* fast/css/z-index-calculated-value-expected.txt:
* fast/css/z-index-calculated-value.html:

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

4 years ago[Modern Media Controls] Tracks panel does not display in the right location in fullsc...
commit-queue@webkit.org [Thu, 8 Dec 2016 05:51:05 +0000 (05:51 +0000)]
[Modern Media Controls] Tracks panel does not display in the right location in fullscreen and cannot be dismissed
https://bugs.webkit.org/show_bug.cgi?id=165575

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

Source/WebCore:

We position the tracks panel programmatically based on the current bounds of the fullscreen button in fullscreen.
This allows for the tracks panel to be shown in the right spot even after dragging the controls bar. We also use
the fullscreen media controls as the target for tracking "mousedown" events when the tracks panel is shown in a
fullscreen presentation.

Tests: media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html
       media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html

* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
(.media-controls.mac.fullscreen .scrubber):
(.media-controls.mac.fullscreen .tracks-panel): Deleted.
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.showTracksPanel):
* Modules/modern-media-controls/controls/tracks-panel.js:
(TracksPanel.prototype.presentInParent):
(TracksPanel.prototype.hide):
(TracksPanel.prototype.get bottomY):
(TracksPanel.prototype.set bottomY):
(TracksPanel.prototype.commitProperty):
(TracksPanel.prototype._mousedownTarget):

LayoutTests:

Add new tests to check we correctly position the tracks panel in fullscreen, including when we drag the controls bar.

* media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls-expected.txt: Added.
* media/modern-media-controls/tracks-support/tracks-support-show-panel-after-dragging-controls.html: Added.
* media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen-expected.txt: Added.
* media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html: Added.

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

4 years agopointer-lock/lock-lost-on-esc-in-fullscreen.html timeout on mac-wk1
jeremyj-wk@apple.com [Thu, 8 Dec 2016 05:18:06 +0000 (05:18 +0000)]
pointer-lock/lock-lost-on-esc-in-fullscreen.html timeout on mac-wk1
https://bugs.webkit.org/show_bug.cgi?id=165589

Unreviewed skipping test that is timing out.

* platform/mac-wk1/TestExpectations:

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

4 years agoFix the filename for a newly added test expectation file.
ryanhaddad@apple.com [Thu, 8 Dec 2016 05:09:53 +0000 (05:09 +0000)]
Fix the filename for a newly added test expectation file.

Unreviewed test gardening.

* tiled-drawing/scrolling/scroll-snap/scroll-snap-scrolling-jumps-to-top-expected.txt: Renamed from LayoutTests/tiled-drawing/scrolling/scroll-snap/scroll-snap-scrolling-jumps-to-top.txt.

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

4 years ago[Modern Media Controls] Use a small picture-in-picture button in fullscreen
commit-queue@webkit.org [Thu, 8 Dec 2016 04:46:13 +0000 (04:46 +0000)]
[Modern Media Controls] Use a small picture-in-picture button in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=165587

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

Source/WebCore:

Use a newer, smaller asset for picture-in-picture in fullscreen.

* Modules/modern-media-controls/controls/icon-service.js:
* Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png: Added.
* Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png: Added.

LayoutTests:

Rebaseline tests to account for the smaller picture-in-picture button in fullscreen.

* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-styles-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-styles.html:

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

4 years agoREGRESSION(r203912): Web Inspector: Navigation sidebar widths are not saved
commit-queue@webkit.org [Thu, 8 Dec 2016 04:27:19 +0000 (04:27 +0000)]
REGRESSION(r203912): Web Inspector: Navigation sidebar widths are not saved
https://bugs.webkit.org/show_bug.cgi?id=165496

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

* UserInterface/Views/TabBrowser.js:
(WebInspector.TabBrowser):
(WebInspector.TabBrowser.prototype._sidebarWidthDidChange):
(WebInspector.TabBrowser.prototype._showNavigationSidebarPanelForTabContentView):
(WebInspector.TabBrowser.prototype._sidebarWidthDidChange): Renamed from _detailsSidebarWidthDidChange.
Add event listener for when the navigation sidebar's width is changed.

* UserInterface/Views/TabContentView.js:
(WebInspector.TabContentView):
(WebInspector.TabContentView.prototype.get navigationSidebarPanel):
(WebInspector.TabContentView.prototype.get navigationSidebarCollapsedSetting):
(WebInspector.TabContentView.prototype.get navigationSidebarWidthSetting):
(WebInspector.TabContentView.prototype.get detailsSidebarPanels):
(WebInspector.TabContentView.prototype.get detailsSidebarCollapsedSetting):
(WebInspector.TabContentView.prototype.get detailsSidebarSelectedPanelSetting):
(WebInspector.TabContentView.prototype.get detailsSidebarWidthSetting):
Add WebInspector.Setting object for the navigation sidebar's width.

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

4 years agoMarking inspector/debugger/async-stack-trace.html as flaky on macOS.
ryanhaddad@apple.com [Thu, 8 Dec 2016 03:58:39 +0000 (03:58 +0000)]
Marking inspector/debugger/async-stack-trace.html as flaky on macOS.
https://bugs.webkit.org/show_bug.cgi?id=165584

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoMarking inspector/worker/debugger-scripts.html as flaky on mac-wk2.
ryanhaddad@apple.com [Thu, 8 Dec 2016 03:52:38 +0000 (03:52 +0000)]
Marking inspector/worker/debugger-scripts.html as flaky on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=165582

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years agoDumpRenderTree should stop using CheckedMalloc.
mark.lam@apple.com [Thu, 8 Dec 2016 03:26:10 +0000 (03:26 +0000)]
DumpRenderTree should stop using CheckedMalloc.
https://bugs.webkit.org/show_bug.cgi?id=165563
<rdar://problem/28945820>

Reviewed by Geoffrey Garen.

1. WebKitTestRunner does not have equivalent behavior to that which is implemented
   in CheckedMalloc.
2. bmalloc does not honor the settings of CheckedMalloc.

The only time CheckedMalloc comes into play is when DRT uses gmalloc or system
malloc.  As a result, DRT exhibits different behavior from the normal way we run
our tests.  We should obsolete CheckedMalloc and make DRT behave consistently
with WKTR.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/mac/CheckedMalloc.cpp: Removed.
* DumpRenderTree/mac/CheckedMalloc.h: Removed.
* DumpRenderTree/mac/DumpRenderTree.mm:
(prepareConsistentTestingEnvironment):

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

4 years ago[CSS Parser] Unskip media tests
hyatt@apple.com [Thu, 8 Dec 2016 03:22:36 +0000 (03:22 +0000)]
[CSS Parser] Unskip media tests
https://bugs.webkit.org/show_bug.cgi?id=165580

Reviewed by Jon Lee.

The new parser will still create rules for hover/pointer queries with
unknown identifiers. Patch the tests to account for this.

* TestExpectations:
* fast/media/mq-any-hover-invalid-expected.txt:
* fast/media/mq-any-hover-invalid.html:
* fast/media/mq-any-pointer-invalid-expected.txt:
* fast/media/mq-any-pointer-invalid.html:
* fast/media/mq-hover-invalid-expected.txt:
* fast/media/mq-hover-invalid.html:
* fast/media/mq-pointer-invalid-expected.txt:
* fast/media/mq-pointer-invalid.html:

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

4 years agoRemove runtime toggle for pointer-lock
dino@apple.com [Thu, 8 Dec 2016 02:53:41 +0000 (02:53 +0000)]
Remove runtime toggle for pointer-lock
https://bugs.webkit.org/show_bug.cgi?id=165577
<rdar://problems/29566996>

Reviewed by Jon Lee.

Source/WebCore:

Remove any runtime calls to check if pointer-lock is enabled. It's
either compiled in or out.

Covered by existing tests.

* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setPointerLockEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::pointerLockEnabled): Deleted.
* dom/Document.idl:
* dom/Element.idl:
* page/Page.h:
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
(WebCore::PointerLockController::requestPointerUnlock):
(WebCore::PointerLockController::requestPointerUnlockAndForceCursorVisible):

Source/WebKit/mac:

Remove any runtime calls to check if pointer-lock is enabled. It's
either compiled in or out.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences pointerLockEnabled]): Deleted.
(-[WebPreferences setPointerLockEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Remove any runtime calls to check if pointer-lock is enabled. It's
either compiled in or out.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPointerLockEnabled): Deleted.
(WKPreferencesGetPointerLockEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Remove any runtime calls to check if pointer-lock is enabled. It's
either compiled in or out.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

Websites/webkit.org:

No need to have pointer-lock tested.

* experimental-features.html: Also sort the list alphabetically.

LayoutTests:

Remove any runtime calls to check if pointer-lock is enabled. It's
either compiled in or out.

* platform/mac/TestExpectations: Enable the pointer-lock tests that should work.
* pointer-lock/pointer-lock-api.html: Fix a bad DOM call.
* pointer-lock/pointerlock-interface-disabled-expected.txt: Removed.
* pointer-lock/pointerlock-interface-disabled.html: Removed.

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

4 years ago[MediaStream][Mac] Revoke sandbox extensions when capture ends
eric.carlson@apple.com [Thu, 8 Dec 2016 02:25:57 +0000 (02:25 +0000)]
[MediaStream][Mac] Revoke sandbox extensions when capture ends
https://bugs.webkit.org/show_bug.cgi?id=165476

Reviewed by Brady Eidson.
Source/WebKit2:

Track media capture by process so it is possible to revoke the sandbox extensions issued to
a web process when capture stops. Allocate WK2 user media permission manager lazily rather
than every time a page is created as most pages won't need one.

* CMakeLists.txt: Add new files.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
  with process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox
  extension code to the process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
(WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
  change to the process manager.
(WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

* UIProcess/UserMediaProcessManager.cpp: Added.
(WebKit::ProcessState::ProcessState):
(WebKit::ProcessState::managers):
(WebKit::ProcessState::sandboxExtensionsGranted):
(WebKit::ProcessState::setSandboxExtensionsGranted):
(WebKit::stateMap):
(WebKit::processState):
(WebKit::ProcessState::addRequestManager):
(WebKit::ProcessState::removeRequestManager):
(WebKit::UserMediaProcessManager::singleton):
(WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
(WebKit::UserMediaProcessManager::willCreateMediaStream):
(WebKit::UserMediaProcessManager::startedCaptureSession):
(WebKit::UserMediaProcessManager::endedCaptureSession):
* UIProcess/UserMediaProcessManager.h: Added.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Don't allocate m_userMediaPermissionRequestManager.
(WebKit::WebPageProxy::resetState): Set m_userMediaPermissionRequestManager to null.
(WebKit::WebPageProxy::userMediaPermissionRequestManager): Allocate m_userMediaPermissionRequestManager
  lazily as most pages don't need it.
(WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Call userMediaPermissionRequestManager().
(WebKit::WebPageProxy::enumerateMediaDevicesForFrame): Ditto.
(WebKit::WebPageProxy::clearUserMediaState): Ditto.
(WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
  manager proxy.
* UIProcess/WebPageProxy.h:

* WebKit2.xcodeproj/project.pbxproj: Add new files.

* WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
(WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
(WebKit::MediaDeviceSandboxExtensions::encode):
(WebKit::MediaDeviceSandboxExtensions::decode):
(WebKit::MediaDeviceSandboxExtensions::operator[]):
(WebKit::MediaDeviceSandboxExtensions::size):
* WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
  is now in a HashMap, not a Vector.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
  IDs with extensions so they can be revoked later.
(WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
* WebProcess/MediaStream/UserMediaPermissionRequestManager.h:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
(WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
(WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Add a test which loads a page that calls navigator.mediaDevices.enumerateDevices, kills the
page, and loads the same page again to ensure that the WK2 UserMediaPermissionRequestManagerProxy
is reset and recreated when a web page exits and is reloaded.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/EnumerateMediaDevices.cpp: Added.
(TestWebKitAPI::checkUserMediaPermissionCallback):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/enumerateMediaDevices.html: Added.

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

4 years ago[CSS Parser] Unskip gradients tests
hyatt@apple.com [Thu, 8 Dec 2016 02:18:27 +0000 (02:18 +0000)]
[CSS Parser] Unskip gradients tests
https://bugs.webkit.org/show_bug.cgi?id=165576

Reviewed by Dean Jackson.

Keywords like left, center, top, right and bottom are preserved when serializing in
the new parser.

* TestExpectations:
* fast/gradients/css3-gradient-parsing-expected.txt:
* fast/gradients/css3-gradient-parsing.html:
* fast/gradients/unprefixed-gradient-parsing-expected.txt:
* fast/gradients/unprefixed-gradient-parsing.html:

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

4 years agoAllow commas in Accept, Accept-Language, and Content-Language request headers for...
wilander@apple.com [Thu, 8 Dec 2016 02:08:28 +0000 (02:08 +0000)]
Allow commas in Accept, Accept-Language, and Content-Language request headers for simple CORS
https://bugs.webkit.org/show_bug.cgi?id=165566
<rdar://problem/29560983>

Reviewed by Alex Christensen.

Source/WebCore:

Updated the existing tests.

* platform/network/HTTPParsers.cpp:
(WebCore::isValidAcceptHeaderValue):
    Now also accepts ','.
(WebCore::isValidLanguageHeaderValue):
    Ditto.

LayoutTests:

* http/tests/xmlhttprequest/cors-non-standard-safelisted-headers-should-trigger-preflight.html:
    Added ',' to the tests as well as two examples from
    two sites where we found a regression.

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

4 years ago[CSS Parser] Stop skipping tests in the css3 LayoutTests subdirectory
hyatt@apple.com [Thu, 8 Dec 2016 02:01:30 +0000 (02:01 +0000)]
[CSS Parser] Stop skipping tests in the css3 LayoutTests subdirectory
https://bugs.webkit.org/show_bug.cgi?id=165574

Reviewed by Dean Jackson.

Source/WebCore:

* css/CSSGroupingRule.cpp:
(WebCore::CSSGroupingRule::insertRule):
The old parser didn't support the creation of @namespace rules in the
CSS OM, but the new parser does. We need to ensure that just like for
@import rules, that the insertion of a @namespace rule inside a
@supports rule is not allowed. This test passed in the old parser because
the rule just didn't get created, but in the new parser, we need to
add a check along with the @import rule check to ensure it isn't allowed.

LayoutTests:

* TestExpectations:
Stop skipping two tests.

* css3/font-variant-parsing-expected.txt:
* css3/font-variant-parsing.html:
Patched to yield the correct results when multiple values are specified for the
same sub-property.

* css3/supports-cssom-expected.txt:
* css3/supports-cssom.html:
Patched to account for the new result for @namespace insertion failure (see
corresponding WebCore ChangeLog for explanation), and also patched to get rid
of excess whitespace, since the new parser doesn't preserve whitespace formatting
when serializing @supports.

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