CodeGeneratorJS.pm should generate "isFiringEventListeners()" check in isReachableFromOpaqueRoots()
https://bugs.webkit.org/show_bug.cgi?id=114784

Reviewed by Geoffrey Garen.

EventTarget subclasses shouldn't have to use CustomIsReachable directives
in order to keep their wrappers alive while firing event listeners.

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove obsolete macros from libpng
https://bugs.webkit.org/show_bug.cgi?id=114817

Patch by Alberto Garcia <agarcia@igalia.com> on 2013-04-18
Reviewed by Benjamin Poulain.

libpng 1.4 removes the png_voidp_NULL and png_error_ptr_NULL
macros. Null pointers must be used directly instead.

* platform/image-encoders/PNGImageEncoder.cpp:
(WebCore::compressRGBABigEndianToPNG):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed WinCE build fix after r148545.

* WebCoreSupport/EditorClientWinCE.cpp:
* WebView.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Removed HeapTimer::synchronize
https://bugs.webkit.org/show_bug.cgi?id=114832

Reviewed by Mark Hahnenberg.

HeapTimer::synchronize was a flawed attempt to make HeapTimer thread-safe.
Instead, we use proper locking now.

This is a slight API change, since the GC timer will now only fire in the
run loop that created the JS VM, even if another run loop later executes
some JS.

* API/APIShims.h:
(JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
* heap/HeapTimer.cpp:
(JSC):
* heap/HeapTimer.h:
(HeapTimer):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148704 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LLInt ARM backend should not use the d8 register as scratch register
https://bugs.webkit.org/show_bug.cgi?id=114811

Reviewed by Filip Pizlo.

The d8 register must preserved across function calls and should
not used as scratch register. Changing it to d6.

* offlineasm/arm.rb:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StorageManager should keep track of local storage namespaces
https://bugs.webkit.org/show_bug.cgi?id=114831

Reviewed by Beth Dakin.

* UIProcess/Storage/StorageManager.cpp:
(StorageManager::StorageArea):
Add the local storage namespace, and security origin as member variables.

(StorageManager::LocalStorageNamespace):
New class that represents a local storage namespace.

(WebKit::StorageManager::StorageArea::~StorageArea):
If this storage area belongs to a local storage namespace, notify it that we've been destroyed.

(WebKit::StorageManager::StorageArea::clone):
Assert that we don't have a local storage namespace.

(WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
If we already have a storage area for the given security origin, return it. Otherwise, create a new storage area.
Note that LocalStorageNamespace does not hold strong references to its StorageArea objects; they are being kept alive
by a mapping inside the StorageManager.

(WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
Remove the storage area from the map. If there are no more areas, remove the namespace from the manager.

(WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
StorageArea::create now takes the security origin.

(WebKit::StorageManager::createLocalStorageMap):
Get (or create) the right local storage namespace and then create a storage area.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove GraphicsLayerCA::constrainedSize() now that we can manage large layer memory use ourselves in TileController
https://bugs.webkit.org/show_bug.cgi?id=114834

Reviewed by Tim Horton.

GraphicsLayerCA::constrainedSize() was added to handle poor CATiledLayer behavior when layer sizes
got extremely large. Now that we no longer use CATiledLayer, remove this code. We can later add
tile memory bounding to TileController if that becomes necessary.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateGeometry):
* platform/graphics/ca/GraphicsLayerCA.h:
(GraphicsLayerCA):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Network Process crashing trying to read in IDNScriptWhiteList.txt
https://bugs.webkit.org/show_bug.cgi?id=114827

Reviewed by Anders Carlsson.

Move IDNScriptWhiteList.txt from WebKit to WebCore, so that the NetworkProcess does not have to link against
WebKit. It was a layering violation for WebCore to be trying to access WebKit resources anyway.

Source/WebCore: 

* Resources/IDNScriptWhiteList.txt: Copied from Source/WebKit/mac/Resources/IDNScriptWhiteList.txt.
* WebCore.xcodeproj/project.pbxproj:
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::readIDNScriptWhiteList):

Source/WebKit: 

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac: 

* Resources/IDNScriptWhiteList.txt: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148708 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Interpreter entry points should throw the TerminatedExecutionException from the caller frame.
https://bugs.webkit.org/show_bug.cgi?id=114816.

Reviewed by Oliver Hunt.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Invalidate spell checking requests in platform code
https://bugs.webkit.org/show_bug.cgi?id=114830

Patch by Nima Ghanavatian <nghanavatian@blackberry.com> on 2013-04-18
Reviewed by Rob Buis.

Internally reviewed by Mike Fenton.

Cache the value of the last requested sequence id at focus change.
All requests prior to this point will be rejected upon processing.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::InputHandler):
(BlackBerry::WebKit::InputHandler::requestCheckingOfString):
(BlackBerry::WebKit::InputHandler::stopPendingSpellCheckRequests):
* WebKitSupport/InputHandler.h:
(InputHandler):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash beneath JSC::JIT::privateCompileSlowCases @ stephenrdonaldson.com
https://bugs.webkit.org/show_bug.cgi?id=114774

Reviewed by Geoffrey Garen.

We're not linking up all of the slow cases in the baseline JIT when compiling put_to_base.

Source/JavaScriptCore: 

* jit/JITOpcodes.cpp:
(JSC::JIT::emitSlow_op_put_to_base):

LayoutTests: 

* fast/js/put-to-base-global-checked-expected.txt: Added.
* fast/js/put-to-base-global-checked.html: Added.
* fast/js/script-tests/put-to-base-global-checked.js: Added.
(globalF):
(warmup):
(foo):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148711 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r116645): Versions app's UI is munged in HiDPI due to background-size being reset to 'auto' when background short-hand is also specified
https://bugs.webkit.org/show_bug.cgi?id=114833

