WebKit-https.git
3 years agoBackdrop Filter should not be visible if element has visibility:hidden
dino@apple.com [Fri, 22 Apr 2016 01:48:41 +0000 (01:48 +0000)]
Backdrop Filter should not be visible if element has visibility:hidden
https://bugs.webkit.org/show_bug.cgi?id=149318
<rdar://problem/22749780>

Reviewed by Simon Fraser.

Source/WebCore:

Make sure that backdrop filter layers take note of when
the contents are visible or not.

Tests: css3/filters/backdrop/backdrop-with-visibility-hidden-changing.html
       css3/filters/backdrop/backdrop-with-visibility-hidden.html
       css3/filters/backdrop/backdrop-with-visibility-hidden-2.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateContentsVisibility): Tell the backdrop layer about the
change if there is one.
(WebCore::GraphicsLayerCA::updateBackdropFilters): When we update filters, make
sure to check the contents visibility.
(WebCore::dumpInnerLayer): Output "hidden" if the layer is set as such.
* platform/graphics/ca/PlatformCALayer.h: Add an isHidden method.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::isHidden): Call into CALayer isHidden.

Source/WebKit2:

Add the isHidden method to PlatformCALayerRemote.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::isHidden):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

LayoutTests:

Three tests that check if a backdrop filter should be visible when
its owning element is visibility hidden.

* css3/filters/backdrop/backdrop-with-visibility-hidden-changing-expected.txt: Added.
* css3/filters/backdrop/backdrop-with-visibility-hidden-changing.html: Added.
* css3/filters/backdrop/backdrop-with-visibility-hidden-expected.txt: Added.
* css3/filters/backdrop/backdrop-with-visibility-hidden.html: Added.
* css3/filters/backdrop/backdrop-with-visibility-hidden-2.html: Added.
* css3/filters/backdrop/backdrop-with-visibility-hidden-2-expected.html: Added.

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

3 years agoJSC virtual call thunk shouldn't do a structure->classInfo lookup
fpizlo@apple.com [Fri, 22 Apr 2016 01:25:50 +0000 (01:25 +0000)]
JSC virtual call thunk shouldn't do a structure->classInfo lookup
https://bugs.webkit.org/show_bug.cgi?id=156874

Reviewed by Keith Miller.

This lookup was unnecessary because we can just test the inlined type field.

But also, this meant that we were exempting JSBoundFunction from the virtual call optimization.
That's pretty bad.

* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):

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

3 years agoRenderVideo should always update the intrinsic size before layout.
zalan@apple.com [Fri, 22 Apr 2016 01:13:33 +0000 (01:13 +0000)]
RenderVideo should always update the intrinsic size before layout.
https://bugs.webkit.org/show_bug.cgi?id=156878

Reviewed by Simon Fraser.

In order to layout video element properly we need to know the correct intrinsic size.
This patch also asserts if we end up updating the intrinsic size right after finishing video renderer layout.

This issues was discovered as part of webkit.org/b/156245. (hence covered by existing tests)

* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::updateIntrinsicSize):
(WebCore::RenderVideo::layout):
(WebCore::RenderVideo::updatePlayer):
* rendering/RenderVideo.h:

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

3 years agoWKWebView HTML5 AppCache not working
andersca@apple.com [Fri, 22 Apr 2016 01:05:53 +0000 (01:05 +0000)]
WKWebView HTML5 AppCache not working
https://bugs.webkit.org/show_bug.cgi?id=156887
rdar://problem/17944162

Reviewed by Tim Horton.

* Shared/WebPreferencesDefinitions.h:
Set the offlineWebApplicationCacheEnabled property to true by default.

* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultDataStoreConfiguration):
Set the default applicationCacheFlatFileSubdirectoryName to "Files".

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

3 years agoModern IDB (Workers): Get the IDBConnectionProxy from the Document to the WorkerGloba...
beidson@apple.com [Fri, 22 Apr 2016 01:03:39 +0000 (01:03 +0000)]
Modern IDB (Workers): Get the IDBConnectionProxy from the Document to the WorkerGlobalScope.
https://bugs.webkit.org/show_bug.cgi?id=156877

Reviewed by Tim Horton.

Source/WebCore:

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

* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope): This is the point on the main thread
  where we can get the IDBConnectionProxy from the Document and pass it down through Worker
  machinery so it can end up at the WorkerGlobalScope.

Everything else is this patch is just passing it along as needed.

And cleaning up header style for neglected headers.

* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
* workers/DedicatedWorkerGlobalScope.h:

* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/DedicatedWorkerThread.h:
(WebCore::DedicatedWorkerThread::create):
(WebCore::DedicatedWorkerThread::workerObjectProxy):

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

* workers/WorkerThread.cpp:
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::idbConnectionProxy):
* workers/WorkerThread.h:
(WebCore::WorkerThread::threadID):
(WebCore::WorkerThread::runLoop):
(WebCore::WorkerThread::workerLoaderProxy):
(WebCore::WorkerThread::workerReportingProxy):
(WebCore::WorkerThread::getNotificationClient):
(WebCore::WorkerThread::setNotificationClient):
(WebCore::WorkerThread::workerGlobalScope):

LayoutTests:

* storage/indexeddb/modern/workers-enable-expected.txt:

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

3 years agoWeb Inspector: sourceMappingURL not loaded in generated script
commit-queue@webkit.org [Fri, 22 Apr 2016 00:50:09 +0000 (00:50 +0000)]
Web Inspector: sourceMappingURL not loaded in generated script
https://bugs.webkit.org/show_bug.cgi?id=156022
<rdar://problem/25438595>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-21
Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::appendAPIBacktrace):
Synthetic CallFrames for native code will not have script identifiers.

* inspector/ScriptCallFrame.cpp:
(Inspector::ScriptCallFrame::ScriptCallFrame):
(Inspector::ScriptCallFrame::isEqual):
(Inspector::ScriptCallFrame::buildInspectorObject):
* inspector/ScriptCallFrame.h:
* inspector/protocol/Console.json:
Include the script identifier in ScriptCallFrame so we can correlate this
to the exactly script, even if there isn't a URL. The Script may have a
sourceURL, so the Web Inspector frontend may decide to show / link to it.

* inspector/ScriptCallStackFactory.cpp:
(Inspector::CreateScriptCallStackFunctor::operator()):
(Inspector::createScriptCallStackFromException):
Include SourceID when we have it.

* interpreter/Interpreter.cpp:
(JSC::GetStackTraceFunctor::operator()):
* interpreter/Interpreter.h:
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::sourceID):
* interpreter/StackVisitor.h:
Access the SourceID when we have it.

Source/WebInspectorUI:

* UserInterface/Controllers/SourceMapManager.js:
(WebInspector.SourceMapManager.prototype.downloadSourceMap):
If the sourceMapURL is a dataURL at this point, we can just pass it on,
otherwise we would have returned and skipped it.

