WebKit-https.git
4 years agoAdd content animation tests to benchmark_runner, and allow the runner to collect...
simon.fraser@apple.com [Thu, 21 Apr 2016 05:01:42 +0000 (05:01 +0000)]
Add content animation tests to benchmark_runner, and allow the runner to collect device data as part of the results
https://bugs.webkit.org/show_bug.cgi?id=156827

Add two files missing from the previous commit.

* Animation/css-animation.html: Added.
* Animation/raf-animation.html: Added.

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

4 years agoAdd content animation tests to benchmark_runner, and allow the runner to collect...
simon.fraser@apple.com [Thu, 21 Apr 2016 04:56:57 +0000 (04:56 +0000)]
Add content animation tests to benchmark_runner, and allow the runner to collect device data as part of the results
https://bugs.webkit.org/show_bug.cgi?id=156827
PerformanceTests:

Reviewed by Stephanie Lewis.

Two new files for the content-animation suite.

After patching for use in the benchmark, these tests are a little different to other benchmarks.
The test content itself does not collect performance data; the tests spit out a boilerplate JSON
result with a placeholder for framerate, which is collected in native code.

When run as a benchmark, test completion involves a couple of bounces between the test and MobileSafari.
Test completion is initiated by a setTimeout() in the test, at which point location.hash is set to "#done".
MobileSafari detects that, and asynchronously dumps performance data. Once this is complete, MobileSafari
changes the URL has to "#submit", which triggers the XHR to the test relay that indicates the test is
complete.

* Animation/css-animation.html: Added.
* Animation/raf-animation.html: Added.

Tools:

rdar://problem/24358135

Reviewed by Stephanie Lewis.

Enhance benchmark_runner so that a benchmark can load a set of tests sequentially,
and collate results across them. Also add the ability for the browser_driver to supply
additional results, allowing for tests that collect results data in native code, rather
than generating it in the web page.

Add a set of "content animation" tests that use this new functionality, which test
CSS animation and requestAnimationFrame performance.

'plan' files have two new optional keys:
    'test_files': a list of files to run as a suite
    'options': optional parameters. Currently supports one new option,
        'animation_command', which affects the way that iOS tests are run,
        and is passed to MobileSafari as a parameter on launch.

* Scripts/webkitpy/benchmark_runner/benchmark_runner.py:
(BenchmarkRunner.__init__): If options is not specified in the plan file, set it to an empty dictionary.
(BenchmarkRunner._get_result): Allow the browser_driver to modify the test results.
(BenchmarkRunner):
(BenchmarkRunner._run_one_test): Factored out of _run_benchmark, this contains logic for
running a single test. It starts and stops the http_server_driver.
(BenchmarkRunner._run_benchmark): Run a test in the traditional way if the plan has an 'entry_point'
key, otherwise look for the new 'test_files' and load each in a loop.
(BenchmarkRunner._dump):
* Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver.py:
(BrowserDriver.launch_url): Pass options.
(BrowserDriver.add_additional_results): Allow a driver to supply additional results.
(BrowserDriver):
* Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py:
(GTKMiniBrowserDriver.launch_url):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_browser_driver.py:
(OSXBrowserDriver.close_browsers):
(OSXBrowserDriver._terminate_processes): Fix spelling mistake.
(OSXBrowserDriver._terminiate_processes): Deleted.
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_chrome_driver.py:
(OSXChromeDriver.launch_url):
(OSXChromeCanaryDriver.launch_url):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_firefox_driver.py:
(OSXFirefoxDriver.launch_url):
(OSXFirefoxNightlyDriver.launch_url):
* Scripts/webkitpy/benchmark_runner/browser_driver/osx_safari_driver.py:
(OSXSafariDriver.launch_url):
* Scripts/webkitpy/benchmark_runner/data/patches/ContentAnimation.patch: Added.
* Scripts/webkitpy/benchmark_runner/data/plans/content-animation.plan: Added.

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

4 years agoModern IDB (Workers): Remove IDBRequest/IDBOpenDBRequest's requirement to get an...
beidson@apple.com [Thu, 21 Apr 2016 04:42:17 +0000 (04:42 +0000)]
Modern IDB (Workers): Remove IDBRequest/IDBOpenDBRequest's requirement to get an IDBServerConnection around.
https://bugs.webkit.org/show_bug.cgi?id=156826

Reviewed by Alex Christensen.

No new tests (No behavior change, existing tests pass).

This doesn't appear to do much but make things a little more complicated, but it's the first of a few
small pushes in the right direction.

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest):
(WebCore::IDBOpenDBRequest::maybeCreateOpenRequest):
(WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
(WebCore::IDBOpenDBRequest::onSuccess):
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):
(WebCore::IDBOpenDBRequest::requestCompleted):
(WebCore::IDBOpenDBRequest::createDeleteRequest): Deleted.
(WebCore::IDBOpenDBRequest::createOpenRequest): Deleted.
* Modules/indexeddb/IDBOpenDBRequest.h:

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::connectionToServer):
* Modules/indexeddb/IDBRequest.h:
(WebCore::IDBRequest::connection): Deleted.

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
(WebCore::IDBClient::IDBConnectionProxy::connectionToServer):
(WebCore::IDBClient::IDBConnectionProxy::openDatabase):
(WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
* Modules/indexeddb/client/IDBConnectionProxy.h:
(WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier):

* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
* Modules/indexeddb/shared/IDBResourceIdentifier.h:

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

4 years agoJavaScriptCore garbage collection is missing an autorelease pool
ggaren@apple.com [Thu, 21 Apr 2016 04:40:18 +0000 (04:40 +0000)]
JavaScriptCore garbage collection is missing an autorelease pool
https://bugs.webkit.org/show_bug.cgi?id=156751
<rdar://problem/25787802>

Reviewed by Mark Lam.

* heap/Heap.cpp:
(JSC::Heap::releaseDelayedReleasedObjects): Add an autorelease pool to
catch autoreleases when we call out to arbitrary ObjC code.

We use the C interface here because this is not an ObjC compilation unit.

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

4 years agoAdd Subresource Integrity as "Under consideration".
commit-queue@webkit.org [Thu, 21 Apr 2016 04:25:02 +0000 (04:25 +0000)]
Add Subresource Integrity as "Under consideration".
https://bugs.webkit.org/show_bug.cgi?id=156800

Patch by John Wilander <wilander@apple.com> on 2016-04-20
Reviewed by Alexey Proskuryakov.

No new tests needed.

* features.json:
    Added an entry for Subresource Integrity.

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

4 years agoDFG del_by_id support forgets to set()
fpizlo@apple.com [Thu, 21 Apr 2016 02:35:29 +0000 (02:35 +0000)]
DFG del_by_id support forgets to set()
https://bugs.webkit.org/show_bug.cgi?id=156830

Reviewed by Saam Barati.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* tests/stress/dfg-del-by-id.js: Added.

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

4 years agoImprove sampling profiler CLI JSC tool
sbarati@apple.com [Thu, 21 Apr 2016 00:55:03 +0000 (00:55 +0000)]
Improve sampling profiler CLI JSC tool
https://bugs.webkit.org/show_bug.cgi?id=156824

Reviewed by Mark Lam.

This patch enhances the Sampling Profiler CLI tool from the JSC shell
to display the JITType of a particular CodeBlock. Because this happens
once we process a log of stack frames, the data for a particular frame
being in LLInt vs. Baseline could be wrong. For example, we may have taken
a stack trace of a CodeBlock while it was executing in the LLInt, then
it tiers up to the baseline, then we process the log. We will show such CodeBlocks
as being in the baseline JIT. We could be smarter about this in the future if
it turns out to truly be a problem.

This patch also adds a 'samplingProfilerTimingInterval' JSC option to allow
CLI users to control the sleep time between stack traces.

* jsc.cpp:
(jscmain):
* runtime/Options.h:
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::SamplingProfiler):
(JSC::SamplingProfiler::processUnverifiedStackTraces):
(JSC::SamplingProfiler::reportTopBytecodes):
* runtime/SamplingProfiler.h:
(JSC::SamplingProfiler::StackFrame::hasExpressionInfo):

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

4 years agoAdding ios-simulator-wk1 specific baselines for compositing and css3 LayoutTests...
ryanhaddad@apple.com [Thu, 21 Apr 2016 00:35:18 +0000 (00:35 +0000)]
Adding ios-simulator-wk1 specific baselines for compositing and css3 LayoutTests due to contentsOpaque difference

Unreviewed test gardening.

* Truncating changelog due to large number of added files

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

4 years agoGet rid of a couple of uses of ApplicationCacheStorage::singleton()
andersca@apple.com [Wed, 20 Apr 2016 23:49:20 +0000 (23:49 +0000)]
Get rid of a couple of uses of ApplicationCacheStorage::singleton()
https://bugs.webkit.org/show_bug.cgi?id=156818

Reviewed by Geoffrey Garen.

* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::addResource):
* loader/appcache/ApplicationCacheGroup.h:
(WebCore::ApplicationCacheGroup::storage):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setApplicationCacheOriginQuota):

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

4 years agoModern IDB (Workers): Introduce "IDBConnectionProxy" for future threading abstraction...
beidson@apple.com [Wed, 20 Apr 2016 23:43:34 +0000 (23:43 +0000)]
Modern IDB (Workers): Introduce "IDBConnectionProxy" for future threading abstraction, and adopt it in IDBFactory.
https://bugs.webkit.org/show_bug.cgi?id=156810

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by changes to existing tests).

Add the IDBConnectionProxy object, including the ability to replicate IDBFactory functionality:
* Modules/indexeddb/client/IDBConnectionProxy.cpp: Added.
(WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
(WebCore::IDBClient::IDBConnectionProxy::openDatabase):
(WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
* Modules/indexeddb/client/IDBConnectionProxy.h:

Add pure virtual IDBConnectionProxy accessor:
* dom/ScriptExecutionContext.h:

Implement it:
* dom/Document.cpp:
(WebCore::Document::idbConnectionProxy):
* dom/Document.h:

Implement it:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::idbConnectionProxy):
* workers/WorkerGlobalScope.h:

* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::indexedDB):

Don't keep a reference to IDBConnectionToServer, but rather get at the context's IDBConnectionProxy:
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::create):
(WebCore::IDBFactory::IDBFactory):
(WebCore::IDBFactory::open):
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/IDBFactory.h:
* Modules/indexeddb/IDBFactory.idl:

* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
(WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):

* Modules/indexeddb/client/IDBConnectionToServer.h:

* inspector/InspectorIndexedDBAgent.cpp:

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* storage/indexeddb/intversion-bad-parameters-expected.txt:
* storage/indexeddb/intversion-bad-parameters-private-expected.txt:
* storage/indexeddb/modern/opendatabase-request-event-expected.txt:
* storage/indexeddb/modern/opendatabase-request-event-private-expected.txt:
* storage/indexeddb/modern/opendatabase-request-expected.txt:
* storage/indexeddb/modern/opendatabase-request-private-expected.txt:
* storage/indexeddb/modern/workers-enable-expected.txt:
* storage/indexeddb/version-change-event-basic-expected.txt:
* storage/indexeddb/version-change-event-basic-private-expected.txt:

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

4 years ago[JSC] DFG should not generate two jumps when the target of DoubleBranch is the next...
commit-queue@webkit.org [Wed, 20 Apr 2016 23:28:29 +0000 (23:28 +0000)]
[JSC] DFG should not generate two jumps when the target of DoubleBranch is the next block
https://bugs.webkit.org/show_bug.cgi?id=156815

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-04-20
Reviewed by Mark Lam.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compilePeepHoleDoubleBranch):

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

4 years ago[GTK] Expose AllowUniversalAccessFromFileURLs preference now that calling localStorag...
commit-queue@webkit.org [Wed, 20 Apr 2016 22:56:40 +0000 (22:56 +0000)]
[GTK] Expose AllowUniversalAccessFromFileURLs preference now that calling localStorage.getItem() results in SecurityError: DOM Exception 18
Source/WebKit2:

Patch by Dustin Falgout <dustin@falgout.us> on 2016-04-20
Reviewed by Michael Catanzaro.

As of r197858 JavaScript loaded in the context of a file scheme url cannot access local storage. That is a major
breaking change as many applications that serve files locally rely on having access to local storage. The point
of that security fix is to avoid cases of downloaded HTML content (such as e-mail attachments or JS injected
into local contexts) from having access to your local file system and arbitrary local storage. If you are serving
local files in your applications, you can use the WebKitAllowUniversalAccessFromFileURLs preference key to tell
Webkit that you are approve of these kinds of interactions.

https://bugs.webkit.org/show_bug.cgi?id=156651

* UIProcess/API/gtk/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_allow_universal_access_from_file_urls):
(webkit_settings_set_allow_universal_access_from_file_urls):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:

Tools:

https://bugs.webkit.org/show_bug.cgi?id=156651

Patch by Dustin Falgout <dustin@falgout.us> on 2016-04-20
Reviewed by Michael Catanzaro.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp:
(testWebKitSettings):

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