Reviewed by David Kilzer.

Source/WebCore:

Added applicationIsVersions() to RuntimeApplicationChecks.

* WebCore.exp.in:
* platform/RuntimeApplicationChecks.cpp:
(WebCore::applicationIsVersions):
(WebCore):
* platform/RuntimeApplicationChecks.h:
(WebCore):

Source/WebKit/mac:

The Versions app specifies both a background-size and a background
shorthand CSS property, and its UI is broken after r116645 which resets
background-size to 'auto' if the background shorthand property is
specified.

This patch enables the useLegacyBackgroundSizeShorthandBehavior setting
added in r147034 to restore the expected behavior if the embedder is
Versions.app and it was linked against a version of WebKit that had the
legacy behavior.

* Misc/WebKitVersionChecks.h:
* WebView/WebView.mm:
(shouldUseLegacyBackgroundSizeShorthandBehavior):
(-[WebView _commonInitializationWithFrameName:groupName:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a synchronous version of WKView endDeferringViewInWindowChanges
https://bugs.webkit.org/show_bug.cgi?id=114780
<rdar://problem/12821901>

Reviewed by Simon Fraser.

Add new WKView SPI, endDeferringViewInWindowChangesSync, which synchronously
(though with a 250 ms timeout) does the work required to reparent a WKView
without flashing white.

* UIProcess/API/mac/WKView.mm:
(-[WKView beginDeferringViewInWindowChanges]):
(-[WKView endDeferringViewInWindowChanges]):
Make begin/endDeferringViewInWindowChanges not allow nested deferrals,
as we don't need them, and they complicate synchronous-end a lot.

(-[WKView endDeferringViewInWindowChangesSync]):
Add a sync version of endDeferringViewInWindowChanges which waits
for DidUpdateInWindowState.

(-[WKView isDeferringViewInWindowChanges]):

* UIProcess/API/mac/WKViewPrivate.h: Add endDeferringViewInWindowChangesSync.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::waitForDidUpdateInWindowState):
Add waitForDidUpdateInWindowState(), which blocks for
250ms or until the WebProcess reparents all of its layers and spins
the runloop once, to prevent flashing when parenting a WKView.
If we've already timed out waiting for the WebProcess, don't block, as
it's probably quite busy and is likely to time out again.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isInWindow): Added.
(WebKit::WebPageProxy::waitForDidUpdateInWindowState): Added.
(WebKit::WebPageProxy::didUpdateInWindowState): Added.

* UIProcess/WebPageProxy.messages.in: Add DidUpdateInWindowState()

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didUpdateInWindowStateTimerFired): Send DidUpdateInWindowState to WebPageProxy.
(WebKit::WebPage::setIsInWindow): When setIsInWindow completes, TileController
tiles have been reparented, and the TiledCoreAnimationDrawingArea has
reconnected the layer tree to the context, start a 0-delay runloop timer
to allow painting and layer flushing to finish; when the timer fires,
we'll send the UIProcess a DidUpdateInWindowState so it can stop blocking.