* UserInterface/Models/CallFrame.js:
(WebInspector.CallFrame.fromPayload):
Add handling for "scriptId" if it is available in the Console.CallFrame.
Don't automatically mark CallFrames that didn't have a "url" as native,
instead try to get a SourceCode.

* UserInterface/Models/Script.js:
(WebInspector.Script.prototype.get displayURL):
Used by SourceCodeLocation formatting, so behave more like Resources
when we have only have a sourceURL name. This produces output like:
"foo.js:#:#" instead of "foo.js (line #:#)"

(WebInspector.Script.prototype.get anonymous):
Easy accessor to see if this would be treated as anonymous or not.

* UserInterface/Models/SourceMap.js:
(WebInspector.SourceMap.prototype.get sourceMappingBasePathURLComponents):
Gracefully handle no path.

* UserInterface/Models/StackTrace.js:
(WebInspector.StackTrace.prototype.get firstNonNativeCallFrame):
(WebInspector.StackTrace.prototype.get firstNonNativeNonAnonymousCallFrame):
* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._appendLocationLink):
Now that "Eval Code" with a sourceURL is no longer native, we still don't
want to show it in the Web Inspector if it is anonymous. So include a stricter
version that skips native and anonymous call frames.

LayoutTests:

* inspector/console/messageAdded-from-named-evaluations-expected.txt: Added.
* inspector/console/messageAdded-from-named-evaluations.html: Added.
* inspector/debugger/js-stacktrace-expected.txt:
* inspector/model/stack-trace-expected.txt:

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

3 years agoFix crashes when loading SVG images.
andersca@apple.com [Fri, 22 Apr 2016 00:33:32 +0000 (00:33 +0000)]
Fix crashes when loading SVG images.

* loader/EmptyClients.cpp:
(WebCore::fillWithEmptyClients):
Give the SVG page its own application cache storage.

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

3 years agoFix the iOS build: WAKView may not respond to drawLayer:inContext:
timothy_horton@apple.com [Fri, 22 Apr 2016 00:27:25 +0000 (00:27 +0000)]
Fix the iOS build: WAKView may not respond to drawLayer:inContext:
https://bugs.webkit.org/show_bug.cgi?id=156879
<rdar://problem/25772661>

Reviewed by Beth Dakin.

* WebView/WebHTMLView.mm:
WebHTMLView on iOS never uses drawLayer:inContext:, and WAKView
doesn't implement it, so this would have thrown an exception
if called, anyway. Fix the build with stricter CA protocols.

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

3 years agoGet rid of ApplicationCacheStorage::singleton
andersca@apple.com [Fri, 22 Apr 2016 00:18:48 +0000 (00:18 +0000)]
Get rid of ApplicationCacheStorage::singleton
https://bugs.webkit.org/show_bug.cgi?id=156882

Reviewed by Tim Horton.

* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::setCacheDirectory): Deleted.
(WebCore::ApplicationCacheStorage::singleton): Deleted.
* loader/appcache/ApplicationCacheStorage.h:
* page/Page.cpp:
(WebCore::Page::Page):

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

3 years agoLets do less locking of symbol tables in the BytecodeGenerator where we don't have...
sbarati@apple.com [Fri, 22 Apr 2016 00:09:36 +0000 (00:09 +0000)]
Lets do less locking of symbol tables in the BytecodeGenerator where we don't have race conditions
https://bugs.webkit.org/show_bug.cgi?id=156821

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

The BytecodeGenerator allocates all the SymbolTables that it uses.
This is before any concurrent compiler thread can use that SymbolTable.
This means we don't actually need to lock for any operations of the
SymbolTable. This patch makes this change by removing all locking.
To do this, I've introduced a new constructor for ConcurrentJITLocker
which implies no locking is necessary. You instantiate such a ConcurrentJITLocker like so:
`ConcurrentJITLocker locker(ConcurrentJITLocker::NoLockingNecessary);`

This patch also removes all uses of Strong<SymbolTable> from the bytecode
generator and instead wraps bytecode generation in a DeferGC.

* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::initializeDefaultParameterValuesAndSetupFunctionScopeStack):
(JSC::BytecodeGenerator::initializeArrowFunctionContextScopeIfNeeded):
(JSC::BytecodeGenerator::instantiateLexicalVariables):
(JSC::BytecodeGenerator::emitPrefillStackTDZVariables):
(JSC::BytecodeGenerator::pushLexicalScopeInternal):
(JSC::BytecodeGenerator::initializeBlockScopedFunctions):
(JSC::BytecodeGenerator::hoistSloppyModeFunctionIfNecessary):
(JSC::BytecodeGenerator::popLexicalScopeInternal):
(JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
(JSC::BytecodeGenerator::variable):
(JSC::BytecodeGenerator::createVariable):
(JSC::BytecodeGenerator::emitResolveScope):
(JSC::BytecodeGenerator::emitPushWithScope):
(JSC::BytecodeGenerator::emitPushFunctionNameScope):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::constructorKind):
(JSC::BytecodeGenerator::superBinding):
(JSC::BytecodeGenerator::generate):
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
* runtime/ConcurrentJITLock.h:
(JSC::ConcurrentJITLockerBase::ConcurrentJITLockerBase):
(JSC::ConcurrentJITLockerBase::~ConcurrentJITLockerBase):
(JSC::ConcurrentJITLocker::ConcurrentJITLocker):

Source/WTF:

This patch introduces a new constructor for Locker which implies no
locking is necessary. You instantiate such a locker like so:
`Locker<Lock> locker(Locker<Lock>::NoLockingNecessary);`

This is useful to for very specific places when it is not yet
required to engage in a specified locking protocol. As an example,
we use this in JSC when we allocate a particular object that
engages in a locking protocol with the concurrent compiler thread,
but before a concurrent compiler thread that could have access
to the object exists.

* wtf/Locker.h:
(WTF::Locker::Locker):
(WTF::Locker::~Locker):

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

3 years agoASSERTION FAILED: accumulation == TransformState::FlattenTransform in WebCore::Graphi...
simon.fraser@apple.com [Fri, 22 Apr 2016 00:08:28 +0000 (00:08 +0000)]
ASSERTION FAILED: accumulation == TransformState::FlattenTransform in WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect
https://bugs.webkit.org/show_bug.cgi?id=155362

Reviewed by Zalan Bujtas.

Source/WebCore:

A particular configuration of composited RenderLayers with preserve-3d and clipping
caused assertions because an ancestor clipping layer had masksToBounds() set, but
a preserves3D() parent, triggering an assertion in GraphicsLayerCA::computeVisibleAndCoverageRect().
Make two changes to address this:

First, CSS clip: and clip-path: should force flattening and override preserve-3d in
the RenderStyle.

Second, don't accumulate transforms in GraphicsLayerCA through layers with masksToBounds().

Tests: compositing/clipping/preserve3d-flatten-assertion-nested.html
       compositing/clipping/preserve3d-flatten-assertion.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::accumulatesTransform):

LayoutTests:

Test cases that should not assert in debug builds.