4 years agoMarking compositing/webgl/webgl-reflection.html as failing on ios-simulator
ryanhaddad@apple.com [Wed, 20 Apr 2016 22:51:41 +0000 (22:51 +0000)]
Marking compositing/webgl/webgl-reflection.html as failing on ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=156812

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years agoWeb Inspector: console.table(navigator) throws exception about `rowPreview.propertyPr...
commit-queue@webkit.org [Wed, 20 Apr 2016 22:45:04 +0000 (22:45 +0000)]
Web Inspector: console.table(navigator) throws exception about `rowPreview.propertyPreviews.length`
https://bugs.webkit.org/show_bug.cgi?id=156698
<rdar://problem/25778244>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-20
Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._formatParameterAsTable):
Handle a row with a value preview but no sub-property previews (a function).

LayoutTests:

* inspector/console/console-table-expected.txt:
* inspector/console/console-table.html:

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

4 years ago[JSC] Add register reuse for ArithAdd of an Int32 and constant in DFG
commit-queue@webkit.org [Wed, 20 Apr 2016 22:24:32 +0000 (22:24 +0000)]
[JSC] Add register reuse for ArithAdd of an Int32 and constant in DFG
https://bugs.webkit.org/show_bug.cgi?id=155164

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-04-20
Reviewed by Mark Lam.

Every "inc" in loop was looking like this:
    move rX, rY
    inc rY
    jo 0x230f4a200580

This patch add register Reuse to that case to remove
the extra "move".

* dfg/DFGOSRExit.h:
(JSC::DFG::SpeculationRecovery::SpeculationRecovery):
(JSC::DFG::SpeculationRecovery::immediate):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithAdd):
* tests/stress/arith-add-with-constant-overflow.js: Added.
(opaqueAdd):

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

4 years agoRemove flaky expectation for imported/mozilla/svg/image/image-filter-01.svg on ios...
ryanhaddad@apple.com [Wed, 20 Apr 2016 22:03:09 +0000 (22:03 +0000)]
Remove flaky expectation for imported/mozilla/svg/image/image-filter-01.svg on ios-simulator-wk2

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoWeb Inspector: Use debounce proxies in a couple more places
timothy@apple.com [Wed, 20 Apr 2016 21:58:46 +0000 (21:58 +0000)]
Web Inspector: Use debounce proxies in a couple more places

https://bugs.webkit.org/show_bug.cgi?id=156759

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser.prototype._dispatchCurrentRepresentedObjectsDidChangeEvent):
(WebInspector.ContentBrowser.prototype._contentViewSelectionPathComponentDidChange):
(WebInspector.ContentBrowser.prototype._contentViewSupplementalRepresentedObjectsDidChange):
(WebInspector.ContentBrowser.prototype._dispatchCurrentRepresentedObjectsDidChangeEventSoon): Deleted.
* UserInterface/Views/DOMTreeUpdater.js:
(WebInspector.DOMTreeUpdater.prototype._attributesUpdated):
(WebInspector.DOMTreeUpdater.prototype._characterDataModified):
(WebInspector.DOMTreeUpdater.prototype._nodeInserted):
(WebInspector.DOMTreeUpdater.prototype._nodeRemoved):
(WebInspector.DOMTreeUpdater.prototype._updateModifiedNodes):
(WebInspector.DOMTreeUpdater.prototype._updateModifiedNodesSoon): Deleted.
* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
(WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
(WebInspector.NavigationSidebarPanel.prototype._treeElementDisclosureDidChange):
(WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibilitySoon): Deleted.

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

4 years agoWeb Inspector: Make debounce use an ES6 Proxy
timothy@apple.com [Wed, 20 Apr 2016 21:58:44 +0000 (21:58 +0000)]
Web Inspector: Make debounce use an ES6 Proxy

https://bugs.webkit.org/show_bug.cgi?id=156756
rdar://problem/25809771

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Base/Utilities.js:
(Object.prototype.soon): Added.
(Object.prototype.debounce): Added.
(Function.prototype.debounce): Deleted.
(Function.prototype.cancelDebounce): Added.

* UserInterface/Views/BezierEditor.js:
(WebInspector.BezierEditor.createBezierInput): Use new debounce proxy.
* UserInterface/Views/VisualStyleBackgroundPicker.js:
(WebInspector.VisualStyleBackgroundPicker): Ditto.
* UserInterface/Views/VisualStyleURLInput.js:
(WebInspector.VisualStyleURLInput): Ditto.

LayoutTests:

* inspector/unit-tests/debounce-expected.txt: Added.
* inspector/unit-tests/debounce.html: Added.

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

4 years agoRebaseline tests for iOS simulator.
ryanhaddad@apple.com [Wed, 20 Apr 2016 21:54:09 +0000 (21:54 +0000)]
Rebaseline tests for iOS simulator.

Unreviewed test gardening.

* platform/ios-simulator-wk2/css2.1/t0905-c5525-flthw-00-c-g-expected.txt:
* platform/ios-simulator-wk2/css2.1/t0905-c5526-flthw-00-c-g-expected.txt:
* platform/ios-simulator/fast/canvas/set-colors-expected.txt: Added.
* platform/ios-simulator/fast/text/emoji-expected.txt:

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

4 years agoWe don't need a manual stack for an RAII object when the machine's stack will do...
sbarati@apple.com [Wed, 20 Apr 2016 21:47:39 +0000 (21:47 +0000)]
We don't need a manual stack for an RAII object when the machine's stack will do just fine
https://bugs.webkit.org/show_bug.cgi?id=156807

Reviewed by Mark Lam.

We kept around a vector for an RAII object to maintain
the recursive nature of having these RAII objects on
the stack as the parser recursed. Instead, the RAII object
can just have a field with the value it wants to restore
and use the machine's stack.

This is a 1% octane code-load progression.

* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::BinaryExprContext::BinaryExprContext):
(JSC::SyntaxChecker::BinaryExprContext::~BinaryExprContext):
(JSC::SyntaxChecker::UnaryExprContext::UnaryExprContext):
(JSC::SyntaxChecker::UnaryExprContext::~UnaryExprContext):
(JSC::SyntaxChecker::operatorStackPop):

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

4 years agoSpeculative unflake of dynamic_remove_preload_href layout test
yoav@yoav.ws [Wed, 20 Apr 2016 21:25:11 +0000 (21:25 +0000)]
Speculative unflake of dynamic_remove_preload_href layout test
https://bugs.webkit.org/show_bug.cgi?id=156773

Reviewed by Alexey Proskuryakov.

* http/tests/preload/dynamic_remove_preload_href.html: Avoid using a blocking script based timeout.

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

4 years agoUse Optional<size_t> for OrderIterator::m_orderIndex instead of int
cdumez@apple.com [Wed, 20 Apr 2016 21:07:37 +0000 (21:07 +0000)]
Use Optional<size_t> for OrderIterator::m_orderIndex instead of int
https://bugs.webkit.org/show_bug.cgi?id=156796

Reviewed by Anders Carlsson.

Use Optional<size_t> for OrderIterator::m_orderIndex instead of int
(with invalid value of -1). m_orderIndex a vector index and therefore
is in the range of an unsigned (type used internally by Vector, even
though the index is exposed as size_t). Therefore, assigning it to an
int is unsafe as it may overflow.

This may fix <rdar://problem/23410338> which is a top crasher.

* rendering/OrderIterator.cpp:
(WebCore::OrderIterator::next):
(WebCore::OrderIterator::reset):
* rendering/OrderIterator.h:

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

4 years agoCrash under needsAppleMailPaginationQuirk()
cdumez@apple.com [Wed, 20 Apr 2016 21:07:02 +0000 (21:07 +0000)]
Crash under needsAppleMailPaginationQuirk()
https://bugs.webkit.org/show_bug.cgi?id=156806
<rdar://problem/23323479>

Reviewed by Simon Fraser.

Add check for element()->hasID() before calling element()->idForStyleResolution()
so that we don't dereference a potentially null element()->elementData().
Also stop repeatedly atomizing "messageContentContainer" and leverage
the operator==(const AtomicString&, const char*) instead for performance.

* rendering/RenderBlockFlow.cpp:
(WebCore::needsAppleMailPaginationQuirk):

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

4 years agoREGRESSION(r190289): Spin trying to view/sign in to hbogo.com
msaboff@apple.com [Wed, 20 Apr 2016 20:31:21 +0000 (20:31 +0000)]
REGRESSION(r190289): Spin trying to view/sign in to hbogo.com
https://bugs.webkit.org/show_bug.cgi?id=156765

Reviewed by Saam Barati.

In the op_get_by_val case, we were holding the lock on a profiled CodeBlock
when we call into handleGetById(). Changed to drop the lock before calling
handleGetById().

The bug here was that the call to handleGetById() may end up calling in to
getPredictionWithoutOSRExit() for a tail call opcode. As part of that
processing, we walk back up the stack to find the effective caller and when
found, we lock the corresponding CodeBlock to get the predicition.
That CodeBLock may be the same one locked above. There is no need anyway
to hold the CodeBlock lock when calling handleGetById().

Added a new stress test.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* tests/stress/regress-156765.js: Added.
(realValue):
(object.get hello):
(ok):

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

4 years agoAttempt to fix non-INDEXED_DATABASE_IN_WORKERS builds after r199779
beidson@apple.com [Wed, 20 Apr 2016 20:21:21 +0000 (20:21 +0000)]
Attempt to fix non-INDEXED_DATABASE_IN_WORKERS builds after r199779

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setIndexedDBWorkersEnabled):
* testing/InternalSettings.h:

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

4 years agoPotential overflow in RenderLayer::hitTestList()
cdumez@apple.com [Wed, 20 Apr 2016 19:57:10 +0000 (19:57 +0000)]
Potential overflow in RenderLayer::hitTestList()
https://bugs.webkit.org/show_bug.cgi?id=156804

Reviewed by Simon Fraser.

Use size_t type instead of int to iterate over the Vector to make sure
we don't overflow. This is a speculative fix for <rdar://problem/23249479>.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTestList):

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

4 years agoUnindent an unnecessary block in stringProtoFuncSplitFast().
mark.lam@apple.com [Wed, 20 Apr 2016 19:10:43 +0000 (19:10 +0000)]
Unindent an unnecessary block in stringProtoFuncSplitFast().
https://bugs.webkit.org/show_bug.cgi?id=156802

Reviewed by Filip Pizlo.

In webkit.org/b/156013, I refactored stringProtoFuncSplit into
stringProtoFuncSplitFast.  In that patch, I left an unnecessary block of code in
its original block (with FIXMEs) to keep the diff for that patch minimal.  Now
that the patch for webkit.org/b/156013 has landed, I will unindent that block and
remove the FIXMEs.

* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncSplitFast):

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

4 years agoModern IDB (Workers): Enable INDEXED_DATABASE_IN_WORKERS compile time flag, but disab...
beidson@apple.com [Wed, 20 Apr 2016 18:59:45 +0000 (18:59 +0000)]
Modern IDB (Workers): Enable INDEXED_DATABASE_IN_WORKERS compile time flag, but disabled in RuntimeEnabledFeatures.
https://bugs.webkit.org/show_bug.cgi?id=156782

Reviewed by Alex Christensen.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Test: storage/indexeddb/modern/workers-disabled.html
      storage/indexeddb/modern/workers-enable.html

* Configurations/FeatureDefines.xcconfig:

ScriptExecutionContext shouldn't really be supplementable:
* dom/ScriptExecutionContext.h:

WorkerGlobalScope should be supplementable.
Also modernize this archaic header (pragma once, and re-indent):
* workers/WorkerGlobalScope.h:

Update for WorkerGlobalScope now being directly supplementable:
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
(WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
(WebCore::WorkerGlobalScopeIndexedDatabase::from):
(WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl:
* Modules/notifications/WorkerGlobalScopeNotifications.cpp:
(WebCore::WorkerGlobalScopeNotifications::WorkerGlobalScopeNotifications):
(WebCore::WorkerGlobalScopeNotifications::from):
(WebCore::WorkerGlobalScopeNotifications::webkitNotifications):
* Modules/notifications/WorkerGlobalScopeNotifications.h:

Expose IndexedDBWorkers to RuntimeEnabledFeatures:
* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setIndexedDBWorkersEnabled):
(WebCore::RuntimeEnabledFeatures::indexedDBWorkersEnabled):

Expose IndexedDBWorkers to InternalSettings:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setIndexedDBWorkersEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

Note: One test has some "FAIL" lines in the expected results, which is intentional.
As work on this progresses, those FAILs will become PASSes and the expectations will be updated.

* storage/indexeddb/modern/resources/workers-disabled.js: Added.
* storage/indexeddb/modern/resources/workers-enable.js: Added.
* storage/indexeddb/modern/workers-disabled-expected.txt: Added.
* storage/indexeddb/modern/workers-disabled.html: Added.
* storage/indexeddb/modern/workers-enable-expected.txt: Added.
* storage/indexeddb/modern/workers-enable.html: Added.

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

4 years ago[WK2][Mac][iOS] WebContent crash when using special file:// URI scheme @ WebKit:...
bfulgham@apple.com [Wed, 20 Apr 2016 18:26:20 +0000 (18:26 +0000)]
[WK2][Mac][iOS] WebContent crash when using special file:// URI scheme @ WebKit::resolveSymlinksInPath(WTF::CString const&) + 159
https://bugs.webkit.org/show_bug.cgi?id=156747
<rdar://problem/24648176>

Reviewed by Alexey Proskuryakov.

Source/WebKit2:

FileSystemCF::fileSystemRepresentation return a null string when presented with a file URL that contains embedded nulls. When
this happens, SandboxExtension::createHandle attempts to pass a null string to 'resolveSymlinksInPath', which attemps to call
'strrchr' on the null pointer, causing a crash.

Test: fast/url/file-uri-with-embedded-null-no-crash.html

* Shared/mac/SandboxExtensionMac.mm:
(WebKit::SandboxExtension::createHandle): If 'fileSystemRepresentation' is null, return early with an error.

LayoutTests:

* fast/url/file-uri-with-embedded-null-no-crash-expected.txt: Added.
* fast/url/file-uri-with-embedded-null-no-crash.html: Added.

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

4 years agoHangable punctuation measurement using the wrong indices.
hyatt@apple.com [Wed, 20 Apr 2016 18:01:40 +0000 (18:01 +0000)]
Hangable punctuation measurement using the wrong indices.
https://bugs.webkit.org/show_bug.cgi?id=155899

Reviewed by Simon Fraser.

Source/WebCore:

New tests in fast/text.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
* rendering/RenderText.cpp:
(WebCore::RenderText::hangablePunctuationStartWidth):
(WebCore::RenderText::hangablePunctuationEndWidth):
(WebCore::RenderText::isHangableStopOrComma):

LayoutTests:

* fast/text/hanging-punctuation-variable-font-size-expected.html: Added.
* fast/text/hanging-punctuation-variable-font-size.html: Added.

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

4 years agoDrop [UsePointersEvenForNonNullableObjectArguments] from several Canvas interfaces
cdumez@apple.com [Wed, 20 Apr 2016 17:40:02 +0000 (17:40 +0000)]
Drop [UsePointersEvenForNonNullableObjectArguments] from several Canvas interfaces
https://bugs.webkit.org/show_bug.cgi?id=156781

Reviewed by Darin Adler.

Source/WebCore:

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::fill):
(WebCore::CanvasRenderingContext2D::stroke):
(WebCore::CanvasRenderingContext2D::clip):
(WebCore::CanvasRenderingContext2D::isPointInPath):
(WebCore::CanvasRenderingContext2D::isPointInStroke):
(WebCore::size):
(WebCore::CanvasRenderingContext2D::drawImage):
(WebCore::CanvasRenderingContext2D::drawImageFromRect):
(WebCore::CanvasRenderingContext2D::drawFocusIfNeeded):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.idl:
* html/canvas/DOMPath.h:
* html/canvas/DOMPath.idl:
* html/canvas/WebGLDebugShaders.cpp:
(WebCore::WebGLDebugShaders::getTranslatedShaderSource):
* html/canvas/WebGLDebugShaders.h:
* html/canvas/WebGLDebugShaders.idl:

LayoutTests:

Update outdated test which expected a legacy TYPE_MISMATCH_ERR exception
to be thrown when passing null instead of the newer TypeError.

* canvas/philip/tests/2d.drawImage.null.html:

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

4 years agoDrop [UsePointersEvenForNonNullableObjectArguments] from WebAudio
cdumez@apple.com [Wed, 20 Apr 2016 17:27:37 +0000 (17:27 +0000)]
Drop [UsePointersEvenForNonNullableObjectArguments] from WebAudio
https://bugs.webkit.org/show_bug.cgi?id=156777

Reviewed by Darin Adler.

Source/WebCore:

Drop [UsePointersEvenForNonNullableObjectArguments] from WebAudio and
modernize the interface a bit.

There is no major Web-exposed behavioral change except for
the exception type thrown when passing null (now always TypeError).
Tests were updated to add coverage for this.

* Modules/webaudio/AsyncAudioDecoder.cpp:
(WebCore::AsyncAudioDecoder::decodeAsync):
(WebCore::AsyncAudioDecoder::DecodingTask::DecodingTask):
(WebCore::AsyncAudioDecoder::DecodingTask::decode): Deleted.
* Modules/webaudio/AsyncAudioDecoder.h:
(WebCore::AsyncAudioDecoder::DecodingTask::audioData):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::lazyInitialize):
(WebCore::AudioContext::createBuffer):
(WebCore::AudioContext::decodeAudioData):
(WebCore::AudioContext::createBufferSource):
(WebCore::AudioContext::createMediaElementSource):
(WebCore::AudioContext::createMediaStreamSource):
(WebCore::AudioContext::createMediaStreamDestination):
(WebCore::AudioContext::createScriptProcessor):
(WebCore::AudioContext::createBiquadFilter):
(WebCore::AudioContext::createWaveShaper):
(WebCore::AudioContext::createPanner):
(WebCore::AudioContext::createConvolver):
(WebCore::AudioContext::createDynamicsCompressor):
(WebCore::AudioContext::createAnalyser):
(WebCore::AudioContext::createGain):
(WebCore::AudioContext::createDelay):
(WebCore::AudioContext::createChannelSplitter):
(WebCore::AudioContext::createChannelMerger):
(WebCore::AudioContext::createOscillator):
(WebCore::AudioContext::createPeriodicWave):
(WebCore::AudioContext::derefFinishedSourceNodes):
(WebCore::AudioContext::refNode):
(WebCore::AudioContext::derefNode):
(WebCore::AudioContext::notifyNodeFinishedProcessing): Deleted.
(WebCore::AudioContext::derefUnfinishedSourceNodes): Deleted.
(WebCore::AudioContext::lock): Deleted.
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/AudioContext.idl:
* Modules/webaudio/MediaElementAudioSourceNode.cpp:
(WebCore::MediaElementAudioSourceNode::create):
(WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
(WebCore::MediaElementAudioSourceNode::process):
* Modules/webaudio/MediaElementAudioSourceNode.h:
(WebCore::MediaElementAudioSourceNode::mediaElement):
* Modules/webaudio/OscillatorNode.idl:

LayoutTests:

Added test coverage for the type of the exception being thrown when
pasing null to various WebAudio API.

* webaudio/audiobuffer-expected.txt:
* webaudio/audiobuffer.html:
* webaudio/createMediaStreamSource-null-expected.txt: Added.
* webaudio/createMediaStreamSource-null.html: Added.
* webaudio/decode-audio-data-basic-expected.txt:
* webaudio/decode-audio-data-basic.html:
* webaudio/mediaelementaudiosourcenode-expected.txt:
* webaudio/mediaelementaudiosourcenode.html:

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

4 years agoAddressing additional review feedback for:
beidson@apple.com [Wed, 20 Apr 2016 16:14:14 +0000 (16:14 +0000)]
Addressing additional review feedback for:
Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
https://bugs.webkit.org/show_bug.cgi?id=156760

Source/WebCore:

* Modules/indexeddb/IDBVersionChangeEvent.h:

LayoutTests:

* storage/indexeddb/modern/idbversionchangeevent-constructor-expected.txt:
* storage/indexeddb/modern/idbversionchangeevent-constructor.html:

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

4 years agoUse OpenType MATH fonts by default
fred.wang@free.fr [Wed, 20 Apr 2016 15:43:51 +0000 (15:43 +0000)]
Use OpenType MATH fonts by default
https://bugs.webkit.org/show_bug.cgi?id=133603

Patch by Frederic Wang <fwang@igalia.com> on 2016-04-20
Reviewed by Alejandro G. Castro.

No new tests. This is already tested by pixel tests like roots.xhtml.
However, new math fonts are not used during test execution.

* css/mathml.css:
(math): We use only a list of known OpenType fonts with a MATH table but keep some pre-installed fallback fonts for OS X and iOS.

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

4 years ago[GTK] Move GTK+-independent platform code to platform/glib
csaavedra@igalia.com [Wed, 20 Apr 2016 15:03:05 +0000 (15:03 +0000)]
[GTK] Move GTK+-independent platform code to platform/glib
https://bugs.webkit.org/show_bug.cgi?id=156787

Reviewed by Carlos Garcia Campos.

There is plenty of code in platform/gtk that is independent from the GTK+ library.
Move those files to platform/glib so that they can be reused by other GLib-based ports.

Also clean some style warnings in those files.

* PlatformGTK.cmake: Move the files.
* platform/glib/EventLoopGlib.cpp: Renamed from Source/WebCore/platform/gtk/EventLoopGtk.cpp.
(WebCore::EventLoop::cycle):
* platform/glib/FileSystemGlib.cpp: Renamed from Source/WebCore/platform/gtk/FileSystemGtk.cpp.
(WebCore::filenameToString):
(WebCore::unescapedFilename):
(WebCore::fileSystemRepresentation):
(WebCore::filenameForDisplay):
(WebCore::fileExists):
(WebCore::deleteFile):
(WebCore::deleteEmptyDirectory):
(WebCore::getFileStat):
(WebCore::getFileSize):
(WebCore::getFileCreationTime):
(WebCore::getFileModificationTime):
(WebCore::getFileMetadata):
(WebCore::pathByAppendingComponent):
(WebCore::makeAllDirectories):
(WebCore::homeDirectoryPath):
(WebCore::pathGetFileName):
(WebCore::applicationDirectoryPath):
(WebCore::sharedResourcesPath):
(WebCore::getVolumeFreeSizeForPath):
(WebCore::directoryName):
(WebCore::listDirectory):
(WebCore::openTemporaryFile):
(WebCore::openFile):
(WebCore::closeFile):
(WebCore::seekFile):
(WebCore::writeToFile):
(WebCore::readFromFile):
(WebCore::unloadModule):
(WebCore::hardLinkOrCopyFile):
* platform/glib/GamepadsGlib.cpp: Renamed from Source/WebCore/platform/gtk/GamepadsGtk.cpp.
(WebCore::GamepadDeviceGlib::GamepadDeviceGlib):
(WebCore::GamepadDeviceGlib::~GamepadDeviceGlib):
(WebCore::GamepadDeviceGlib::readCallback):
(WebCore::GamepadsGlib::GamepadsGlib):
(WebCore::GamepadsGlib::~GamepadsGlib):
(WebCore::GamepadsGlib::registerDevice):
(WebCore::GamepadsGlib::unregisterDevice):
(WebCore::GamepadsGlib::updateGamepadList):
(WebCore::GamepadsGlib::onUEventCallback):
(WebCore::GamepadsGlib::isGamepadDevice):
(WebCore::sampleGamepads):
* platform/glib/SharedBufferGlib.cpp: Renamed from Source/WebCore/platform/gtk/SharedBufferGtk.cpp.
(WebCore::SharedBuffer::createFromReadingFile):

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

4 years agoRefactor RenderMathMLSpace to avoid using flexbox
fred.wang@free.fr [Wed, 20 Apr 2016 13:25:39 +0000 (13:25 +0000)]
Refactor RenderMathMLSpace to avoid using flexbox
https://bugs.webkit.org/show_bug.cgi?id=155168

Patch by Frederic Wang <fwang@igalia.com> on 2016-04-20
Reviewed by Martin Robinson.

Source/WebCore:

No new tests, already covered by existing tests. The behavior of mspace-prefered-width-expected is not specified by the MathML recommendation, we update that test to match our new behavior.

* rendering/mathml/RenderMathMLSpace.cpp: Implement layout functions without passing by flebox.
(WebCore::RenderMathMLSpace::computePreferredLogicalWidths): Implement this function.
(WebCore::RenderMathMLSpace::layoutBlock): Implement this function.
(WebCore::RenderMathMLSpace::computeIntrinsicLogicalWidths): Deleted.
(WebCore::RenderMathMLSpace::updateLogicalWidth): Deleted.
(WebCore::RenderMathMLSpace::updateLogicalHeight): Deleted.
* rendering/mathml/RenderMathMLSpace.h: Update function declarations.

LayoutTests:

* mathml/presentation/mspace-prefered-width-expected.html: Update the expectation so that the logical width and preferred width are both equal to the one specified by the width attribute.

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

4 years agoUnreviewed GTK+ gardening. Mark HLS tests release expectations as release only.
carlosgc@webkit.org [Wed, 20 Apr 2016 09:06:00 +0000 (09:06 +0000)]
Unreviewed GTK+ gardening. Mark HLS tests release expectations as release only.

* platform/gtk/TestExpectations:

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

4 years ago[Cairo] Crash in GraphicsContext::drawFocusRing when painting is disabled
carlosgc@webkit.org [Wed, 20 Apr 2016 08:47:45 +0000 (08:47 +0000)]
[Cairo] Crash in GraphicsContext::drawFocusRing when painting is disabled
https://bugs.webkit.org/show_bug.cgi?id=156785

Reviewed by Žan Doberšek.

This happens for example when view state changes to focus and paint is called from
FrameView::updateControlTints() with a graphics context that doesn't have a platform context. Layout test
fast/images/image-map-outline-with-scale-transform.html sometimes crashes because of this.

* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawFocusRing): Return early if painting is disabled.

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

4 years agoRemove unused m_writtenVariables from the parser and related bits
sbarati@apple.com [Wed, 20 Apr 2016 08:44:43 +0000 (08:44 +0000)]
Remove unused m_writtenVariables from the parser and related bits
https://bugs.webkit.org/show_bug.cgi?id=156784

Reviewed by Yusuke Suzuki.

This isn't a octane/codeload speedup even though we're doing less work in
collectFreeVariables. But it's good to get rid of things that are not used.

* parser/Nodes.h:
(JSC::ScopeNode::usesEval):
(JSC::ScopeNode::usesArguments):
(JSC::ScopeNode::usesArrowFunction):
(JSC::ScopeNode::isStrictMode):
(JSC::ScopeNode::setUsesArguments):
(JSC::ScopeNode::usesThis):
(JSC::ScopeNode::modifiesParameter): Deleted.
(JSC::ScopeNode::modifiesArguments): Deleted.
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseAssignmentExpression):
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::hasDeclaredParameter):
(JSC::Scope::preventAllVariableDeclarations):
(JSC::Scope::collectFreeVariables):
(JSC::Scope::mergeInnerArrowFunctionFeatures):
(JSC::Scope::getSloppyModeHoistedFunctions):
(JSC::Scope::getCapturedVars):
(JSC::Scope::setStrictMode):
(JSC::Scope::strictMode):
(JSC::Scope::fillParametersForSourceProviderCache):
(JSC::Scope::restoreFromSourceProviderCache):
(JSC::Parser::hasDeclaredParameter):
(JSC::Parser::exportName):
(JSC::Scope::declareWrite): Deleted.
(JSC::Parser::declareWrite): Deleted.
* parser/ParserModes.h:

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

4 years agoUnreviewed EFL gardening. Follow up gardening for media test.
gyuyoung.kim@webkit.org [Wed, 20 Apr 2016 08:33:22 +0000 (08:33 +0000)]
Unreviewed EFL gardening. Follow up gardening for media test.

* platform/efl/TestExpectations: Unskip 3 media tests.

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

4 years agoBuild fix after r199738
achristensen@apple.com [Wed, 20 Apr 2016 06:38:59 +0000 (06:38 +0000)]
Build fix after r199738

* CMakeLists.txt:

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

4 years agoUnreviewed build fix after r199752.
bfulgham@apple.com [Wed, 20 Apr 2016 06:26:24 +0000 (06:26 +0000)]
Unreviewed build fix after r199752.

* DumpRenderTree/win/FrameLoadDelegate.cpp:
(FrameLoadDelegate::didChangeIcons): Remove call to removed function.

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

4 years agoREGRESSION(r198782): SHOULD NEVER BE REACHED failure in ImageSource::setData since...
carlosgc@webkit.org [Wed, 20 Apr 2016 06:02:24 +0000 (06:02 +0000)]
REGRESSION(r198782): SHOULD NEVER BE REACHED failure in ImageSource::setData since r198782
https://bugs.webkit.org/show_bug.cgi?id=156690

Reviewed by Michael Catanzaro.

The assertion is wrong, because it assumes that ImageDecoder::create() always returns a valid pointer, which is
only true for the CG implementation. The non CG implementation can return nullptr if there isn't enough data to
figure out the image format or if the image format is not supported. This is causing several crashes in the
debug bots.

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::setData): Remove the invalid ASSERT and return early if we fail to create the decoder.
(WebCore::ImageSource::ensureDecoderIsCreated): Deleted.
* platform/graphics/ImageSource.h:

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

4 years agoUnreviewed, fix cloop build after r199754.
sbarati@apple.com [Wed, 20 Apr 2016 05:49:31 +0000 (05:49 +0000)]
Unreviewed, fix cloop build after r199754.

* jsc.cpp:
(jscmain):

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

4 years agoiTunes crashing JavaScriptCore.dll
msaboff@apple.com [Wed, 20 Apr 2016 05:13:28 +0000 (05:13 +0000)]
iTunes crashing JavaScriptCore.dll
https://bugs.webkit.org/show_bug.cgi?id=156647

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Given that there there are only 128 FLS indices compared to over a 1000 for TLS,
I eliminated the thread specific m_threadSpecificForThread and instead we look
for the current thread in m_registeredThreads list when we need it.
In most cases there will only be one thread.

Added THREAD_SPECIFIC_CALL to signature of ThreadSpecific remove callbacks
to set the calling convention correctly for Windows 32 bit.

* heap/MachineStackMarker.cpp:
(JSC::ActiveMachineThreadsManager::remove):
(JSC::MachineThreads::MachineThreads):
(JSC::MachineThreads::~MachineThreads):
(JSC::MachineThreads::addCurrentThread):
(JSC::MachineThreads::machineThreadForCurrentThread):
(JSC::MachineThreads::removeThread):
* heap/MachineStackMarker.h:

Source/WTF:

If a thread was created without using the WTF thread apis and that thread uses
a JavaScript VM and that thread exits with the VM still around, JSC won't know
that the thread has exited.  Currently, we use ThreadSpecificThreadExit() to
clean up any thread specific keys.  Cleaning up these keys is how JSC is
notified of a thread exit.  We only call ThreadSpecificThreadExit() from
wtfThreadEntryPoint() when the thread entry point function returns.
This mechanism was put in place for Windows because we layer the WTF::ThreadSpecific
functionality on top of TLS (Thread Local Storage), but TLS doesn't have
a thread exiting callback the way that pthread_create_key does.

The fix is to change from using TLS to using FLS (Fiber Local Storage).  Although
Windows allows multiple fibers per thread, WebKit is not designed to work with a
multiple fibers per thread.  When there is only one fiber per thread, FLS works just
like TLS, but it has the destroy callback.

I restructured the Windows version of WTF::ThreadSpecific to be almost the same
as the pthread version.  Added THREAD_SPECIFIC_CALL to set the correct
calling convenction for Windows 32 bit.

* wtf/ThreadSpecific.h:
(WTF::threadSpecificKeyCreate):
(WTF::threadSpecificKeyDelete):
(WTF::threadSpecificSet):
(WTF::threadSpecificGet):
(WTF::ThreadSpecific<T>::ThreadSpecific):
(WTF::ThreadSpecific<T>::~ThreadSpecific):
(WTF::ThreadSpecific<T>::get):
(WTF::ThreadSpecific<T>::set):
(WTF::ThreadSpecific<T>::destroy):
Restructured to use FLS.  Renamed TLS* to FLS*.

* wtf/ThreadSpecificWin.cpp:
(WTF::flsKeyCount):
(WTF::flsKeys):
Renamed from tlsKey*() to flsKey*().

(WTF::destructorsList): Deleted.
(WTF::destructorsMutex): Deleted.
(WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
(WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
(WTF::PlatformThreadSpecificKey::setValue): Deleted.
(WTF::PlatformThreadSpecificKey::value): Deleted.
(WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
(WTF::tlsKeyCount): Deleted.
(WTF::tlsKeys): Deleted.
(WTF::threadSpecificKeyCreate): Deleted.
(WTF::threadSpecificKeyDelete): Deleted.
(WTF::threadSpecificSet): Deleted.
(WTF::threadSpecificGet): Deleted.
(WTF::ThreadSpecificThreadExit): Deleted.

* wtf/ThreadingWin.cpp:
(WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.

LayoutTests:

Disabled fast/workers/dedicated-worker-lifecycle.html as it creates
more workers that we have ThreadSpecific keys.  We need at least one
key per JSC VM we create.  I didn't want to weaken the test for other
platforms.

* platform/win/TestExpectations:

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

4 years agoAdd more locking algorithms to the LockSpeedTest.
fpizlo@apple.com [Wed, 20 Apr 2016 04:27:15 +0000 (04:27 +0000)]
Add more locking algorithms to the LockSpeedTest.

Rubber stamped by Saam Barati.

* benchmarks/LockSpeedTest.cpp:
(main):

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

4 years agoClean up the ParkingLot uparking API a bit
fpizlo@apple.com [Wed, 20 Apr 2016 04:25:02 +0000 (04:25 +0000)]
Clean up the ParkingLot uparking API a bit
https://bugs.webkit.org/show_bug.cgi?id=156746

Reviewed by Saam Barati and Geoffrey Garen.

Previously, unparkOne() would either return a boolean to tell you if there are any more threads on
the queue or it would pass your callback a pair of booleans - one to tell if a thread was unparked
and another to tell if there are any more threads. This was an annoying inconsistency. What if you
wanted to know if unparkOne() unparked a thread but you don't care to use callbacks?

This fixes unparkOne() to use a struct called UnparkResult for both of its variants. This makes the
code a bit cleaner.

* wtf/Atomics.h: Add some more atomic ops.
(WTF::Atomic::exchangeAndAdd):
(WTF::Atomic::exchange):
* wtf/Condition.h: Change calls to unparkOne().
(WTF::ConditionBase::notifyOne):
* wtf/Lock.cpp: Change calls to unparkOne().
(WTF::LockBase::unlockSlow):
* wtf/ParkingLot.cpp:
(WTF::ParkingLot::parkConditionally):
(WTF::ParkingLot::unparkOne):
* wtf/ParkingLot.h: Switch to using ScopedLambda and introduce UnparkResult.

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

4 years agobmalloc: fix up overflow checks
ggaren@apple.com [Wed, 20 Apr 2016 04:14:02 +0000 (04:14 +0000)]
bmalloc: fix up overflow checks
https://bugs.webkit.org/show_bug.cgi?id=156780

Reviewed by Mark Lam.

We used to try to avoid overflow in large object math by setting a very
high limit on the largest large object. But that's a bit error-prone
since the check is far away from the math that might overflow -- and
we were missing some cases.

This patch removes the limit and instead checks at each math site.

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::tryAllocate):
(bmalloc::Allocator::allocate):
(bmalloc::Allocator::reallocate):
(bmalloc::Allocator::allocateSlowCase): Remove the limit. tryAllocateLarge
will check for overflow for us.

* bmalloc/Chunk.h: This ASSERT was just totally wrong.

* bmalloc/Heap.cpp:
(bmalloc::Heap::tryAllocateLarge): Check for overflow when adding.

* bmalloc/Sizes.h:

* bmalloc/VMAllocate.h:
(bmalloc::tryVMAllocate): Check for overflow when adding.

* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::tryAllocateLargeChunk): Check for overflow when adding.

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

4 years ago[JSC] Small cleanup of RegisterAtOffsetList
commit-queue@webkit.org [Wed, 20 Apr 2016 04:03:25 +0000 (04:03 +0000)]
[JSC] Small cleanup of RegisterAtOffsetList
https://bugs.webkit.org/show_bug.cgi?id=156779

Patch by Benjamin Poulain <bpoulain@webkit.org> on 2016-04-19
Reviewed by Mark Lam.

I was wondering why RegisterAtOffsetList always cache-miss.
It looks like it is doing more than it needs to.

We do not need to sort the values. The total order of
RegisterAtOffset is:
1) Order of Reg.
2) Order of offsets.
We already generate the list in order.

Also allocate the right array size ahead of filling the array.

* jit/RegisterAtOffsetList.cpp:
(JSC::RegisterAtOffsetList::RegisterAtOffsetList):
(JSC::RegisterAtOffsetList::sort): Deleted.
* jit/RegisterAtOffsetList.h:
(JSC::RegisterAtOffsetList::append): Deleted.

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

4 years agoWeb Inspector: Picking Snapshot from navigation bar popup does to switch views
commit-queue@webkit.org [Wed, 20 Apr 2016 03:52:42 +0000 (03:52 +0000)]
Web Inspector: Picking Snapshot from navigation bar popup does to switch views
https://bugs.webkit.org/show_bug.cgi?id=156762

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-19
Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineDataGridNodePathComponent.js:
(WebInspector.TimelineDataGridNodePathComponent.prototype.get previousSibling):
(WebInspector.TimelineDataGridNodePathComponent.prototype.get nextSibling):
Wrong represented object provided by TimelineDataGridNodePathComponent.

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

4 years ago2016-04-19 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Wed, 20 Apr 2016 03:08:33 +0000 (03:08 +0000)]
2016-04-19  Geoffrey Garen  <ggaren@apple.com>

        Unreviewed, try to fix an ASSERT seen on the bots.

        * bmalloc/Heap.cpp:
        (bmalloc::Heap::tryAllocateLarge): This ASSERT is supposed to be about
        alignment, not size. Oops.

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

4 years agoAdd a couple UNLIKELY macros in parseMemberExpression
sbarati@apple.com [Wed, 20 Apr 2016 02:41:00 +0000 (02:41 +0000)]
Add a couple UNLIKELY macros in parseMemberExpression
https://bugs.webkit.org/show_bug.cgi?id=156775

Reviewed by Filip Pizlo.

These UNLIKELY macros have to do with the base of the
member expression being 'super'. I think it's safe to
argue that this is truly UNLIKELY. I am seeing speedups
sometimes on Octane codeload. Usually around 0.5%. Sometimes 1%.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseMemberExpression):

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

4 years agoallow jsc shell to dump sampling profiler data
sbarati@apple.com [Wed, 20 Apr 2016 02:24:53 +0000 (02:24 +0000)]
allow jsc shell to dump sampling profiler data
https://bugs.webkit.org/show_bug.cgi?id=156725

Reviewed by Benjamin Poulain.

This patch adds a '--reportSamplingProfilerData' option to the
JSC shell which will enable the sampling profiler and dump
its data at the end of execution. The dump will include the
40 hottest functions and the 80 hottest bytecode locations.
If you're using this option to debug, it's easy to just hack
on the code to make it dump more or less information.

* jsc.cpp:
(CommandLine::parseArguments):
(jscmain):
* runtime/Options.h:
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::processUnverifiedStackTraces):
(JSC::SamplingProfiler::stackTracesAsJSON):
(JSC::SamplingProfiler::reportTopFunctions):
(JSC::SamplingProfiler::reportTopBytecodes):
* runtime/SamplingProfiler.h:
(JSC::SamplingProfiler::StackFrame::hasExpressionInfo):
(JSC::SamplingProfiler::StackFrame::hasBytecodeIndex):
(JSC::SamplingProfiler::StackFrame::hasCodeBlockHash):
(JSC::SamplingProfiler::setStopWatch):

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

4 years agoFix CMake build.
achristensen@apple.com [Wed, 20 Apr 2016 01:36:02 +0000 (01:36 +0000)]
Fix CMake build.

* CMakeLists.txt:
Don't compile a file that doesn't exist.
* PlatformMac.cmake:
Put the XPCServices in the right place.

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

4 years agoRemove remaining bits of dynamic <link> rel='icon' loading
bfulgham@apple.com [Wed, 20 Apr 2016 01:33:34 +0000 (01:33 +0000)]
Remove remaining bits of dynamic <link> rel='icon' loading
https://bugs.webkit.org/show_bug.cgi?id=156727

Reviewed by Darin Adler.

Source/WebCore:

Don't call 'shouldLoadLink' for 'icon' link types. It performs no
useful checks for 'icon' types, and emits the non-standard
'onbeforeload' event.

This work finishes up https://webkit.org/b/153151, where we removed
FrameLoaderClient::dispatchDidChangeIcons() and related code.

Test: webarchive/test-link-rel-subresource-beforeload.html

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink): Remove unneeded call to 'shouldLoadLink'.

Tools:

Remove unused test infrastructure. This code never existed in WebKit2
testing since was only used on Windows.

* DumpRenderTree/TestRunner.cpp:
(dumpIconChangesCallback): Deleted.
* DumpRenderTree/TestRunner.h:
(TestRunner::dumpIconChanges): Deleted.
(TestRunner::setDumpIconChanges): Deleted.

LayoutTests:

Rename 'test-link-rel-icon-beforeload.html' to 'test-link-rel-subresource-beforeload.html'.

* fast/dom/icon-url-property-expected.txt: Removed.
* fast/dom/icon-url-property.html: Removed.
* platform/gtk/TestExpectations: Remove references to deleted tests.
* platform/ios-simulator/TestExpectations: Ditto.
* platform/wk2/TestExpectations: Ditto.
* webarchive/test-link-rel-icon-beforeload-expected.webarchive: Removed.
* webarchive/test-link-rel-icon-beforeload.html: Removed.
* webarchive/test-link-rel-subresource-beforeload-expected.webarchive: Copied from LayoutTests/webarchive/test-link-rel-icon-beforeload-expected.webarchive.
* webarchive/test-link-rel-subresource-beforeload.html: Copied from LayoutTests/webarchive/test-link-rel-icon-beforeload.html.

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

4 years agoAudioBufferSourceNode.buffer should be nullable
cdumez@apple.com [Wed, 20 Apr 2016 01:30:11 +0000 (01:30 +0000)]
AudioBufferSourceNode.buffer should be nullable
https://bugs.webkit.org/show_bug.cgi?id=156769

Reviewed by Darin Adler.

Source/WebCore:

AudioBufferSourceNode.buffer should be nullable as per the
specification:
https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode

Our implementation was initially returning null when getting
AudioBufferSourceNode.buffer, which is correct. However, it would
throw a TypeError when trying to set the attribute to null. Our
implementation setter actually supported setting the buffer to
null but the custom bindings for the setter would not.

This patch does the following:
- Get rid of the custom bindings for the AudioBufferSourceNode.buffer
  setter. We can have the bindings generator generate the same code
  by using [StrictTypeChecking]. The custom bindinds were also throwing
  a TypeError if the input AudioBuffer had too many channels but this
  does not seem to be possible.
- Mark AudioBufferSourceNode.buffer as nullable in the IDL so that
  we no longer throw when the JS tries to assign null, but instead
  calls AudioBufferSourceNode::setBuffer(nullptr)

No new test, updated webaudio/audiobuffersource-channels.html

* CMakeLists.txt:
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::setBuffer):
* Modules/webaudio/AudioBufferSourceNode.h:
* Modules/webaudio/AudioBufferSourceNode.idl:
* Modules/webaudio/AudioContext.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSAudioBufferSourceNodeCustom.cpp: Removed.

LayoutTests:

Update existing layout test to check that:
- AudioBufferSourceNode.buffer is initially null
- AudioBufferSourceNode.buffer can be set to null
- We cannot create an AudioBuffer that has too many channels

* webaudio/audiobuffersource-channels-expected.txt:
* webaudio/audiobuffersource-channels.html:

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

4 years agoModern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent...
beidson@apple.com [Wed, 20 Apr 2016 01:19:59 +0000 (01:19 +0000)]
Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
https://bugs.webkit.org/show_bug.cgi?id=156760

Reviewed by Darin Adler (and looked over by Chris Dumez and Alex Christensen).

Source/WebCore:

Test: storage/indexeddb/modern/idbversionchangeevent-constructor.html

Add WorkerGlobalScopeConstructors to the xcodeproj:
* WebCore.xcodeproj/project.pbxproj:

Remove the completely irrelevant webkit* prefixed constructors from DOMWindow:
* page/DOMWindow.idl:

Remove the poor way most objects were exposed on the WorkerGlobalScope:
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl:

Expose most of the objects on the WorkerGlobalScope the correct way:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBCursorWithValue.idl:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBFactory.idl:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBKeyRange.idl:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBOpenDBRequest.idl:
* Modules/indexeddb/IDBRequest.idl:
* Modules/indexeddb/IDBTransaction.idl:

Make IDBVersionChangeEvent constructible:
* Modules/indexeddb/IDBVersionChangeEvent.cpp:
(WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
(WebCore::IDBVersionChangeEvent::newVersion): Deleted.
* Modules/indexeddb/IDBVersionChangeEvent.h:
* Modules/indexeddb/IDBVersionChangeEvent.idl:

* bindings/js/JSDictionary.h:
(WebCore::JSDictionary::convertValue): Add a templated form of convertValue that
  handles Optional<>s.

LayoutTests:

* js/dom/global-constructors-attributes-idb-expected.txt: Updated for removed attributes.
* storage/indexeddb/modern/idbversionchangeevent-constructor-expected.txt: Added.
* storage/indexeddb/modern/idbversionchangeevent-constructor.html: Added.

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

4 years ago[EFL] Unskip media tests since r199649
gyuyoung.kim@webkit.org [Wed, 20 Apr 2016 01:05:36 +0000 (01:05 +0000)]
[EFL] Unskip media tests since r199649

Unreviewed EFL gardening.

* platform/efl/TestExpectations: r199649 fixed media test crash as well.

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

4 years agoRe-landing: ES6: Implement RegExp.prototype[@@search].
mark.lam@apple.com [Wed, 20 Apr 2016 00:02:07 +0000 (00:02 +0000)]
Re-landing: ES6: Implement RegExp.prototype[@@search].
https://bugs.webkit.org/show_bug.cgi?id=156331

Reviewed by Keith Miller.

Source/JavaScriptCore:

What changed?
1. Implemented search builtin in RegExpPrototype.js.
   The native path is now used as a fast path.
2. Added DFG support for an IsRegExpObjectIntrinsic (modelled after the
   IsJSArrayIntrinsic).
3. Renamed @isRegExp to @isRegExpObject to match the new IsRegExpObjectIntrinsic.
4. Change the esSpecIsRegExpObject() implementation to check if the object's
   JSType is RegExpObjectType instead of walking the classinfo chain.

* builtins/RegExpPrototype.js:
(search):
* builtins/StringPrototype.js:
(search):
- fixed some indentation.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileIsArrayConstructor):
(JSC::DFG::SpeculativeJIT::compileIsRegExpObject):
(JSC::DFG::SpeculativeJIT::compileCallObjectConstructor):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileIsFunction):
(JSC::FTL::DFG::LowerDFGToB3::compileIsRegExpObject):
(JSC::FTL::DFG::LowerDFGToB3::compileTypeOf):
(JSC::FTL::DFG::LowerDFGToB3::isExoticForTypeof):
(JSC::FTL::DFG::LowerDFGToB3::isRegExpObject):
(JSC::FTL::DFG::LowerDFGToB3::isType):
* runtime/Intrinsic.h:
- Added IsRegExpObjectIntrinsic.

* runtime/CommonIdentifiers.h:

* runtime/ECMAScriptSpecInternalFunctions.cpp:
(JSC::esSpecIsConstructor):
- Changed to use uncheckedArgument since this is only called from internal code.
(JSC::esSpecIsRegExpObject):
(JSC::esSpecIsRegExp): Deleted.
* runtime/ECMAScriptSpecInternalFunctions.h:
- Changed to check the object for a JSType of RegExpObjectType.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
- Added split fast path.

* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
(JSC::regExpProtoFuncSearchFast):
(JSC::regExpProtoFuncSearch): Deleted.
* runtime/RegExpPrototype.h:

* tests/es6.yaml:
* tests/stress/regexp-search.js:
- Rebased test.

LayoutTests:

* js/regress/regexp-prototype-search-observable-side-effects-expected.txt: Added.
* js/regress/regexp-prototype-search-observable-side-effects.html: Added.
* js/regress/regexp-prototype-search-observable-side-effects2-expected.txt: Added.
* js/regress/regexp-prototype-search-observable-side-effects2.html: Added.

* js/regress/script-tests/regexp-prototype-search-observable-side-effects.js: Added.
* js/regress/script-tests/regexp-prototype-search-observable-side-effects2.js: Added.

* js/regress/script-tests/string-prototype-search-observable-side-effects.js: Added.
* js/regress/script-tests/string-prototype-search-observable-side-effects2.js: Added.
* js/regress/script-tests/string-prototype-search-observable-side-effects3.js: Added.
* js/regress/script-tests/string-prototype-search-observable-side-effects4.js: Added.

* js/regress/string-prototype-search-observable-side-effects-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects.html: Added.
* js/regress/string-prototype-search-observable-side-effects2-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects2.html: Added.
* js/regress/string-prototype-search-observable-side-effects3-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects3.html: Added.
* js/regress/string-prototype-search-observable-side-effects4-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects4.html: Added.

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

4 years agoWeb Inspector: DataGrid should be virtualized so it only renders visible rows
timothy@apple.com [Tue, 19 Apr 2016 23:41:25 +0000 (23:41 +0000)]
Web Inspector: DataGrid should be virtualized so it only renders visible rows

https://bugs.webkit.org/show_bug.cgi?id=156663
rdar://problem/25765256

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WebInspector.ComputedStyleDetailsPanel.prototype.set containerRegions):
Call updateLayoutIfNeeded since we don't use views here.

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._formatParameterAsTable):
Set inline and variableHeightRows to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.

* UserInterface/Views/DOMTreeDataGrid.js:
(WebInspector.DOMTreeDataGrid):
Set inline to true, remove direct classList add.

* UserInterface/Views/DataGrid.css:
(.data-grid td):
(.data-grid table.data):
(.data-grid:not(.variable-height-rows) table.data):
(.data-grid:not(.variable-height-rows) table.data.odd-first-zebra-stripe):
(.data-grid.variable-height-rows table.data tr:nth-child(odd)):
(.data-grid.variable-height-rows table.data tr:nth-child(even)):
(.data-grid.variable-height-rows.odd-first-zebra-stripe table.data tr:nth-child(odd)):
(.data-grid.variable-height-rows.odd-first-zebra-stripe table.data tr:nth-child(even)):
(.data-grid.variable-height-rows table.data tr.filler):
Updated styles to support variable height rows directly and flipping the order of the stripes
when the virtual table starts at an odd row.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid): Added rowHeight and rows.
(WebInspector.DataGrid.prototype.get inline): Added.
(WebInspector.DataGrid.prototype.set inline): Added.
(WebInspector.DataGrid.prototype.get variableHeightRows): Added.
(WebInspector.DataGrid.prototype.set variableHeightRows): Added.
(WebInspector.DataGrid.prototype.layout): Call _updateVisibleRows.
(WebInspector.DataGrid.prototype._noteRowsChanged): Added.
(WebInspector.DataGrid.prototype._updateVisibleRows): Added.
(WebInspector.DataGrid.prototype._sortNodesCallback): Update to not use the DOM.
(WebInspector.DataGridNode.prototype.set hasChildren): Call needsLayout.
(WebInspector.DataGridNode.prototype.collapse): Call needsLayout.
(WebInspector.DataGridNode.prototype.expand): Call needsLayout.
(WebInspector.DataGridNode.prototype._attach): Call _noteRowsChanged.
(WebInspector.DataGridNode.prototype._detach): Call _noteRowsChanged.

* UserInterface/Views/DatabaseUserQuerySuccessView.js:
(WebInspector.DatabaseUserQuerySuccessView):
Set inline to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.

* UserInterface/Views/DetailsSection.css:
(.details-section > .content .data-grid td.value-column):
(.details-section > .content .data-grid table.data): Deleted.
(.details-section > .content .data-grid tr:nth-child(even)): Deleted.
(.details-section > .content .data-grid tr:nth-child(odd)): Deleted.
Now handled by DataGrid.css directly.

* UserInterface/Views/DetailsSectionDataGridRow.js:
(WebInspector.DetailsSectionDataGridRow.prototype.set dataGrid):
Set inline and variableHeightRows to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.

* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot > .data-grid tr:matches(.selected, :hover) td .go-to-arrow):
(.heap-snapshot .icon):
Remove margin-top to fit inside 20px row instead of 21px.

* UserInterface/Views/IndexedDatabaseObjectStoreContentView.css:
(.content-view.indexed-database-object-store > .data-grid table.data): Deleted.
(.content-view.indexed-database-object-store > .data-grid table.data tr:nth-child(even)): Deleted.
(.content-view.indexed-database-object-store > .data-grid table.data tr:nth-child(odd)): Deleted.
(.content-view.indexed-database-object-store > .data-grid table.data tr.filler): Deleted.
Now handled by DataGrid.css directly.

* UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
(WebInspector.IndexedDatabaseObjectStoreContentView):
Set variableHeightRows to true.

* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):
Set inline to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.

* UserInterface/Views/LogContentView.css:
(.console-item .data-grid table.data): Deleted.
(.console-item .data-grid table.data tr:nth-child(even)): Deleted.
Now handled by DataGrid.css directly.

* UserInterface/Views/NetworkGridContentView.css:
(.content-view.network-grid > .data-grid td): Deleted.
(.content-view.network-grid > .data-grid table.data): Deleted.
Now handled by DataGrid.css directly.

* UserInterface/Views/ProbeSetDataGrid.js:
(WebInspector.ProbeSetDataGrid):
Set inline to true, remove direct classList add.

* UserInterface/Views/ProfileView.css:
(.profile > .data-grid td .icon):
(.profile > .data-grid tr:matches(.selected, :hover) .go-to-arrow):
Remove margin-top to fit inside 20px row instead of 21px.

* UserInterface/Views/TimelineRecordingContentView.css:
(.content-view.timeline-recording > .content-browser > .content-view-container > .timeline-view > .data-grid td): Deleted.
(.content-view.timeline-recording > .content-browser > .content-view-container > .timeline-view > .data-grid table.data): Deleted.
Now handled by DataGrid.css directly.

* UserInterface/Views/Variables.css:
(:root): Added zebra stripe colors.

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

4 years agobmalloc: Merge the large and xlarge allocators
ggaren@apple.com [Tue, 19 Apr 2016 23:36:20 +0000 (23:36 +0000)]
bmalloc: Merge the large and xlarge allocators
https://bugs.webkit.org/show_bug.cgi?id=156734

Reviewed by Andreas Kling.

This give us better defense against worst case memory usage:

                                      Baseline                Patch                    Δ
    Peak Memory:
        nimlang                      198,132kB            181,468kB      ^ 1.09x smaller

It also eliminates inline metadata for large objects, fixing the
regression introduced in r198675, and more:

    run-malloc-benchmarks Baseline:~/OpenSource/WebKitBuildBaseline/Release/ Patch:~/OpenSource/WebKitBuild/Release/

                                                          Baseline                          Patch                              Δ
    Memory at End:
        big                                               10,880kB                        3,328kB                ^ 3.27x smaller
        facebook                                           3,112kB                        2,868kB                ^ 1.09x smaller
        fragment --parallel                                1,848kB                          760kB                ^ 2.43x smaller
        fragment_iterate --parallel                        4,908kB                          776kB                ^ 6.32x smaller
        big --parallel                                    48,076kB                       11,892kB                ^ 4.04x smaller

Overall memory use looks OK:

    run-malloc-benchmarks --memory_warning Baseline:~/OpenSource/WebKitBuildBaseline/Release/ Patch:~/OpenSource/WebKitBuild/Release/

                                                Baseline                               Patch                                   Δ
    Memory at End:
        <arithmetic mean>                       13,992kB                            13,987kB                      ^ 1.0x smaller

Overall throughput looks OK:

    run-malloc-benchmarks Baseline:~/OpenSource/WebKitBuildBaseline/Release/ Patch:~/OpenSource/WebKitBuild/Release/

                                                          Baseline                          Patch                              Δ
    Execution Time:
        <arithmetic mean>                                    103ms                          104ms                 ! 1.01x slower

We're a bit slower on the "all-out large allocations on all cores"
benchmark, but I think that's an OK price to pay:

                                                          Baseline                          Patch                              Δ
    Execution Time:
        big --parallel                                       125ms                          136ms                 ! 1.09x slower

This patch net removes 1.5k lines of code. It turns out that large
allocations are rare, and free memory fragments are also rare, so the
combination is super rare, and a simple O(n) algorithm that ensures good
memory behavior is the best option.

Fun fact: In practice, the odds that the old code would save memory
were *worse* than the odds that it would contain a bug that wasted
memory. :)

* bmalloc.xcodeproj/project.pbxproj:

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::tryAllocate): largeMax is the new xLargeMax since
xLargeMax is gone now.

(bmalloc::Allocator::allocate): I moved the rounding code into allocateLarge,
so we don't have to do it here.

(bmalloc::Allocator::reallocate):
(bmalloc::Allocator::allocateSlowCase):
(bmalloc::Allocator::allocateXLarge): Deleted. No more XLarge case.

* bmalloc/Allocator.h:

* bmalloc/BeginTag.h: Removed.
* bmalloc/BoundaryTag.h: Removed.

* bmalloc/Chunk.h:
(bmalloc::ChunkHash::hash): Added a hash function. The best hash function
is a unique and monotonically increasing integer, and that's exactly what
we typically get from the high bits of a Chunk, since the OS allocates
Chunks at unique and increasing addresses.
(bmalloc::Chunk::boundaryTags): Deleted.
(bmalloc::Chunk::objectType): Deleted.
(bmalloc::Chunk::beginTag): Deleted.
(bmalloc::Chunk::endTag): Deleted.

* bmalloc/Deallocator.cpp:
(bmalloc::Deallocator::deallocateSlowCase): We no longer know for sure,
by looking at its bit pattern, whether a pointer is small or large.
Instead, any pointer with large alignment *might* be large, and when
we occasionally encounter such an object, we have to consult a hash
table in the Heap to find out for sure. This turns out to be just as
cheap in practice.

We don't deallocate large objects on the fast path anymore. We can't,
because large objects have out-of-line metadata now.

(bmalloc::Deallocator::deallocateXLarge): Deleted.

* bmalloc/Deallocator.h:
(bmalloc::Deallocator::deallocateFastCase): See deallocateSlowCase.

* bmalloc/EndTag.h: Removed.
* bmalloc/FreeList.cpp: Removed.
* bmalloc/FreeList.h: Removed.

* bmalloc/Heap.cpp:
(bmalloc::Heap::allocateSmallPage): Be sure to track each chunk in
the object type map, so we can distinguish small vs large objects.

(bmalloc::Heap::deallocateSmallLine): No need to check object type
because we know object type now by virtue of being on the small object
path.

(bmalloc::Heap::splitAndAllocate): Be sure to track each chunk in
the object type map, so we can distinguish small vs large objects. Large
objects can split across chunks, so we need to add each large object's
chunk as it is allocated.

(bmalloc::Heap::tryAllocateLarge):
(bmalloc::Heap::allocateLarge):
(bmalloc::Heap::isLarge):
(bmalloc::Heap::largeSize):
(bmalloc::Heap::shrinkLarge):
(bmalloc::Heap::deallocateLarge): Merged in existing XLarge logic for
large objects.

(bmalloc::Heap::scavengeXLargeObjects): Deleted.
(bmalloc::Heap::allocateXLarge): Deleted.
(bmalloc::Heap::tryAllocateXLarge): Deleted.
(bmalloc::Heap::xLargeSize): Deleted.
(bmalloc::Heap::shrinkXLarge): Deleted.
(bmalloc::Heap::deallocateXLarge): Deleted.

* bmalloc/Heap.h:
(bmalloc::Heap::LargeObjectHash::hash):

* bmalloc/LargeObject.h: Removed.

* bmalloc/Map.h: Added.
(bmalloc::Map::size):
(bmalloc::Map::capacity):
(bmalloc::Map::get):
(bmalloc::Map::set):
(bmalloc::Map::remove):
(bmalloc::Map::shouldGrow):
(bmalloc::Map::shouldShrink):
(bmalloc::Map::find):
(bmalloc::Hash>::rehash): Simple hash table.

* bmalloc/Object.h:

* bmalloc/ObjectType.cpp:
(bmalloc::objectType):
* bmalloc/ObjectType.h:
(bmalloc::mightBeLarge): See deallocateSlowCase.
(bmalloc::isXLarge): Deleted.

* bmalloc/SegregatedFreeList.cpp: Removed.
* bmalloc/SegregatedFreeList.h: Removed.

* bmalloc/Sizes.h: Upped smallMax to 64kB. Upping to 32kB is pretty
reasonable, since sizes between 16kB and 32kB share page sizes. I went
all the way up to 64kB because the GC uses 64kB blocks, and also just
for extra padding to ensure that large allocations are indeed rare.

* bmalloc/SortedVector.h: Removed.

* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::tryAllocateLargeChunk):
(bmalloc::VMHeap::allocateSmallChunk):
(bmalloc::VMHeap::VMHeap): Deleted.
(bmalloc::VMHeap::allocateChunk): Deleted.
* bmalloc/VMHeap.h:
(bmalloc::VMHeap::deallocateSmallPage):
(bmalloc::VMHeap::allocateLargeObject): Deleted.
(bmalloc::VMHeap::deallocateLargeObject): Deleted. Nixed all the boundary
tag logic since metadata is out of line now.

* bmalloc/VMState.h: Removed. Instead of an abstract state, we track
the precise amount of committed physical pages at the head of a VM
range. This allows us to merge aggressively without triggering an madvise
storm most of the time.

* bmalloc/Vector.h:
(bmalloc::Vector<T>::Vector):
(bmalloc::Vector<T>::insert):
(bmalloc::Vector<T>::remove):
(bmalloc::Vector<T>::resize): Filled out some missing helpers.

* bmalloc/XLargeMap.cpp:
(bmalloc::XLargeMap::remove):
(bmalloc::XLargeMap::add):
(bmalloc::XLargeMap::removePhysical):
(bmalloc::XLargeMap::takeFree): Deleted.
(bmalloc::XLargeMap::addFree): Deleted.
(bmalloc::XLargeMap::addAllocated): Deleted.
(bmalloc::XLargeMap::getAllocated): Deleted.
(bmalloc::XLargeMap::takeAllocated): Deleted.
(bmalloc::XLargeMap::shrinkToFit): Deleted.
(bmalloc::XLargeMap::takePhysical): Deleted.
(bmalloc::XLargeMap::addVirtual): Deleted.
* bmalloc/XLargeMap.h:
(bmalloc::XLargeMap::Allocation::operator<): Deleted. We don't track
object sizes anymore -- just free space. (The Heap tracks object sizes.)
We use plain old linear search for free space. (See intro.)

* bmalloc/XLargeRange.h:
(bmalloc::XLargeRange::physicalSize):
(bmalloc::XLargeRange::setPhysicalSize):
(bmalloc::merge):
(bmalloc::XLargeRange::split):
(bmalloc::XLargeRange::vmState): Deleted.
(bmalloc::XLargeRange::setVMState): Deleted. See VMState.h.

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

4 years agoReplace $vm.printValue() with $vm.value().
mark.lam@apple.com [Tue, 19 Apr 2016 23:31:25 +0000 (23:31 +0000)]
Replace $vm.printValue() with $vm.value().
https://bugs.webkit.org/show_bug.cgi?id=156767

Reviewed by Saam Barati.

When debugging with $vm, this change allows us to do this:

    $vm.print("myObj = " + $vm.value(myObj) + "\n");

... instead of having to do this:

    $vm.print("myObj = ");
    $vm.printValue(myObj);
    $vm.print("\n");

* tools/JSDollarVMPrototype.cpp:
(JSC::JSDollarVMPrototype::printValue):
(JSC::functionValue):
(JSC::JSDollarVMPrototype::finishCreation):
(JSC::functionPrintValue): Deleted.

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

4 years agoRebase test after r199738
achristensen@apple.com [Tue, 19 Apr 2016 21:51:12 +0000 (21:51 +0000)]
Rebase test after r199738

* fast/canvas/webgl/fragment-shader-assertion-expected.txt:
ANGLE gives us a more descriptive error now.  No big deal.
This test was added to make sure it didn't crash in http://trac.webkit.org/changeset/199340
and it still does not crash.

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

4 years agoBuild fix after r199738
achristensen@apple.com [Tue, 19 Apr 2016 21:45:44 +0000 (21:45 +0000)]
Build fix after r199738

Source/ThirdParty/ANGLE:

* CMakeLists.txt:

Source/WebCore:

* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/win/GraphicsContext3DWin.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):

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

4 years agoObjcInstance::stringValue should not call NSObject's description method
keith_miller@apple.com [Tue, 19 Apr 2016 21:02:15 +0000 (21:02 +0000)]
ObjcInstance::stringValue should not call NSObject's description method
https://bugs.webkit.org/show_bug.cgi?id=156758

Reviewed by Geoffrey Garen.

Source/WebCore:

This patch makes it so that we no longer call NSObject's description method without first
swizzling the implementation for WebScriptObjects. We restore the incomming NSObject's
description method once we have finished generating the string.

Test: platform/mac/fast/objc/webScriptObject-does-not-call-description-on-nsobject.html

* bridge/objc/objc_instance.mm:
(swizzleNSObjectDescription):
(ObjcInstance::stringValue):

Tools:

Add new methods to ObjCController that expose two Types of WebScriptObjects. The first is
an NSObject and the second is an NSArray of NSObjects. These are used to test that we don't
call the NSObjects description method without first swizzling it.

* DumpRenderTree/mac/ObjCController.m:
(+[ObjCController isSelectorExcludedFromWebScript:]):
(+[ObjCController webScriptNameForSelector:]):
(-[ObjCController testArrayOfObjects]):
(-[ObjCController testObject]):

LayoutTests:

Test that we don't use the NSObject's description method when stringifying a WebScriptObject.

* platform/mac/fast/objc/webScriptObject-does-not-call-description-on-nsobject-expected.txt: Added.
* platform/mac/fast/objc/webScriptObject-does-not-call-description-on-nsobject.html: Added.
* platform/wk2/TestExpectations:

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

4 years agoNew SPI to export a dictionary of runtime features
dino@apple.com [Tue, 19 Apr 2016 20:25:36 +0000 (20:25 +0000)]
New SPI to export a dictionary of runtime features
https://bugs.webkit.org/show_bug.cgi?id=156645
<rdar://problem/23621666>

Reviewed by Anders Carlsson.

Mark the new SPI as WK_MAC_TBA, WK_IOS_TBA.

* UIProcess/API/Cocoa/_WKExperimentalFeature.h:

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

4 years agoCrash under WebKit::PluginView::pluginSnapshotTimerFired
cdumez@apple.com [Tue, 19 Apr 2016 20:20:10 +0000 (20:20 +0000)]
Crash under WebKit::PluginView::pluginSnapshotTimerFired
https://bugs.webkit.org/show_bug.cgi?id=156754
<rdar://problem/22566764>

Reviewed by Beth Dakin.

Add null check for frame() before trying to access the frame settings,
similarly to what is done earlier in this function. This fixes a top
crasher.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::pluginSnapshotTimerFired):

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

4 years agoBuild fix.
achristensen@apple.com [Tue, 19 Apr 2016 19:57:14 +0000 (19:57 +0000)]
Build fix.

* src/compiler/translator/Intermediate.h: Added.
(TIntermediate::TIntermediate):
* src/compiler/translator/intermediate.h: Removed.
Changed case of Intermediate.h file name for case sensitive file systems.

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

4 years agoUpdate ANGLE
achristensen@apple.com [Tue, 19 Apr 2016 19:46:21 +0000 (19:46 +0000)]
Update ANGLE
https://bugs.webkit.org/show_bug.cgi?id=156755

Reviewed by Dean Jackson.

Source/ThirdParty/ANGLE:

Huge list of changed files omitted.

Source/WebCore:

* CMakeLists.txt:
* platform/graphics/ANGLEWebKitBridge.h:
(WebCore::ANGLEWebKitBridge::getResources):
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
Continue to compile successfully with new ANGLE.

LayoutTests:

* webgl/1.0.2/conformance/glsl/reserved/webgl_preprocessor_reserved-expected.txt: Removed.
* webgl/1.0.2/conformance/glsl/reserved/webgl_preprocessor_reserved.html: Removed.
Removed invalid test based on https://github.com/KhronosGroup/WebGL/pull/1230

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

4 years agoNew SPI to export a dictionary of runtime features
dino@apple.com [Tue, 19 Apr 2016 19:35:34 +0000 (19:35 +0000)]
New SPI to export a dictionary of runtime features
https://bugs.webkit.org/show_bug.cgi?id=156645
<rdar://problem/23621666>

Post commit follow-up. Darin gave review comments that
I didn't address in my original commit - I was waiting
on some advice.

* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::isEnabledForFeature): Change the macro
to generate a static list of function pointers, rather than
a lot of conditional statements.
(WebKit::WebPreferences::setEnabledForFeature): Ditto.

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

4 years agoimported/w3c/web-platform-tests/streams/readable-streams/general.https.html is a...
youenn.fablet@crf.canon.fr [Tue, 19 Apr 2016 19:06:47 +0000 (19:06 +0000)]
imported/w3c/web-platform-tests/streams/readable-streams/general.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=155760

Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

Flakiness was coming from a callback being called after a timeout.
Timeout was set so that a double promise resolution (promise resolved
in another promise resolution callback) is done before calling the callback.
On some slow bots, the timeout was not big enough.

* web-platform-tests/streams/readable-streams/general.js: Increased the callback delay.

LayoutTests:

* TestExpectations: removed flaky expectation.

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

4 years agoMark more classes as WTF_MAKE_FAST_ALLOCATED
cdumez@apple.com [Tue, 19 Apr 2016 18:39:09 +0000 (18:39 +0000)]
Mark more classes as WTF_MAKE_FAST_ALLOCATED
https://bugs.webkit.org/show_bug.cgi?id=156732

Reviewed by Darin Adler.

Source/WebCore:

* css/CSSImageGeneratorValue.h:
* css/DocumentRuleSets.h:
* css/MediaQueryMatcher.h:
* css/RuleFeature.h:
* css/StyleResolver.h:
* dom/ActiveDOMCallbackMicrotask.h:
* dom/DocumentSharedObjectPool.h:
* dom/MutationObserver.cpp:
* dom/MutationObserverInterestGroup.h:
* dom/MutationObserverRegistration.h:
* dom/ScriptExecutionContext.cpp:
* dom/SlotAssignment.h:
* html/HTMLCollection.h:
* html/canvas/CanvasRenderingContext2D.cpp:
* html/parser/HTMLToken.h:
* html/parser/XSSAuditorDelegate.h:
* loader/FrameLoader.cpp:
* loader/SubframeLoader.h:
* page/AutoscrollController.h:
* page/csp/ContentSecurityPolicySource.h:
* platform/cf/RunLoopObserver.h:
* platform/graphics/FloatQuad.h:
* platform/graphics/FloatRoundedRect.h:
* platform/graphics/IntSize.h:
* platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
* platform/graphics/cg/ImageDecoderCG.h:
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/displaylists/DisplayList.h:
* platform/graphics/mac/ComplexTextController.h:
* platform/graphics/mac/FontCustomPlatformData.h:
* platform/mac/PowerObserverMac.h:
* platform/network/DataURLDecoder.cpp:
* platform/text/PlatformLocale.h:
* rendering/TextAutosizer.h:
* style/StyleUpdate.h:
* xml/XMLHttpRequestUpload.h:

Source/WebKit2:

* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
* Shared/API/Cocoa/RemoteObjectInvocation.h:

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

4 years agoEnable separated heap by default on ios
oliver@apple.com [Tue, 19 Apr 2016 18:34:13 +0000 (18:34 +0000)]
Enable separated heap by default on ios
https://bugs.webkit.org/show_bug.cgi?id=156720

Reviewed by ggaren.

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

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

4 years agoContext menu items related to fullscreen should be specific to standard fullscreen
adachan@apple.com [Tue, 19 Apr 2016 17:58:57 +0000 (17:58 +0000)]
Context menu items related to fullscreen should be specific to standard fullscreen
https://bugs.webkit.org/show_bug.cgi?id=156723
<rdar://problem/25452632>

Reviewed by Darin Adler.

Introduce HTMLMediaElement::isStandardFullscreen() that the HitTestResult code can use
when handling the validation and selection of fullscreen-related context menu items.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isStandardFullscreen):
(WebCore::HTMLMediaElement::toggleStandardFullscreenState):
Renamed to make it clear that it's for toggling standard fullscreen. Call the new
HTMLMediaElement::isStandardFullscreen().
* html/HTMLMediaElement.h:
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::mediaIsInFullscreen):
Use HTMLMediaElement::isStandardFullscreen().
(WebCore::HitTestResult::toggleMediaFullscreenState):
Call the renamed HTMLMediaElement::toggleStandardFullscreenState().

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

4 years agoBuild fix.
achristensen@apple.com [Tue, 19 Apr 2016 17:46:48 +0000 (17:46 +0000)]
Build fix.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob):
result is unused.

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

4 years agoRe-landing: ES6: Implement String.prototype.split and RegExp.prototype[@@split].
mark.lam@apple.com [Tue, 19 Apr 2016 17:25:20 +0000 (17:25 +0000)]
Re-landing: ES6: Implement String.prototype.split and RegExp.prototype[@@split].
https://bugs.webkit.org/show_bug.cgi?id=156013

Reviewed by Keith Miller.

Source/JavaScriptCore:

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/GlobalObject.js:
(speciesConstructor):
* builtins/PromisePrototype.js:
- refactored to use the @speciesConstructor internal function.

* builtins/RegExpPrototype.js:
(advanceStringIndex):
- refactored from @advanceStringIndexUnicode() to be match the spec.
  Benchmarks show that there's no advantage in doing the unicode check outside
  of the advanceStringIndexUnicode part.  So, I simplified the code to match the
  spec (especially since @@split needs to call advanceStringIndex from more than
  1 location).
(match):
- Removed an unnecessary call to @Object because it was already proven above.
- Changed to use advanceStringIndex instead of advanceStringIndexUnicode.
  Again, there's no perf regression for this.
(regExpExec):
(hasObservableSideEffectsForRegExpSplit):
(split):
(advanceStringIndexUnicode): Deleted.

* builtins/StringPrototype.js:
(split):
- Modified to use RegExp.prototype[@@split].

* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
(JSC::BytecodeIntrinsicRegistry::lookup):
* bytecode/BytecodeIntrinsicRegistry.h:
- Added the @@split symbol.

* runtime/CommonIdentifiers.h:
* runtime/ECMAScriptSpecInternalFunctions.cpp: Added.
(JSC::esSpecIsConstructor):
(JSC::esSpecIsRegExp):
* runtime/ECMAScriptSpecInternalFunctions.h: Added.

* runtime/JSGlobalObject.cpp:
(JSC::getGetterById):
(JSC::JSGlobalObject::init):

* runtime/PropertyDescriptor.cpp:
(JSC::PropertyDescriptor::setDescriptor):
- Removed an assert that is no longer valid.

* runtime/RegExpObject.h:
- Made advanceStringUnicode() public so that it can be re-used by the regexp split
  fast path.

* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
(JSC::regExpProtoFuncExec):
(JSC::regExpProtoFuncSearch):
(JSC::advanceStringIndex):
(JSC::regExpProtoFuncSplitFast):
* runtime/RegExpPrototype.h:

* runtime/StringObject.h:
(JSC::jsStringWithReuse):
(JSC::jsSubstring):
- Hoisted some utility functions from StringPrototype.cpp so that they can be
  reused by the regexp split fast path.

* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
(JSC::stringProtoFuncSplitFast):
(JSC::stringProtoFuncSubstr):
(JSC::builtinStringSubstrInternal):
(JSC::stringProtoFuncSubstring):
(JSC::stringIncludesImpl):
(JSC::stringProtoFuncIncludes):
(JSC::builtinStringIncludesInternal):
(JSC::jsStringWithReuse): Deleted.
(JSC::jsSubstring): Deleted.
(JSC::stringProtoFuncSplit): Deleted.
* runtime/StringPrototype.h:

* tests/es6.yaml:

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/dom/string-prototype-properties-expected.txt:

* js/regress/regexp-prototype-split-observable-side-effects-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects2-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects2.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-flags-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-flags.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-global-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-global.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-ignoreCase-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-ignoreCase.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-multiline-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-multiline.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-sticky-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-sticky.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-unicode-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-unicode.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects4-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects4.html: Added.

* js/regress/script-tests/regexp-prototype-split-observable-side-effects.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects2.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-flags.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-global.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-ignoreCase.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-multiline.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-sticky.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-unicode.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects4.js: Added.

* js/regress/script-tests/string-prototype-split-observable-side-effects.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects2.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-flags.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-global.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-ignoreCase.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-multiline.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-sticky.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-unicode.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects4.js: Added.

* js/regress/string-prototype-split-observable-side-effects-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects.html: Added.
* js/regress/string-prototype-split-observable-side-effects2-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects2.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-flags-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-flags.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-global-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-global.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-ignoreCase-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-ignoreCase.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-multiline-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-multiline.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-sticky-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-sticky.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-unicode-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-unicode.html: Added.
* js/regress/string-prototype-split-observable-side-effects4-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects4.html: Added.

* js/script-tests/Object-getOwnPropertyNames.js:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T3-expected.txt:

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

4 years agoModern IDB: ObjectStore Blob Support.
beidson@apple.com [Tue, 19 Apr 2016 16:58:17 +0000 (16:58 +0000)]
Modern IDB: ObjectStore Blob Support.
https://bugs.webkit.org/show_bug.cgi?id=143193

Reviewed by Alex Christensen.

Source/WebCore:

Tests: imported/blink/storage/indexeddb/blob-basics-metadata.html
       imported/blink/storage/indexeddb/blob-delete-objectstore-db.html
       imported/blink/storage/indexeddb/blob-valid-after-deletion.html
       imported/blink/storage/indexeddb/blob-valid-before-commit.html
       imported/blink/storage/indexeddb/empty-blob-file.html
       storage/indexeddb/modern/blob-simple.html

Most of the work has been done already.

Besides a handful of tweaks to that work, all this really does is remove the clause
that prevents blob URLs from going into the database.

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putOrAdd): Only disallow blobs if private browsing is enabled
  (Making that work is already covered by another bug)

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer):

* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):

* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):

* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):

* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::deleteDatabaseFile): Delete all database-related files
  now that we use WAL mode.

Source/WebKit2:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Don't ASSERT that
  this is the first we've heard of this path - The Connection now remembers all extensions.
(WebKit::NetworkConnectionToWebProcess::getBlobDataFileReferenceForPath): Don't take - Just get.

LayoutTests:

Note: The blob-basics-metadata.html test has some failure lines in it because we don't support the
File constructor.

Once support is added, that test will start failing with the correct results, at which point we
can update expectations.

* imported/blink/storage/indexeddb/blob-basics-metadata-expected.txt: Added.
* imported/blink/storage/indexeddb/blob-basics-metadata.html: Added.
* imported/blink/storage/indexeddb/blob-delete-objectstore-db-expected.txt: Added.
* imported/blink/storage/indexeddb/blob-delete-objectstore-db.html: Added.
* imported/blink/storage/indexeddb/blob-valid-after-deletion-expected.txt: Added.
* imported/blink/storage/indexeddb/blob-valid-after-deletion.html: Added.
* imported/blink/storage/indexeddb/blob-valid-before-commit-expected.txt: Added.
* imported/blink/storage/indexeddb/blob-valid-before-commit.html: Added.
* imported/blink/storage/indexeddb/empty-blob-file-expected.txt: Added.
* imported/blink/storage/indexeddb/empty-blob-file.html: Added.
* imported/blink/storage/indexeddb/resources/empty.txt: Added.
* imported/blink/storage/indexeddb/resources/shared.js: Added.
* imported/blink/storage/indexeddb/resources/test-data.html: Added.
* imported/blink/storage/indexeddb/resources/test-data.txt: Added.

* platform/wk2/TestExpectations:

* storage/indexeddb/modern/blob-simple-expected.txt: Added.
* storage/indexeddb/modern/blob-simple.html: Added.
* storage/indexeddb/modern/resources/blob-simple.js: Added.

* storage/indexeddb/noblobs-expected.txt: Removed.
* storage/indexeddb/noblobs-private-expected.txt: Removed.
* storage/indexeddb/noblobs-private.html: Removed.
* storage/indexeddb/noblobs.html: Removed.
* storage/indexeddb/resources/noblobs.js: Removed.

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

4 years agoUnreviewed, rolling out r199726.
commit-queue@webkit.org [Tue, 19 Apr 2016 16:29:54 +0000 (16:29 +0000)]
Unreviewed, rolling out r199726.
https://bugs.webkit.org/show_bug.cgi?id=156748

WebKit tests crash on Windows 32 (Requested by msaboff on
#webkit).

Reverted changeset:

"iTunes crashing JavaScriptCore.dll"
https://bugs.webkit.org/show_bug.cgi?id=156647
http://trac.webkit.org/changeset/199726

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

4 years ago[css-grid] Use the margin box for non-auto minimum sizes
svillar@igalia.com [Tue, 19 Apr 2016 15:48:00 +0000 (15:48 +0000)]
[css-grid] Use the margin box for non-auto minimum sizes
https://bugs.webkit.org/show_bug.cgi?id=156711

Reviewed by Darin Adler.

Source/WebCore:

When computing the min-size of items with non-auto minimum height/width we are incorrectly
returning the size of the border box, and thus incorrectly ignoring the margins of the item.

This is a follow up patch of r199153 were we added the missing border and paddings for
heights. Contrary to that, we were not including margins for both axis.

This CL requires 3 different interrelated changes:
- Add the margins to the min-size returned by minSizeForChild (might require a layout).
- Refactor and extract width computations from logicalHeightForChild(); not totally
mandatory but pretty logical and helpful.
- Use a new update function to isolate the computation of the override width.

Test: fast/css-grid-layout/min-width-margin-box.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeInlineDirectionMargins): Added const to a parameter.
* rendering/RenderBox.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeTrackSizesForDirection): Initialize the sizingOperation.
(WebCore::RenderGrid::computeIntrinsicLogicalWidths): Ditto.
(WebCore::RenderGrid::computeIntrinsicLogicalHeight): Ditto.
(WebCore::RenderGrid::logicalHeightForChild): Renamed from logicalContentHeightForChild as
it no longer returns the content size but the outer size.
(WebCore::RenderGrid::minSizeForChild):
(WebCore::RenderGrid::updateOverrideContainingBlockContentLogicalWidthForChild): Extracted
from logicalHeightForChild().
(WebCore::RenderGrid::minContentForChild): Update override width if needed.
(WebCore::RenderGrid::maxContentForChild): Ditto.
(WebCore::RenderGrid::computeMarginLogicalSizeForChild): Generalized from
computeMarginLogicalHeightForChild(), it can now compute also margins for the inline
direction.
(WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
(WebCore::RenderGrid::logicalContentHeightForChild): Deleted.
(WebCore::RenderGrid::computeMarginLogicalHeightForChild): Deleted.
* rendering/RenderGrid.h:

LayoutTests:

* fast/css-grid-layout/min-height-border-box.html:
* fast/css-grid-layout/min-width-margin-box-expected.txt: Added.
* fast/css-grid-layout/min-width-margin-box.html: Added.

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

4 years ago[Cairo] GraphicsContext::drawFocusRing methods are not consistent to each other
carlosgc@webkit.org [Tue, 19 Apr 2016 15:10:36 +0000 (15:10 +0000)]
[Cairo] GraphicsContext::drawFocusRing methods are not consistent to each other
https://bugs.webkit.org/show_bug.cgi?id=156742

Reviewed by Martin Robinson.

We are rendering the focus ring differently depending on whether a path is used or a vector of rectangles. This
is causing that some reftests fail because they assume we always render the focus ring the same way. For example
fast/images/image-map-outline-in-positioned-container.html, when rendering the test
GraphicsContext::drawFocusRing is called with a path, and when rendering the reference it's called with a vector
of rectangles, producing different results.

* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawFocusRing): When receiving a vector of rectangles, build a Path from the given
rectangles and call drawFocusRing() with the built path to ensure consistency.

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

4 years agoiTunes crashing JavaScriptCore.dll
msaboff@apple.com [Tue, 19 Apr 2016 14:11:19 +0000 (14:11 +0000)]
iTunes crashing JavaScriptCore.dll
https://bugs.webkit.org/show_bug.cgi?id=156647

Reviewed by Saam Barati.

Source/JavaScriptCore:

Given that there there are only 128 FLS indices compared to over a 1000 for TLS, I
eliminated the thread specific m_threadSpecificForThread and instead we look for the
current thread in m_registeredThreads list when we need it.  In most cases there
will only be one thread.

* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::MachineThreads):
(JSC::MachineThreads::~MachineThreads):
(JSC::MachineThreads::addCurrentThread):
(JSC::MachineThreads::machineThreadForCurrentThread):
(JSC::MachineThreads::removeThread):
* heap/MachineStackMarker.h:

Source/WTF:

If a thread was created without using the WTF thread apis and that thread uses
a JavaScript VM and that thread exits with the VM still around, JSC won't know
that the thread has exited.  Currently, we use ThreadSpecificThreadExit() to
clean up any thread specific keys.  Cleaning up these keys is how JSC is
notified of a thread exit.  We only call ThreadSpecificThreadExit() from
wtfThreadEntryPoint() when the thread entry point function returns.
This mechanism was put in place for Windows because we layer the WTF::ThreadSpecific
functionality on top of TLS (Thread Local Storage), but TLS doesn't have
a thread exiting callback the way that pthread_create_key.

The fix is to change from using TLS to using FLS (Fiber Local Storage).  Although
Windows allows multiple fibers per thread, WebKit is not designed to work with a
multiple fibers per thread.  When there is only one fiber per thread, FLS works just
like TLS, but it has the destroy callback.

I restructured the Windows version of WTF::ThreadSpecific to be almost the same
as the pthread version.

* wtf/ThreadSpecific.h:
(WTF::threadSpecificKeyCreate):
(WTF::threadSpecificKeyDelete):
(WTF::threadSpecificSet):
(WTF::threadSpecificGet):
(WTF::ThreadSpecific<T>::ThreadSpecific):
(WTF::ThreadSpecific<T>::~ThreadSpecific):
(WTF::ThreadSpecific<T>::get):
(WTF::ThreadSpecific<T>::set):
(WTF::ThreadSpecific<T>::destroy):
Restructured to use FLS.  Renamed TLS* to FLS*.

* wtf/ThreadSpecificWin.cpp:
(WTF::flsKeyCount):
(WTF::flsKeys):
Renamed from tlsKey*() to flsKey*().

(WTF::destructorsList): Deleted.
(WTF::destructorsMutex): Deleted.
(WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
(WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
(WTF::PlatformThreadSpecificKey::setValue): Deleted.
(WTF::PlatformThreadSpecificKey::value): Deleted.
(WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
(WTF::tlsKeyCount): Deleted.
(WTF::tlsKeys): Deleted.
(WTF::threadSpecificKeyCreate): Deleted.
(WTF::threadSpecificKeyDelete): Deleted.
(WTF::threadSpecificSet): Deleted.
(WTF::threadSpecificGet): Deleted.
(WTF::ThreadSpecificThreadExit): Deleted.

* wtf/ThreadingWin.cpp:
(WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.

LayoutTests:

Disabled fast/workers/dedicated-worker-lifecycle.html as it creates
more workers that we have ThreadSpecific keys.  We need at least one
key per JSC VM we create.  I didn't want to weaken the test for other
platforms.

* platform/win/TestExpectations:

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

4 years ago[INTL] Use @thisNumberValue instead of `instanceof @Number`
utatane.tea@gmail.com [Tue, 19 Apr 2016 13:34:02 +0000 (13:34 +0000)]
[INTL] Use @thisNumberValue instead of `instanceof @Number`
https://bugs.webkit.org/show_bug.cgi?id=156680

Reviewed by Saam Barati.

Source/JavaScriptCore:

Use @thisNumberValue instead of `instanceof @Number`.
`instanceof @Number` is not enough;
For example, given 2 realms, the object created in one realm does not
inherit the Number of another realm.
Another example is that the object which does not inherit Number.

```
var number = new Number(42);
number.__proto__ = null;
```

* builtins/NumberPrototype.js:
(toLocaleString):
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/NumberPrototype.cpp:
(JSC::numberProtoFuncValueOf):
* runtime/NumberPrototype.h:
* tests/stress/number-to-locale-string-should-accept-strange-number-objects.js: Added.
(shouldBe):

LayoutTests:

* js/number-toLocaleString-expected.txt:
* js/script-tests/number-toLocaleString.js:

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

4 years agoUnreviewed, rolling out r199712.
gskachkov@gmail.com [Tue, 19 Apr 2016 13:29:54 +0000 (13:29 +0000)]
Unreviewed, rolling out r199712.
https://bugs.webkit.org/show_bug.cgi?id=156741

It caused a serious regression on 32 bit platform (Requested
by gskachkov on #webkit).

Reverted changeset:

"calling super() a second time in a constructor should throw"
https://bugs.webkit.org/show_bug.cgi?id=151113
http://trac.webkit.org/changeset/199712

Patch by Commit Queue <commit-queue@webkit.org> on 2016-04-19

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

4 years agoTry to fix iOS build.
antti@apple.com [Tue, 19 Apr 2016 13:29:25 +0000 (13:29 +0000)]
Try to fix iOS build.

* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:

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

4 years agoMove FontSelectorClient to a file of its own
antti@apple.com [Tue, 19 Apr 2016 13:03:32 +0000 (13:03 +0000)]
Move FontSelectorClient to a file of its own
https://bugs.webkit.org/show_bug.cgi?id=156738

Reviewed by Carlos Garcia Campos.

So modifying FontSelector does not trigger world rebuild via Document.h.

* WebCore.xcodeproj/project.pbxproj:
* css/CSSFontSelector.cpp:
* dom/Document.h:
* html/canvas/CanvasRenderingContext2D.h:
* platform/graphics/FontSelector.h:
(WebCore::FontSelectorClient::~FontSelectorClient): Deleted.
* platform/graphics/FontSelectorClient.h: Added.
(WebCore::FontSelectorClient::~FontSelectorClient):

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

4 years agoREGRESSION (r199635) Web Inspector: Percentages in Heap Allocations view are too...
commit-queue@webkit.org [Tue, 19 Apr 2016 12:34:33 +0000 (12:34 +0000)]
REGRESSION (r199635) Web Inspector: Percentages in Heap Allocations view are too large
https://bugs.webkit.org/show_bug.cgi?id=156729
<rdar://problem/25796002>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-19
Reviewed by Timothy Hatcher.

* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
Fix callsite that failed to be updated once percentageString
required 0..1 input instead of 0..100.

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

4 years agoUnreviewed GTK+ gardening. Update CSP tests.
carlosgc@webkit.org [Tue, 19 Apr 2016 12:22:58 +0000 (12:22 +0000)]
Unreviewed GTK+ gardening. Update CSP tests.

Rebaseline http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics.html after r197118 and
remove specific expectations of http/tests/security/contentSecurityPolicy/source-list-parsing-10.html.

* platform/gtk/http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics-expected.txt:
* platform/gtk/http/tests/security/contentSecurityPolicy/source-list-parsing-10-expected.txt: Removed.

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

4 years agoUnreviewed GTK+ gardening. Rebaseline fast/events/updateLayoutForHitTest.html after...
carlosgc@webkit.org [Tue, 19 Apr 2016 11:35:09 +0000 (11:35 +0000)]
Unreviewed GTK+ gardening. Rebaseline fast/events/updateLayoutForHitTest.html after r195263.

* platform/gtk/fast/events/updateLayoutForHitTest-expected.txt:

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

4 years agoUnreviewed GTK+ gardening. Rebaseline fast/transforms/bounding-rect-zoom.html after...
carlosgc@webkit.org [Tue, 19 Apr 2016 11:10:12 +0000 (11:10 +0000)]
Unreviewed GTK+ gardening. Rebaseline fast/transforms/bounding-rect-zoom.html after r197450.

* platform/gtk/fast/transforms/bounding-rect-zoom-expected.txt:

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

4 years agoUnreviewed GTK+ gardening. Rebaseline tests after r199659.
carlosgc@webkit.org [Tue, 19 Apr 2016 10:59:28 +0000 (10:59 +0000)]
Unreviewed GTK+ gardening. Rebaseline tests after r199659.

We are now using the theme colors for the menu lists text.

* platform/gtk/fast/forms/basic-selects-expected.txt:
* platform/gtk/fast/forms/disabled-select-change-index-expected.txt:
* platform/gtk/fast/forms/menulist-style-color-expected.txt:
* platform/gtk/fast/forms/select-baseline-expected.txt:
* platform/gtk/fast/forms/select-disabled-appearance-expected.txt:

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

4 years agoUnreviewed GTK+ gardening. Rebaseline tests after r199034.
carlosgc@webkit.org [Tue, 19 Apr 2016 10:32:13 +0000 (10:32 +0000)]
Unreviewed GTK+ gardening. Rebaseline tests after r199034.

* platform/gtk/fast/block/float/016-expected.txt:
* platform/gtk/fast/css/bidi-override-in-anonymous-block-expected.txt:
* platform/gtk/media/video-zoom-controls-expected.txt:
* platform/gtk/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/bugs/bug1055-2-expected.txt:

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

4 years ago[GTK] accessibility/gtk/entry-and-password.html is failing since r194847
jdiggs@igalia.com [Tue, 19 Apr 2016 09:50:26 +0000 (09:50 +0000)]
[GTK] accessibility/gtk/entry-and-password.html is failing since r194847
https://bugs.webkit.org/show_bug.cgi?id=153062

Reviewed by Carlos Garcia Campos.

Source/WebCore:

The changes in r194847 include using WebCore's rendering for the CapsLock indicator.
As a side effect, password inputs gained a TextControlInnerTextElement child from
the Shadow DOM. If we include that child in the accessibility tree, the child will
emit focus and text notifications that suggest the user is no longer in the control.
This can be especially problematic for screen reader users with key echo enabled
when typing in a password input. To fix this, prune TextControlInnerTextElement
children from the accessibility tree for ATK.

No new tests as existing coverage caught this regression. Also modified the
auto-fill-crash.html test whose expectations include the children count for
a text input.

* accessibility/atk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):

LayoutTests:

The auto-fill-crash.html test has expectations which include the children
count for the text input. These expectations were incorrect for ATK where
accessible text inputs lack accessible text children.

* accessibility/auto-fill-crash.html: Modified to take platform into account.
* platform/gtk/TestExpectations: Unskipped entry-and-password.html.
* platform/gtk/accessibility/auto-fill-crash-expected.txt: Added.

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

4 years agoUnreviewed GTK+ gardening. Rebaseline tests after r190840.
carlosgc@webkit.org [Tue, 19 Apr 2016 09:22:53 +0000 (09:22 +0000)]
Unreviewed GTK+ gardening. Rebaseline tests after r190840.

* platform/gtk/fast/html/details-remove-summary-1-and-click-expected.txt:
* platform/gtk/fast/html/details-remove-summary-4-and-click-expected.txt:

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

4 years ago[GTK] Use Generic WorkQueue instead of WorkQueueGLib
utatane.tea@gmail.com [Tue, 19 Apr 2016 09:16:40 +0000 (09:16 +0000)]
[GTK] Use Generic WorkQueue instead of WorkQueueGLib
https://bugs.webkit.org/show_bug.cgi?id=156721

Reviewed by Benjamin Poulain.

WorkQueueGLib includes platform-dependent part only for WorkQueue::dispatchAfter.
However, its code is related to RunLoopGLib rather than WorkQueueGLib.
In this patch, we move the code from WorkQueueGLib to RunLoopGLib, drop WorkQueueGLib
and use WorkQueueGeneric.

* wtf/PlatformGTK.cmake:
* wtf/RunLoop.h:
* wtf/WorkQueue.h:
* wtf/glib/RunLoopGLib.cpp:
(WTF::DispatchAfterContext::DispatchAfterContext):
(WTF::DispatchAfterContext::dispatch):
(WTF::RunLoop::dispatchAfter):
* wtf/glib/WorkQueueGLib.cpp: Removed.
(WTF::WorkQueue::platformInitialize): Deleted.
(WTF::WorkQueue::platformInvalidate): Deleted.
(WTF::WorkQueue::dispatch): Deleted.
(WTF::DispatchAfterContext::DispatchAfterContext): Deleted.
(WTF::DispatchAfterContext::~DispatchAfterContext): Deleted.
(WTF::DispatchAfterContext::dispatch): Deleted.
(WTF::WorkQueue::dispatchAfter): Deleted.

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

4 years agocalling super() a second time in a constructor should throw
gskachkov@gmail.com [Tue, 19 Apr 2016 08:47:44 +0000 (08:47 +0000)]
calling super() a second time in a constructor should throw
https://bugs.webkit.org/show_bug.cgi?id=151113

Reviewed by Saam Barati and Keith Miller.

Source/JavaScriptCore:

Currently, our implementation checks if 'super()' was called in a constructor more
than once and raises a RuntimeError before the second call. According to the spec
we need to raise an error just after the second super() is finished and before
the new 'this' is assigned https://esdiscuss.org/topic/duplicate-super-call-behaviour.
To implement this behavior this patch adds a new op code, op_is_empty, that is used
to check if 'this' is empty.

* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitIsEmpty):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionCallValueNode::emitBytecode):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileIsEmpty):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_is_empty):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_is_empty):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* tests/stress/class-syntax-double-constructor.js: Added.

LayoutTests:

* js/class-syntax-super-expected.txt:
* js/script-tests/class-syntax-super.js:

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

4 years agoUnreviewed, rolling out r199658.
commit-queue@webkit.org [Tue, 19 Apr 2016 07:21:46 +0000 (07:21 +0000)]
Unreviewed, rolling out r199658.
https://bugs.webkit.org/show_bug.cgi?id=156736

It broke all EFL layout tests (Requested by KaL on #webkit).

Reverted changeset:

"[UNIX] Initialize WebKit before the platform initializations"
https://bugs.webkit.org/show_bug.cgi?id=156622
http://trac.webkit.org/changeset/199658

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

4 years ago[JSC] Fix some overhead affecting small codegen
commit-queue@webkit.org [Tue, 19 Apr 2016 06:54:25 +0000 (06:54 +0000)]
[JSC] Fix some overhead affecting small codegen
https://bugs.webkit.org/show_bug.cgi?id=156728

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-04-18
Reviewed by Filip Pizlo.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::AbstractMacroAssembler):
(JSC::AbstractMacroAssembler::random):
cryptographicallyRandomNumber() is very costly.
We only need it in lowering some very particular cases
of non-trusted immediates. No inline cache needs that.

* assembler/LinkBuffer.h:
(JSC::LinkBuffer::link):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::addSlowCase):
Do not copy the JumpList to access its elements.

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

4 years agoBuild fix after r199700
achristensen@apple.com [Tue, 19 Apr 2016 06:33:05 +0000 (06:33 +0000)]
Build fix after r199700

* PlatformMac.cmake:

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

4 years agoModern IDB (Blob support): When reading Blobs from the database, grant the Networking...
beidson@apple.com [Tue, 19 Apr 2016 06:02:04 +0000 (06:02 +0000)]
Modern IDB (Blob support): When reading Blobs from the database, grant the Networking process sandbox access to the files.
https://bugs.webkit.org/show_bug.cgi?id=156640

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No change in behavior, as blobs in IDB are not yet enabled,
              but when they are enabled testing will cover this).

* Modules/indexeddb/shared/IDBResultData.h: Export some stuff

* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): Account for
  BlobRegistry change described below.

* platform/network/BlobRegistry.h: Change registerBlobURLOptionallyFileBacked to take a
  BlobDataFileReference instead of a raw path, to allow WK2 to include a sandbox extension.

* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL): Account for BlobRegistry change described above.
(WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked): Use the passed in
  BlobDataFileHandle, and also register the BlobResourceHandle constructor.
* platform/network/BlobRegistryImpl.h:

Source/WebKit2:

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles): Utility function to ask the UI process for
  SandboxExtensions for a list of files.
(WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles): Take the SandboxExtensions from the UI process
  and pass them along to the completion handler.
* DatabaseProcess/DatabaseProcess.h:
* DatabaseProcess/DatabaseProcess.messages.in:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::didGetRecord): If the value returned from the database doesn't have Blob files,
  pass the result directly on to WebCore. If it does, ask the UI process for SandboxExtensions first.

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked): Grab the BlobDataFileReference from the
  NetworkConnectionToWebProcess to pass along to the BlobRegistry.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Add this message
  so the WebProcess can preflight the creation of some blob URLs by passing along the SandboxExtensions for their files.
(WebKit::NetworkConnectionToWebProcess::takeBlobDataFileReferenceForPath):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:

* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::getSandboxExtensionsForBlobFiles): Create SandboxExtensions for the passed in files and
  return them to the DatabaseProcess.
* UIProcess/Databases/DatabaseProcessProxy.h:
* UIProcess/Databases/DatabaseProcessProxy.messages.in:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): New form of "didGetRecord" that handles passing
  the SandboxExtensions to the Networking process before they are needed.
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
* WebProcess/FileAPI/BlobRegistryProxy.h:

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

4 years agoFix iOS build after r199701
achristensen@apple.com [Tue, 19 Apr 2016 05:08:53 +0000 (05:08 +0000)]
Fix iOS build after r199701

* platform/ios/WebAVPlayerController.mm:

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