* WebProcess/WebPage/WebPage.h:
(WebPage): Add didUpdateInWindowStateTimerFired and m_sendDidUpdateInWindowStateTimer.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening; fix bindings tests after r148700.

* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTargetOwner::isReachableFromOpaqueRoots):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use the page group id from the UI process as the local storage namespace ID
https://bugs.webkit.org/show_bug.cgi?id=114836

Reviewed by Beth Dakin.

The WebCore PageGroup identifier is different across processes, so use the one given to us by the UI process.

* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
* WebProcess/WebPage/WebPageGroupProxy.h:
(WebKit::WebPageGroupProxy::corePageGroup):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::webPageGroup):
* WebProcess/WebProcess.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Dispatch local storage events
https://bugs.webkit.org/show_bug.cgi?id=114838

Reviewed by Beth Dakin.

* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::StorageArea::dispatchEvents):
Pass 0 as the storage area ID if the event originally comes from another process.

* WebProcess/Storage/StorageAreaMap.cpp:
(WebKit::StorageAreaMap::dispatchLocalStorageEvent):
Gather all the frames for which we want to dispatch events.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148716 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PDFPlugin: Hook up the search-in-Spotlight menu item
https://bugs.webkit.org/show_bug.cgi?id=114837
<rdar://problem/13583591>

Reviewed by Mark Rowe.

* WebProcess/Plugins/PDF/PDFLayerControllerDetails.h:
Add performSpotlightSearch: delegate callback.

* WebProcess/Plugins/PDF/PDFPlugin.h:
(WebKit::PDFPlugin::performSpotlightSearch):
Add performSpotlightSearch() PDFPlugin method.

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(-[WKPDFLayerControllerDelegate performSpotlightSearch:]): Hand the search string to PDFPlugin.
(WebKit::PDFPlugin::performSpotlightSearch): Hand the search string to WebPageProxy.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Build break when using cmake without CMAKE_BUILD_TYPE
https://bugs.webkit.org/show_bug.cgi?id=114835

Unreviewed build fix.

Patch by Ryuan Choi <ryuan.choi@gmail.com> on 2013-04-18

* Source/cmake/OptionsEfl.cmake:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PDFPlugin: Update PDFLayerController's scale factors earlier
https://bugs.webkit.org/show_bug.cgi?id=114843

Reviewed by Simon Fraser.

Inform PDFLayerController of the initial page/device scale factors so that
it renders at the correct scale the first time, instead of first rendering
at 1x and then flashing to 2x (on 2x devices).

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::pdfDocumentDidLoad):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StackFrame::column() returning bogus value
https://bugs.webkit.org/show_bug.cgi?id=114840

Reviewed by Gavin Barraclough.

Source/JavaScriptCore:

Don't add one part of the expression offset to the other part of the expression.
Make StackFrame::toString() include the column info.

* interpreter/Interpreter.cpp:
(JSC::StackFrame::expressionInfo):
(JSC::StackFrame::toString):

LayoutTests:

Update test result

* fast/js/stack-trace-expected.txt:

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