* compositing/clipping/preserve3d-flatten-assertion-nested.html: Added.
* compositing/clipping/preserve3d-flatten-assertion.html: Added.

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

3 years ago[WK1] Add WebPlaybackSession support to WebKit
jer.noble@apple.com [Thu, 21 Apr 2016 23:56:03 +0000 (23:56 +0000)]
[WK1] Add WebPlaybackSession support to WebKit
https://bugs.webkit.org/show_bug.cgi?id=156854

Reviewed by Beth Dakin.

Add support for WebPlaybackSession and the ChromeClient methods setUpPlaybackControlsManager() and
clearPlaybackControlsManager() to WebKit.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::setUpPlaybackControlsManager):
(WebChromeClient::clearPlaybackControlsManager):
* WebView/WebView.mm:
(-[WebView _hasActiveVideoForControlsInterface]):
(-[WebView _setUpPlaybackControlsManagerForMediaElement:]):
(-[WebView _clearPlaybackControlsManagerForMediaElement:]):
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
* WebView/WebViewInternal.h:

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

3 years agoRemove some unnecessary RefPtrs in the parser
sbarati@apple.com [Thu, 21 Apr 2016 23:30:36 +0000 (23:30 +0000)]
Remove some unnecessary RefPtrs in the parser
https://bugs.webkit.org/show_bug.cgi?id=156865

Reviewed by Filip Pizlo.

The IdentifierArena or the SourceProviderCacheItem will own these UniquedStringImpls
while we are using them. There is no need for us to reference count them.

This might be a 0.5% speedup on octane code-load.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
* parser/Parser.h:
(JSC::Scope::setIsLexicalScope):
(JSC::Scope::isLexicalScope):
(JSC::Scope::closedVariableCandidates):
(JSC::Scope::declaredVariables):
(JSC::Scope::lexicalVariables):
(JSC::Scope::finalizeLexicalEnvironment):
(JSC::Scope::computeLexicallyCapturedVariablesAndPurgeCandidates):
(JSC::Scope::collectFreeVariables):
(JSC::Scope::getCapturedVars):
(JSC::Scope::setStrictMode):
(JSC::Scope::isValidStrictMode):
(JSC::Scope::shadowsArguments):
(JSC::Scope::copyCapturedVariablesToVector):
* parser/SourceProviderCacheItem.h:
(JSC::SourceProviderCacheItem::usedVariables):
(JSC::SourceProviderCacheItem::~SourceProviderCacheItem):
(JSC::SourceProviderCacheItem::create):
(JSC::SourceProviderCacheItem::SourceProviderCacheItem):
(JSC::SourceProviderCacheItem::writtenVariables): Deleted.

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

3 years agoElement::idForStyleResolution() is a foot-gun
cdumez@apple.com [Thu, 21 Apr 2016 23:28:48 +0000 (23:28 +0000)]
Element::idForStyleResolution() is a foot-gun
https://bugs.webkit.org/show_bug.cgi?id=156852

Reviewed by Darin Adler.

Element::idForStyleResolution() is a foot-gun. It requires the caller to check
Element::hasID() first or it may end up crashing when dereferencing elementData()
(e.g. see Bug 156806).

This patch updates Element::idForStyleResolution() to return nullAtom is the
Element does not have an ID. I did not see a performance impact on Speedometer,
Dromaeo DOM Core, Dromaeo CSS Selectors and our local performanceTests/.

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorFilter.cpp:
(WebCore::collectElementIdentifierHashes):
* dom/Element.h:
(WebCore::Element::idForStyleResolution):
* rendering/RenderBlockFlow.cpp:
(WebCore::needsAppleMailPaginationQuirk):
* rendering/RenderTreeAsText.cpp:
(WebCore::writeRenderRegionList):
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement):

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

3 years agoModern IDB (Workers): Move IDBConnectionProxy into IDBRequest and IDBDatabase.
beidson@apple.com [Thu, 21 Apr 2016 23:25:10 +0000 (23:25 +0000)]
Modern IDB (Workers): Move IDBConnectionProxy into IDBRequest and IDBDatabase.
https://bugs.webkit.org/show_bug.cgi?id=156868

Reviewed by Tim Horton.

No new tests (No behavior change).

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::create):
(WebCore::IDBDatabase::IDBDatabase):
(WebCore::IDBDatabase::~IDBDatabase):
(WebCore::IDBDatabase::transaction):
(WebCore::IDBDatabase::maybeCloseInServer):
* Modules/indexeddb/IDBDatabase.h:
(WebCore::IDBDatabase::connectionProxy):
(WebCore::IDBDatabase::serverConnection):

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

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

* Modules/indexeddb/IDBTransaction.h:

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

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

3 years agoGet rid of the last uses of ApplicationCacheStorage::singleton() from WebKit2
andersca@apple.com [Thu, 21 Apr 2016 23:06:41 +0000 (23:06 +0000)]
Get rid of the last uses of ApplicationCacheStorage::singleton() from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=156876

Reviewed by Tim Horton.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
Add and encode and decode a applicationCacheFlatFileSubdirectoryName.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
Set m_applicationCacheFlatFileSubdirectoryName to "ApplicationCache".

(API::ProcessPoolConfiguration::ProcessPoolConfiguration):
Set m_applicationCacheFlatFileSubdirectoryName to "Files".

(API::ProcessPoolConfiguration::copy):
Copy m_applicationCacheFlatFileSubdirectoryName.

* UIProcess/API/APIProcessPoolConfiguration.h:
Add getter for applicationCacheFlatFileSubdirectoryName.

* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
Initialize applicationCacheFlatFileSubdirectoryName from the process pool configuration.

(WebKit::WebProcessPool::createNewWebProcess):
Initialize parameters.applicationCacheFlatFileSubdirectoryName. Remove a call to
ApplicationCacheStorage::singleton().setDefaultOriginQuota since it had no effect (it was called in the UI process).

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
Initialize m_applicationCacheFlatFileSubdirectoryName.

(WebKit::WebsiteDataStore::fetchData):
(WebKit::WebsiteDataStore::removeData):
Pass m_applicationCacheFlatFileSubdirectoryName when creating the application cache storage.

* UIProcess/WebsiteData/WebsiteDataStore.h:
Add new members.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Set the application cache storage.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
Initialize the application cache storage.

* WebProcess/WebProcess.h:
(WebKit::WebProcess::applicationCacheStorage):
Add new getter.

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

3 years agoAdd a missing space, as noticed by Darin.
andersca@apple.com [Thu, 21 Apr 2016 23:03:27 +0000 (23:03 +0000)]
Add a missing space, as noticed by Darin.

* WebApplicationCache.cpp:
(applicationCachePath):

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

3 years ago[iOS] DumpRenderTree crashed in com.apple.WebCore: WebCore::ResourceLoadNotifier...
jiewen_tan@apple.com [Thu, 21 Apr 2016 22:50:50 +0000 (22:50 +0000)]
[iOS] DumpRenderTree crashed in com.apple.WebCore: WebCore::ResourceLoadNotifier::didFailToLoad
https://bugs.webkit.org/show_bug.cgi?id=156829
<rdar://problem/23348217>

