achristensen@apple.com [Wed, 14 Dec 2016 02:39:39 +0000 (02:39 +0000)]
Fix CMake build.
Source/WebKit2:
* PlatformMac.cmake:
Tools:
* DumpRenderTree/PlatformMac.cmake:
Define NS_RETURNS_RETAINED as nothing for now.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209786
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
sbarati@apple.com [Wed, 14 Dec 2016 01:31:43 +0000 (01:31 +0000)]
WebAssembly: implement the elements section
https://bugs.webkit.org/show_bug.cgi?id=165715
Reviewed by Keith Miller.
JSTests:
* wasm/Builder.js:
(export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
(export.default.Builder.prototype._registerSectionBuilders.switch):
* wasm/Builder_WebAssemblyBinary.js:
(const.emitters.Element):
* wasm/function-tests/basic-element.js: Added.
* wasm/js-api/element.js: Added.
(assertBadBinary):
(assertBadBinary.badInstantiation):
Source/JavaScriptCore:
This is a straight forward implementation of the Element
section in the Wasm spec:
https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#element-section
There are a few ambiguities I encountered when implementing this, so I've
filed bugs against the Wasm design repo, and corresponding bugzilla bugs
for us to address after they've been discussed by the various Wasm folks:
- https://bugs.webkit.org/show_bug.cgi?id=165827
- https://bugs.webkit.org/show_bug.cgi?id=165826
- https://bugs.webkit.org/show_bug.cgi?id=165825
* wasm/WasmFormat.h:
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseElement):
(JSC::Wasm::ModuleParser::parseInitExpr):
(JSC::Wasm::ModuleParser::parseData):
* wasm/WasmModuleParser.h:
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::evaluate):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209785
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Wed, 14 Dec 2016 00:20:11 +0000 (00:20 +0000)]
REGRESSION(r204163): Web Inspector: Page crashes when Inspector tries to load insecure SourceMap
https://bugs.webkit.org/show_bug.cgi?id=165806
<rdar://problem/
28169025>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-12-13
Reviewed by Alex Christensen.
Source/WebCore:
Test: http/tests/inspector/network/loadResource-insecure-resource.html
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::loadResource):
DocumentThreadableLoader now triggers the ThreadableLoaderClient's didFail
callback, so this didFailLoaderCreation is now redundent and incorrect.
LayoutTests:
* http/tests/inspector/network/loadResource-insecure-resource-expected.txt: Added.
* http/tests/inspector/network/loadResource-insecure-resource.html: Added.
* http/tests/inspector/network/resource-timing.html:
* http/tests/inspector/resources/inspector-test.js:
(runTestHTTPS):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209784
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
hyatt@apple.com [Wed, 14 Dec 2016 00:18:17 +0000 (00:18 +0000)]
[CSS Parser] Enhance fast path translate transforms to allow percentages
https://bugs.webkit.org/show_bug.cgi?id=165822
Reviewed by Simon Fraser.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseTransformTranslateArguments):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209783
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jer.noble@apple.com [Tue, 13 Dec 2016 23:37:15 +0000 (23:37 +0000)]
Fullscreen in WebKit2 does not restore topContentInset upon exiting; leaves top of page not visible
https://bugs.webkit.org/show_bug.cgi?id=165697
Source/WebKit2:
Delegate the values of topContentInset() from WebViewImpl (used by WKWebView and WKView) to the
WebPageProxy, so that setting the topContentInset() on WebPageProxy is reflected in the getters
for the two view classes.
Reviewed by Tim Horton.
* UIProcess/Cocoa/WebViewImpl.h:
(WebKit::WebViewImpl::topContentInset): Deleted.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
(WebKit::WebViewImpl::topContentInset):
(WebKit::WebViewImpl::setTopContentInset):
(WebKit::WebViewImpl::dispatchSetTopContentInset):
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController enterFullScreen:]):
(-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
(-[WKFullScreenWindowController _saveTopContentInset]): Deleted.
(-[WKFullScreenWindowController _restoreTopContentInset]): Deleted.
Tools:
Reviewed by Tim Horton.
* TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenTopContentInset.mm:
(TestWebKitAPI::TEST):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209782
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ryanhaddad@apple.com [Tue, 13 Dec 2016 23:24:47 +0000 (23:24 +0000)]
Rebaseline js/dom/global-constructors-attributes.html after r209777.
Unreviewed test gardening.
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209781
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
rniwa@webkit.org [Tue, 13 Dec 2016 23:22:03 +0000 (23:22 +0000)]
:hover rule causes a single tap to not activate a slotted anchor element
https://bugs.webkit.org/show_bug.cgi?id=165551
Reviewed by Antti Koivisto.
Source/WebCore:
Fixed a bug in ancestorRespondingToClickEvents that we were traversing the ancestor nodes without taking
shadow roots and slots into account. This prevented tapping on a text node assigned to a slot inside
an anchor element to activate the hyperlink on iOS.
This bug was supposed to be fixed in r206605, and it was still broken on iOS due to the bug in
ancestorRespondingToClickEvents. It is now tested by click-text-inside-linked-slot.html.
Tests: fast/shadow-dom/click-on-slotted-anchor-with-hover.html
fast/shadow-dom/click-text-inside-linked-slot.html
* page/ios/FrameIOS.mm:
(WebCore::ancestorRespondingToClickEvents):
(WebCore::Frame::qualifyingNodeAtViewportLocation):
LayoutTests:
Added a test for tapping on an anchor element assigned to a slot, which has been fixed in r209065.
Also added a new helper JS wrapepr, UIHelper, defined inside LayoutTests/resources/js-helper.js
to provide an abstraction around EventSender and UIScriptController.
Fixed click-text-inside-linked-slot.html on iOS using UIHelper.
* fast/shadow-dom/click-on-slotted-anchor-with-hover-expected.txt: Added.
* fast/shadow-dom/click-on-slotted-anchor-with-hover.html: Added.
* fast/shadow-dom/click-text-inside-linked-slot.html:
* platform/ios-simulator/fast/shadow-dom/click-text-inside-linked-slot-expected.txt: Added.
* resources/ui-helper.js: Added.
(window.UIHelper.isIOS):
(window.UIHelper.activateAt.return.new.Promise):
(window.UIHelper.activateAt):
(window.UIHelper.wait):
(window.UIHelper):
* platform/ios-simulator-wk2/TestExpectations: Skip the test in the open source iOS's WebKit2.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209780
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
bfulgham@apple.com [Tue, 13 Dec 2016 22:56:28 +0000 (22:56 +0000)]
[Mac][WK2] Tighten Keychain directory access
https://bugs.webkit.org/show_bug.cgi?id=165818
<rdar://problem/
16863857>
Reviewed by Anders Carlsson.
Lock down Keychain directory access to just the file-read-data, file-read-metadata, and
file-write-data operations we actually need.
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209779
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jfbastien@apple.com [Tue, 13 Dec 2016 22:27:48 +0000 (22:27 +0000)]
std::expected: fix rvalue forwarding issues
https://bugs.webkit.org/show_bug.cgi?id=165812
Reviewed by Mark Lam.
* wtf/Expected.h:
(WTF::UnexpectedType::UnexpectedType):
(WTF::ExpectedDetail::Base::Base):
(WTF::Expected::Expected):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209778
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
hyatt@apple.com [Tue, 13 Dec 2016 22:15:13 +0000 (22:15 +0000)]
[CSS Parser] Eliminate SVGPaint and SVGColor
https://bugs.webkit.org/show_bug.cgi?id=165819
Reviewed by Dean Jackson.
Source/WebCore:
Remove SVGColor and SVGPaint CSS values from the tree. The new parser
already stopped making these values when parsing, so all that's left
is to make sure computed style doesn't use these values either.
We are the only browser engine to support these CSS values, they see no use
on the Web, and they're already gone at the parsing level, so it's time
to remove these interfaces from our tree.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::toJSNewlyCreated):
* css/CSSComputedStyleDeclaration.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
* css/CSSValue.h:
(WebCore::CSSValue::isSubtypeExposedToCSSOM):
(WebCore::CSSValue::isSVGColor): Deleted.
(WebCore::CSSValue::isSVGPaint): Deleted.
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSVGColor):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFill):
(WebCore::StyleBuilderCustom::applyValueStroke):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fillPaintType):
(WebCore::RenderStyle::setFillPaintColor):
(WebCore::RenderStyle::strokePaintType):
(WebCore::RenderStyle::setStrokePaintColor):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialFillPaintType):
(WebCore::SVGRenderStyle::initialStrokePaintType):
(WebCore::SVGRenderStyle::setFillPaint):
(WebCore::SVGRenderStyle::setStrokePaint):
(WebCore::SVGRenderStyle::fillPaintType):
(WebCore::SVGRenderStyle::strokePaintType):
(WebCore::SVGRenderStyle::visitedLinkFillPaintType):
(WebCore::SVGRenderStyle::visitedLinkStrokePaintType):
(WebCore::SVGRenderStyle::hasStroke):
(WebCore::SVGRenderStyle::hasFill):
* rendering/style/SVGRenderStyleDefs.h:
* rendering/svg/RenderSVGResource.cpp:
(WebCore::requestPaintingResource):
* rendering/svg/SVGResources.cpp:
(WebCore::paintingResourceFromSVGPaint):
* svg/SVGAllInOne.cpp:
* svg/SVGAnimatedColor.cpp:
(WebCore::SVGAnimatedColorAnimator::constructFromString):
(WebCore::parseColorFromString):
(WebCore::SVGAnimatedColorAnimator::calculateDistance):
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::setValueAsString):
* svg/SVGAnimatedType.h:
* svg/SVGColor.cpp: Removed.
* svg/SVGColor.h: Removed.
* svg/SVGColor.idl: Removed.
* svg/SVGFEDiffuseLightingElement.cpp:
* svg/SVGFESpecularLightingElement.cpp:
* svg/SVGPaint.cpp: Removed.
* svg/SVGPaint.h: Removed.
* svg/SVGPaint.idl: Removed.
LayoutTests:
* fast/dom/Window/resources/window-properties.js:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* svg/animations/additive-type-by-animation-expected.txt:
* svg/animations/animate-color-calcMode-discrete-expected.txt:
* svg/animations/animate-color-fill-currentColor-expected.txt:
* svg/animations/animate-color-fill-from-by-expected.txt:
* svg/animations/animate-color-transparent-expected.txt:
* svg/animations/animate-currentColor-expected.txt:
* svg/animations/animate-dynamic-update-attributeName-expected.txt:
* svg/animations/animate-elem-03-t-drt-expected.txt:
* svg/animations/animate-inherit-css-property-expected.txt:
* svg/animations/attributeTypes-expected.txt:
* svg/animations/resources/SVGAnimationTestCase.js:
(expectColor):
* svg/animations/script-tests/animate-color-fill-currentColor.js:
(sample1):
(sample2):
(sample3):
* svg/animations/script-tests/animate-color-fill-from-by.js:
(sample1):
(sample2):
(sample3):
* svg/css/getComputedStyle-basic-expected.txt:
* svg/css/rect-system-color-expected.txt:
* svg/css/rect-system-color.xhtml:
* svg/custom/global-constructors-expected.txt:
* svg/custom/js-svg-constructors-expected.txt:
* svg/custom/js-svg-constructors.svg:
* svg/custom/script-tests/global-constructors.js:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209777
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
achristensen@apple.com [Tue, 13 Dec 2016 22:11:19 +0000 (22:11 +0000)]
Restore NSURLRequest's default time interval to match behavior before NSURLSession adoption
https://bugs.webkit.org/show_bug.cgi?id=165821
<rdar://problem/
28492939>
Reviewed by Brady Eidson.
Before adopting NSURLSession, iOS used CFURLConnection, not NSURLConnection.
iOS used to have a default timeout of INT_MAX and it now has a default timeout of 0, which means use the
default NSURLRequest timeout, which is 60 seconds. This is not enough for some slow mobile networks,
so we want to match behavior of our CFURLConnection code here.
* platform/network/ResourceRequestBase.cpp:
Use INT_MAX as the default timeout of requests on iOS.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209776
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
aestes@apple.com [Tue, 13 Dec 2016 22:08:49 +0000 (22:08 +0000)]
[Cocoa] Implement -shouldInsertText: on WKWebProcessPlugInEditingDelegate
https://bugs.webkit.org/show_bug.cgi?id=165785
<rdar://problem/
26929398>
Reviewed by Darin Adler.
Source/WebKit2:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Defined
WKEditorInsertAction and declared
-_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction:.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(toWK): Added. Mapped a WebCore::EditorInsertAction to a WKEditorInsertAction.
(-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Implemented
EditorClient::shouldInsertText() by calling
-_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction: with
the text, wrapped range handle, and action. Added shouldInsertText to DelegateMethods and
initialized it according to whether the delegate responds to shouldInsertText:.
Tools:
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegate.mm:
(-[BundleEditingDelegateRemoteObject shouldInsertText:replacingRange:givenAction:]): Added
expectations for the text, range, and action.
(TEST): Set the "EditingDelegateShouldInsertText" bundle parameter to NO so that the plug-in
will return NO in -_webProcessPlugInBrowserContextController:willInsertText:. Added a
plain-text string to the pasteboard, executed a paste action, and verified that the selected
text in the web view did not change.
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegatePlugIn.mm:
(-[BundleEditingDelegatePlugIn webProcessPlugIn:didCreateBrowserContextController:]): Set
_editingDelegateShouldInsertText according to the "EditingDelegateShouldInsertText" bundle
parameter.
(-[BundleEditingDelegatePlugIn _webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction:]):
Added. Called -shouldInsertText:replacingRange:givenAction: on the remote object proxy
and returned the value of _editingDelegateShouldInsertText.
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegateProtocol.h: Declared
-shouldInsertText:replacingRange:givenAction:.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209775
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ryanhaddad@apple.com [Tue, 13 Dec 2016 22:05:00 +0000 (22:05 +0000)]
Rebaseline js/dom/global-constructors-attributes.html after r209760.
Unreviewed test gardening.
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209774
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Tue, 13 Dec 2016 20:44:17 +0000 (20:44 +0000)]
Unreviewed, rolling out r209544.
Looks like r209489 did not cause the performance regression
after all
Reverted changeset:
"Unreviewed, rolling out r209489."
https://bugs.webkit.org/show_bug.cgi?id=165550
http://trac.webkit.org/changeset/209544
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209773
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
beidson@apple.com [Tue, 13 Dec 2016 20:41:42 +0000 (20:41 +0000)]
Add a PerfTest targeting IDBObjectStore.get().
https://bugs.webkit.org/show_bug.cgi?id=165816
Reviewed by Alex Christensen.
* IndexedDB/objectstore-get.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209772
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
sbarati@apple.com [Tue, 13 Dec 2016 20:32:40 +0000 (20:32 +0000)]
WebAssembly: implement the table section and table import
https://bugs.webkit.org/show_bug.cgi?id=165716
Reviewed by Keith Miller.
JSTests:
* wasm/Builder.js:
(const._importMemoryContinuation):
(const._importTableContinuation):
(export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
(const._importMemoryContinuation.section): Deleted.
(const): Deleted.
(const._importMemoryContinuation.assert): Deleted.
* wasm/Builder_WebAssemblyBinary.js:
(const.putResizableLimits):
(const.putTable):
(const.emitters.Import):
(const.emitters.Table):
* wasm/function-tests/call-indirect-params.js:
* wasm/function-tests/call-indirect.js:
* wasm/function-tests/table-basic-2.js: Added.
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
(func):
* wasm/function-tests/table-basic.js: Added.
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
* wasm/js-api/call-indirect-results.js:
(const.wasmModuleWhichImportJS): Deleted.
(MonomorphicImport): Deleted.
* wasm/js-api/call-indirect.js:
(const.wasmModuleWhichImportJS):
(const.makeTable):
(Polyphic2Import):
(VirtualImport):
(MonomorphicImport): Deleted.
* wasm/js-api/table.js: Added.
(assertBadBinary):
(assert.truthy):
(assertBadTable):
(assertBadTableImport):
(assertBadBinary.assertBadTableInstance):
(assertBadTableInstance):
(new.WebAssembly.Table):
* wasm/js-api/test_basic_api.js:
(const.c.in.constructorProperties.switch):
Source/JavaScriptCore:
This patch implements the Table space for wasm:
https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#table-section
It only implements defining and importing a table. The bulk
of this patch is implementing the various wasm Table prototype
methods and the underlying Table object:
https://github.com/WebAssembly/design/blob/master/JS.md#webassemblytable-constructor
This patch also fixes a bug in our implementation with call_indirect.
We initially implemented call_indirect as a way to call functions that
are imported or defined in the module. This was the wrong
interpretation of the spec. Instead, call_indirect can only index into
the table index space.
* JavaScriptCore.xcodeproj/project.pbxproj:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
(JSC::Wasm::parseAndCompile):
* wasm/WasmFormat.h:
(JSC::Wasm::TableInformation::TableInformation):
(JSC::Wasm::TableInformation::operator bool):
(JSC::Wasm::TableInformation::isImport):
(JSC::Wasm::TableInformation::initial):
(JSC::Wasm::TableInformation::maximum):
(JSC::Wasm::CallableFunction::CallableFunction):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseImport):
(JSC::Wasm::ModuleParser::parseResizableLimits):
(JSC::Wasm::ModuleParser::parseTableHelper):
(JSC::Wasm::ModuleParser::parseTable):
(JSC::Wasm::ModuleParser::parseMemoryHelper):
(JSC::Wasm::ModuleParser::parseExport):
* wasm/WasmModuleParser.h:
* wasm/js/JSWebAssemblyHelpers.h: Added.
(JSC::toNonWrappingUint32):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::table):
(JSC::JSWebAssemblyInstance::setTable):
(JSC::JSWebAssemblyInstance::offsetOfTable):
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::create):
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::visitChildren):
(JSC::JSWebAssemblyTable::grow):
(JSC::JSWebAssemblyTable::clearFunction):
(JSC::JSWebAssemblyTable::setFunction):
* wasm/js/JSWebAssemblyTable.h:
(JSC::JSWebAssemblyTable::maximum):
(JSC::JSWebAssemblyTable::size):
(JSC::JSWebAssemblyTable::getFunction):
(JSC::JSWebAssemblyTable::offsetOfSize):
(JSC::JSWebAssemblyTable::offsetOfFunctions):
(JSC::JSWebAssemblyTable::isValidSize):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::call):
(JSC::WebAssemblyFunction::create):
(JSC::WebAssemblyFunction::visitChildren):
(JSC::WebAssemblyFunction::finishCreation):
* wasm/js/WebAssemblyFunction.h:
(JSC::WebAssemblyFunction::signature):
(JSC::WebAssemblyFunction::wasmEntrypoint):
(JSC::WebAssemblyFunction::webAssemblyCallee): Deleted.
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::constructJSWebAssemblyMemory):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::finishCreation):
(JSC::WebAssemblyModuleRecord::link):
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::constructJSWebAssemblyTable):
* wasm/js/WebAssemblyTablePrototype.cpp:
(JSC::getTable):
(JSC::webAssemblyTableProtoFuncLength):
(JSC::webAssemblyTableProtoFuncGrow):
(JSC::webAssemblyTableProtoFuncGet):
(JSC::webAssemblyTableProtoFuncSet):
(JSC::WebAssemblyTablePrototype::create):
(JSC::WebAssemblyTablePrototype::finishCreation):
* wasm/js/WebAssemblyTablePrototype.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209771
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ryanhaddad@apple.com [Tue, 13 Dec 2016 20:24:11 +0000 (20:24 +0000)]
Remove ios-simulator-wk2 pass expectation for a directory that requires touch events.
https://bugs.webkit.org/show_bug.cgi?id=165787
Unreviewed test gardening.
* platform/ios-simulator-wk2/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209770
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Tue, 13 Dec 2016 20:23:07 +0000 (20:23 +0000)]
NSArray leaks seen in Safari, allocated under WKIconDatabaseTryCopyCGImageArrayForURL
https://bugs.webkit.org/show_bug.cgi?id=165809
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-12-13
Reviewed by Dan Bernstein.
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
(WKIconDatabaseTryCopyCGImageArrayForURL):
Avoid an extra retain on already newly created array.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209769
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ryanhaddad@apple.com [Tue, 13 Dec 2016 20:18:01 +0000 (20:18 +0000)]
Marking two scroll-to-fragid tests as flaky on ios-simulator.
Unreviewed test gardening.
* platform/ios-simulator-wk2/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209768
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fpizlo@apple.com [Tue, 13 Dec 2016 20:14:51 +0000 (20:14 +0000)]
Add null checks to opaque root APIs.
Rubber stamped by Saam Barati.
If we got a crash report about null in the opaque root HashSet, we would probably not
celebrate how great it is that we found out about a new race - instead we would probably
be annoyed that null wasn't just silently ignored.
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::addOpaqueRoot):
(JSC::SlotVisitor::containsOpaqueRoot):
(JSC::SlotVisitor::containsOpaqueRootTriState):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209767
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fpizlo@apple.com [Tue, 13 Dec 2016 19:54:15 +0000 (19:54 +0000)]
Make opaque root scanning truly constraint-based
https://bugs.webkit.org/show_bug.cgi?id=165760
Reviewed by Saam Barati.
Source/JavaScriptCore:
We have bugs when visitChildren() changes its mind about what opaque root to add, since
we don't have barriers on opaque roots. This supposedly once worked for generational GC,
and I started adding more barriers to support concurrent GC. But I think that the real
bug here is that we want the JSObject->OpaqueRoot to be evaluated as a constraint that
participates in the fixpoint. A constraint is different from the normal visiting in that
the GC will not wait for a barrier to rescan the object.
So, it's now possible for any visitChildren() method to become a constraint by calling
slotVisitor.rescanAsConstraint(). Because opaque roots are constraints, addOpaqueRoot()
does rescanAsConstraint() for you.
The constraint set is simply a HashSet<JSCell*> that accumulates with every
rescanAsConstraint() call and is only cleared at the start of full GC. This trivially
resolves most classes of GC bugs that would have arisen from opaque roots being changed
in a way that the GC did not anticipate.
Looks like this is perf-neutral.
* heap/Heap.cpp:
(JSC::Heap::markToFixpoint):
(JSC::Heap::setMutatorShouldBeFenced):
(JSC::Heap::writeBarrierOpaqueRootSlow): Deleted.
(JSC::Heap::addMutatorShouldBeFencedCache): Deleted.
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::writeBarrierOpaqueRoot): Deleted.
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::visitWeakSets):
* heap/MarkedSpace.h:
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::visitChildren):
(JSC::SlotVisitor::visitSubsequently):
(JSC::SlotVisitor::drain):
(JSC::SlotVisitor::addOpaqueRoot):
(JSC::SlotVisitor::rescanAsConstraint):
(JSC::SlotVisitor::mergeIfNecessary):
(JSC::SlotVisitor::mergeOpaqueRootsAndConstraints):
(JSC::SlotVisitor::mergeOpaqueRootsIfNecessary): Deleted.
* heap/SlotVisitor.h:
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::reportExtraMemoryVisited):
(JSC::SlotVisitor::reportExternalMemoryVisited):
(JSC::SlotVisitor::didNotRace):
* heap/WeakBlock.cpp:
(JSC::WeakBlock::specializedVisit):
(JSC::WeakBlock::visit):
* heap/WeakBlock.h:
* heap/WeakSet.h:
(JSC::WeakSet::visit):
Source/WebCore:
No new tests yet. I think that writing tests for this is a big investigation:
https://bugs.webkit.org/show_bug.cgi?id=165808
Remove the previous advancing wavefront DOM write barrier. I don't think this will scale
very well. It's super confusing.
This change makes it so that visitChildren can become a GC constraint that executes as
part of the fixpoint. This changes all WebCore visitChildren methods that do opaque
roots into constraints.
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
(WebCore::writeBarrierOpaqueRootSlow): Deleted.
* bindings/js/CommonVM.h:
(WebCore::writeBarrierOpaqueRoot): Deleted.
* bindings/js/JSAttrCustom.cpp:
(WebCore::JSAttr::visitAdditionalChildren):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::visitAdditionalChildren):
* bindings/js/JSIDBCursorCustom.cpp:
(WebCore::JSIDBCursor::visitAdditionalChildren):
* bindings/js/JSMessageChannelCustom.cpp:
(WebCore::JSMessageChannel::visitAdditionalChildren):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::visitAdditionalChildren):
* bindings/js/JSNodeIteratorCustom.cpp:
(WebCore::JSNodeIterator::visitAdditionalChildren):
* bindings/js/JSTextTrackCueCustom.cpp:
(WebCore::JSTextTrackCue::visitAdditionalChildren):
* bindings/js/JSTreeWalkerCustom.cpp:
(WebCore::JSTreeWalker::visitAdditionalChildren):
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::visitAdditionalChildren):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::visitAdditionalChildren):
* bindings/js/JSXPathResultCustom.cpp:
(WebCore::JSXPathResult::visitAdditionalChildren):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted):
(WebCore::notifyChildNodeRemoved):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209766
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
beidson@apple.com [Tue, 13 Dec 2016 19:44:06 +0000 (19:44 +0000)]
Add a PerfTest targeting IDBIndex.get().
https://bugs.webkit.org/show_bug.cgi?id=165803
Reviewed by Alex Christensen.
* IndexedDB/index-get.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209765
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Tue, 13 Dec 2016 19:38:13 +0000 (19:38 +0000)]
Unreviewed, rolling out r209725.
https://bugs.webkit.org/show_bug.cgi?id=165811
"Broke ARMv7 builds" (Requested by msaboff on #webkit).
Reverted changeset:
"REGRESSION(r209653): speedometer crashes making virtual slow
path tailcalls"
https://bugs.webkit.org/show_bug.cgi?id=165748
http://trac.webkit.org/changeset/209725
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209764
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fpizlo@apple.com [Tue, 13 Dec 2016 19:28:19 +0000 (19:28 +0000)]
Unreviewed, revert the collectorPermittedIdleRatio back to 0 because of 100MB
regression on membuster. Also, it didn't seem to help perf.
* runtime/Options.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209763
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ryanhaddad@apple.com [Tue, 13 Dec 2016 19:26:43 +0000 (19:26 +0000)]
Skip fast/events/page-visibility-onvisibilitychange.html on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=165799
Unreviewed test gardening.
* platform/ios-simulator/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209762
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jfbastien@apple.com [Tue, 13 Dec 2016 19:15:05 +0000 (19:15 +0000)]
[WTF] Turn tryMakeString(), makeString() into variadic templates
https://bugs.webkit.org/show_bug.cgi?id=147142
Reviewed by Mark Lam.
Source/JavaScriptCore:
* runtime/JSStringBuilder.h:
(JSC::jsMakeNontrivialString): remove WTF:: prefix, it isn't needed anymore
* runtime/Lookup.cpp:
(JSC::reifyStaticAccessor): remove WTF:: prefix, it isn't needed anymore
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncToString): remove WTF:: prefix, it isn't needed anymore
Source/WTF:
I wrote this patch while improving WebAssembly's error messages,
and only found this bug afterwards. My implementation does the
bare minimum to make this code variadic without changing
behavior. I think it's better to go with this baby step first, and
improve the code later.
Notable, for my WebAssembly patch I also taught the code to handle
integers and other types (including WebAssembly types). A
follow-up could rely on ADL magic to pretty-format these other
types.
* wtf/text/StringConcatenate.h:
(WTF::sumWithOverflow): This unconditionally does the sum for all
inputs, which the compiler is more likely to appreciate (because
it's the common case) compared to testing for overflow and bailing
on each addition
(WTF::are8Bit): are: the plural of is!
(WTF::makeStringAccumulator): accumulate strings
(WTF::tryMakeStringFromAdapters): a small helper which creates the string adapters
(WTF::tryMakeString): expose out of WTF, since it's part of this file's used API
(WTF::makeString): make it variadic
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209761
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
weinig@apple.com [Tue, 13 Dec 2016 18:47:01 +0000 (18:47 +0000)]
[WebIDL] Remove use of Dictionary in ApplePaySession
https://bugs.webkit.org/show_bug.cgi?id=165787
Reviewed by Anders Carlsson.
Source/WebCore:
First take at generating the bindings for ApplePaySession and removing
all use of Dictionary.
- Removes all use of Dictionary!
- Removes use of logging errors to the console with improved Exception messages.
- Use ExceptionOr extensively to pass exception state.
Still to do:
- Reconcile / merge ApplePaySession::PaymentRequest with WebCore::PaymentRequest
and all the sub-objects held within.
- Remove PaymentRequestValidator entirely, merging validation into the validation
we already do in ApplePaySession.cpp
- Make ApplePayEvents use generated dictionary creation code.
Test: http/tests/ssl/applepay/ApplePaySession.html
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
(WebCore::canCallApplePaySessionAPIs):
(WebCore::ApplePaySession::create):
(WebCore::ApplePaySession::ApplePaySession):
(WebCore::ApplePaySession::supportsVersion):
(WebCore::ApplePaySession::canMakePayments):
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
(WebCore::ApplePaySession::openPaymentSetup):
(WebCore::ApplePaySession::begin):
(WebCore::ApplePaySession::completeMerchantValidation):
(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::didSelectShippingMethod):
(WebCore::createContactFields): Deleted.
(WebCore::toLineItemType): Deleted.
(WebCore::isValidLineItemPropertyName): Deleted.
(WebCore::createLineItem): Deleted.
(WebCore::createLineItems): Deleted.
(WebCore::createMerchantCapabilities): Deleted.
(WebCore::createSupportedNetworks): Deleted.
(WebCore::toShippingType): Deleted.
(WebCore::isValidShippingMethodPropertyName): Deleted.
(WebCore::createShippingMethod): Deleted.
(WebCore::createShippingMethods): Deleted.
(WebCore::isValidPaymentRequestPropertyName): Deleted.
(WebCore::createPaymentRequest): Deleted.
* Modules/applepay/ApplePaySession.h:
Replace hand written dictionary extraction code with autogenerated code
and hand written additional validation.
* Modules/applepay/ApplePaySession.idl:
Add helper dictionaries and enums.
* Modules/applepay/PaymentRequestValidator.cpp:
(WebCore::PaymentRequestValidator::validate):
(WebCore::PaymentRequestValidator::validateTotal):
(WebCore::validateCountryCode):
(WebCore::validateCurrencyCode):
(WebCore::validateMerchantCapabilities):
(WebCore::validateSupportedNetworks):
(WebCore::validateShippingMethod):
(WebCore::validateShippingMethods):
(WebCore::PaymentRequestValidator::PaymentRequestValidator): Deleted.
(WebCore::PaymentRequestValidator::~PaymentRequestValidator): Deleted.
(WebCore::PaymentRequestValidator::validateCountryCode): Deleted.
(WebCore::PaymentRequestValidator::validateCurrencyCode): Deleted.
(WebCore::PaymentRequestValidator::validateMerchantCapabilities): Deleted.
(WebCore::PaymentRequestValidator::validateShippingMethod): Deleted.
(WebCore::PaymentRequestValidator::validateSupportedNetworks): Deleted.
(WebCore::PaymentRequestValidator::validateShippingMethods): Deleted.
* Modules/applepay/PaymentRequestValidator.h:
Instead of reporting the validation errors to the console, pass them in the exception.
This allows us to remove the window member, and move the helpers to the implementation
file as statics.
* WebCore.xcodeproj/project.pbxproj:
Remove file.
* bindings/generic/IDLTypes.h:
(WebCore::IDLObject::nullValue):
(WebCore::IDLObject::isNullValue):
(WebCore::IDLObject::extractValueFromNullable):
Add nullability traits for IDLObject.
* bindings/js/JSApplePaySessionCustom.cpp:
Removed.
Tools:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration):
(WTR::TestController::platformCreateWebView):
Enable ApplePay for the tests (where supported).
LayoutTests:
* http/tests/ssl/applepay: Added.
* http/tests/ssl/applepay/ApplePaySession-expected.txt: Added.
* http/tests/ssl/applepay/ApplePaySession.html: Added.
Add a compressive test of the handling of the payment request to the ApplePaySession
constructor. For further testing, we will need to mock out bits of the underlying
coordinator, but this allows for testing the aspect I am changing. The applepay
directory is in the ssl directory, as all use of ApplePay requires https.
* TestExpectations:
* platform/ios-simulator-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
Only enable the tests on iOS 10.10 and greater, and macOS 10.12 and greater, WebKit2.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209760
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dbates@webkit.org [Tue, 13 Dec 2016 18:21:37 +0000 (18:21 +0000)]
CSP: Teach the preload scanner about the 'nonce' attribute
https://bugs.webkit.org/show_bug.cgi?id=161192
<rdar://problem/
28010354>
Reviewed by Darin Adler.
Source/WebCore:
This patch was inspired by a similar Blink change:
<https://chromium.googlesource.com/chromium/src/+/
dde5487f380cf774e4c0e96ba7f88ea68e723907>
Preload external scripts and stylesheets whose HTML script and link elements have a nonce
attribute that is listed in the Content Security Policy (CSP) of the page.
Currently the preload scanner ignores the nonce attribute on HTML script and link elements.
So, WebKit does not preload their associated subresources unless the value of the src
attribute or href attribute is whitelisted in the CSP of the page for script and link
elements, respectively. Instead the preload scanner should recognize the nonce attribute on
script and link elements and query the CSP of the page with it. If the nonce attribute is
whitelisted then the request should be preloaded.
Tests: http/tests/loading/do-not-preload-css-blocked-by-csp.html
http/tests/loading/do-not-preload-script-src-blocked-by-csp.html
http/tests/loading/preload-css-with-csp-nonce.html
http/tests/loading/preload-script-src-with-csp-nonce.html
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Set the nonce on the
PreloadRequest to the nonce that we found during the scan.
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): For script and link tag names,
save the value of the nonce attribute (if it has one).
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::resourceRequest): Skip CSP policy check if the nonce is listed in
the CSP of the page.
* html/parser/HTMLResourcePreloader.h:
(WebCore::PreloadRequest::setNonce): Added.
LayoutTests:
Add tests to ensure that we preload <script>s and <link>s whose nonce is allowed by the
Content Security Policy of the page.
* http/tests/loading/do-not-preload-css-blocked-by-csp-expected.txt: Added.
* http/tests/loading/do-not-preload-css-blocked-by-csp.html: Added.
* http/tests/loading/do-not-preload-script-src-blocked-by-csp-expected.txt: Added.
* http/tests/loading/do-not-preload-script-src-blocked-by-csp.html: Added.
* http/tests/loading/preload-css-with-csp-nonce-expected.txt: Added.
* http/tests/loading/preload-css-with-csp-nonce.html: Added.
* http/tests/loading/preload-script-src-with-csp-nonce-expected.txt: Added.
* http/tests/loading/preload-script-src-with-csp-nonce.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209759
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
hyatt@apple.com [Tue, 13 Dec 2016 17:39:27 +0000 (17:39 +0000)]
[CSS Parser] Rename CSSPrimitiveValue::UnitTypes to CSSPrimitiveValue::UnitType
https://bugs.webkit.org/show_bug.cgi?id=165776
Reviewed by Zalan Bujtas.
* css/CSSCalculationValue.cpp:
(WebCore::unitCategory):
(WebCore::hasDoubleValue):
(WebCore::determineCategory):
(WebCore::CSSCalcExpressionNodeParser::parseValue):
* css/CSSCalculationValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::isStringType):
(WebCore::CSSPrimitiveValue::unitCategory):
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::computeLengthDouble):
(WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
(WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor):
(WebCore::CSSPrimitiveValue::getFloatValue):
(WebCore::CSSPrimitiveValue::doubleValue):
(WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory):
(WebCore::CSSPrimitiveValue::doubleValueInternal):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isFontRelativeLength):
(WebCore::CSSPrimitiveValue::isLength):
(WebCore::CSSPrimitiveValue::isResolution):
(WebCore::CSSPrimitiveValue::createAllowingMarginQuirk):
* css/CSSValue.h:
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createValue):
* css/CSSValuePool.h:
(WebCore::CSSValuePool::createValue):
* css/MediaQueryExp.cpp:
(WebCore::featureWithValidDensity):
(WebCore::MediaQueryExpression::MediaQueryExpression):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseSimpleLength):
(WebCore::parseSimpleLengthValue):
(WebCore::parseColorIntOrPercentage):
(WebCore::fastParseColorInternal):
(WebCore::parseTransformTranslateArguments):
(WebCore::parseTransformNumberArguments):
* css/parser/CSSParserToken.cpp:
(WebCore::cssPrimitiveValueUnitFromTrie):
(WebCore::stringToUnitType):
(WebCore::CSSParserToken::CSSParserToken):
(WebCore::CSSParserToken::convertToPercentage):
* css/parser/CSSParserToken.h:
(WebCore::CSSParserToken::unitType):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeTransformOrigin):
(WebCore::consumeCounter):
(WebCore::consumeAnimationName):
(WebCore::consumePerspective):
(WebCore::consumePositionLonghand):
(WebCore::consumeCounterContent):
(WebCore::consumeReflect):
(WebCore::consumeGridBreadth):
(WebCore::CSSPropertyParser::consumeFlex):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeInteger):
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):
(WebCore::CSSPropertyParserHelpers::consumeAngle):
(WebCore::CSSPropertyParserHelpers::consumeTime):
(WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
(WebCore::CSSPropertyParserHelpers::consumeString):
(WebCore::CSSPropertyParserHelpers::consumeUrl):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
(WebCore::CSSPropertyParserHelpers::consumeCrossFade):
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::readFeatureValue):
* css/parser/SizesAttributeParser.cpp:
(WebCore::SizesAttributeParser::computeLength):
* css/parser/SizesAttributeParser.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::setInlineStyleProperty):
(WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
* dom/StyledElement.h:
* svg/SVGLengthValue.cpp:
(WebCore::SVGLengthValue::toCSSPrimitiveValue):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209758
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
eric.carlson@apple.com [Tue, 13 Dec 2016 16:59:55 +0000 (16:59 +0000)]
Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
https://bugs.webkit.org/show_bug.cgi?id=165251
Reviewed by Youenn Fablet.
Source/WebCore:
No new tests, fixes an API test.
* page/Settings.in: Delete mediaStreamEnabled and peerConnectionEnabled, we don't need a
setting and a runtime feature.
Source/WebKit2:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Update the media stream and peer connection runtime
feature instead of the setting.
Tools:
* TestWebKitAPI/Tests/WebKit2/EnumerateMediaDevices.cpp:
(TestWebKitAPI::TEST): Enable MediaStream, create web view from the page group upon which
the preferences have been set.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209757
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
antti@apple.com [Tue, 13 Dec 2016 16:08:04 +0000 (16:08 +0000)]
Source/WebCore:
REGRESSION (r198990): Cannot edit content inside <details> in wysiwyg editor
https://bugs.webkit.org/show_bug.cgi?id=165757
Reviewed by Andreas Kling.
Test: fast/html/details-edit.html
-webkit-user-modify is reset on shadow boundary so it doesn't go through <details> shadow tree.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForElement):
(WebCore::StyleResolver::pseudoStyleForElement):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
* dom/Node.cpp:
(WebCore::computeEditabilityFromComputedStyle):
(WebCore::Node::computeEditability):
Make -webkit-user-modify (which we would want to get rid of completely eventually) have no effect in shadow trees.
Check for contenteditable directly instead.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createInnerTextStyle):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::createInnerTextStyle):
* html/shadow/TextControlInnerElements.cpp:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::createFlowThreadStyle):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::styleDidChange):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::createAnonymousStyleWithDisplay):
(WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
(WebCore::RenderStyle::inheritFrom):
Let -webkit-user-modify inherit through shadow boundary as normal.
* rendering/style/RenderStyle.h:
LayoutTests:
REGRESSION (r198990): Safari - Cannot edit content inside <details> in wysiwyg editor
https://bugs.webkit.org/show_bug.cgi?id=165757
Reviewed by Andreas Kling.
* editing/execCommand/justify-right-then-indent-with-problematic-body-expected.txt:
* fast/html/details-edit-expected.txt: Added.
* fast/html/details-edit.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209756
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
annulen@yandex.ru [Tue, 13 Dec 2016 12:49:20 +0000 (12:49 +0000)]
Unreviewed, silence -Wsuggest-attribute for GCC with pragmas
* wtf/PrintStream.cpp:
(WTF::PrintStream::printfVariableFormat):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209755
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
pvollan@apple.com [Tue, 13 Dec 2016 12:25:17 +0000 (12:25 +0000)]
Unreviewed test gardening.
Update test expectations on Windows for failing tests. These failures are tracked in
https://bugs.webkit.org/show_bug.cgi?id=160447.
* platform/win/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209754
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
svillar@igalia.com [Tue, 13 Dec 2016 10:23:25 +0000 (10:23 +0000)]
Fix GTK build after r209733
https://bugs.webkit.org/show_bug.cgi?id=165794
Document::visibilityState() now returns an IDL string enumeration.
Reviewed by Žan Doberšek.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_get_visibility_state):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209753
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
darin@apple.com [Tue, 13 Dec 2016 05:17:28 +0000 (05:17 +0000)]
Remove bindings generation support for legacy WebCore::Dictionary
https://bugs.webkit.org/show_bug.cgi?id=165762
Reviewed by Sam Weinig.
LayoutTests/imported/w3c:
* web-platform-tests/webrtc/datachannel-emptystring-expected.txt:
* web-platform-tests/webrtc/no-media-call-expected.txt:
* web-platform-tests/webrtc/promises-call-expected.txt:
* web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:
* web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt:
Updated to expect error messages with "dictionary" with a lowercase D.
Source/WebCore:
After this patch, all use of legacy WebCore::Dictionary is within custom bindings or
inside the DOM code itself. Bindings generation machinery no longer has a special
type named "Dictionary" but has increasingly good support for IDL-defined dictionaries.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create): Take ExecState and a JSValue rather than a Dictionary.
(WebCore::ApplePaySession::completeMerchantValidation): Ditto.
* Modules/applepay/ApplePaySession.h: Updated for the above changes.
* Modules/applepay/ApplePaySession.idl: For this last file using Dictionary in IDL, move
to "[CallWith=ScriptState]" and "any" as a stopgap. Later we can return and use IDL
dictionaries or other more modern solutions.
* Modules/mediastream/MediaDevices.idl: For the custom binding written in JavaScript,
use the type mentioned in the specification rather than Dictionary. The bindings generator
ignores the type, so this is more like changing a comment rather than changing source code.
* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection): Refer to a non-object as not a valid "dictionary", lowercase
rather than "Dictionary".
* Modules/mediastream/RTCPeerConnectionInternals.js:
(callbacksAndDictionaryOverload): Ditto.
* bindings/generic/IDLTypes.h: Removed IDLLegacyDictionary.
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::getHashAlgorithm): Fixed a comment.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLLegacyDictionary<T>>::convert): Deleted.
* bindings/scripts/CodeGenerator.pm:
(IsBuiltinType): Removed special case for "Dictionary".
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType): Ditto.
(AreTypesDistinguishableForOverloadResolution): Ditto.
(GenerateOverloadedFunctionOrConstructor): Ditto.
(GenerateParametersCheck): Ditto.
(GetBaseIDLType): Ditto.
* bindings/scripts/test/JS/JSTestObj.cpp: Regenerated results.
* bindings/scripts/test/TestObj.idl: Removed test case for Dictionary.
LayoutTests:
* fast/mediastream/RTCPeerConnection-expected.txt:
* fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt:
* fast/mediastream/RTCPeerConnection-overloaded-operations-params.html:
Updated to expect error messages with "dictionary" with a lowercase D.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209752
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Tue, 13 Dec 2016 02:20:58 +0000 (02:20 +0000)]
Drop unnecessary null check in removeDetachedChildrenInContainer()
https://bugs.webkit.org/show_bug.cgi?id=165778
Reviewed by Alex Christensen.
Drop unnecessary null check in removeDetachedChildrenInContainer().
Node cannot be null but we do an implicit null check.
No new tests, no Web-exposed behavior change.
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::removeDetachedChildrenInContainer):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209751
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Tue, 13 Dec 2016 02:05:42 +0000 (02:05 +0000)]
Add Document.onvisibilitychange event handler attribute
https://bugs.webkit.org/show_bug.cgi?id=165784
Reviewed by Daniel Bates.
Source/WebCore:
Add Document.onvisibilitychange event handler attribute as per Page
Visibility Level 2 API:
- http://w3c.github.io/page-visibility/#onvisiblitychange-event-handler
Test: fast/events/page-visibility-onvisibilitychange.html
* dom/Document.idl:
LayoutTests:
Add layout test coverage.
* fast/events/page-visibility-onvisibilitychange-expected.txt: Added.
* fast/events/page-visibility-onvisibilitychange.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209750
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jiewen_tan@apple.com [Tue, 13 Dec 2016 01:32:56 +0000 (01:32 +0000)]
[WebCrypto] Migrate some tests from webkitSubtle to subtle
https://bugs.webkit.org/show_bug.cgi?id=165554
Reviewed by Brent Fulgham.
To improve test coverage for subtle.
* crypto/crypto-key-algorithm-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc-expected.txt.
* crypto/crypto-key-algorithm-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-algorithm-gc.html.
* crypto/crypto-key-usages-gc-expected.txt: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc-expected.txt.
* crypto/crypto-key-usages-gc.html: Renamed from LayoutTests/crypto/webkitSubtle/crypto-key-usages-gc.html.
* crypto/subtle/resources/rsa-indexeddb-non-exportable.js: Added.
* crypto/subtle/resources/rsa-indexeddb.js: Added.
* crypto/subtle/rsa-indexeddb-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-private-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-non-exportable-private.html: Added.
* crypto/subtle/rsa-indexeddb-non-exportable.html: Added.
* crypto/subtle/rsa-indexeddb-private-expected.txt: Added.
* crypto/subtle/rsa-indexeddb-private.html: Added.
* crypto/subtle/rsa-indexeddb.html: Added.
* crypto/subtle/rsa-oaep-plaintext-length-expected.txt: Added.
* crypto/subtle/rsa-oaep-plaintext-length.html: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent-expected.txt: Added.
* crypto/subtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html: Added.
* platform/ios-simulator-wk1/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209749
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
nvasilyev@apple.com [Tue, 13 Dec 2016 01:05:15 +0000 (01:05 +0000)]
[GTK] Web Inspector: Add NavigationItemCodeCoverage.svg icon
https://bugs.webkit.org/show_bug.cgi?id=165698
Reviewed by Joseph Pecoraro.
* UserInterface/Images/gtk/NavigationItemCodeCoverage.svg: Added.
Match in style the existing NavigationItemTypes.svg icon.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209748
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dino@apple.com [Tue, 13 Dec 2016 00:45:37 +0000 (00:45 +0000)]
[iOS] MediaDocument "Done" button should navigate the page back
https://bugs.webkit.org/show_bug.cgi?id=165779
Reviewed by Sam Weinig.
Source/WebCore:
Detect if the exit from fullscreen was caused by the Done button,
and if so, tell the page to navigate back.
Unfortunately this is not yet testable. It's waiting on the
UI-based device testing in development by the media team.
* platform/cocoa/WebVideoFullscreenModel.h: Add a finishedWithMedia parameter to
requestFullscreenMode, to indicate if the change in mode is associated with
the closing of the media document.
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
* platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::requestFullscreenMode): If we're a media
document, and we say we're finished with the media, tell the document
to navigate back a page.
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(WebVideoFullscreenControllerContext::requestFullscreenMode):
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
Source/WebKit2:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenModelContext::requestFullscreenMode):
(WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode):
* WebProcess/cocoa/WebVideoFullscreenManager.h:
* WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::requestFullscreenMode):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209747
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Tue, 13 Dec 2016 00:37:40 +0000 (00:37 +0000)]
Remove unused workaround for Silverlight
https://bugs.webkit.org/show_bug.cgi?id=165773
Patch by Alex Christensen <achristensen@webkit.org> on 2016-12-12
Reviewed by Dean Jackson.
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView _workaroundSilverlightFullscreenBug:]): Deleted.
This code was introduced in January 2010. Microsoft fixed their bug shortly thereafter.
Allowing 6 years for users to update Silverlight is more than enough.
Safari doesn't even use WebKit1 for this any more.
I need this to be removed because this is the only non-WebGL code that needs to link against
the OpenGL framework, and I'm changing how that is done to link only through ANGLE instead.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209746
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
zalan@apple.com [Tue, 13 Dec 2016 00:35:28 +0000 (00:35 +0000)]
Infinite recursion when viewport is set to the size of the content but the content overflows the viewport.
https://bugs.webkit.org/show_bug.cgi?id=165775
rdar://problem/
29366628
Reviewed by Simon Fraser.
In certain cases when the viewport is sized to accomodate the content and
the content always overflows the viewport, we might end up in recursive FrameView::layout calls.
This is specific to content with viewport units, because we always invalidate elements with vw/vh units on
viewport size change. However if this viewport size change is in response to content size change (layout),
invalidating elements could trigger synchronous layout, while we are still inside this current layout.
This is very similar to the m_setNeedsLayoutWasDeferred case and they should eventually be merged.
It also means that we might be behind by one layout on elements with vw/vh units (fixed layout only though).
Currently not testable.
* page/FrameView.cpp:
(WebCore::FrameView::availableContentSizeChanged):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209745
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
krollin@apple.com [Tue, 13 Dec 2016 00:28:18 +0000 (00:28 +0000)]
Memory warning logging appears to capture resident footprint, missing compress/swap.
https://bugs.webkit.org/show_bug.cgi?id=165533
<rdar://problem/
29318410>
Reviewed by Andreas Kling.
Have platformMemoryUsage return both resident and resident + swapped
values. This is now returned as a struct in a std::optional to better
support cases where values cannot or are not returned. Report these
values in logMemoryUsageChange.
Remove most of the ReliefLogger instances and their messages. We no
longer free up fastMalloc memory after each memory-release operation,
so there are no memory regions returned to the OS. Instead, we now
free up fastMalloc memory regions at the end of all memory-releasing
operations in one fell swoop and report a grand total of memory
returned.
No new tests -- no changes to user accessible functionality.
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseMemory):
(WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::loggingEnabled):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::platformReleaseMemory):
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
* platform/linux/MemoryPressureHandlerLinux.cpp:
* platform/win/MemoryPressureHandlerWin.cpp:
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209744
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
beidson@apple.com [Tue, 13 Dec 2016 00:12:55 +0000 (00:12 +0000)]
More IndexedDB perf tests.
https://bugs.webkit.org/show_bug.cgi?id=165634
Reviewed by Sam Weinig.
* IndexedDB/index-multientry.html:
* IndexedDB/large-number-of-inserts-responsiveness.html: Added.
* IndexedDB/large-number-of-inserts.html: Added.
* IndexedDB/objectstore-cursor.html: Added. Runtime cut in 1/4th compared to r209672.
* resources/runner.js:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209738
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
timothy_horton@apple.com [Tue, 13 Dec 2016 00:07:11 +0000 (00:07 +0000)]
Provide SPI to avoid blocking on painting when coming into view
https://bugs.webkit.org/show_bug.cgi?id=165780
<rdar://problem/
29009559>
Reviewed by Simon Fraser.
By default, when parenting a WKWebView which was previously in-window,
we block on painting to ensure that we don't flash stale content.
We added SPI to disable this behavior to WKWebViewConfiguration, but
some clients might want the behavior most of the time, but sometimes
instead want to not block the UI process main thread, but instead do
their own work (e.g. removing a snapshot) when painting eventually occurs.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Tell WebPageProxy not to block on painting next time we are parented,
and use doAfterNextPresentationUpdate to call the block when the painting
does eventually happen. This SPI must be called before - but in the same
runloop cycle - the WKWebView is brought back in-window to work correctly.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchActivityStateChange):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::skipWaitingForPaintAfterNextViewDidMoveToWindow):
If we would block because we're coming in-window, but the bit to skip
blocking the next time we get brought in-window is set, reset the bit,
and avoid blocking.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209736
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mattbaker@apple.com [Mon, 12 Dec 2016 23:56:41 +0000 (23:56 +0000)]
Unreviewed, follow-up after r209706.
* inspector/debugger/breakpoint-action-log.html:
Add missing test case description.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209735
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
joepeck@webkit.org [Mon, 12 Dec 2016 23:36:09 +0000 (23:36 +0000)]
Web Inspector: Add tests for Fetch API Network Data (CORs, Opaque Responses, Filtered Headers)
https://bugs.webkit.org/show_bug.cgi?id=165683
Reviewed by Brian Burg.
* http/tests/inspector/network/fetch-network-data-expected.txt: Added.
* http/tests/inspector/network/fetch-network-data.html: Added.
* http/tests/inspector/network/resources/cors-data.pl: Added.
* http/tests/inspector/resources/inspector-test.js:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209734
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Mon, 12 Dec 2016 23:27:13 +0000 (23:27 +0000)]
Document.visibilityState should use an IDL string enumeration
https://bugs.webkit.org/show_bug.cgi?id=165774
Reviewed by Daniel Bates.
Source/WebCore:
Document.visibilityState should use an IDL string enumeration:
- http://w3c.github.io/page-visibility/#extensions-to-the-document-interface
No new tests, there should be no Web-exposed behavior change.
* CMakeLists.txt:
* Modules/vibration/NavigatorVibration.cpp:
(WebCore::NavigatorVibration::vibrate):
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::hidden):
(WebCore::Document::pageVisibilityState): Deleted.
(WebCore::Document::visibilityState): Deleted.
* dom/Document.h:
* dom/Document.idl:
* page/Page.cpp:
(WebCore::Page::visibilityState):
* page/PageVisibilityState.cpp: Removed.
* page/PageVisibilityState.h:
(): Deleted.
Source/WebKit/mac:
* DOM/DOMDocument.mm:
(-[DOMDocument visibilityState]):
* WebView/WebView.mm:
(kit):
Source/WebKit2:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toPageVisibilityState):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209733
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jer.noble@apple.com [Mon, 12 Dec 2016 23:12:12 +0000 (23:12 +0000)]
Remove implementation of legacy Mozilla-based Fullscreen API.
https://bugs.webkit.org/show_bug.cgi?id=165689
Source/WebCore:
Reviewed by Eric Carlson.
Alias the legacy webkitRequestFull_S_creen() function on Element to webkitRequestFull_s_creen().
Remove the custom behavior in Document::requestFullScreenForElement() to handle the legacy path.
* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::webkitRequestFullscreen):
(WebCore::Element::webkitRequestFullScreen): Deleted.
* dom/Element.h:
* dom/Element.idl:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
Source/WebKit/mac:
<rdar://problem/
29603053>
Reviewed by Eric Carlson.
* DOM/DOMElement.mm:
(-[DOMElement webkitRequestFullScreen:]):
LayoutTests:
Reviewed by Eric Carlson.
* fullscreen/full-screen-css-expected.txt:
* fullscreen/full-screen-css.html:
* fullscreen/full-screen-keyboard-disabled-expected.txt: Removed.
* fullscreen/full-screen-keyboard-disabled.html: Removed.
* fullscreen/full-screen-twice-expected.txt:
* fullscreen/full-screen-twice.html:
* js/dom/dom-static-property-for-in-iteration-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209730
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mark.lam@apple.com [Mon, 12 Dec 2016 23:11:29 +0000 (23:11 +0000)]
Rename BytecodeGenerator's ControlFlowContext to ControlFlowScope.
https://bugs.webkit.org/show_bug.cgi?id=165777
Reviewed by Keith Miller.
The existing code sometimes refer to ControlFlowContext (and associated references)
as context, and sometimes as scope. Let's be consistent and always call it a scope.
Also renamed push/popScopedControlFlowContext() to push/popLocalControlFlowScope()
because these are only used when we inc/dec the m_localScopeDepth.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::initializeVarLexicalEnvironment):
(JSC::BytecodeGenerator::pushLexicalScopeInternal):
(JSC::BytecodeGenerator::popLexicalScopeInternal):
(JSC::BytecodeGenerator::emitPushWithScope):
(JSC::BytecodeGenerator::emitPopWithScope):
(JSC::BytecodeGenerator::pushFinallyControlFlowScope):
(JSC::BytecodeGenerator::pushIteratorCloseControlFlowScope):
(JSC::BytecodeGenerator::popFinallyControlFlowScope):
(JSC::BytecodeGenerator::popIteratorCloseControlFlowScope):
(JSC::BytecodeGenerator::emitComplexPopScopes):
(JSC::BytecodeGenerator::emitPopScopes):
(JSC::BytecodeGenerator::pushLocalControlFlowScope):
(JSC::BytecodeGenerator::popLocalControlFlowScope):
(JSC::BytecodeGenerator::emitEnumeration):
(JSC::BytecodeGenerator::pushFinallyContext): Deleted.
(JSC::BytecodeGenerator::pushIteratorCloseContext): Deleted.
(JSC::BytecodeGenerator::popFinallyContext): Deleted.
(JSC::BytecodeGenerator::popIteratorCloseContext): Deleted.
(JSC::BytecodeGenerator::pushScopedControlFlowContext): Deleted.
(JSC::BytecodeGenerator::popScopedControlFlowContext): Deleted.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::TryNode::emitBytecode):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209728
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fpizlo@apple.com [Mon, 12 Dec 2016 22:06:41 +0000 (22:06 +0000)]
GC scheduler should avoid consecutive pauses
https://bugs.webkit.org/show_bug.cgi?id=165758
Reviewed by Michael Saboff.
This factors out the scheduler from lambdas in Heap::markToFixpoint to an actual class.
It's called the SpaceTimeScheduler because it is a linear controller that ties the
amount of time you spend on things to the amount of space you are using.
This patch uses this refactoring to fix a bug where the GC would pause even though we
still had time during a mutator timeslice. This is a 15% improvement on
JetStream/splay-latency. Seems neutral on everything else. However, it's not at all
clear if this is the right policy or not since retreating wavefront can sometimes be so
sensitive to scheduling decisions. For this reason, there is a tunable option that lets
you decide how long the GC will sit idle before the start of its timeslice.
So, we can revert this policy change in this patch without reverting the patch.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/Heap.cpp:
(JSC::Heap::markToFixpoint):
* heap/Heap.h:
* heap/SpaceTimeScheduler.cpp: Added.
(JSC::SpaceTimeScheduler::Decision::targetMutatorUtilization):
(JSC::SpaceTimeScheduler::Decision::targetCollectorUtilization):
(JSC::SpaceTimeScheduler::Decision::elapsedInPeriod):
(JSC::SpaceTimeScheduler::Decision::phase):
(JSC::SpaceTimeScheduler::Decision::shouldBeResumed):
(JSC::SpaceTimeScheduler::Decision::timeToResume):
(JSC::SpaceTimeScheduler::Decision::timeToStop):
(JSC::SpaceTimeScheduler::SpaceTimeScheduler):
(JSC::SpaceTimeScheduler::snapPhase):
(JSC::SpaceTimeScheduler::currentDecision):
* heap/SpaceTimeScheduler.h: Added.
(JSC::SpaceTimeScheduler::Decision::Decision):
(JSC::SpaceTimeScheduler::Decision::operator bool):
* runtime/Options.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209727
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
hyatt@apple.com [Mon, 12 Dec 2016 21:49:53 +0000 (21:49 +0000)]
[CSS Parser] MediaQueryParser should use Ref and not RefPtr
https://bugs.webkit.org/show_bug.cgi?id=165771
Reviewed by Simon Fraser.
* css/MediaList.cpp:
(WebCore::MediaQuerySet::create):
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeImportRule):
(WebCore::CSSParserImpl::consumeMediaRule):
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::parseMediaQuerySet):
(WebCore::MediaQueryParser::parseMediaCondition):
(WebCore::MediaQueryParser::parseInternal):
* css/parser/MediaQueryParser.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209726
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
msaboff@apple.com [Mon, 12 Dec 2016 21:46:45 +0000 (21:46 +0000)]
REGRESSION(r209653): speedometer crashes making virtual slow path tailcalls
https://bugs.webkit.org/show_bug.cgi?id=165748
Reviewed by Filip Pizlo.
JSTests:
New regression test.
* stress/regress-165748.js: Added.
(sum1):
(sum2):
(sum3):
(sum4):
(sum5):
(sum6):
(tailCaller):
(test):
Source/JavaScriptCore:
The virtual slow path for tailcalls always passes arguments on the stack.
The fix here is to link to the stack argument entrypoint instead of a register
argument entrypoint.
While fixing this bug, I found that we weren't clearing the code origin when
shuffling the call frame for a register argument tailcall.
Also rolling back in r209653, r209654, r209663, and r209673.
* jit/CallFrameShuffler.cpp:
(JSC::CallFrameShuffler::prepareAny):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
Source/WTF:
Rolling back in r209653, r209654, r209663, and r209673.
* wtf/Platform.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209725
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mark.lam@apple.com [Mon, 12 Dec 2016 21:26:23 +0000 (21:26 +0000)]
Debug JSC test timeout: stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js.ftl-no-cjit.
https://bugs.webkit.org/show_bug.cgi?id=164630
Reviewed by Keith Miller.
Speculative fix for timeout issue. It looks like this test just runs a bit
slower on debug builds. So, we'll give it a little more time to run.
* stress/string-prototype-replace-should-throw-out-of-memory-error-when-using-too-much-memory.js:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209724
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mark.lam@apple.com [Mon, 12 Dec 2016 21:03:49 +0000 (21:03 +0000)]
Rename BytecodeGenerator's m_symbolTableStack to m_lexicalScopeStack.
https://bugs.webkit.org/show_bug.cgi?id=165768
Reviewed by Saam Barati.
The lexical scope in "m_lexicalScopeStack" here refers to a pair of { } in the
source code that bounds the scope of variables.
There are 4 places in the code where we call m_symbolTableStack.append() to
append a new stack entry. In only 3 of the 4 cases, a symbol table is provided
in the new stack entry. In all 4 cases, a scope register is provided in the new
stack entry.
Also, 3 of the 4 functions that appends an entry to this stack are named:
1. initializeVarLexicalEnvironment()
2. pushLexicalScopeInternal()
3. emitPushWithScope()
The 4th function is the BytecodeGenerator constructor where it pushes the scope
for a module environment.
Based on these details, m_lexicalScopeStack is a better name for this stack than
m_symbolTableStack.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::initializeArrowFunctionContextScopeIfNeeded):
(JSC::BytecodeGenerator::initializeVarLexicalEnvironment):
(JSC::BytecodeGenerator::pushLexicalScopeInternal):
(JSC::BytecodeGenerator::initializeBlockScopedFunctions):
(JSC::BytecodeGenerator::hoistSloppyModeFunctionIfNecessary):
(JSC::BytecodeGenerator::popLexicalScopeInternal):
(JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
(JSC::BytecodeGenerator::variable):
(JSC::BytecodeGenerator::resolveType):
(JSC::BytecodeGenerator::emitResolveScope):
(JSC::BytecodeGenerator::emitPushWithScope):
(JSC::BytecodeGenerator::emitPopWithScope):
(JSC::BytecodeGenerator::pushFinallyContext):
(JSC::BytecodeGenerator::pushIteratorCloseContext):
(JSC::BytecodeGenerator::emitComplexPopScopes):
(JSC::BytecodeGenerator::popTryAndEmitCatch):
(JSC::BytecodeGenerator::emitPushFunctionNameScope):
* bytecompiler/BytecodeGenerator.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209723
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
sbarati@apple.com [Mon, 12 Dec 2016 20:55:23 +0000 (20:55 +0000)]
Unreviewed. Try to fix the cloop build.
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::calleeSaveRegisters):
* interpreter/StackVisitor.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209722
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
rego@igalia.com [Mon, 12 Dec 2016 20:49:11 +0000 (20:49 +0000)]
[css-grid] Add some test cases that were removed in r209562
https://bugs.webkit.org/show_bug.cgi?id=165750
Reviewed by Sergio Villar Senin.
Some valid test cases were removed in r209562, this patch adds them back.
* fast/css-grid-layout/grid-template-shorthand-get-set.html: The specified style is now preserved,
so we've to use a different value for it (as it doesn't merge the line names).
* fast/css-grid-layout/resources/grid-columns-rows-get-set.js: Flexible sizes must be non-negative,
but 0fr should be accepted (this is new as it was not working like that with the old parser).
A space between the dimension and the unit is wrong for flexible sizes.
* fast/css-grid-layout/resources/non-grid-columns-rows-get-set.js: Ditto.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209721
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
zalan@apple.com [Mon, 12 Dec 2016 20:17:50 +0000 (20:17 +0000)]
The CSS 'columns' property when set on the <body> element makes short columns
https://bugs.webkit.org/show_bug.cgi?id=164891
Reviewed by Darin Adler and David Hyatt.
Source/WebCore:
Currently when the body has auto height, we use the height of the viewport as
the available height for the columns defined on the body element.
This is the desired behaviour for paginated content.
However in case of a simple, non-paginated multicolumn context, we should let the columns grow beyond
the viewport vertically. This is also what other browsers do.
This patch sets the available height on columns (in non-paginated context) only if the logical height
is defined (we are right before layout, so applying non-defined values does not make much sense anyway).
The reason why it is only broken on the <body> is because it stretches to the viewport by
default (see stretchesToViewport()) while other block renderers do not.
Test: fast/multicol/columns-on-body.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
LayoutTests:
* fast/multicol/columns-on-body-expected.html: Added.
* fast/multicol/columns-on-body.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209719
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
hyatt@apple.com [Mon, 12 Dec 2016 19:55:12 +0000 (19:55 +0000)]
[CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
https://bugs.webkit.org/show_bug.cgi?id=165743
Reviewed by Darin Adler.
Source/WebCore:
Added new tests in fast/css/deferred-parsing.
This patch implements deferred parsing in CSS. By default, when parsing
author stylesheets, the parser goes into a deferred mode where it leaves
the declaration block of all style rules unparsed initially. Instead of
creating and setting an ImmutableStyleProperties object on the StyleRule,
the parser creates a DeferredStyleProperties object instead that is
capable of calling into CSSDeferredParser to parse the properties and values
only when the properties are finally asked for.
In addition, this patch defers the parsing of the interior of @media,
@supports, and @keyframes rules. @media blocks that are never matched will
never parse any of the rules inside. @supports conditions for unsupported
features will also not be parsed. For @keyframes, if the animation is never
referenced/used, then the @keyframes child rules will never be parsed.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add CSSDeferredParser to the build.
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::matchingFaces):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.
* css/CSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
(WebCore::StyleRuleKeyframes::parseDeferredRulesIfNeeded):
(WebCore::StyleRuleKeyframes::keyframes):
(WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
(WebCore::StyleRuleKeyframes::wrapperRemoveKeyframe):
(WebCore::StyleRuleKeyframes::findKeyframeIndex):
* css/CSSKeyframesRule.h:
Keyframes now hold both a keyframes Vector and a DeferredStyleGroupRuleList
object. The keyframes vector won't be populated until it is needed, and the
population is done by DeferredStyleGroupRuleList, which holds both the original
CSSParserTokenRange of the keyframes rule interior, and a references to the
CSSDeferredParser that will do the parsing.
* css/DOMCSSNamespace.cpp:
(WebCore::DOMCSSNamespace::supports):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRulesForList):
ElementRuleCollector tests to see if a rule is empty by counting properties(),
but we don't want to initiate deferred parsing just to check this. Instead we
invoke propertiesWithoutDeferredParsing, which will hand back a nullptr if
the properties haven't been parsed yet. In order to ensure this optimization
continues to work, any rules whose interiors consist of only whitespace do
not get deferred.
* css/FontFace.cpp:
(WebCore::FontFace::setVariant):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
(WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::MutableStyleProperties):
(WebCore::MutableStyleProperties::setProperty):
(WebCore::DeferredStyleProperties::create):
(WebCore::DeferredStyleProperties::DeferredStyleProperties):
(WebCore::DeferredStyleProperties::~DeferredStyleProperties):
(WebCore::DeferredStyleProperties::parseDeferredProperties):
* css/StyleProperties.h:
(WebCore::StylePropertiesBase::type):
(WebCore::StylePropertiesBase::cssParserMode):
(WebCore::StylePropertiesBase::StylePropertiesBase):
(WebCore::StyleProperties::isMutable):
(WebCore::StyleProperties::StyleProperties):
(WebCore::StylePropertiesBase::deref):
(isType):
(WebCore::StyleProperties::cssParserMode): Deleted.
(WebCore::StyleProperties::deref): Deleted.
Right now StyleProperties has two subclasses, ImmutableStyleProperties (which
is created by the parser when not deferring), and MutableStyleProperties (used
when making changes and doing DOM Manipulations).
This patch adds a new base class called StylePropertiesBase, and StyleProperties
now derives from it. DeferredStyleProperties derives from this base. The members
of StyleProperties have been moved up into StylePropertiesBase.
The m_isMutable bit, used to determine the type for downcasting has been enhanced
to m_type (2 bits), since there are now three possible subclasses.
* css/StyleRule.cpp:
(WebCore::StyleRule::StyleRule):
(WebCore::StyleRule::properties):
(WebCore::StyleRule::mutableProperties):
(WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
Patched to ensure that when properties() are accessed, that if the current
stored StylePropertyBase in the rule is a DeferredStyleProperties, we then
parse and replace DeferredStyleProperties with ImmutableStyleProperties on the
rule. By using a common base class, we avoid increasing memory usage in
StyleRule.
(WebCore::DeferredStyleGroupRuleList::create):
(WebCore::DeferredStyleGroupRuleList::DeferredStyleGroupRuleList):
(WebCore::DeferredStyleGroupRuleList::parseDeferredRules):
(WebCore::DeferredStyleGroupRuleList::parseDeferredKeyframes):
DeferredStyleGroupList is used to handle deferred parsing of objects with
child rules. These include @media, @supports and @keyframes.
(WebCore::StyleRuleGroup::StyleRuleGroup):
(WebCore::StyleRuleGroup::childRules):
(WebCore::StyleRuleGroup::wrapperInsertRule):
(WebCore::StyleRuleGroup::wrapperRemoveRule):
(WebCore::StyleRuleGroup::parseDeferredRulesIfNeeded):
(WebCore::StyleRuleMedia::StyleRuleMedia):
(WebCore::StyleRuleSupports::StyleRuleSupports):
StyleRuleGroup now holds both a child rules Vector and a
DeferredStyleGroupRuleList. If DeferredStyleGroupRuleList is set, then
when the childRules are finally accessed, we will populate the childRules
Vector and then null out the DeferredStyleGroupRuleList.
* css/StyleRule.h:
(WebCore::StyleRule::propertiesWithoutDeferredParsing):
(WebCore::StyleRuleGroup::childRulesWithoutDeferredParsing):
(WebCore::StyleRuleGroup::childRules): Deleted.
Add new accesors for fetching properties and child rules without causing
deferred parsing to happen.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
(WebCore::StyleSheetContents::parseString):
Patched to turn on deferred parsing for author sheets and for all
non-UA stylesheets parsed from a string (e.g., <style>).
(WebCore::traverseSubresourcesInRules):
The broken resource check was aggressively accessing properties(). Patch
it to call propertiesWithoutDeferredParsing() instead so that it doesn't
defeat the new optimization.
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
Patched to drop the StyleSheetContents* argument from parseValue, since it
is no longer needed.
* css/parser/CSSDeferredParser.cpp: Added.
(WebCore::CSSDeferredParser::CSSDeferredParser):
(WebCore::CSSDeferredParser::parseDeclaration):
(WebCore::CSSDeferredParser::parseRuleList):
(WebCore::CSSDeferredParser::parseKeyframeList):
* css/parser/CSSDeferredParser.h: Added.
(WebCore::CSSDeferredParser::create):
(WebCore::CSSDeferredParser::tokenizer):
(WebCore::CSSDeferredParser::mode):
(WebCore::CSSDeferredParser::context):
(WebCore::CSSDeferredParser::styleSheet):
The CSSDeferredParser. It caches the original CSSTokenizer used to parse
the sheet, which in turn retains all the tokens and escaped strings. Because
the CSSDeferredParser is referenced by all the rules that have yet to parse,
it will stay alive until all rules in the stylesheet has been fully parsed.
The parser receives CSSParserTokenRanges from DeferredStyleProperties or
DeferredStyleGroupRuleList and feeds them to CSSParserImpl, which then
is able to do the parsing as it would have occurred originally had the
range not been deferred.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSheet):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::parseSingleValue):
(WebCore::CSSParser::parseValue):
* css/parser/CSSParser.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::parseKeywordValue):
(WebCore::CSSParserFastPaths::maybeParseValue):
* css/parser/CSSParserFastPaths.h:
Drop the StyleSheetContents* argument from the methods that no longer need
them.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::CSSParserImpl):
(WebCore::CSSParserImpl::tokenizer):
(WebCore::CSSParserImpl::parseValue):
(WebCore::CSSParserImpl::parseCustomPropertyValue):
(WebCore::CSSParserImpl::parseDeclarationList):
(WebCore::CSSParserImpl::parseInlineStyleDeclaration):
(WebCore::CSSParserImpl::parseRule):
(WebCore::CSSParserImpl::parseStyleSheet):
(WebCore::CSSParserImpl::parseDeclarationListForInspector):
(WebCore::CSSParserImpl::parseStyleSheetForInspector):
(WebCore::CSSParserImpl::consumeQualifiedRule):
(WebCore::CSSParserImpl::consumeMediaRule):
(WebCore::CSSParserImpl::consumeSupportsRule):
(WebCore::CSSParserImpl::consumeKeyframesRule):
(WebCore::CSSParserImpl::consumeStyleRule):
Drop the StyleSheetContents* argument from the methods that no longer need
them.
(WebCore::CSSParserImpl::createDeferredStyleProperties):
(WebCore::CSSParserImpl::parseDeferredDeclaration):
(WebCore::CSSParserImpl::parseDeferredRuleList):
(WebCore::CSSParserImpl::parseDeferredKeyframeList):
The methods that handle deferred parsing. They make sure to initialize
new CSSParserImpls with the original deferred parser, and then call existing
methods to do the parsing.
* css/parser/CSSParserImpl.h:
Patched to remove StyleSheetContents* arguments from some methods and
to add the new deferred parsing methods.
* css/parser/CSSParserTokenRange.cpp:
(WebCore::CSSParserTokenRange::consumeBlockCheckingForEditability):
* css/parser/CSSParserTokenRange.h:
In order to preserve the editability optimization from r180867, when
a style rule's block is consumed, we use a special method that looks
for -webkit-user-modify tokens. If one is seen, then the editability
optimization is turned off. Because we do this at the token level,
the optimization keeps working even if properties don't get parsed.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
(WebCore::CSSPropertyParser::consumeFont):
(WebCore::CSSPropertyParser::parseShorthand):
Patched to remove StyleSheetContents* arguments now that the editability
check is in CSSTokenizer instead.
* css/parser/CSSTokenizer.cpp:
(WebCore::CSSTokenizer::tokenRange):
* css/parser/CSSTokenizer.h:
Make tokenRange() const.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setFont):
Patched to drop the StyleSheetContents* argument.
* testing/Internals.cpp:
(WebCore::deferredStyleRulesCountForList):
(WebCore::Internals::deferredStyleRulesCount):
(WebCore::deferredGroupRulesCountForList):
(WebCore::Internals::deferredGroupRulesCount):
(WebCore::deferredKeyframesRulesCountForList):
(WebCore::Internals::deferredKeyframesRulesCount):
* testing/Internals.h:
* testing/Internals.idl:
Add new testing methods that can count the deferred style rules and
group child rule lists. These methods are used by the new layout tests.
LayoutTests:
* fast/css/deferred-parsing: Added.
* fast/css/deferred-parsing/dynamic-external-style-expected.txt: Added.
* fast/css/deferred-parsing/dynamic-external-style.html: Added.
* fast/css/deferred-parsing/dynamic-style-in-document-expected.txt: Added.
* fast/css/deferred-parsing/dynamic-style-in-document.html: Added.
* fast/css/deferred-parsing/hover-test-expected.txt: Added.
* fast/css/deferred-parsing/hover-test.html: Added.
* fast/css/deferred-parsing/keyframes-rule-expected.txt: Added.
* fast/css/deferred-parsing/keyframes-rule.html: Added.
* fast/css/deferred-parsing/media-print-expected.txt: Added.
* fast/css/deferred-parsing/media-print.html: Added.
* fast/css/deferred-parsing/nth-of-type-expected.txt: Added.
* fast/css/deferred-parsing/nth-of-type.html: Added.
* fast/css/deferred-parsing/resources: Added.
* fast/css/deferred-parsing/resources/basic-sheet.css: Added.
* fast/css/deferred-parsing/simple-external-style-expected.txt: Added.
* fast/css/deferred-parsing/simple-external-style.html: Added.
* fast/css/deferred-parsing/simple-style-in-document-expected.txt: Added.
* fast/css/deferred-parsing/simple-style-in-document.html: Added.
* fast/css/deferred-parsing/supports-rule-expected.txt: Added.
* fast/css/deferred-parsing/supports-rule.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209718
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
antti@apple.com [Mon, 12 Dec 2016 19:49:56 +0000 (19:49 +0000)]
Enable network cache speculative revalidation in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=165616
Reviewed by Darin Adler.
Match Safari. Also add a menu item to disable it.
* MiniBrowser/mac/AppDelegate.m:
(defaultConfiguration):
* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController networkCacheSpeculativeRevalidationDisabled]):
(-[SettingsController toggleNetworkCacheSpeculativeRevalidationDisabled:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209717
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Mon, 12 Dec 2016 18:59:39 +0000 (18:59 +0000)]
Unreviewed, rolling out r209672.
https://bugs.webkit.org/show_bug.cgi?id=165766
IndexedDB/objectstore-cursor.html perf test always times out
(Requested by ap on #webkit).
Reverted changeset:
"More IndexedDB perf tests."
https://bugs.webkit.org/show_bug.cgi?id=165634
http://trac.webkit.org/changeset/209672
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209716
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
dino@apple.com [Mon, 12 Dec 2016 18:42:32 +0000 (18:42 +0000)]
Autoplay isn't working in iPhone MediaDocuments
https://bugs.webkit.org/show_bug.cgi?id=165710
<rdar://problems/
29606761>
Reviewed by Darin Adler.
Source/WebCore:
Our silent video autoplay detection disabled autoplay
of videos in MediaDocuments.
Test: media/ios/autoplay-only-in-main-document.html
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted):
Return true if we're in a top-level media document.
LayoutTests:
* media/ios/autoplay-only-in-main-document.html: Make sure that
an iframe pointing to media is not autoplayed.
* TestExpectations:
* platform/ios-simulator/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209715
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ap@apple.com [Mon, 12 Dec 2016 18:18:02 +0000 (18:18 +0000)]
ChangeLogs become readonly after resolving a conflict
https://bugs.webkit.org/show_bug.cgi?id=165440
rdar://problem/
29491002
Reviewed by Darin Adler.
* Scripts/resolve-ChangeLogs: (resolveChangeLog): Set correct permissions when
moving the file.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209714
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ryanhaddad@apple.com [Mon, 12 Dec 2016 18:17:38 +0000 (18:17 +0000)]
Marking http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html as flaky on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=165691
Unreviewed test gardening.
* platform/ios-simulator/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209713
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
ryanhaddad@apple.com [Mon, 12 Dec 2016 17:38:06 +0000 (17:38 +0000)]
Rebaseline js/dom/global-constructors-attributes.html for mac-wk1 after r209666.
Unreviewed test gardening.
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209712
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mattbaker@apple.com [Mon, 12 Dec 2016 17:24:03 +0000 (17:24 +0000)]
Web Inspector: Cleanup HierarchicalPathComponent
https://bugs.webkit.org/show_bug.cgi?id=165745
Reviewed by Brian Burg.
Prefer toggle for style class names, remove single use CSS class name
constants, and back all properties by the model not the DOM.
* UserInterface/Views/HierarchicalPathComponent.js:
(WebInspector.HierarchicalPathComponent):
(WebInspector.HierarchicalPathComponent.prototype.get element):
(WebInspector.HierarchicalPathComponent.prototype.get representedObject):
(WebInspector.HierarchicalPathComponent.prototype.get minimumWidth):
(WebInspector.HierarchicalPathComponent.prototype.get forcedWidth):
(WebInspector.HierarchicalPathComponent.prototype.set forcedWidth):
(WebInspector.HierarchicalPathComponent.prototype.get hidden):
(WebInspector.HierarchicalPathComponent.prototype.set hidden):
(WebInspector.HierarchicalPathComponent.prototype.get collapsed):
(WebInspector.HierarchicalPathComponent.prototype.set collapsed):
(WebInspector.HierarchicalPathComponent.prototype.get selectorArrows):
(WebInspector.HierarchicalPathComponent.prototype.set selectorArrows):
(WebInspector.HierarchicalPathComponent.prototype.get previousSibling):
(WebInspector.HierarchicalPathComponent.prototype.set previousSibling):
(WebInspector.HierarchicalPathComponent.prototype.get nextSibling):
(WebInspector.HierarchicalPathComponent.prototype.set nextSibling):
(WebInspector.HierarchicalPathComponent.prototype._updateElementTitleAndText):
(WebInspector.HierarchicalPathComponent.prototype._updateSelectElement.createOption):
(WebInspector.HierarchicalPathComponent.prototype._updateSelectElement):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209711
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fpizlo@apple.com [Mon, 12 Dec 2016 17:21:27 +0000 (17:21 +0000)]
Re-enable collectContinuously since it doesn't crash anymore
Rubber stamped by Michael Saboff.
* Scripts/run-jsc-stress-tests:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209710
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mattbaker@apple.com [Mon, 12 Dec 2016 17:20:37 +0000 (17:20 +0000)]
Web Inspector: Allow keyboard navigation in Heap Snapshot data grids
https://bugs.webkit.org/show_bug.cgi?id=165752
Reviewed by Brian Burg.
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom:focus li.selected > span::after):
Use new color variable.
* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.get selectable): Deleted.
Should be selectable.
* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot > .data-grid:focus tr.selected > td .sub-retained):
(.heap-snapshot > .data-grid:focus tr.selected .object-id,):
(.heap-snapshot > .data-grid:focus tr.selected .formatted-string,):
(.heap-snapshot > .data-grid:focus tr.selected td .location):
Selected row text should just be white, except for values that are usually
gray (object ID, object size, and sub-retained size values). These should
be styled like the "= $0" marker in the DOM tree outline.
(.heap-snapshot > .data-grid:matches(:focus, .force-focus) tr.selected td .location): Deleted.
Removed forced-focus reference. Only used by TreeOutlineDataGridSynchronizer.
* UserInterface/Views/Variables.css:
(:root):
Added --selected-secondary-text-color.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209709
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
msaboff@apple.com [Mon, 12 Dec 2016 17:10:30 +0000 (17:10 +0000)]
FTL: Dumping disassembly requires that code origin is set when making polymorphic tail calls.
https://bugs.webkit.org/show_bug.cgi?id=165747
Reviewed by Filip Pizlo.
Setting the code origin needs to be done for both the fast and slow path as we might need
it when linking a polymorphic or virtual call stub.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209708
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
pvollan@apple.com [Mon, 12 Dec 2016 16:17:13 +0000 (16:17 +0000)]
Unreviewed test gardening.
Update test expectations on Windows for failing tests. These failures are tracked in
https://bugs.webkit.org/show_bug.cgi?id=160447.
* platform/win/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209707
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mattbaker@apple.com [Mon, 12 Dec 2016 11:11:59 +0000 (11:11 +0000)]
Web Inspector: Breakpoint Log action should support template literals
https://bugs.webkit.org/show_bug.cgi?id=165116
<rdar://problem/
29464765>
Reviewed by Joseph Pecoraro.
Source/WebInspectorUI:
* Localizations/en.lproj/localizedStrings.js:
New string "${expr} = expression" for breakpoint popover.
* UserInterface/Controllers/BreakpointLogMessageLexer.js: Added.
To support template literal placeholders in message text, it is necessary
to distinguish plain text parts of the message from placeholders, since
plain text must be escaped.
(WebInspector.BreakpointLogMessageLexer):
(WebInspector.BreakpointLogMessageLexer.prototype.tokenize):
(WebInspector.BreakpointLogMessageLexer.prototype.reset):
(WebInspector.BreakpointLogMessageLexer.prototype._finishPlainText):
(WebInspector.BreakpointLogMessageLexer.prototype._finishExpression):
(WebInspector.BreakpointLogMessageLexer.prototype._appendToken):
(WebInspector.BreakpointLogMessageLexer.prototype._consume):
(WebInspector.BreakpointLogMessageLexer.prototype._peek):
(WebInspector.BreakpointLogMessageLexer.prototype._expression):
(WebInspector.BreakpointLogMessageLexer.prototype._plainText):
(WebInspector.BreakpointLogMessageLexer.prototype._possiblePlaceholder):
(WebInspector.BreakpointLogMessageLexer.prototype._regExpOrStringLiteral):
* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype._debuggerBreakpointOptions):
Build breakpoint "options" object for DebuggerAgent. If a Log action
contains template literal placeholders it is changed to an Evaluate
action, which calls console.log with a template literal.
(WebInspector.DebuggerManager.prototype._setBreakpoint):
Use converted breakpoint options.
* UserInterface/Main.html:
* UserInterface/Test.html:
New file.
* UserInterface/Views/BreakpointActionView.css:
(.breakpoint-action-block-body > .description):
Styles for breakpoint Log action hint text.
* UserInterface/Views/BreakpointActionView.js:
(WebInspector.BreakpointActionView.prototype._updateBody):
Add Log action hint text element.
LayoutTests:
* inspector/debugger/breakpoint-action-log-expected.txt: Added.
* inspector/debugger/breakpoint-action-log.html: Added.
Check that breakpoint log actions support template literal placeholders.
* inspector/unit-tests/breakpoint-log-message-lexer-expected.txt: Added.
* inspector/unit-tests/breakpoint-log-message-lexer.html: Added.
Check that the lexer correctly scans breakpoint log action text.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209706
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
zandobersek@gmail.com [Mon, 12 Dec 2016 09:10:07 +0000 (09:10 +0000)]
Unreviewed. Fixing build breakage in GStreamer's WebKitCommonEncryptionDecryptorGStreamer.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):
WTF::Seconds should be used instead of std::chrono::seconds.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209705
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
annulen@yandex.ru [Mon, 12 Dec 2016 08:32:01 +0000 (08:32 +0000)]
Unreviewed, rolling out r209703.
https://bugs.webkit.org/show_bug.cgi?id=165749
Broke Apple builds (Requested by annulen|home on #webkit).
Reverted changeset:
"Unreviewed, use WTF_ATTRIBUTE_PRINTF instead of clang pragma"
http://trac.webkit.org/changeset/209703
Patch by Commit Queue <commit-queue@webkit.org> on 2016-12-12
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209704
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
annulen@yandex.ru [Mon, 12 Dec 2016 08:14:58 +0000 (08:14 +0000)]
Unreviewed, use WTF_ATTRIBUTE_PRINTF instead of clang pragma
* wtf/PrintStream.cpp:
(WTF::PrintStream::printfVariableFormat):
* wtf/PrintStream.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209703
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
sbarati@apple.com [Mon, 12 Dec 2016 07:44:40 +0000 (07:44 +0000)]
Unreviewed. Try to fix the linux build.
* runtime/StackFrame.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209702
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
annulen@yandex.ru [Mon, 12 Dec 2016 07:20:49 +0000 (07:20 +0000)]
Unreviewed, guarded clang pragma with COMPILER(CLANG) to fix -Werror
* wtf/PrintStream.cpp:
(WTF::PrintStream::printfVariableFormat):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209701
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
annulen@yandex.ru [Mon, 12 Dec 2016 07:13:26 +0000 (07:13 +0000)]
Unreviewed attempt to fix EFL and Mac/cmake builds after r209665.
https://bugs.webkit.org/show_bug.cgi?id=165686
Source/WebKit2:
* PlatformEfl.cmake: WebKit2 should precede other target so that right
config.h comes first in include path.
Tools:
* DumpRenderTree/CMakeLists.txt: WebKit2 should precede other target
so that right config.h comes first in include path.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209700
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
hyatt@apple.com [Mon, 12 Dec 2016 06:39:39 +0000 (06:39 +0000)]
[CSS Parser] Make sure content extensions initialize AtomicString
https://bugs.webkit.org/show_bug.cgi?id=165737
Reviewed by Darin Adler.
* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::makeBackend):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209699
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mattbaker@apple.com [Mon, 12 Dec 2016 04:59:18 +0000 (04:59 +0000)]
Web Inspector: ThreadTreeElement should have a "Resume" status button when paused
https://bugs.webkit.org/show_bug.cgi?id=165581
Reviewed by Joseph Pecoraro.
* UserInterface/Images/Resume.svg:
Fill/stroke should be unspecified so that both can be styled in CSS.
* UserInterface/Views/DebuggerDashboardView.css:
(.dashboard.debugger .navigation-bar .item.debugger-dashboard-pause.activated):
* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger > .navigation-bar .debugger-pause-resume):
(.sidebar > .panel.navigation.debugger > .navigation-bar .debugger-pause-resume.activated):
Recreate original style which relied on 'fill="none"' being specified in the SVG.
* UserInterface/Views/ThreadTreeElement.css:
(.tree-outline > .item.thread .icon):
(.tree-outline > .item.thread .status-button.resume):
(.tree-outline > .item.thread .status-button.resume:active):
(.tree-outline:matches(:focus, .force-focus) > .item.thread.selected .status-button.resume):
(.tree-outline > .item.thread.selected .status-button.resume,):
(.details-section.call-stack .thread .icon): Deleted.
Status button styles. Colors match those of the goto-arrow button.
* UserInterface/Views/ThreadTreeElement.js:
(WebInspector.ThreadTreeElement.prototype.refresh):
Update status icon.
(WebInspector.ThreadTreeElement.prototype.oncontextmenu):
(WebInspector.ThreadTreeElement.prototype._updateStatus):
Add/remove status button based on paused state.
Stop propagation of "mousedown" events on the status button, to
prevent button press from selecting the tree element.
(WebInspector.ThreadTreeElement):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209698
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
simon.fraser@apple.com [Mon, 12 Dec 2016 04:58:02 +0000 (04:58 +0000)]
REGRESSION (r200283): Transform, overflow hidden and filter combination completely hides the element
https://bugs.webkit.org/show_bug.cgi?id=161509
Reviewed by David Hyatt.
Source/WebCore:
When the filter painting code needs to recompute a paintDirtyRect, it was using selfClipRect()
which is obviously wrong because it returns a rect in absolute coordinates. Use code factored
out of localClipRect() instead, which returns a rect relative to the painting root.
Test: css3/filters/filter-on-overflow-hidden.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
LayoutTests:
* css3/filters/filter-on-overflow-hidden-expected.html: Added.
* css3/filters/filter-on-overflow-hidden.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209697
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
sbarati@apple.com [Mon, 12 Dec 2016 03:11:18 +0000 (03:11 +0000)]
We should be able to throw exceptions from Wasm code and when Wasm frames are on the stack
https://bugs.webkit.org/show_bug.cgi?id=165429
Reviewed by Keith Miller.
JSTests:
* wasm/function-tests/trap-load.js: Added.
(assert):
(wasmFrameCountFromError):
(i.catch):
(assert.continuation):
* wasm/function-tests/trap-store.js: Added.
(import.Builder.from.string_appeared_here.assert):
(i.catch):
(assert.continuation):
(assert):
* wasm/js-api/test_memory_constructor.js:
(assert):
Source/JavaScriptCore:
This patch teaches the stack walking runtime about wasm.
To do this, I taught StackVisitor that a callee is not
always an object.
To be able to unwind callee save registers properly, I've given
JSWebAssemblyCallee a list of RegisterAtOffsetList for the callee
saves that B3 saved in the prologue. Also, because we have two
B3Compilations per wasm function, one for wasm entrypoint, and
one for the JS entrypoint, I needed to create a callee for each
because they each might spill callee save registers.
I also fixed a bug inside the Wasm::Memory constructor where we
were trying to mmap the same number of bytes even after the first
mmap failed. We should start by trying to mmap the maximum bytes,
and if that fails, fall back to the specified initial bytes. However,
the code was just mmapping the maximum twice. I've fixed that and
also added a RELEASE_ASSERT_NOT_REACHED() for when the second mmap
fails along with a FIXME to throw an OOM error.
There was a second bug I fixed where JSModuleRecord was calling
visitWeak on its CallLinkInfos inside ::visitChldren(). It needs
to do this after marking. I changed JSModuleRecord to do what
CodeBlock does and call visitWeak on its CallLinkInfos inside
an UnconditionalFinalizer.
* API/JSContextRef.cpp:
(BacktraceFunctor::operator()):
* inspector/ScriptCallStackFactory.cpp:
(Inspector::createScriptCallStackFromException):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::vmEntryGlobalObject):
* interpreter/CallFrame.h:
(JSC::ExecState::callee):
* interpreter/Interpreter.cpp:
(JSC::GetStackTraceFunctor::operator()):
(JSC::UnwindFunctor::operator()):
(JSC::UnwindFunctor::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
* interpreter/Interpreter.h:
* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::update):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::StackVisitor):
(JSC::StackVisitor::readFrame):
(JSC::StackVisitor::readNonInlinedFrame):
(JSC::StackVisitor::readInlinedFrame):
(JSC::StackVisitor::Frame::isWasmFrame):
(JSC::StackVisitor::Frame::codeType):
(JSC::StackVisitor::Frame::calleeSaveRegisters):
(JSC::StackVisitor::Frame::functionName):
(JSC::StackVisitor::Frame::sourceURL):
(JSC::StackVisitor::Frame::toString):
(JSC::StackVisitor::Frame::hasLineAndColumnInfo):
(JSC::StackVisitor::Frame::setToEnd):
* interpreter/StackVisitor.h:
(JSC::StackVisitor::Frame::callee):
(JSC::StackVisitor::Frame::isNativeFrame):
(JSC::StackVisitor::Frame::isJSFrame): Deleted.
* jsc.cpp:
(callWasmFunction):
(functionTestWasmModuleFunctions):
* runtime/Error.cpp:
(JSC::addErrorInfoAndGetBytecodeOffset):
* runtime/JSCell.cpp:
(JSC::JSCell::isAnyWasmCallee):
* runtime/JSCell.h:
* runtime/JSFunction.cpp:
(JSC::RetrieveArgumentsFunctor::operator()):
(JSC::RetrieveCallerFunctionFunctor::operator()):
* runtime/StackFrame.cpp:
(JSC::StackFrame::sourceID):
(JSC::StackFrame::sourceURL):
(JSC::StackFrame::functionName):
(JSC::StackFrame::computeLineAndColumn):
(JSC::StackFrame::toString):
* runtime/StackFrame.h:
(JSC::StackFrame::StackFrame):
(JSC::StackFrame::hasLineAndColumnInfo):
(JSC::StackFrame::hasBytecodeOffset):
(JSC::StackFrame::bytecodeOffset):
(JSC::StackFrame::isNative): Deleted.
* runtime/VM.h:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::createJSToWasmWrapper):
(JSC::Wasm::parseAndCompile):
* wasm/WasmCallingConvention.h:
(JSC::Wasm::CallingConvention::setupFrameInPrologue):
* wasm/WasmFormat.h:
* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::Memory):
* wasm/WasmMemory.h:
(JSC::Wasm::Memory::isValid):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::run):
(JSC::Wasm::Plan::initializeCallees):
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::jsToWasmEntryPointForFunction): Deleted.
* wasm/js/JSWebAssemblyCallee.cpp:
(JSC::JSWebAssemblyCallee::finishCreation):
* wasm/js/JSWebAssemblyCallee.h:
(JSC::JSWebAssemblyCallee::create):
(JSC::JSWebAssemblyCallee::entrypoint):
(JSC::JSWebAssemblyCallee::calleeSaveRegisters):
(JSC::JSWebAssemblyCallee::jsToWasmEntryPoint): Deleted.
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::JSWebAssemblyModule):
(JSC::JSWebAssemblyModule::visitChildren):
(JSC::JSWebAssemblyModule::UnconditionalFinalizer::finalizeUnconditionally):
* wasm/js/JSWebAssemblyModule.h:
(JSC::JSWebAssemblyModule::jsEntrypointCalleeFromFunctionIndexSpace):
(JSC::JSWebAssemblyModule::wasmEntrypointCalleeFromFunctionIndexSpace):
(JSC::JSWebAssemblyModule::setJSEntrypointCallee):
(JSC::JSWebAssemblyModule::setWasmEntrypointCallee):
(JSC::JSWebAssemblyModule::allocationSize):
(JSC::JSWebAssemblyModule::calleeFromFunctionIndexSpace): Deleted.
* wasm/js/JSWebAssemblyRuntimeError.h:
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::call):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::constructJSWebAssemblyMemory):
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::constructJSWebAssemblyModule):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
Source/WebCore:
* bindings/js/JSDOMBinding.cpp:
(WebCore::GetCallerGlobalObjectFunctor::operator()):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209696
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
darin@apple.com [Mon, 12 Dec 2016 02:50:06 +0000 (02:50 +0000)]
Remove uses of Dictionary in WebRTC IDL files
https://bugs.webkit.org/show_bug.cgi?id=165736
Reviewed by Sam Weinig.
Source/WebCore:
Also removed quite a bit of unused code. There were some mocks that were out of date and
no longer matched the types used in the real code, that also were no longer hooked up,
and other types of dead code. We will have to implement anew when we want to restore tests
like the ones these were intended to enable.
* CMakeLists.txt: Updated for all the removed files.
* Modules/mediastream/MediaEndpointPeerConnection.cpp: Moved some types in here
that don't need to be in the header.
(WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): Use make_unique.
(WebCore::MediaEndpointPeerConnection::setConfiguration): Changed argument type,
obviating the need for most of the code that was here.
* Modules/mediastream/MediaEndpointPeerConnection.h: Updated for the above. Made more
things private and final. Marked the constructor explicit. Removed unneeded includes.
* Modules/mediastream/PeerConnectionBackend.h: Removed unneeded includes and forward
declarations. Changed the argument type for setConfiguration (see above).
* Modules/mediastream/RTCConfiguration.cpp: Removed.
None of the code here was needed except for the ICE server validation, and that was
moved into RTCPeerConnection::setConfiguration.
* Modules/mediastream/RTCConfiguration.h: Changed this from a class to a struct since
this is now a dictionary rather than an interface.
* Modules/mediastream/RTCConfiguration.idl: Changed this from an interface to a dictionary.
* Modules/mediastream/RTCDTMFSender.cpp: Removed some of the code from this file. This
class currently isn't implemented, but was depending on RTCPeerConnectionHandler. I removed
some of the dead code. Someone will have to straighten this out so we can turn it back on.
* Modules/mediastream/RTCDTMFSender.h: Ditto.
* Modules/mediastream/RTCDataChannel.cpp: Updated includes.
* Modules/mediastream/RTCIceCandidate.cpp:
(WebCore::RTCIceCandidate::create): Removed most of the code, since this now takes
a structure rather than a WebCore::Dictionary, and so the bindings take care of the work.
* Modules/mediastream/RTCIceCandidate.h: Updated for the above.
* Modules/mediastream/RTCIceCandidate.idl: Changed the constructor to take a
RTCIceCandidateInit instead of a Dictionary.
* Modules/mediastream/RTCIceServer.h: Changed this from a class to a struct since
this is now a dictionary rather than an interface.
* Modules/mediastream/RTCIceServer.idl: Changed this from an interface to a dictionary.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::initializeWith): Take an RTCConfiguration rather than
a Dictionary.
(WebCore::RTCPeerConnection::getConfiguration): Moved to header, now an inline.
(WebCore::RTCPeerConnection::setConfiguration): Use the configuration dictionary now instead
of the configuration class. Also moved validation of server URLs here, formerly in the
RTCConfiguration RTCConfiguration::initialize function. Also moved code to convert from
RTCConfiguration to MediaEndpointConfiguration here, formerly in
MediaEndpointPeerConnection::setConfiguration.
* Modules/mediastream/RTCPeerConnection.h: Updated for the above.
* Modules/mediastream/RTCPeerConnection.idl: Changed argument to initializeWith and
setConfiguration from Dictionary to RTCConfiguration.
* Modules/mediastream/RTCSessionDescription.cpp:
(WebCore::parseTypeString): Deleted.
(WebCore::RTCSessionDescription::create): Changed to take struct instead of Dictionary.
* Modules/mediastream/RTCSessionDescription.h: Added Init struct and changed create to
take it.
* Modules/mediastream/RTCSessionDescription.idl: Changed constructor argument to take
RTCSessionDescriptionInit dictionary instead of Dictionary.
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp: Updated includes.
* WebCore.xcodeproj/project.pbxproj: Updated for all the removed files.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent): Fixed convertDictionaryToJS to work with other
nullable types besides RefPtr.
* bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
* platform/mediastream/RTCConfigurationPrivate.h: Removed.
* platform/mediastream/RTCIceServerPrivate.h: Removed.
* platform/mediastream/RTCPeerConnectionHandler.cpp: Removed.
* platform/mediastream/RTCPeerConnectionHandler.h: Removed.
* platform/mock/RTCDTMFSenderHandlerMock.cpp: Removed.
* platform/mock/RTCDTMFSenderHandlerMock.h: Removed.
* platform/mock/RTCDataChannelHandlerMock.h: Updated includes, made more things private and final.
* platform/mock/RTCPeerConnectionHandlerMock.cpp: Removed.
* platform/mock/RTCPeerConnectionHandlerMock.h: Removed.
* testing/Internals.cpp:
(WebCore::Internals::Internals): Removed call to enableMockRTCPeerConnectionHandler.
(WebCore::Internals::enableMockRTCPeerConnectionHandler): Deleted.
LayoutTests:
* fast/mediastream/RTCIceCandidate-expected.txt: Regenerated; no new failures.
* fast/mediastream/RTCIceCandidate.html: Updated test to expect the WebIDL rules for parsing
unsigned short for sdpMLineIndex. The old code expected additional range checking which is
not expected behavior.
* fast/mediastream/RTCPeerConnection-expected.txt: Regenerated; no new failures.
* fast/mediastream/RTCPeerConnection.html: Updated test to not expect an exception when
iceServers is entirely omitted or when it is an empty array. This is a progression and is
closer to the specification.
* fast/mediastream/RTCPeerConnection-getConfiguration-expected.txt: Regenerated; no new failures.
* fast/mediastream/RTCPeerConnection-getConfiguration.html: Updated test to expect the username
and credential fields to round trip as missing rather than turning from missing into empty strings.
Also updated the tests to pass in sequences of strings for "urls" since they expect sequences on
the way back out. We could also test round tripping of single strings, which should go in and come
back out as individual strings, but for now I did not bother adding that to this test.
* fast/mediastream/RTCSessionDescription-expected.txt: Regenerated; some exception messages are
now more specific than they were before.
* imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:
Updated expected results. The new code correctly allows callers of the RTCPeerConnection constructor
to omit iceServers, pass undefined, or pass an empty array, as specified. Thuis change leads to
a couple tests that now correctly pass instead of failing. And it also leads to some other tests
failing that were passing before. These were passing because they expected an exception for some
other reason, however the exception was actually occurring because of incorrect handling of iceServers.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209695
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fpizlo@apple.com [Mon, 12 Dec 2016 01:41:16 +0000 (01:41 +0000)]
Re-enable concurrent GC.
Rubber stampted by Saam Barati.
This change actually landed in r209692 by accident.
* runtime/Options.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209694
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fpizlo@apple.com [Mon, 12 Dec 2016 01:39:04 +0000 (01:39 +0000)]
Change to use #pragma once (requested by Darin Adler).
* wtf/RecursiveLockAdapter.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209693
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fpizlo@apple.com [Mon, 12 Dec 2016 01:34:07 +0000 (01:34 +0000)]
Change to use #pragma once (requested by Darin Adler).
* wtf/LockedPrintStream.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209692
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fpizlo@apple.com [Mon, 12 Dec 2016 01:19:47 +0000 (01:19 +0000)]
MarkedBlock::marksConveyLivenessDuringMarking should take into account collection scope
https://bugs.webkit.org/show_bug.cgi?id=165741
Reviewed by Saam Barati.
Source/JavaScriptCore:
MarkedBlock::marksConveyLivenessDuringMarking thought that the off-by-one marking
version indicated liveness during any collection when it's just during full collection.
One of its users - MarkedBlock::sweep - knew this and had a special case, but the other
one - MarkedBlock::isLive - didn't. So, I moved the special case into
marksConveyLivenessDuringMarking.
Also, this cleans up some remaining bitvector races.
To find this bug, I significantly strengthened our assertions.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/CellContainer.cpp: Added.
(JSC::CellContainer::isNewlyAllocated):
* heap/CellContainer.h:
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::addBlock):
(JSC::MarkedAllocator::removeBlock):
(JSC::MarkedAllocator::dumpBits):
* heap/MarkedAllocator.h:
(JSC::MarkedAllocator::forEachBitVector):
(JSC::MarkedAllocator::forEachBitVectorWithName):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::tryCreate):
(JSC::MarkedBlock::Handle::~Handle):
(JSC::MarkedBlock::MarkedBlock):
(JSC::MarkedBlock::Handle::specializedSweep):
(JSC::MarkedBlock::Handle::sweepHelperSelectMarksMode):
(JSC::MarkedBlock::Handle::stopAllocating):
(JSC::MarkedBlock::Handle::resumeAllocating):
(JSC::MarkedBlock::aboutToMarkSlow):
(JSC::MarkedBlock::Handle::didConsumeFreeList):
(JSC::MarkedBlock::Handle::dumpState):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::markingVersion):
(JSC::MarkedBlock::isMarkedRaw):
(JSC::MarkedBlock::isMarked):
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::marksConveyLivenessDuringMarking):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/StructureIDTable.h:
(JSC::StructureIDTable::size):
(JSC::StructureIDTable::get):
Source/WTF:
To find this bug, I needed to seriously beef up our logging infrastructure.
It's now the case that:
dataLog(...);
will print its output atomically. This happens with some careful magic:
- dataFile() is now a LockedPrintStream that locks around print().
- The lock is a recursive lock via RecursiveLockAdapter<>, so if the dump methods end
up calling back into dataLog() then it just works. This is important: say the dump()
calls a getter that itself does logging, maybe because it's encountering badness and
wants to report it before crashing).
- The lock is a WordLock so that ParkingLot and Lock can keep using dataLog() for
debugging. We probably won't need to debug WordLock anytime soon - the algorithm is
so simple.
- LockedPrintStream::print(...) causes the print callbacks of its arguments to run on
the underlying PrintStream, so that you don't need to do recursive lock acquisition
on each individual argument and whatever printing it does recursively.
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/DataLog.cpp:
(WTF::initializeLogFileOnce):
(WTF::initializeLogFile):
(WTF::dataFile):
* wtf/DataLog.h:
* wtf/LockedPrintStream.cpp: Added.
(WTF::LockedPrintStream::LockedPrintStream):
(WTF::LockedPrintStream::~LockedPrintStream):
(WTF::LockedPrintStream::vprintf):
(WTF::LockedPrintStream::flush):
(WTF::LockedPrintStream::begin):
(WTF::LockedPrintStream::end):
* wtf/LockedPrintStream.h: Added.
* wtf/PrintStream.cpp:
(WTF::PrintStream::printfVariableFormat):
(WTF::PrintStream::begin):
(WTF::PrintStream::end):
* wtf/PrintStream.h:
(WTF::PrintStream::atomically):
(WTF::PrintStream::print):
(WTF::PrintStream::println):
(WTF::PrintStream::printImpl):
(WTF::>::unpack):
(WTF::FormatImpl::FormatImpl):
(WTF::FormatImpl::dump):
(WTF::format):
(WTF::printInternal):
* wtf/RecursiveLockAdapter.h: Added.
(WTF::RecursiveLockAdapter::RecursiveLockAdapter):
(WTF::RecursiveLockAdapter::lock):
(WTF::RecursiveLockAdapter::unlock):
(WTF::RecursiveLockAdapter::tryLock):
(WTF::RecursiveLockAdapter::isLocked):
* wtf/WordLock.cpp:
* wtf/WordLock.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209691
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
timothy_horton@apple.com [Mon, 12 Dec 2016 01:10:00 +0000 (01:10 +0000)]
Quarter-second stalls scrolling images that are links because of sync getPositionInformation
https://bugs.webkit.org/show_bug.cgi?id=165707
Reviewed by Simon Fraser.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView positionInformationForActionSheetAssistant:]):
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
For now, synchronously block when presenting the action sheet if we
don't have a snapshot ready.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
Respect includeSnapshot in another place in getPositionInformation,
so that many getPositionInformations don't have to do extra snapshotting work.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209690
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
darin@apple.com [Mon, 12 Dec 2016 00:57:02 +0000 (00:57 +0000)]
Use std::vsnprintf instead of vasprintf
https://bugs.webkit.org/show_bug.cgi?id=165740
Reviewed by Sam Weinig.
Source/WebCore:
* platform/FileHandle.cpp:
(WebCore::FileHandle::printf): Use vsnprintf, including StringExtras.h to
ensure compatibility with older versions of the Visual Studio library,
and Vector for the buffer. Use inline capacity in the vector so we normally
don't need to allocate any memory on the heap.
* xml/XSLTUnicodeSort.cpp:
(xsltTransformErrorTrampoline): Ditto.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::error): Ditto.
Source/WTF:
* wtf/Platform.h: Remove HAVE_VASPRINTF.
* wtf/StringExtras.h: Change the vsnprintf workaround to be used only
in older versions of Visual Studio, since the problem it works around
was resolved in Visual Studio 2015.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209689
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
darin@apple.com [Mon, 12 Dec 2016 00:56:25 +0000 (00:56 +0000)]
Make some refinements to HTMLPlugInImageElement
https://bugs.webkit.org/show_bug.cgi?id=165742
Reviewed by Sam Weinig.
* html/HTMLPlugInImageElement.cpp: Removed many unneeded includes.
(WebCore::titleText): Use HashMap::ensure, correct argument types.
(WebCore::subtitleText): Ditto.
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Moved
initialization of most scalars to the class definition.
(WebCore::HTMLPlugInImageElement::isImageType): Use auto.
(WebCore::HTMLPlugInImageElement::wouldLoadAsPlugIn): Removed
unneeded local variable and if statement.
(WebCore::HTMLPlugInImageElement::willDetachRenderers): Use auto.
(WebCore::HTMLPlugInImageElement::updateSnapshot): Do not call
renderer twice unnecessarily.
(WebCore::plugInImageElementIsolatedWorld): Use auto.
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Use auto.
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay): Use auto.
(WebCore::HTMLPlugInImageElement::restartSimilarPlugIns): Got rid of
unnecessary typedef.
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Take a
reference rather than PassRefPtr.
(WebCore::documentHadRecentUserGesture): Removed unneeded if.
(WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting): Use auto.
(WebCore::isSmallerThanTinySizingThreshold): Use auto.
(WebCore::HTMLPlugInImageElement::isTopLevelFullPagePlugin): Use auto.
(WebCore::HTMLPlugInImageElement::checkSnapshotStatus): Use auto.
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Got rid
of unnecessary local variable. Use auto.
(WebCore::HTMLPlugInImageElement::requestObject): Got rid of unnecessary
local variable.
* html/HTMLPlugInImageElement.h: Updated for the above. Removed incorrect
use of const. Initialized all scalars. Made function private and final.
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::handleEvent): Pass reference instead
of pointer.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209688
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Sun, 11 Dec 2016 23:40:15 +0000 (23:40 +0000)]
Web Inspector: Cleanup some InspectorInstrumentation network loading notifications
https://bugs.webkit.org/show_bug.cgi?id=165688
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-12-11
Reviewed by Brian Burg.
Eliminate InspectorInstrumentation::willReceiveResourceResponse by folding
it into InspectorInstrumentation::didReceiveResourceResponse. Simplify other
related InspectorInstrumentation calls by using references and using more
consistent InspectorInstrumentation patterns.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
(WebCore::InspectorInstrumentation::willReceiveResourceResponseImpl): Deleted.
(WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl): Deleted.
(WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl): Deleted.
(WebCore::InspectorInstrumentation::continueWithPolicyDownloadImpl): Deleted.
(WebCore::InspectorInstrumentation::continueWithPolicyIgnoreImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didReceiveResourceResponse):
(WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDenied):
(WebCore::InspectorInstrumentation::continueWithPolicyDownload):
(WebCore::InspectorInstrumentation::continueWithPolicyIgnore):
(WebCore::InspectorInstrumentation::willReceiveResourceResponse): Deleted.
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
(WebCore::DocumentLoader::continueAfterContentPolicy):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didReceiveResponse):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209687
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Sun, 11 Dec 2016 23:37:11 +0000 (23:37 +0000)]
Web Inspector: Move MainTarget and WorkerTarget to their own files
https://bugs.webkit.org/show_bug.cgi?id=165701
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-12-11
Reviewed by Brian Burg.
* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.scriptDidParse):
* UserInterface/Main.html:
* UserInterface/Protocol/MainTarget.js: Added.
(WebInspector.MainTarget):
(WebInspector.MainTarget.prototype.get displayName):
(WebInspector.MainTarget.prototype.get mainResource):
* UserInterface/Protocol/Target.js:
(WebInspector.Target):
(WebInspector.MainTarget): Deleted.
(WebInspector.MainTarget.prototype.get displayName): Deleted.
(WebInspector.MainTarget.prototype.get mainResource): Deleted.
(WebInspector.MainTarget.prototype.initialize): Deleted.
(WebInspector.WorkerTarget): Deleted.
(WebInspector.WorkerTarget.prototype.get displayName): Deleted.
(WebInspector.WorkerTarget.prototype.initialize): Deleted.
* UserInterface/Protocol/WorkerTarget.js: Added.
(WebInspector.WorkerTarget):
(WebInspector.WorkerTarget.prototype.get displayName):
* UserInterface/Test.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209686
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
eric.carlson@apple.com [Sun, 11 Dec 2016 22:08:05 +0000 (22:08 +0000)]
[MediaStream] Protect MediaDevicesRequest during callback
https://bugs.webkit.org/show_bug.cgi?id=165711
<rdar://problem/
28400468>
Reviewed by Sam Weinig.
No new tests, I was unable to create a reproducible test but this fix avoids
an occasional crash in existing tests.
* Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
(WebCore::MediaDevicesEnumerationRequest::start): Take a reference to the object
before calling the controller in case the completion handler is called synchronously.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209685
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jiewen_tan@apple.com [Sun, 11 Dec 2016 22:00:17 +0000 (22:00 +0000)]
[WebCrypto] Add tests for wrap/unwrap SPKI/PKCS8 keys
https://bugs.webkit.org/show_bug.cgi?id=165557
Reviewed by Darin Adler.
* crypto/subtle/aes-cbc-import-key-unwrap-pkcs8-key-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-unwrap-pkcs8-key.html: Added.
* crypto/subtle/aes-cbc-import-key-unwrap-spki-key-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-unwrap-spki-key.html: Added.
* crypto/subtle/aes-cbc-import-key-wrap-pkcs8-key-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-wrap-pkcs8-key.html: Added.
* crypto/subtle/aes-cbc-import-key-wrap-spki-key-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-wrap-spki-key.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209684
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fpizlo@apple.com [Sun, 11 Dec 2016 18:19:22 +0000 (18:19 +0000)]
The DOM should have an advancing wavefront opaque root barrier
https://bugs.webkit.org/show_bug.cgi?id=165712
Reviewed by Yusuke Suzuki.
Source/JavaScriptCore:
This exposes the ability to fire an advancing wavefront barrier on opaque roots. It also
gives clients the ability to maintain their own cache of whether that barrier needs to
be enabled.
The DOM uses this to enable a very cheap barrier on the DOM. This is neutral on
Speedometer and fixes another concurrent GC crash.
* heap/Heap.cpp:
(JSC::Heap::beginMarking):
(JSC::Heap::endMarking):
(JSC::Heap::writeBarrierOpaqueRootSlow):
(JSC::Heap::addMutatorShouldBeFencedCache):
(JSC::Heap::setMutatorShouldBeFenced):
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::writeBarrierOpaqueRoot):
Source/WebCore:
No new tests because this was covered by crashing tests.
Consider these two cases:
Removal:
1) DOM at start: D->X->Y
2) Mark X, X->visitChildren, addOpaqueRoot(D)
3) remove X
4) Y thinks it's not reachable (its opaque root, X, is not in the set).
Insertion:
1) DOM at start: D, X->Y
2) Mark X, X->visitChildren, addOpaqueRoot(X)
3) insert X into D
4) Y thinks it's not reachable (its opaque root, D, is not in the set).
We can fix this with two barriers:
Removal: add X (the removed child) to the opaque root set.
Insertion: add D (the insertion point) to the opaque root set.
Thanks Rysosuke for coming up with this idea!
Both barriers advance the wavefront. We could consider retreating wavefront barriers in
the future (where we cause visitChildren to be called again on wrappers that belonged to
roots that got affected by insertion/removal) but those would probably require more
bookkeeping.
To make this barrier very fast, the WebCore caches the JSC VM's barrier state in
its own global variable for very fast access. This variable will be false most of the
time. It's false when there is no VM, so triggering the barrier won't cause the VM to be
created. It's only true when GC is running, which is rare by design.
To make that caching more sensible, I finally gave WebCore a central header for
the common VM (CommonVM.h).
* CMakeLists.txt:
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::SDPProcessor::callScript):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CommonVM.cpp: Added.
(WebCore::commonVMSlow):
(WebCore::writeBarrierOpaqueRootSlow):
* bindings/js/CommonVM.h: Added.
(WebCore::commonVM):
(WebCore::writeBarrierOpaqueRoot):
* bindings/js/DOMWrapperWorld.cpp:
(WebCore::mainThreadNormalWorld):
* bindings/js/GCController.cpp:
(WebCore::collect):
(WebCore::GCController::garbageCollectSoon):
(WebCore::GCController::garbageCollectNow):
(WebCore::GCController::garbageCollectNowIfNotDoneRecently):
(WebCore::GCController::setJavaScriptGarbageCollectorTimerEnabled):
(WebCore::GCController::deleteAllCode):
(WebCore::GCController::deleteAllLinkedCode):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMBinding.cpp:
(WebCore::addImpureProperty):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
(WebCore::JSDOMWindowBase::commonVM): Deleted.
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::setWindow):
* bindings/js/JSNodeCustom.h:
(WebCore::root):
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
(WebCore::ScriptCachedFrameData::restore):
(WebCore::ScriptCachedFrameData::clear):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::~ScriptController):
(WebCore::ScriptController::createWorld):
(WebCore::ScriptController::getAllWorlds):
(WebCore::ScriptController::clearWindowShell):
(WebCore::ScriptController::cacheableBindingRootObject):
(WebCore::ScriptController::bindingRootObject):
(WebCore::ScriptController::windowScriptNPObject):
(WebCore::ScriptController::jsObjectForPluginElement):
(WebCore::ScriptController::clearScriptObjects):
* dom/CollectionIndexCache.cpp:
(WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
* dom/ContainerNode.cpp:
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted):
(WebCore::notifyChildNodeRemoved):
* dom/Document.cpp:
(WebCore::Document::shouldBypassMainWorldContentSecurityPolicy):
* dom/Node.h:
(WebCore::Node::opaqueRoot):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::vm):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::notifyFinished):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::pauseAfterDetachedTask):
(WebCore::HTMLMediaElement::ensureIsolatedWorld):
* html/HTMLPlugInImageElement.cpp:
(WebCore::plugInImageElementIsolatedWorld):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::vm):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::PageScriptDebugServer):
* page/PerformanceLogging.cpp:
(WebCore::PerformanceLogging::memoryUsageStatistics):
(WebCore::PerformanceLogging::javaScriptObjectCounts):
* page/ResourceUsageThread.cpp:
(WebCore::ResourceUsageThread::createThreadIfNeeded):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::reportApproximateMemoryCost):
* testing/MemoryInfo.h:
(WebCore::MemoryInfo::MemoryInfo):
Source/WebKit/mac:
Propagate the JSDOMWindowBase::commonVM() -> commonVM() change.
* Misc/WebCoreStatistics.mm:
(+[WebCoreStatistics javaScriptObjectsCount]):
(+[WebCoreStatistics javaScriptGlobalObjectsCount]):
(+[WebCoreStatistics javaScriptProtectedObjectsCount]):
(+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]):
(+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]):
(+[WebCoreStatistics javaScriptObjectTypeCounts]):
(+[WebCoreStatistics shouldPrintExceptions]):
(+[WebCoreStatistics setShouldPrintExceptions:]):
(+[WebCoreStatistics memoryStatistics]):
(+[WebCoreStatistics javaScriptReferencedObjectsCount]):
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(identifierFromIdentifierRep):
* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyInstance::getPropertyNames):
* Plugins/WebNetscapePluginStream.mm:
(WebNetscapePluginStream::wantsAllStreams):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView sendEvent:isDrawRect:]):
(-[WebNetscapePluginView privateBrowsingModeDidChange]):
(-[WebNetscapePluginView setWindowIfNecessary]):
(-[WebNetscapePluginView createPluginScriptableObject]):
(-[WebNetscapePluginView getFormValue:]):
(-[WebNetscapePluginView evaluateJavaScriptPluginRequest:]):
(-[WebNetscapePluginView webFrame:didFinishLoadWithReason:]):
(-[WebNetscapePluginView loadPluginRequest:]):
(-[WebNetscapePluginView _printedPluginBitmap]):
* Plugins/WebPluginController.mm:
(-[WebPluginController plugInViewWithArguments:fromPluginPackage:]):
(-[WebPluginController stopOnePlugin:]):
(-[WebPluginController stopOnePluginForPageCache:]):
(-[WebPluginController destroyOnePlugin:]):
(-[WebPluginController startAllPlugins]):
(-[WebPluginController addPlugin:]):
Source/WebKit/win:
Propagate the JSDOMWindowBase::commonVM() -> commonVM() change.
* Plugins/PluginView.cpp:
(WebCore::PluginView::start):
(WebCore::PluginView::stop):
(WebCore::PluginView::performRequest):
(WebCore::PluginView::npObject):
(WebCore::PluginView::privateBrowsingStateChanged):
* Plugins/PluginViewWin.cpp:
(WebCore::PluginView::dispatchNPEvent):
(WebCore::PluginView::handleKeyboardEvent):
(WebCore::PluginView::handleMouseEvent):
(WebCore::PluginView::setNPWindowRect):
* WebCoreStatistics.cpp:
(WebCoreStatistics::javaScriptObjectsCount):
(WebCoreStatistics::javaScriptGlobalObjectsCount):
(WebCoreStatistics::javaScriptProtectedObjectsCount):
(WebCoreStatistics::javaScriptProtectedGlobalObjectsCount):
(WebCoreStatistics::javaScriptProtectedObjectTypeCounts):
(WebCoreStatistics::javaScriptObjectTypeCounts):
(WebCoreStatistics::shouldPrintExceptions):
(WebCoreStatistics::setShouldPrintExceptions):
(WebCoreStatistics::memoryStatistics):
* WebJavaScriptCollector.cpp:
(WebJavaScriptCollector::objectCount):
Source/WebKit2:
Propagate the JSDOMWindowBase::commonVM() -> commonVM() change.
* Shared/linux/WebMemorySamplerLinux.cpp:
(WebKit::WebMemorySampler::sampleWebKit):
* Shared/mac/WebMemorySampler.mac.mm:
(WebKit::WebMemorySampler::sampleWebKit):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::javaScriptObjectsCount):
* WebProcess/Plugins/Netscape/JSNPObject.cpp:
(WebKit::JSNPObject::callMethod):
(WebKit::JSNPObject::callObject):
(WebKit::JSNPObject::callConstructor):
(WebKit::JSNPObject::put):
(WebKit::JSNPObject::deleteProperty):
(WebKit::JSNPObject::getOwnPropertyNames):
(WebKit::JSNPObject::propertyGetter):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runJavaScriptInMainFrame):
(WebKit::WebPage::getBytecodeProfile):
(WebKit::WebPage::getSamplingProfilerOutput):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWebCoreStatistics):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209683
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mitz@apple.com [Sun, 11 Dec 2016 18:10:03 +0000 (18:10 +0000)]
[Cocoa] NSAttributedString representation of text copied from -webkit-nbsp-mode:space element contains non-breaking space characters, but shouldn’t
https://bugs.webkit.org/show_bug.cgi?id=165515
<rdar://problem/4108460>
Reviewed by Darin Adler.
Source/WebCore:
Test: platform/mac/fast/text/attributed-substring-from-range.html
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_processText): Emit a space instead of a non-breaking space if the text node
is styled with -webkit-nbsp-mode:space.
(WebCore::editingAttributedStringFromRange): Replace all non-breaking spaces with spaces if
they come from a text node with -webkit-nbsp-mode:space.
LayoutTests:
* platform/mac/fast/text/attributed-substring-from-range-expected.txt: Updated.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209682
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
annulen@yandex.ru [Sun, 11 Dec 2016 12:48:46 +0000 (12:48 +0000)]
Unreviewed build fix for EFL after r209665
* UIProcess/efl/TextCheckerClientEfl.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209681
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
annulen@yandex.ru [Sun, 11 Dec 2016 11:11:57 +0000 (11:11 +0000)]
Unreviewed, add KHR include dir to fix ANGLE build after r209665
https://bugs.webkit.org/show_bug.cgi?id=165686
* CMakeLists.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209680
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
hyatt@apple.com [Sun, 11 Dec 2016 05:14:54 +0000 (05:14 +0000)]
Rolling out 165737, since it broke layout tests. I need to find a
different place to put the init.
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::isValidSelector):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209679
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Sun, 11 Dec 2016 01:14:37 +0000 (01:14 +0000)]
Unreviewed, rolling out r209653, r209654, r209663, and
r209673.
https://bugs.webkit.org/show_bug.cgi?id=165739
speedometer crashes (Requested by pizlo on #webkit).
Reverted changesets:
"JSVALUE64: Pass arguments in platform argument registers when
making JavaScript calls"
https://bugs.webkit.org/show_bug.cgi?id=160355
http://trac.webkit.org/changeset/209653
"Unreviewed build fix for 32 bit builds."
http://trac.webkit.org/changeset/209654
"Unreviewed build fix for the CLOOP after r209653"
http://trac.webkit.org/changeset/209663
"REGRESSION(r209653) Crash in CallFrameShuffler::snapshot()"
https://bugs.webkit.org/show_bug.cgi?id=165728
http://trac.webkit.org/changeset/209673
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209678
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
simon.fraser@apple.com [Sun, 11 Dec 2016 00:04:30 +0000 (00:04 +0000)]
Support the deprecated dictionary constructor for DOMPointReadOnly and DOMPoint
https://bugs.webkit.org/show_bug.cgi?id=165732
Reviewed by Sam Weinig.
Source/WebCore:
For compatibility with other browsers, support the DOMPointInit constructor to
DOMPoint and DOMPointReadOnly per <https://www.w3.org/TR/geometry-1/#DOMPoint>
Extended geometry/DOMPoint-001.html to test.
* dom/DOMPoint.h:
* dom/DOMPoint.idl:
* dom/DOMPointReadOnly.h:
(WebCore::DOMPointReadOnly::create):
* dom/DOMPointReadOnly.idl:
LayoutTests:
* geometry/DOMPoint-001-expected.txt:
* geometry/DOMPoint-001.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209677
268f45cc-cd09-0410-ab3c-
d52691b4dbfc