Reviewed by Daniel Bates.

Source/WebCore:

Ensure that the frame associated with the ResourceLoadNotifier is kept alive when notifying the Web Inspector.

Covered by existing tests.

* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::didFailToLoad):
(WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
(WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
(WebCore::ResourceLoadNotifier::dispatchDidReceiveData):
(WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
(WebCore::ResourceLoadNotifier::dispatchDidFailLoading):

LayoutTests:

Unmark imported/blink/http/tests/css/remove-placeholder-styles.html as flaky because of bug fix.

* platform/ios-simulator-wk1/TestExpectations:

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

3 years agoRemove two uses of ApplicationCacheStorage::singleton() from WebKit2
andersca@apple.com [Thu, 21 Apr 2016 22:24:36 +0000 (22:24 +0000)]
Remove two uses of ApplicationCacheStorage::singleton() from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=156873

Reviewed by Beth Dakin.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::clearApplicationCache): Deleted.
* WebProcess/WebProcess.h:

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

3 years agoWeb Inspector: Debugger statement gets a space after it when pretty printed
commit-queue@webkit.org [Thu, 21 Apr 2016 22:24:17 +0000 (22:24 +0000)]
Web Inspector: Debugger statement gets a space after it when pretty printed
https://bugs.webkit.org/show_bug.cgi?id=156867
<rdar://problem/25862308>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-21
Reviewed by Geoffrey Garen.

Source/WebInspectorUI:

* Tools/Formatting/index.html:
* UserInterface/Workers/Formatter/EsprimaFormatter.js:
(EsprimaFormatter.prototype._handleTokenAtNode):
Handle the unhandled DebuggerStatement node type.

LayoutTests:

* inspector/formatting/formatting-javascript-expected.txt:
* inspector/formatting/formatting-javascript.html:
* inspector/formatting/resources/javascript-tests/other-statements-expected.js: Renamed from LayoutTests/inspector/formatting/resources/javascript-tests/throw-statement-expected.js.
* inspector/formatting/resources/javascript-tests/other-statements.js: Renamed from LayoutTests/inspector/formatting/resources/javascript-tests/throw-statement.js.

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

3 years agoPolymorphicAccess adds sizeof(CallerFrameAndPC) rather than subtracting it when calcu...
fpizlo@apple.com [Thu, 21 Apr 2016 22:11:38 +0000 (22:11 +0000)]
PolymorphicAccess adds sizeof(CallerFrameAndPC) rather than subtracting it when calculating stack height
https://bugs.webkit.org/show_bug.cgi?id=156872

Reviewed by Geoffrey Garen.

The code that added sizeof(CallerFrameAndPC) emerged from a bad copy-paste in r189586. That was
the revision that created the PolymorphicAccess class. It moved code for generating a
getter/setter call from Repatch.cpp to PolymorphicAccess.cpp. You can see the code doing a
subtraction here:

    http://trac.webkit.org/changeset/189586/trunk/Source/JavaScriptCore/jit/Repatch.cpp

This makes the world right again.

* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::generateImpl):

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

3 years agoStop using ApplicationCacheStorage::singleton() on Windows
andersca@apple.com [Thu, 21 Apr 2016 21:16:54 +0000 (21:16 +0000)]
Stop using ApplicationCacheStorage::singleton() on Windows
https://bugs.webkit.org/show_bug.cgi?id=156861

Reviewed by Darin Adler.

* WebApplicationCache.cpp:
(applicationCachePath):
(WebApplicationCache::storage):
* WebApplicationCache.h:
* WebCache.cpp:
(WebCache::empty):
* WebView.cpp:
(WebView::initWithFrame):
(WebKitSetApplicationCachePathIfNecessary): Deleted.

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

3 years agoModern IDB (Workers): More IDBConnectionProxy refactoring.
beidson@apple.com [Thu, 21 Apr 2016 21:08:20 +0000 (21:08 +0000)]
Modern IDB (Workers): More IDBConnectionProxy refactoring.
https://bugs.webkit.org/show_bug.cgi?id=156855

Reviewed by Darin Adler.

Source/WebCore:

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

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

Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::create):
(WebCore::IDBFactory::IDBFactory):
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/IDBFactory.h:

Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
(WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
(WebCore::WorkerGlobalScopeIndexedDatabase::from):
(WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:

Make IDBConnectionProxy ThreadSafeRefCounted:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::create):
* Modules/indexeddb/client/IDBConnectionProxy.h:

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

LayoutTests:

* storage/indexeddb/modern/workers-enable-expected.txt: Revert some of the PASS expectations to FAIL, just for now.

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

3 years agoWebScriptObject description swizzler should work in a multi-threaded world
keith_miller@apple.com [Thu, 21 Apr 2016 21:00:02 +0000 (21:00 +0000)]
WebScriptObject description swizzler should work in a multi-threaded world
https://bugs.webkit.org/show_bug.cgi?id=156808

Source/WebCore:

Reviewed by Geoffrey Garen.

A WebKit legacy API user might be running Objective-C code on another thread.
Since we don't want to corrupt other thread's NSObject description method
we use TLS to record if we are in the stringValue function. As an attempt to
preserve any user swizzling we update the non-stringValue NSObject description
method on each call to stringValue if it has changed. Additionally, the TLS
needs to be a int because the user might call into stringValue, back into JS,
then back into stringValue. If the TLS was a boolean then it would be unset
at that point so when we return into the first stringValue call we would call
the original NSObject description method rather than our override.

Test added to API tests: WebKit1.WebScriptObjectDescription

* bridge/objc/objc_instance.mm:
(-[NSObject _web_description]):
(ObjcInstance::stringValue):
(swizzleNSObjectDescription): Deleted.

Tools:

Add a test for our NSObject swizzling TLS implementation. The test runs on
two threads. One in JS and another in Objective-C. We expect the JS thread
to use our NSObject description override and the Objective-C thread to act
as though it was using the original NSObject description method.

Reviewed by Geoffrey Garen.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/WebScriptObjectDescription.html: Added.
* TestWebKitAPI/Tests/mac/WebScriptObjectDescription.mm: Added.
(nsObjectDescriptionTest):
(-[WebScriptDescriptionTest webView:didFinishLoadForFrame:]):
(TestWebKitAPI::TEST):

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

3 years agoBuild warning: CODE_SIGN_ENTITLEMENTS specified without specifying CODE_SIGN_IDENTITY
ggaren@apple.com [Thu, 21 Apr 2016 20:23:28 +0000 (20:23 +0000)]
Build warning: CODE_SIGN_ENTITLEMENTS specified without specifying CODE_SIGN_IDENTITY
https://bugs.webkit.org/show_bug.cgi?id=156862

Reviewed by Joseph Pecoraro.

* Configurations/Base.xcconfig: Specify the ad hoc signing identity by
default. See <http://trac.webkit.org/changeset/143544>.

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

3 years agoBuild fix.
bdakin@apple.com [Thu, 21 Apr 2016 20:21:03 +0000 (20:21 +0000)]
Build fix.

* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceMac::invalidate):

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

3 years ago32 bit build fix.
bdakin@apple.com [Thu, 21 Apr 2016 20:18:28 +0000 (20:18 +0000)]
32 bit build fix.

* platform/mac/WebPlaybackSessionInterfaceMac.mm:

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

3 years agoFixed compilation with !ENABLE(SVG_FONTS).
commit-queue@webkit.org [Thu, 21 Apr 2016 20:07:40 +0000 (20:07 +0000)]
Fixed compilation with !ENABLE(SVG_FONTS).
https://bugs.webkit.org/show_bug.cgi?id=156850

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-04-21
Reviewed by Michael Catanzaro.

No new tests needed.

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::CSSFontFaceSource):
Added missing ENABLE(SVG_FONTS) guards.
* css/CSSFontFaceSource.h: Ditto.
* platform/graphics/FontCascade.cpp: Ditto.
* svg/SVGToOTFFontConversion.cpp:
(WebCore::FontCascade::drawGlyphBuffer): Deleted extraneous
!ENABLE(SVG_FONTS) guard.

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

3 years agoStop using ApplicationCacheStorage::singleton() in WebKitLegacy
andersca@apple.com [Thu, 21 Apr 2016 20:05:56 +0000 (20:05 +0000)]
Stop using ApplicationCacheStorage::singleton() in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=156859

Reviewed by Tim Horton.

* WebCoreSupport/WebApplicationCache.mm:
(+[WebApplicationCache initializeWithBundleIdentifier:]):
Change this to just store the bundle identifier.

(applicationCacheBundleIdentifier):
Helper function that returns the bundle identifier for the app cache.

(applicationCachePath):
Return the application cache path.

(webApplicationCacheStorage):
Create a new ApplicationCacheStorage object.

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
Set pageConfiguration.applicationCacheStorage to webApplicationCacheStorage().

(WebKitInitializeApplicationCachePathIfNecessary): Deleted.

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

3 years agoshowCandidates() should take a range and the string should be the whole
bdakin@apple.com [Thu, 21 Apr 2016 19:37:30 +0000 (19:37 +0000)]
showCandidates() should take a range and the string should be the whole
paragraph
https://bugs.webkit.org/show_bug.cgi?id=156813
-and corresponding-
rdar://problem/25760533

Reviewed by Tim Horton.

Source/WebKit/mac:

Cache the range and the paragraph since we compute them in
requestCandidatesForSelection, and then we can use them again in
handleRequestedCandidates.
* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::requestCandidatesForSelection):
(WebEditorClient::handleRequestedCandidates):
* WebView/WebView.mm:
(-[WebView updateWebViewAdditions]):
(-[WebView showCandidates:forString:inRect:forSelectedRange:view:completionHandler:]):
(-[WebView showCandidates:forString:inRect:view:completionHandler:]): Deleted.
* WebView/WebViewInternal.h:

Source/WebKit2:

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateWebViewImplAdditions):
(WebKit::WebViewImpl::showCandidates):
(WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
(WebKit::WebViewImpl::handleRequestedCandidates):

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

3 years agoRemove reliance on WebAVMediaSelectionOptionMac for the
bdakin@apple.com [Thu, 21 Apr 2016 19:36:36 +0000 (19:36 +0000)]
Remove reliance on WebAVMediaSelectionOptionMac for the
WebPlaybackControlsManager
https://bugs.webkit.org/show_bug.cgi?id=156811
-and corresponding-
rdar://problem/25760523

Reviewed by Jer Noble.

* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(-[WebPlaybackControlsManager setSeekableTimeRanges:]):
(-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
(-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
(WebCore::WebPlaybackSessionInterfaceMac::~WebPlaybackSessionInterfaceMac):
(WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
(WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceMac::invalidate):
(-[WebAVMediaSelectionOptionMac localizedDisplayName]): Deleted.
(-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]): Deleted.
(-[WebPlaybackControlsManager isSeeking]): Deleted.
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): Deleted.
(-[WebPlaybackControlsManager audioMediaSelectionOptions]): Deleted.
(-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]): Deleted.
(-[WebPlaybackControlsManager currentAudioMediaSelectionOption]): Deleted.
(-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]): Deleted.
(-[WebPlaybackControlsManager legibleMediaSelectionOptions]): Deleted.
(-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]): Deleted.
(-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]): Deleted.
(-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]): Deleted.
(-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]): Deleted.
(WebCore::mediaSelectionOptions): Deleted.

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

3 years agoSkip <area ping> tests on ios-simulator
ryanhaddad@apple.com [Thu, 21 Apr 2016 19:03:23 +0000 (19:03 +0000)]
Skip <area ping> tests on ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=156857

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

3 years ago[Fetch API] Improve some fetch response streams tests
youenn.fablet@crf.canon.fr [Thu, 21 Apr 2016 18:11:28 +0000 (18:11 +0000)]
[Fetch API] Improve some fetch response streams tests
https://bugs.webkit.org/show_bug.cgi?id=156848

Reviewed by Darin Adler.

Most important changes are for response-stream-disturbed-2.html and response-stream-disturbed-5.html which were broken.
response-stream-disturbed-2.html was calling an undefined function and was expecting to get a resolved promise while it should be rejected.
response-stream-disturbed-5.html was expecting to have a null body if data is consumed.
After rereading the spec, this test is non conformant, as the body should not be null, but getting the reader should throw.

* web-platform-tests/fetch/api/resources/utils.js: Adding delay helper function.
* web-platform-tests/fetch/api/response/response-cancel-stream.html: Using delay function.
* web-platform-tests/fetch/api/response/response-stream-disturbed-1.html: Removing unused function.
* web-platform-tests/fetch/api/response/response-stream-disturbed-2-expected.txt: Rebasing
* web-platform-tests/fetch/api/response/response-stream-disturbed-2.html: Fixing test.
* web-platform-tests/fetch/api/response/response-stream-disturbed-5-expected.txt: Rebasing
* web-platform-tests/fetch/api/response/response-stream-disturbed-5.html: Fixing test.

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

3 years agoLayoutTest http/tests/media/hls/video-controls-live-stream.html is sometimes flaky
eric.carlson@apple.com [Thu, 21 Apr 2016 18:11:17 +0000 (18:11 +0000)]
LayoutTest http/tests/media/hls/video-controls-live-stream.html is sometimes flaky
https://bugs.webkit.org/show_bug.cgi?id=156851
<rdar://problem/25792102>

Reviewed by Daniel Bates.

* http/tests/media/hls/video-controls-live-stream.html: Only listen for events once because
  we don't care if they fire more often.

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

3 years ago[iOS] Allow clients to hide the accessory view on a form input session
commit-queue@webkit.org [Thu, 21 Apr 2016 18:10:34 +0000 (18:10 +0000)]
[iOS] Allow clients to hide the accessory view on a form input session
https://bugs.webkit.org/show_bug.cgi?id=155574

Patch by Chelsea Pugh <cpugh@apple.com> on 2016-04-21
Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession accessoryViewShouldNotShow]): Getter for accessoryViewShouldNotShow.
(-[WKFormInputSession setAccessoryViewShouldNotShow:]): Set accessoryViewShouldNotShow and reload input views.
(-[WKContentView requiresAccessoryView]): If the accessory view should be not be shown, do not require
the accessory view.

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

3 years agoAdd tests for <area ping>
dbates@webkit.org [Thu, 21 Apr 2016 18:03:38 +0000 (18:03 +0000)]
Add tests for <area ping>
https://bugs.webkit.org/show_bug.cgi?id=79438
<rdar://problem/22586699>

Reviewed by Alexey Proskuryakov.

* http/tests/navigation/ping-attribute/anchor-cookie.html: Extracted out code into functions setCookie(),
clearLastPingResultAndRunTest() and clickElement() (defined in utilities.js) so that they can be
used by this test and others. Also added HTML5 doctype declaration since it is unnecessary to run
this test in quirks mode.
* http/tests/navigation/ping-attribute/area-cookie-expected.txt: Added.
* http/tests/navigation/ping-attribute/area-cookie.html: Added.
* http/tests/navigation/ping-attribute/area-cross-origin-expected.txt: Added.
* http/tests/navigation/ping-attribute/area-cross-origin-from-https-expected.txt: Added.
* http/tests/navigation/ping-attribute/area-cross-origin-from-https.html: Added.
* http/tests/navigation/ping-attribute/area-cross-origin.html: Added.
* http/tests/navigation/ping-attribute/area-same-origin-expected.txt: Added.
* http/tests/navigation/ping-attribute/area-same-origin.html: Added.
* http/tests/navigation/ping-attribute/resources/utilities.js: Added.
(setCookie):
(clearLastPingResultAndRunTest.done):
(clearLastPingResultAndRunTest):
(clickElement):

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

3 years agoREGRESSION(198782): ImageSource::subsamplingLevelForScale() does not cache the Maximu...
commit-queue@webkit.org [Thu, 21 Apr 2016 17:02:57 +0000 (17:02 +0000)]
REGRESSION(198782): ImageSource::subsamplingLevelForScale() does not cache the MaximumSubsamplingLevel for this ImageSource
https://bugs.webkit.org/show_bug.cgi?id=156766

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-04-21
Reviewed by Darin Adler.

Ensure the MaximumSubsamplingLevel for the ImageSource is calculated
only once and is cached for subsequent uses.

The image subsampling is on by default only for iOS. So the and this
patch currently affects the iOS port.

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::cacheMetadata): Cache m_maximumSubsamplingLevel.
Use m_frameCount as a flag for having_the_cache_done.
(WebCore::ImageSource::subsamplingLevelForScale): Call cacheMetadata()
before using m_maximumSubsamplingLevel.
(WebCore::ImageSource::frameCount): Call cacheMetadata() before returning
m_frameCount.
* platform/graphics/ImageSource.h:

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

3 years agoREGRESSION (r199734): WebKit crashes loading numerous websites in iOS Simulator
aestes@apple.com [Thu, 21 Apr 2016 16:44:50 +0000 (16:44 +0000)]
REGRESSION (r199734): WebKit crashes loading numerous websites in iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=156842

Reviewed by Daniel Bates.

Disable separated heap on iOS Simulator.

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

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

3 years agoCreating a large number of WebGL contexts should recycle older contexts
commit-queue@webkit.org [Thu, 21 Apr 2016 16:38:16 +0000 (16:38 +0000)]
Creating a large number of WebGL contexts should recycle older contexts
https://bugs.webkit.org/show_bug.cgi?id=156689
<rdar://problem/19535330>

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

Source/WebCore:

We used to stop creating WebGL contexts once a maximum of 64 WebGL contexts had been
created on a page. Other browsers have a limit of 16 concurrent active WebGL contexts
and they lose older contexts when the developer creates a new context, logging a warning
to the console. We now follow the same approach.

Tests: webgl/max-active-contexts-console-warning.html
       webgl/max-active-contexts-gc.html
       webgl/max-active-contexts-oldest-context-lost.html
       webgl/max-active-contexts-webglcontextlost-prevent-default.html

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::recycleContext):

Prints a warning message to the console indicating that an older WebGL context
will be lost to accomodate for the active contexts limit being reached and loses
the provided context in a way that it may not be recovered by calling `event.preventDefault()`
in the `webglcontextlost` event handler. Finally, we destroy the associated GraphicsContext3D
since it will no longer be useful and it may hold large Open GL resources.

* html/canvas/WebGLRenderingContextBase.h:
* platform/graphics/GraphicsContext3D.h:

Changed GraphicsContext3D::create to return RefPtr instead of PassRefPtr.

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::create):
* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::create):
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::activeContexts):
(WebCore::GraphicsContext3D::create):

Check if we are at the active contexts limit (16) and recycle the oldest context
in our active contexts list. Calling recycleContext() on a context will call the
GraphicsContext3D destructor and remove it from the active contexts list there.

(WebCore::GraphicsContext3D::~GraphicsContext3D):

Remove the deconstructed context from the active contexts list.

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::recycleContext):
* platform/graphics/win/GraphicsContext3DWin.cpp:
(WebCore::GraphicsContext3D::create):

LayoutTests:

* webgl/many-contexts-expected.txt:
* webgl/many-contexts.html:

New output for this existing test since a lot of warnings are now logged to
indicate that we've reached the active contexts limit. We also removed the
check that the last context created was null since it no longer is due to this
source change (older contexts are lost instead).

* webgl/max-active-contexts-console-warning-expected.txt: Added.
* webgl/max-active-contexts-console-warning.html: Added.

This new test checks that we log a warning when we've created one context more
than the active contexts limit.

* webgl/max-active-contexts-gc-expected.txt: Added.
* webgl/max-active-contexts-gc.html: Added.

This new test checks that contexts that are garbage collected do not count
agaist the active contexts limit.

* webgl/max-active-contexts-oldest-context-lost-expected.txt: Added.
* webgl/max-active-contexts-oldest-context-lost.html: Added.

This new test checks that older contexts are lost when we reach the active
contexts limit and we create a new context.

* webgl/max-active-contexts-webglcontextlost-prevent-default-expected.txt: Added.
* webgl/max-active-contexts-webglcontextlost-prevent-default.html: Added.

This new test checks that calling `event.preventDefault()` in a `webglcontextlost`
event handler does not prevent a context from being lost when the active contexts
limit is reached.

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

3 years agoDon't hyphenate the last word in a paragraph of text.
hyatt@apple.com [Thu, 21 Apr 2016 16:25:13 +0000 (16:25 +0000)]
Don't hyphenate the last word in a paragraph of text.
https://bugs.webkit.org/show_bug.cgi?id=156803

Reviewed by Simon Fraser.

Source/WebCore:

Added fast/text/hyphenate-avoid-orphaned-word.html

* rendering/RenderText.h:
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):

LayoutTests:

* fast/text/hyphenate-avoid-orphaned-word.html: Added.
* platform/mac/fast/text/hyphenate-avoid-orphaned-word-expected.txt: Added.
* platform/mac/fast/text/hyphenate-limit-before-after-expected.txt:

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

3 years agoDrop [UsePointersEvenForNonNullableObjectArguments] from Range
cdumez@apple.com [Thu, 21 Apr 2016 16:07:18 +0000 (16:07 +0000)]
Drop [UsePointersEvenForNonNullableObjectArguments] from Range
https://bugs.webkit.org/show_bug.cgi?id=156805

Reviewed by Youenn Fablet.

Source/WebCore:

No new tests, no web-exposed behavior change.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::rangeForNodeContents):
(WebCore::characterOffsetsInOrder):
(WebCore::setRangeStartOrEndWithCharacterOffset):
(WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
(WebCore::AXObjectCache::previousBoundary):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectText):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange):
* dom/Node.cpp:
(WebCore::Node::textRects):
* dom/Range.cpp:
(WebCore::Range::Range):
(WebCore::Range::setDocument):
(WebCore::Range::setStart):
(WebCore::Range::setEnd):
(WebCore::Range::isPointInRange):
(WebCore::Range::comparePoint):
(WebCore::Range::compareNode):
(WebCore::Range::compareBoundaryPoints):
(WebCore::Range::compareBoundaryPointsForBindings):
(WebCore::Range::intersectsNode):
(WebCore::Range::processContents):
(WebCore::Range::insertNode):
(WebCore::Range::checkNodeWOffset):
(WebCore::Range::setStartAfter):
(WebCore::Range::setEndBefore):
(WebCore::Range::setEndAfter):
(WebCore::Range::selectNode):
(WebCore::Range::selectNodeContents):
(WebCore::Range::surroundContents):
(WebCore::Range::setStartBefore):
(WebCore::Range::contains):
(WebCore::rangesOverlap):
(WebCore::rangeOfContents):
(WebCore::boundaryNodeChildrenWillBeRemoved):
(WebCore::boundaryTextNodesMerged):
(WebCore::boundaryTextNodesSplit):
(WebCore::Range::expand):
(WebCore::checkForDifferentRootContainer): Deleted.
(WebCore::highestAncestorUnderCommonRoot): Deleted.
(WebCore::childOfCommonRootBeforeOffset): Deleted.
(WebCore::deleteCharacterData): Deleted.
(WebCore::Range::toString): Deleted.
(WebCore::Range::toHTML): Deleted.
(WebCore::Range::text): Deleted.
(WebCore::Range::cloneRange): Deleted.
(WebCore::Range::absoluteTextRects): Deleted.
(WebCore::Range::absoluteTextQuads): Deleted.
(WebCore::boundaryNodeChildrenChanged): Deleted.
(WebCore::boundaryNodeWillBeRemoved): Deleted.
(WebCore::Range::nodeWillBeRemoved): Deleted.
(WebCore::boundaryTextRemoved): Deleted.
(WebCore::Range::getBoundingClientRect): Deleted.
(WebCore::Range::getBorderAndTextQuads): Deleted.
* dom/Range.h:
* dom/Range.idl:
* dom/RangeBoundaryPoint.h:
(WebCore::RangeBoundaryPoint::set):
(WebCore::RangeBoundaryPoint::setToStartOfNode):
(WebCore::RangeBoundaryPoint::setToEndOfNode):
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::applyAlternativeTextToRange):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
* editing/Editor.cpp:
(WebCore::Editor::advanceToNextMisspelling):
(WebCore::Editor::rangeOfString):
(WebCore::isFrameInRange):
(WebCore::Editor::countMatchesForText):
* editing/EditorCommand.cpp:
(WebCore::unionDOMRanges):
(WebCore::executeDeleteToMark):
(WebCore::executeSelectToMark):
* editing/FormatBlockCommand.cpp:
(WebCore::FormatBlockCommand::formatRange):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::respondToNodeModification):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApplyForSingleParagraph):
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingParagraph::offsetTo):
* editing/TextIterator.cpp:
(WebCore::CharacterIterator::range):
(WebCore::BackwardsCharacterIterator::range):
(WebCore::TextIterator::rangeFromLocationAndLength):
(WebCore::TextIterator::getLocationAndLengthFromRange):
(WebCore::findPlainText):
* editing/VisiblePosition.cpp:
(WebCore::setStart):
(WebCore::setEnd):
* editing/VisibleSelection.cpp:
(WebCore::makeSearchRange):
* editing/VisibleUnits.cpp:
(WebCore::previousBoundary):
(WebCore::nextBoundary):
* editing/htmlediting.cpp:
(WebCore::visiblePositionForIndexUsingCharacterIterator):
(WebCore::isNodeVisiblyContainedWithin):
* editing/htmlediting.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::adjustedSelectionRange):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/DOMSelection.cpp:
(WebCore::DOMSelection::addRange):
* page/DragController.cpp:
(WebCore::selectElement):
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent):
* page/Page.cpp:
(WebCore::Page::findStringMatchingRanges):
* page/TextIndicator.cpp:
(WebCore::hasNonInlineOrReplacedElements):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::getRanges):

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame _smartDeleteRangeForProposedRange:]):

Source/WebKit2:

* WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
(-[WKDOMRange setStart:offset:]):
(-[WKDOMRange setEnd:offset:]):
(-[WKDOMRange selectNode:]):
(-[WKDOMRange selectNodeContents:]):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::contentsAsString):

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

3 years agoDrop [UsePointersEvenForNonNullableObjectArguments] from DOMURL
cdumez@apple.com [Thu, 21 Apr 2016 15:42:44 +0000 (15:42 +0000)]
Drop [UsePointersEvenForNonNullableObjectArguments] from DOMURL
https://bugs.webkit.org/show_bug.cgi?id=156797

Reviewed by Youenn Fablet.

* html/DOMURL.cpp:
(WebCore::DOMURL::create):
* html/DOMURL.h:
* html/DOMURL.idl:

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

3 years ago[GTK][EFL] Move non-glib/gtk platform implementations out of platform/gtk
csaavedra@igalia.com [Thu, 21 Apr 2016 15:12:11 +0000 (15:12 +0000)]
[GTK][EFL] Move non-glib/gtk platform implementations out of platform/gtk
https://bugs.webkit.org/show_bug.cgi?id=156847

Reviewed by Carlos Garcia Campos.

The Language and Logging implementation don't really need glib, so
rework them and move them to a new platform/unix directory so that
they can be shared among Unix ports.

* PlatformEfl.cmake: Use the unix version.
* PlatformGTK.cmake: Same.
* platform/efl/LanguageEfl.cpp: Removed.
* platform/efl/LoggingEfl.cpp: Removed.
* platform/unix/LanguageUnix.cpp: Renamed from Source/WebCore/platform/gtk/LanguageGtk.cpp.
(WebCore::platformLanguage):
(WebCore::platformUserPreferredLanguages):
* platform/unix/LoggingUnix.cpp: Renamed from Source/WebCore/platform/gtk/LoggingGtk.cpp.
(WebCore::logLevelString):

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

3 years agoUnreviewed GTK+ gardening. Update expectations for some editing tests that are slow...
carlosgc@webkit.org [Thu, 21 Apr 2016 12:33:13 +0000 (12:33 +0000)]
Unreviewed GTK+ gardening. Update expectations for some editing tests that are slow on Debug.

All these pass for me locally when run with --no-timeout.

* platform/gtk/TestExpectations:

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

3 years agoUnreviewed GTK+ gardening. Rebaseline tests after r180867.
carlosgc@webkit.org [Thu, 21 Apr 2016 11:45:09 +0000 (11:45 +0000)]
Unreviewed GTK+ gardening. Rebaseline tests after r180867.

* platform/gtk/editing/execCommand/5142012-1-expected.txt:
* platform/gtk/editing/inserting/insert-at-end-02-expected.txt:
* platform/gtk/editing/pasteboard/4989774-expected.txt:

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

3 years agoAlign RegExp[@@match] with other @@ methods
msaboff@apple.com [Thu, 21 Apr 2016 10:57:45 +0000 (10:57 +0000)]
Align RegExp[@@match] with other @@ methods
https://bugs.webkit.org/show_bug.cgi?id=156832

Reviewed by Mark Lam.

Various changes to align the RegExp[@@match] with [@@search] and [@@split].

Made RegExp.prototype.@exec a hidden property on the global object and
called it @regExpBuiltinExec to match the name it has in the standard.
Changed all places that used the old name to use the new one.

Made the match fast path function, which used to be call @match, to be called
@regExpMatchFast and put it on the global object.  Changed it to also handle
expressions both with and without the global flag.  Refactored the builtin
@match accordingly.

Added the builtin function @hasObservableSideEffectsForRegExpMatch() that
checks to see if we can use the fast path of if we need the explicit version.

Put the main RegExp functions @match, @search and @split in alphabetical
order in RegExpPrototype.js.  Did the same for @match, @repeat, @search and
@split in StringPrototype.js.

* builtins/RegExpPrototype.js:
(regExpExec):
(hasObservableSideEffectsForRegExpMatch): New.
(match):
(search):
(hasObservableSideEffectsForRegExpSplit):
Reordered in the file and updated to use @regExpBuiltinExec.

* builtins/StringPrototype.js:
(match):
(repeatSlowPath):
(repeat):
(search):
(split):
Reordered functions in the file.

* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::setGlobalThis):
(JSC::getById):
(JSC::getGetterById):
(JSC::JSGlobalObject::init):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
(JSC::regExpProtoFuncExec):
(JSC::regExpProtoFuncMatchFast):
(JSC::regExpProtoFuncMatchPrivate): Deleted.
* runtime/RegExpPrototype.h:

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

3 years ago[GTK] WebKitWebView should claim the contents size as its natural size
carlosgc@webkit.org [Thu, 21 Apr 2016 10:53:51 +0000 (10:53 +0000)]
[GTK] WebKitWebView should claim the contents size as its natural size
https://bugs.webkit.org/show_bug.cgi?id=156835

Reviewed by Žan Doberšek.

Source/WebKit2:

And keep claiming 0 as its minimum size since it's scrollable.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::didChangeContentSize): Call webkitWebViewBaseSetContentsSize().
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseGetPreferredWidth): Return the contents width as natural width.
(webkitWebViewBaseGetPreferredHeight): Return the contents height as natural height.
(webkit_web_view_base_class_init): Add implementations of get_preferred_width/height.
(webkitWebViewBaseSetContentsSize): Save the contents size.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:

Tools:

Add test case to check the WebKitWebView preferred size.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
(testWebViewPreferredSize):
(beforeAll):

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

3 years ago[GTK] WebKitWebView should propagate wheel events not handled by the web process
carlosgc@webkit.org [Thu, 21 Apr 2016 10:50:59 +0000 (10:50 +0000)]
[GTK] WebKitWebView should propagate wheel events not handled by the web process
https://bugs.webkit.org/show_bug.cgi?id=156834

Reviewed by Žan Doberšek.

We are currently swallowing all wheel events unconditionally, not allowing applications to handle wheel events
when not handled by us. Since the GTK+ event propagation system is synchronous, and our events are handled
asynchronously, we need to do something similar to what we do for key events, not propagate the event the first
time and if not handled by the web process, re-inject it in the event loop and then just propagate it.

* Shared/NativeWebWheelEvent.h:
(WebKit::NativeWebWheelEvent::nativeEvent): Remove useless const.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Tell the web view to propagate the next wheel event,
and re-inject the event not handled by the web process in the event loop.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseScrollEvent): Propagate the event if shouldForwardNextWheelEvent is true.
(webkitWebViewBaseForwardNextWheelEvent): Set shouldForwardNextWheelEvent to true.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveEvent): Remove ifdef.
* UIProcess/efl/WebView.h:

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

3 years agoAX: stringForTextMarkerRange returning empty string for document range
n_wang@apple.com [Thu, 21 Apr 2016 08:41:14 +0000 (08:41 +0000)]
AX: stringForTextMarkerRange returning empty string for document range
https://bugs.webkit.org/show_bug.cgi?id=156819

Reviewed by Chris Fleizach.

Source/WebCore:

Set text marker data with CharacterOffset when VisiblePosition is having PositionIsAfterAnchor
or PositionIsAfterChildren anchor type, so that the character offset corresponds to the anchored
node.

Test: accessibility/mac/text-marker-string-for-document-range.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::textMarkerDataForVisiblePosition):

LayoutTests:

* accessibility/mac/text-marker-string-for-document-range-expected.txt: Added.
* accessibility/mac/text-marker-string-for-document-range.html: Added.

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

3 years agoAdd content animation tests to benchmark_runner, and allow the runner to collect...
simon.fraser@apple.com [Thu, 21 Apr 2016 05:04:47 +0000 (05:04 +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

Update the .plan file now that the files are present in SVN.

* Scripts/webkitpy/benchmark_runner/data/plans/content-animation.plan:

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

3 years agoCrash under WebCore::TextIterator::subrange()
cdumez@apple.com [Thu, 21 Apr 2016 05:02:23 +0000 (05:02 +0000)]
Crash under WebCore::TextIterator::subrange()
https://bugs.webkit.org/show_bug.cgi?id=156809
<rdar://problem/21102730>

Reviewed by Ryosuke Niwa.

TextIterator::rangeFromLocationAndLength() may return null. However, we
failed to do a null check before calling TextIterator::subrange() with
that range.

No new tests, do not know how to reproduce.

* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::applyAlternativeTextToRange):

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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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