WebKit-https.git
7 years agoAllow ImageBuffer to re-use IOSurfaces
mmaxfield@apple.com [Sat, 21 Dec 2013 00:43:27 +0000 (00:43 +0000)]
Allow ImageBuffer to re-use IOSurfaces
https://bugs.webkit.org/show_bug.cgi?id=125477

Reviewed by Geoff Garen.

PerformanceTests:

This test times creating a variety of different sizes of canvases
once some have already been created. The second creation of the
canvases should re-use the existing IOSurfaces.

* Canvas/reuse.html: Added.

Source/WebCore:

This test adds a static class, ImageBufferBackingStoreCache, that vends
IOSurfaces. It remembers IOSurfaces that have been returned to it until
a configurable timeout.

The storage used by this class is in the form of a HashMap from a
bucketed size to the IOSurface. There are many other data structures
that could be used, but this implementation gives a 80% hit rate on
normal browsing of some example sites with Canvas and
text-decoration-skip: ink. Because the buckets are fairly
small (rounding the width and height up to multiples of 8), traversing the
bucket contents takes on average 2 steps.

Test: fast/canvas/canvas-backing-store-reuse.html

* WebCore.xcodeproj/project.pbxproj: Added new caching class
* platform/graphics/cg/ImageBufferBackingStoreCache.cpp: Added.
(WebCore::createIOSurface): Moved from ImageBufferCG.cpp
(WebCore::ImageBufferBackingStoreCache::timerFired): Forget the cache
contents
(WebCore::ImageBufferBackingStoreCache::schedulePurgeTimer):
(WebCore::ImageBufferBackingStoreCache::get): Static getter
(WebCore::ImageBufferBackingStoreCache::ImageBufferBackingStoreCache):
(WebCore::ImageBufferBackingStoreCache::insertIntoCache): Memory-management
creation function
(WebCore::ImageBufferBackingStoreCache::takeFromCache): Memory-management
deletion function
(WebCore::ImageBufferBackingStoreCache::isAcceptableSurface): Does this cached
IOSurface fit the bill?
(WebCore::ImageBufferBackingStoreCache::tryTakeFromCache): Lookup
a bucket and walk through its contents
(WebCore::ImageBufferBackingStoreCache::getOrAllocate): Public function
for clients who want a IOSurface from the cache
(WebCore::ImageBufferBackingStoreCache::deallocate): Public
function for clients to return an IOSurface to the pool
* platform/graphics/cg/ImageBufferBackingStoreCache.h: Added.
* platform/graphics/cg/ImageBufferCG.cpp: Update to use new cache
(WebCore::ImageBuffer::ImageBuffer):
(WebCore::ImageBuffer::~ImageBuffer):

LayoutTests:

Now that we're re-using the backing store of canvases, this
test makes sure that if we draw to a canvas, then destroy it,
then create a new canvas (which should share the same backing
store) that it doesn't have the stale data in it

* fast/canvas/canvas-backing-store-reuse-expected.txt: Added.
* fast/canvas/canvas-backing-store-reuse.html: Added.

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

7 years agoChange "threaded scrolling" terminology to "asynchronous scrolling"
simon.fraser@apple.com [Sat, 21 Dec 2013 00:35:44 +0000 (00:35 +0000)]
Change "threaded scrolling" terminology to "asynchronous scrolling"
https://bugs.webkit.org/show_bug.cgi?id=126094

Source/WebCore:

Reviewed by Tim Horton.

Rename ENABLE_THREADED_SCROLLING to ENABLE_ASYNC_SCROLLING, and change
references to "main thread scrolling" to "synchronous scrolling".

In a few places, functions with names like shouldUpdateScrollLayerPositionOnMainThread()
were actually returning SynchronousScrollingReasons, so rename them appropriately.

* WebCore.exp.in:
* page/FrameView.cpp:
(WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
(WebCore::FrameView::isRubberBandInProgress):
(WebCore::FrameView::requestScrollPositionUpdate):
(WebCore::FrameView::updatesScrollLayerPositionOnMainThread):
(WebCore::FrameView::wheelEvent):
* page/Page.cpp:
(WebCore::Page::synchronousScrollingReasonsAsText):
* page/Page.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::create):
(WebCore::ScrollingCoordinator::ScrollingCoordinator):
(WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
(WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
(WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::ScrollingCoordinator::synchronousScrollingReasons):
(WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
(WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates):
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
(WebCore::ScrollingCoordinator::setSynchronousScrollingReasons):
* page/scrolling/ScrollingStateFixedNode.cpp:
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateNode.cpp:
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons):
(WebCore::ScrollingStateScrollingNode::dumpProperties):
* page/scrolling/ScrollingStateScrollingNode.h: Awkward "ReasonsForSynchronousScrolling" to avoid
conflict with the enum called SynchronousScrollingReasons.
* page/scrolling/ScrollingStateStickyNode.cpp:
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingStateTree.cpp:
* page/scrolling/ScrollingStateTree.h:
* page/scrolling/ScrollingThread.cpp:
* page/scrolling/ScrollingThread.h:
* page/scrolling/ScrollingTree.cpp:
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeNode.cpp:
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::ScrollingTreeScrollingNode):
(WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::synchronousScrollingReasons):
(WebCore::ScrollingTreeScrollingNode::shouldUpdateScrollLayerPositionSynchronously):
* page/scrolling/mac/ScrollingCoordinatorMac.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::setSynchronousScrollingReasons):
(WebCore::ScrollingCoordinatorMac::commitTreeState):
* page/scrolling/mac/ScrollingStateNodeMac.mm:
* page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
* page/scrolling/mac/ScrollingThreadMac.mm:
* page/scrolling/mac/ScrollingTreeFixedNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):
(WebCore::ScrollingTreeScrollingNodeMac::scrollPosition):
(WebCore::ScrollingTreeScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
(WebCore::logThreadedScrollingMode):
* page/scrolling/mac/ScrollingTreeStickyNode.h:
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::TileController):
(WebCore::TileController::updateTileCoverageMap):
* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::releaseMemory):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setupFontSubpixelQuantization):
* rendering/RenderLayerBacking.cpp:
(WebCore::computeTileCoverage):
* testing/Internals.cpp:
(WebCore::Internals::mainThreadScrollingReasons):
* testing/Internals.idl:

Source/WebKit2:

Reviewed by Tim Horton.

Rename ENABLE_THREADED_SCROLLING to ENABLE_ASYNC_SCROLLING, and change
references to "main thread scrolling" to "synchronous scrolling".

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::wheelEvent):
* WebProcess/WebPage/EventDispatcher.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::~WebPage):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::didInstallPageOverlay):
(WebKit::TiledCoreAnimationDrawingArea::didUninstallPageOverlay):
(WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
(WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):

Source/WTF:

Reviewed by Tim Horton.

Rename ENABLE_THREADED_SCROLLING to ENABLE_ASYNC_SCROLLING.

* wtf/FeatureDefines.h:

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

7 years agoRevert r160327, r160273, and r160260.
timothy_horton@apple.com [Sat, 21 Dec 2013 00:26:49 +0000 (00:26 +0000)]
Revert r160327, r160273, and r160260.

We'll come up with something less aggressive, as this doesn't quite work.

* loader/cache/CachedImage.h:
* loader/cache/CachedResource.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedDataIfNecessary):
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:

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

7 years agoPostAttachCallbackDisabler should take a Document
andersca@apple.com [Sat, 21 Dec 2013 00:12:39 +0000 (00:12 +0000)]
PostAttachCallbackDisabler should take a Document
https://bugs.webkit.org/show_bug.cgi?id=126090

Reviewed by Andreas Kling.

suspendPostAttachCallbacks and resumePostAttachCallbacks always only get the document from the
container node, so make them static member functions that take a Document&. Also, move PostAttachCallbackDisabler
to Element.h in preparation for moving post attach callback handling to Element.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::suspendPostAttachCallbacks):
(WebCore::ContainerNode::resumePostAttachCallbacks):
* dom/ContainerNode.h:
* dom/Element.h:
(WebCore::PostAttachCallbackDisabler::PostAttachCallbackDisabler):
(WebCore::PostAttachCallbackDisabler::~PostAttachCallbackDisabler):
* style/StyleResolveTree.cpp:
(WebCore::Style::attachRenderTree):

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

7 years agoPretty print LayoutUnit, LayoutPoint, and LayoutSize in gdb and lldb
bjonesbe@adobe.com [Sat, 21 Dec 2013 00:05:40 +0000 (00:05 +0000)]
Pretty print LayoutUnit, LayoutPoint, and LayoutSize in gdb and lldb
https://bugs.webkit.org/show_bug.cgi?id=126080

Reviewed by Anders Carlsson.

This changes the output of printing LayoutUnits to be in px, removing
the need to divide by 64 manually.

This will lead to gdb output like:

m_frameRect = {
    m_location = LayoutPoint(0px, 0px),
    m_size = LayoutSize(800px, 585px)
}

And lldb output like:

(const WebCore::LayoutRect) $0 = {
  m_location = { x = 744px, y = 1px }
  m_size = { width = 236px, height = 40px }
}

This patch is based on patch for Blink by cbiesinger@chromium.org.

* gdb/webkit.py:
(WebCoreLayoutUnitPrinter):
(WebCoreLayoutUnitPrinter.__init__):
(WebCoreLayoutUnitPrinter.to_string):
(WebCoreLayoutSizePrinter):
(WebCoreLayoutSizePrinter.__init__):
(WebCoreLayoutSizePrinter.to_string):
(WebCoreLayoutPointPrinter):
(WebCoreLayoutPointPrinter.__init__):
(WebCoreLayoutPointPrinter.to_string):
(add_pretty_printers):
* lldb/lldb_webkit.py:
(__lldb_init_module):
(WebCoreLayoutUnit_SummaryProvider):
(WebCoreLayoutSize_SummaryProvider):
(WebCoreLayoutPoint_SummaryProvider):
(WebCoreLayoutUnitProvider):
(WebCoreLayoutUnitProvider.__init__):
(WebCoreLayoutUnitProvider.to_string):
(WebCoreLayoutSizeProvider):
(WebCoreLayoutSizeProvider.__init__):
(WebCoreLayoutSizeProvider.get_width):
(WebCoreLayoutSizeProvider.get_height):
(WebCoreLayoutPointProvider):
(WebCoreLayoutPointProvider.__init__):
(WebCoreLayoutPointProvider.get_x):
(WebCoreLayoutPointProvider.get_y):

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

7 years agoRename PlugInAutoStartProvider's ...EntriesAddedBeforeTime facility to ...EntriesAdde...
commit-queue@webkit.org [Fri, 20 Dec 2013 23:56:38 +0000 (23:56 +0000)]
Rename PlugInAutoStartProvider's ...EntriesAddedBeforeTime facility to ...EntriesAddedAfterTime
https://bugs.webkit.org/show_bug.cgi?id=126078

Patch by Ricky Mondello <rmondello@apple.com> on 2013-12-20
Reviewed by Anders Carlsson.

r160922 accidentally named a facility for filtering out data added after a certain time,
"...FilteringOutEntriesAddedBeforeTime", which was incorrect. This patch renames those instances
to "...FilteringOutEntriesAddedAfterTime".

* UIProcess/API/C/WKContext.cpp:
(WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
* UIProcess/API/C/WKContext.h:
* UIProcess/Plugins/PlugInAutoStartProvider.cpp:
(WebKit::PlugInAutoStartProvider::setAutoStartOriginsFilteringOutEntriesAddedAfterTime):
* UIProcess/Plugins/PlugInAutoStartProvider.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::setPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
* UIProcess/WebContext.h:

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

7 years ago[WK2] Add SPI for using a custom protocol handler
weinig@apple.com [Fri, 20 Dec 2013 23:55:04 +0000 (23:55 +0000)]
[WK2] Add SPI for using a custom protocol handler
https://bugs.webkit.org/show_bug.cgi?id=126089

Reviewed by Anders Carlsson.

* UIProcess/API/C/mac/WKContextPrivateMac.h:
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextRegisterSchemeForCustomProtocol):
(WKContextUnregisterSchemeForCustomProtocol):
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(+[WKBrowsingContextController registerSchemeForCustomProtocol:]):
(+[WKBrowsingContextController unregisterSchemeForCustomProtocol:]):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::globalURLSchemesWithCustomProtocolHandlers):
(WebKit::WebContext::registerGlobalURLSchemeAsHavingCustomProtocolHandlers):
(WebKit::WebContext::unregisterGlobalURLSchemeAsHavingCustomProtocolHandlers):
* UIProcess/WebContext.h:
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformInitializeWebProcess):
(WebKit::WebContext::platformInitializeNetworkProcess):
(WebKit::WebContext::registerNotificationObservers):
(WebKit::WebContext::unregisterNotificationObservers):

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

7 years ago[GTK] [CMake] Add support for building ImageDiff
mrobinson@webkit.org [Fri, 20 Dec 2013 23:46:12 +0000 (23:46 +0000)]
[GTK] [CMake] Add support for building ImageDiff
https://bugs.webkit.org/show_bug.cgi?id=125960

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Build ImageDiff for GTK+.
* ImageDiff/PlatformGTK.cmake: Added.

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

7 years ago[GTK] [CMake] Add support for building DumpRenderTree
mrobinson@webkit.org [Fri, 20 Dec 2013 23:44:11 +0000 (23:44 +0000)]
[GTK] [CMake] Add support for building DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=125767

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Load the DumpRenderTree cmake file for GTK+ when WebKit1 is enabled.
* DumpRenderTree/PlatformGTK.cmake: Added.

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

7 years ago[GTK] [CMake] Add support for building WebKitTestRunner
mrobinson@webkit.org [Fri, 20 Dec 2013 23:24:43 +0000 (23:24 +0000)]
[GTK] [CMake] Add support for building WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=125768

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Compile WebKitTestRunner for GTK+ when WebKit2 is enabled.
* WebKitTestRunner/CMakeLists.txt: Remove some EFL specific flags from the common
build file.
* WebKitTestRunner/PlatformEfl.cmake: Move the flags here.
* WebKitTestRunner/PlatformGTK.cmake: Added.

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

7 years agoMove scheduleSetNeedsStyleRecalc to HTMLFrameOwnerElement
andersca@apple.com [Fri, 20 Dec 2013 22:34:31 +0000 (22:34 +0000)]
Move scheduleSetNeedsStyleRecalc to HTMLFrameOwnerElement
https://bugs.webkit.org/show_bug.cgi?id=126083

Reviewed by Antti Koivisto.

scheduleSetNeedsStyleRecalc is only ever called on HTMLFrameOwnerElement, so
move it there, remove the Node implementation and make it non-virtual.

* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
* dom/Node.h:
* html/HTMLFrameOwnerElement.cpp:
(WebCore::needsStyleRecalcCallback):
(WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc):
* html/HTMLFrameOwnerElement.h:

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

7 years agoRemove an unneeded include of WebCoreSystemInterface.h.
aestes@apple.com [Fri, 20 Dec 2013 22:19:28 +0000 (22:19 +0000)]
Remove an unneeded include of WebCoreSystemInterface.h.

Rubber-stamped by Dan Bernstein.

* platform/mac/ContentFilterMac.mm:

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

7 years agoNode post attach callbacks should use references
andersca@apple.com [Fri, 20 Dec 2013 22:15:13 +0000 (22:15 +0000)]
Node post attach callbacks should use references
https://bugs.webkit.org/show_bug.cgi?id=126081

Reviewed by Antti Koivisto.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::queuePostAttachCallback):
(WebCore::ContainerNode::dispatchPostAttachCallbacks):
(WebCore::needsStyleRecalcCallback):
(WebCore::ContainerNode::scheduleSetNeedsStyleRecalc):
* dom/ContainerNode.h:
* html/HTMLFormControlElement.cpp:
(WebCore::focusPostAttach):
(WebCore::HTMLFormControlElement::didAttachRenderers):
(WebCore::updateFromElementCallback):
(WebCore::HTMLFormControlElement::didRecalcStyle):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAttachRenderers):
(WebCore::HTMLPlugInImageElement::updateWidgetCallback):
(WebCore::HTMLPlugInImageElement::startLoadingImageCallback):
* html/HTMLPlugInImageElement.h:

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

7 years agoWeb Inspector: Extract CommandLineAPI into its own InjectedScriptModule
joepeck@webkit.org [Fri, 20 Dec 2013 22:04:31 +0000 (22:04 +0000)]
Web Inspector: Extract CommandLineAPI into its own InjectedScriptModule
https://bugs.webkit.org/show_bug.cgi?id=126038

Reviewed by Timothy Hatcher.

Only inject the CommandLineAPIModule once, when the InjectedScript
is first created. This avoids running a small snippet of JavaScript
to check if the module is loaded every time we fetch the InjectedScript.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
Add new files to the build.

* inspector/InjectedScriptManager.h:
* inspector/InjectedScriptManager.cpp:
(WebCore::InjectedScriptManager::createForPage):
(WebCore::InjectedScriptManager::injectedScriptFor):
(WebCore::InjectedScriptManager::didCreateInjectedScript):
Add didCreateInjectedScript hook for a subclass to inject more scripts.

* inspector/PageInjectedScriptManager.h: Added.
* inspector/PageInjectedScriptManager.cpp: Added.
(WebCore::PageInjectedScriptManager::didCreateInjectedScript):
For pages, inject the CommandLineAPIModule.

* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::injectedScriptForEval):
This is replaced by PageInjectedScriptManager, we no longer need
to do extra work every time we fetch the injectedScriptForEval.

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

7 years agoWeb Inspector: Extract CommandLineAPI into its own InjectedScriptModule
joepeck@webkit.org [Fri, 20 Dec 2013 22:04:28 +0000 (22:04 +0000)]
Web Inspector: Extract CommandLineAPI into its own InjectedScriptModule
https://bugs.webkit.org/show_bug.cgi?id=126038

Reviewed by Timothy Hatcher.

No tests, no observable change in behavior.

Move the CommandLineAPI source into its own module. Load the module
in InjectedScripts for WebCore::Pages. Not for workers.

Moving CommandLineAPI into it's own module moves it from being inside
the same anonymous function to being evaluated outside the anonymous
function. To connect the two InjectedScript passes itself to the
injected module, and the CommandLineAPI module places its class on the
injectedScript as injectedScript.CommandLineAPI.

This essentially makes the CommandLineAPI module an InjectedScript
extension. InjectedScriptSource checks for the existence of
this.CommandLineAPI to see if the fuller version is available. Otherwise
it falls back to a BasicCommandLineAPI which only exposes "$_",
which is the "last evaluated result". That will be useful for JS Contexts
and Workers.

At the same time, this patch makes InjectedScriptModule more generic,
to support being used in a pure JavaScript environment, meaning one
without "window" as the global object.

* CMakeLists.txt:
* DerivedSources.make:
* GNUmakefile.am:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorAllInOne.cpp:
Add files. Minify the CommandLineAPIModuleSource in generation.

* inspector/CommandLineAPIModule.h: Added.
* inspector/CommandLineAPIModule.cpp: Added.
(WebCore::CommandLineAPIModule::CommandLineAPIModule):
(WebCore::CommandLineAPIModule::injectIfNeeded):
(WebCore::CommandLineAPIModule::source):
Inject the module that doesn't return an object, its just evaluated code
extending the original InjectedScript.

* inspector/InjectedScriptModule.h:
* inspector/InjectedScriptModule.cpp:
(WebCore::InjectedScriptModule::ensureInjected):
Only ASSERT the result was an object if the Module claims it returns an object.

* inspector/InjectedScriptCanvasModule.h:
(WebCore::InjectedScriptCanvasModule::returnsObject):
Return an object used later to call into the CanvasModule.

* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::injectedScriptForEval):
Ensure the CommandLineAPIModule is loaded in the Page's InjectedScript.

* inspector/CommandLineAPIModuleSource.js: Added.
Create the CommandLineAPI class and place it on injectedScript.

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype._evaluateOn):
Inject either the BasicCommandLineAPI or extended CommandLineAPI.
Derive the globalObject dynamically instead of assuming window.
Inject the commandLineAPI on window.console or the globalObject based on context.
Audit and rename uses of "window" to something like globalObject.

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

7 years agoWebKit2 View Gestures: Implement smartMagnifyWithEvent: and make it work
timothy_horton@apple.com [Fri, 20 Dec 2013 22:01:27 +0000 (22:01 +0000)]
WebKit2 View Gestures: Implement smartMagnifyWithEvent: and make it work
https://bugs.webkit.org/show_bug.cgi?id=125752
<rdar://problem/15664245>

Reviewed by Anders Carlsson.

Implement "smart magnify", which is the double-tap-to-zoom gesture on OS X.

* UIProcess/API/mac/WKView.mm:
(-[WKView smartMagnifyWithEvent:]):
Forward smartMagnifyWithEvent to ViewGestureController.

* UIProcess/mac/ViewGestureController.cpp:
(WebKit::ViewGestureController::handleMagnificationGesture):
Drive-by repair a comment.

(WebKit::ViewGestureController::handleSmartMagnificationGesture):
Added. Immediately dispatch a message to the web process to retrieve
the rendered rect of the element under the gesture.

(WebKit::maximumRectangleComponentDelta):
Return the absolute maximum delta between corresponding components of two rects.

(WebKit::ViewGestureController::didCollectGeometryForSmartMagnificationGesture):
Once the WebProcess has replied with the relevant geometry, use it to
determine our target rectangle (the element's rect, with some padding)
and target magnification (attempting to keep replaced elements
fully in-view, and otherwise zooming in as far as possible to fit the
element's width).

If this gesture occurs after the page is already magnified, and targets
a similar region to the previous smart magnification gesture, zoom out
instead of panning across the page.

Begin a transient zoom with the current magnification, and immediately
commit it at our target magnification and offset, so that the drawing
area will animate to the new parameters.

(WebKit::ViewGestureController::endActiveGesture):
* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureController.messages.in:
* WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
(WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
Hit-test the document to determine the node under the smart magnification
gesture, and return it to the UI process along with various other bits of data.

* WebProcess/WebPage/ViewGestureGeometryCollector.h:
* WebProcess/WebPage/ViewGestureGeometryCollector.messages.in:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
(WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
Instead of short-circuiting the animation if we didn't have to constrain
the origin, short-circuit if we're already *at* the right origin,
like the comment said. This prevents jarring jumps when double-tap-panning
between elements when zoomed all the way in.

* WebCore.exp.in:
Add some exports.

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

7 years agoAllow partial application of PlugInAutoStart tables based on timestamp
commit-queue@webkit.org [Fri, 20 Dec 2013 21:00:46 +0000 (21:00 +0000)]
Allow partial application of PlugInAutoStart tables based on timestamp
https://bugs.webkit.org/show_bug.cgi?id=125871

Patch by Ricky Mondello <rmondello@apple.com> on 2013-12-20
Reviewed by Anders Carlsson.

* UIProcess/API/C/WKContext.cpp:
(WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedBeforeTime): New API.
* UIProcess/API/C/WKContext.h: New API.

* UIProcess/Plugins/PlugInAutoStartProvider.cpp:
(WebKit::PlugInAutoStartProvider::setAutoStartOriginsTable): Call setAutoStartOriginsTableWithItemsPassingTest
    with a predicate that lets all policies pass.
(WebKit::PlugInAutoStartProvider::setAutoStartOriginsFilteringOutEntriesAddedBeforeTime): Call
    setAutoStartOriginsTableWithItemsPassingTest with a predicate that lets policies created before a certain
    time pass.
(WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest): Added. Contains most of the
    contents of setAutoStartOriginsTable, with support for applying a predicate.
* UIProcess/Plugins/PlugInAutoStartProvider.h: Add public method,
    `setAutoStartOriginsFilteringOutEntriesAddedBeforeTime`, and private method,
    `setAutoStartOriginsTableWithItemsPassingTest`.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::setPlugInAutoStartOriginsFilteringOutEntriesAddedBeforeTime): Pass through to the
    PlugInAutoStartProvider.
* UIProcess/WebContext.h: Declare `setPlugInAutoStartOriginsFilteringOutEntriesAddedBeforeTime`.

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

7 years agoMyles C. Maxfield is a committer now
mmaxfield@apple.com [Fri, 20 Dec 2013 20:54:03 +0000 (20:54 +0000)]
Myles C. Maxfield is a committer now

Unreviewed.

* Scripts/webkitpy/common/config/contributors.json:

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

7 years agohttp/tests/misc/object-image-error.html asserts
antti@apple.com [Fri, 20 Dec 2013 20:49:23 +0000 (20:49 +0000)]
http/tests/misc/object-image-error.html asserts
https://bugs.webkit.org/show_bug.cgi?id=126074

Reviewed by Andreas Kling.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAttachRenderers):
(WebCore::HTMLPlugInImageElement::updateWidgetCallback):
(WebCore::HTMLPlugInImageElement::startLoadingImage):
(WebCore::HTMLPlugInImageElement::startLoadingImageCallback):
* html/HTMLPlugInImageElement.h:

    Start image load from post-attach so we don't re-enter attach when image load fails synchronously.

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

7 years agoClean up DFG write barriers
mhahnenberg@apple.com [Fri, 20 Dec 2013 20:19:59 +0000 (20:19 +0000)]
Clean up DFG write barriers
https://bugs.webkit.org/show_bug.cgi?id=126047

Reviewed by Filip Pizlo.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::storeToWriteBarrierBuffer): Use the register allocator to
determine which registers need saving instead of saving every single one of them.
(JSC::DFG::SpeculativeJIT::osrWriteBarrier): We don't need to save live register state
because the write barriers during OSR execute when there are no live registers. Also we
don't need to use pushes to pad the stack pointer for pokes on x86; we can just use an add.
(JSC::DFG::SpeculativeJIT::writeBarrier):
* dfg/DFGSpeculativeJIT.h:
* jit/Repatch.cpp:
(JSC::emitPutReplaceStub):
(JSC::emitPutTransitionStub):
* runtime/VM.h: Get rid of writeBarrierRegisterBuffer since it's no longer used.

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

7 years ago[GTK] WebKitWebViewBase's ClickCounter should be reset
commit-queue@webkit.org [Fri, 20 Dec 2013 19:45:21 +0000 (19:45 +0000)]
[GTK] WebKitWebViewBase's ClickCounter should be reset
https://bugs.webkit.org/show_bug.cgi?id=122551

Patch by Enrique Ocaña González <eocanha@igalia.com> on 2013-12-20
Reviewed by Martin Robinson.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::didCommitLoadForMainFrame):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseResetClickCounter):
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:

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

7 years agoCrashes in AccessibilityRenderObject::computeAccessibilityIsIgnored()
antti@apple.com [Fri, 20 Dec 2013 19:05:34 +0000 (19:05 +0000)]
Crashes in AccessibilityRenderObject::computeAccessibilityIsIgnored()
https://bugs.webkit.org/show_bug.cgi?id=126073

Reviewed by Ryosuke Niwa.

Prevent the crash and try to catch in debug why it is happening.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
(WebCore::AccessibilityRenderObject::~AccessibilityRenderObject):
(WebCore::AccessibilityRenderObject::detach):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
* accessibility/AccessibilityRenderObject.h:

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

7 years ago[Win] Unreviewed build fix after r160908.
bfulgham@apple.com [Fri, 20 Dec 2013 17:27:19 +0000 (17:27 +0000)]
[Win] Unreviewed build fix after r160908.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Add
missing export.

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

7 years agoFix asserting accesibility tests.
antti@apple.com [Fri, 20 Dec 2013 16:50:53 +0000 (16:50 +0000)]
Fix asserting accesibility tests.

* html/HTMLElement.cpp:
(WebCore::HTMLElement::supportsFocus): Accessibility code checks focus status during painting.

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

7 years ago[MIPS] Missing MacroAssemblerMIPS::branchTest8(ResultCondition, BaseIndex, TrustedImm32)
commit-queue@webkit.org [Fri, 20 Dec 2013 15:51:00 +0000 (15:51 +0000)]
[MIPS] Missing MacroAssemblerMIPS::branchTest8(ResultCondition, BaseIndex, TrustedImm32)
https://bugs.webkit.org/show_bug.cgi?id=126062

Patch by Balazs Kilvady <kilvadyb@homejinni.com> on 2013-12-20
Reviewed by Mark Hahnenberg.

* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::branchTest8):

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

7 years ago[sh4] Add missing implementation in MacroAssembler to fix build.
commit-queue@webkit.org [Fri, 20 Dec 2013 15:48:46 +0000 (15:48 +0000)]
[sh4] Add missing implementation in MacroAssembler to fix build.
https://bugs.webkit.org/show_bug.cgi?id=126063

Patch by Julien Brianceau <jbriance@cisco.com> on 2013-12-20
Reviewed by Mark Hahnenberg.

* assembler/MacroAssemblerSH4.h:
(JSC::MacroAssemblerSH4::branchTest8):

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

7 years ago[arm] Add missing implementation in MacroAssembler to fix CPU(ARM_TRADITIONAL) build.
commit-queue@webkit.org [Fri, 20 Dec 2013 15:46:34 +0000 (15:46 +0000)]
[arm] Add missing implementation in MacroAssembler to fix CPU(ARM_TRADITIONAL) build.
https://bugs.webkit.org/show_bug.cgi?id=126064

Patch by Julien Brianceau <jbriance@cisco.com> on 2013-12-20
Reviewed by Mark Hahnenberg.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::branchTest8):

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

7 years agoUnreviewed GTK build fix after r160909.
zandobersek@gmail.com [Fri, 20 Dec 2013 15:36:56 +0000 (15:36 +0000)]
Unreviewed GTK build fix after r160909.
Remove remaining uses of AttachLazily in code specific to the GTK port.

* html/shadow/MediaControlsGtk.cpp:
(WebCore::MediaControlsGtk::initializeControls):
(WebCore::MediaControlsGtk::createTextTrackDisplay):

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

7 years ago[GTK] The fullscreen API should be enabled by default
commit-queue@webkit.org [Fri, 20 Dec 2013 14:58:40 +0000 (14:58 +0000)]
[GTK] The fullscreen API should be enabled by default
https://bugs.webkit.org/show_bug.cgi?id=125993

Patch by Enrique Ocaña González <eocanha@igalia.com> on 2013-12-20
Reviewed by Gustavo Noronha Silva.

Set the WebSettings property to TRUE

Source/WebKit/gtk:

* webkit/webkitwebsettings.cpp:
(webkit_web_settings_class_init):

Source/WebKit2:

* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_class_init):

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

7 years agoCreate render tree lazily
antti@apple.com [Fri, 20 Dec 2013 14:44:23 +0000 (14:44 +0000)]
Create render tree lazily
https://bugs.webkit.org/show_bug.cgi?id=120685

Source/WebCore:

Reviewed by Andreas Kling.

We currently recompute style and construct renderer for each DOM node immediately after they are added to
the tree. This is often inefficient as the style may change immediately afterwards and the work needs to be
redone.

With this patch we always compute style and construct render tree lazily, either on style recalc timer or
synchronously when they are needed. It also removes the 'attached' bit. If document has render tree then
all nodes are conceptually "attached" even if this happens lazily.

The patch slightly changes behavior of implicit CSS transitions. A synchronous style change during parsing
may not trigger the animation anymore as laziness means we don't see anything changing. This matches Firefox
and Chrome in our test cases.

* WebCore.exp.in:
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::insertBefore):
(WebCore::JSNode::replaceChild):
(WebCore::JSNode::appendChild):

    All attaching is now lazy, remove AttachLazily.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):

    SVG renderers with !isValid() have empty display property value for some reason. Keep the behavior.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::parserInsertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::appendChild):
(WebCore::ContainerNode::parserAppendChild):
(WebCore::ContainerNode::updateTreeAfterInsertion):
* dom/ContainerNode.h:
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::createRenderTree):
(WebCore::Document::destroyRenderTree):

    Remove attach bit maintenance.

(WebCore::Document::webkitDidExitFullScreenForElement):

    Do lazy render tree reconstruction after returning from full screen. That is the only reliable way
    to get the render tree back to decent shape.

* dom/Element.cpp:
(WebCore::Element::isFocusable):

    Remove pointless !renderer()->needsLayout() assert.

(WebCore::Element::addShadowRoot):
(WebCore::Element::childShouldCreateRenderer):
(WebCore::Element::resetComputedStyle):

    Take care to reset computed style in all descendants. attachRenderTree no longer does this.

* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::insertBefore):
(WebCore::Node::replaceChild):
(WebCore::Node::appendChild):
(WebCore::Node::setNeedsStyleRecalc):

    Propagate ReconstructRenderTree.

(WebCore::Node::attached):

    Emulate the behavior of old attached bit for now so existing code calling this mostly stays working.

* dom/Node.h:

    Add new ReconstructRenderTree value for StyleChangeType.

* dom/Range.cpp:
(WebCore::Range::isPointInRange):
(WebCore::Range::comparePoint):
(WebCore::Range::compareNode):
(WebCore::Range::intersectsNode):
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::canRebalance):
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::doApply):
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::activeElement):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setInnerText):

    TextControlInnerTextElement always preserves newline even if it doesn't have style yet.

(WebCore::HTMLElement::supportsFocus):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::parseAttribute):
* html/HTMLFormControlElement.cpp:
(WebCore::shouldAutofocus):

    Don't autofocus until we have renderer.

* html/HTMLFormControlElementWithState.cpp:
(WebCore::HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType):

    Lazy render tree construction.

(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::defaultEventHandler):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseAttribute):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::executeTask):

    Don't attach renderer after construction.

* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::invalidateDistribution):
* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::willAttachRenderers):
(WebCore::InsertionPoint::willDetachRenderers):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::createTextTrackDisplay):
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::createControls):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::getDisplayTree):
* loader/PlaceholderDocument.cpp:
(WebCore::PlaceholderDocument::createRenderTree):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::preload):
* style/StyleResolveTree.cpp:
(WebCore::Style::attachTextRenderer):
(WebCore::Style::detachTextRenderer):

    Remove attached bit maintenance.

(WebCore::Style::attachChildren):
(WebCore::Style::attachShadowRoot):
(WebCore::Style::attachRenderTree):
(WebCore::Style::detachShadowRoot):
(WebCore::Style::detachRenderTree):
(WebCore::Style::resolveLocal):
* svg/SVGTests.cpp:
(WebCore::SVGTests::handleAttributeChange):

    Make lazy.

* testing/Internals.cpp:
(WebCore::Internals::attached):
(WebCore::Internals::elementRenderTreeAsText):
(WebCore::Internals::markerAt):
(WebCore::Internals::nodesFromRect):

LayoutTests:

Reviewed by Andreas Kling.

Most of these are non-visible render tree dump changes (they become simpler).

* editing/selection/click-on-head-margin-expected.txt:
* fast/css-generated-content/before-content-continuation-chain-expected.txt:
* fast/css/transition-color-unspecified.html:
* fast/dom/adopt-node-crash-2-expected.txt:
* fast/dom/modify-node-and-while-in-the-callback-too-crash-expected.txt:
* fast/forms/radio/radio_checked_dynamic-expected.txt:
* fast/frames/lots-of-iframes-expected.txt:
* fast/frames/sandboxed-iframe-autofocus-denied-expected.txt:
* fast/table/table-row-style-not-updated-with-after-content-expected.txt:
* fullscreen/full-screen-render-inline-expected.txt:
* fullscreen/parent-flow-inline-with-block-child-expected.txt:
* platform/mac/editing/inserting/break-blockquote-after-delete-expected.txt:
* platform/mac/fast/css-generated-content/table-row-group-to-inline-expected.txt:
* platform/mac/fast/dynamic/011-expected.txt:
* platform/mac/fast/forms/formmove3-expected.txt:
* platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt:
* platform/mac/fast/invalid/001-expected.txt:
* platform/mac/fast/invalid/003-expected.txt:
* platform/mac/fast/invalid/004-expected.txt:
* platform/mac/fast/invalid/007-expected.txt:
* platform/mac/fast/invalid/019-expected.txt:
* platform/mac/fast/multicol/span/span-as-immediate-child-generated-content-expected.txt:
* platform/mac/fast/multicol/span/span-as-immediate-columns-child-dynamic-expected.txt:
* platform/mac/fast/multicol/span/span-as-nested-columns-child-dynamic-expected.txt:
* platform/mac/fast/ruby/ruby-base-merge-block-children-crash-expected.txt:
* platform/mac/tables/mozilla/bugs/bug113235-1-expected.txt:
* platform/mac/tables/mozilla/bugs/bug647-expected.txt:
* platform/mac/tables/mozilla/other/wa_table_tr_align-expected.txt:
* plugins/plugin-remove-readystatechange-expected.txt:
* svg/custom/system-language-crash-expected.txt:
* transitions/equivalent-background-image-no-transition.html:
* transitions/repeated-firing-background-color.html:
* transitions/transition-duration-cleared-in-transitionend-crash.html:

    Adopt a few transition test cases to new behavior.

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

7 years ago[ATK] [WK2] platform/gtk/accessibility/roles-exposed.html is failing
mario.prada@samsung.com [Fri, 20 Dec 2013 14:12:04 +0000 (14:12 +0000)]
[ATK] [WK2] platform/gtk/accessibility/roles-exposed.html is failing
https://bugs.webkit.org/show_bug.cgi?id=125854

Reviewed by Chris Fleizach.

Tools:

Ensure we don't ever create instances of AccessibilityUIElement
wrapping invalid platform-specific accessibility objects in DRT,
both for consistency with what WKTR does (so we avoid situations
where some tests fail in WK2 and not in WK1) and also to avoid
overlooking tests that might not be checking the right thing.

* DumpRenderTree/AccessibilityUIElement.cpp:
(AccessibilityUIElement::makeJSAccessibilityUIElement): Return a
nullPtr if the platformUIElement() is not a valid one.
* DumpRenderTree/AccessibilityUIElement.h:
(AccessibilityUIElement::platformUIElement): Added const modifier.

LayoutTests:

Updated tests and expectations to keep them passing after the
change done in DRT, without changing their actual purpose.

* platform/gtk/accessibility/roles-exposed.html: Make sure we
print "AXRole: (no element)" when accessibilityElementByID() does
not return a valid object, not to confuse it with cases where the
returned string for the role is an empty string.
* platform/gtk/accessibility/roles-exposed-expected.txt: Update
test expectations to reflect the "AXRole: (no element)" string
that is now being exposed. Also, replace the (wrongly added) PASS
expectations with FAIL for rowgroups, which are currently not
being exposed for ATK either.

* accessibility/deleting-iframe-destroys-axcache.html: Just
consider the first and third sons of the accessibility object for
the body (instead of the grandsons), so the test can run both in
Mac, where sons and grandsons are exposed, and ATK, where only
sons are exposed (no StaticText objects exposed there).

* accessibility/non-data-table-cell-title-ui-element.html: Use
accessibilityElementById() to get the accessibility object for the
"skip" table header instead of navigating with childAtIndex(),
since the hierarchy is not the same for Mac and ATK based ports.

* platform/mac/accessibility/search-predicate.html: Do not rely on
shouldBe() together with the string "AXRole: " when asking for the
role of objects that should no longer be in the accessibility
tree, and use shouldBeUndefined() instead.
* platform/mac/accessibility/search-when-element-starts-in-table.html: Ditto.

* platform/mac/accessibility/search-predicate-expected.txt: Update
expectations according to the usage of shouldBeUndefined().
* platform/mac/accessibility/search-when-element-starts-in-table-expected.txt: Ditto.

* platform/mac/TestExpectations: Add loading-iframe-updates-axtree.html
here, since it seems not to be returning the expected values for
either the scrollarea and the webarea in the iframe (see bug 126066).

* platform/mac-wk2/TestExpectations: Add search-when-element-starts-in-table.html
here, since it does not return an undefined object in WebKit2 when
the search query should return no results (see bug 125996).

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

7 years agoDevirtualize RenderElement::setStyle().
akling@apple.com [Fri, 20 Dec 2013 13:47:42 +0000 (13:47 +0000)]
Devirtualize RenderElement::setStyle().
<https://webkit.org/b/126065>

setStyle() was only virtual in order to let RenderSVGBlock override
the display type in some cases. Devirtualized it and moved the fixup
logic to StyleResolver::adjustRenderStyle().

This hack had an evil twin in RenderElement::initializeStyle() that
also goes away. FIXME--!

Based on a Blink change by Elliott Sprehn.

Reviewed by Antti Koivisto.

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

7 years ago[CSS Regions] When changing flow-from/flow-into on :hover, elements overflowing the...
stavila@adobe.com [Fri, 20 Dec 2013 13:44:45 +0000 (13:44 +0000)]
[CSS Regions] When changing flow-from/flow-into on :hover, elements overflowing the region are not correctly repainted
https://bugs.webkit.org/show_bug.cgi?id=117259

Reviewed by Antti Koivisto.

Source/WebCore:

When computing the repaint rect for a region, the existing visual overflow must be taken into consideration.
For this purpose, I overridden the visualOverflowRect method in RenderNamedFlowFragment, which ends up being
called from RenderBox::clippedOverflowRectForRepaint.

Test: fast/regions/hover-single-flow-from-none-overflow.html
      fast/regions/hover-single-flow-from-none-overflow-top.html

* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::visualOverflowRect):
* rendering/RenderNamedFlowFragment.h:

LayoutTests:

Added new tests and rebased existing test.

* fast/regions/hover-single-flow-from-none-overflow-expected.html: Added.
* fast/regions/hover-single-flow-from-none-overflow.html: Added.
* fast/regions/hover-single-flow-from-none-overflow-top-expected.html: Added.
* fast/regions/hover-single-flow-from-none-overflow-top.html: Added.
* fast/regions/repaint/repaint-regions-overflow-expected.txt: Rebased.

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

7 years ago[GTK] Some unit tests using web extensions fail when run alone
carlosgc@webkit.org [Fri, 20 Dec 2013 12:11:45 +0000 (12:11 +0000)]
[GTK] Some unit tests using web extensions fail when run alone
https://bugs.webkit.org/show_bug.cgi?id=126002

Reviewed by Gustavo Noronha Silva.

The problem is that the page is created before the dbus connection
has been established, and we are connecting to web-page-created
signal once we have a valid dbus connection. We should connect to
the signal before connecting to dbus and queue any request to emit
a dbus signal until the connection is set. This also fixes the
WebExtensions tests when using the network process because a new
web process is launched for every test case.

* UIProcess/API/gtk/tests/WebExtensionTest.cpp:
(DelayedSignal::DelayedSignal): Helper struct to queue signal
emissions requested before the dbus connection has been
established.
(emitDocumentLoaded): Emit the dbus DocumentLoaded signal.
(documentLoadedCallback): Queue the signal emission if we still
don't have a connection or call emitDocumentLoaded otherwise.
(emitURIChanged): Emit the dbus URIChanged signal.
(uriChangedCallback): Queue the signal emission if we still don't
have a connection or call emitURIChanged otherwise.
(pageCreatedCallback): Pass the web extension as user data to
document-loaded and uri-changed callbacks.
(busAcquiredCallback): Set the connection as user data of the web
extension and process any delayed signal emission pending.
(webkit_web_extension_initialize): Connect to web-page-create
signal before connecting to dbus.

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

7 years agoProgrammatically-inserted children lack accessibility events
mario.prada@samsung.com [Fri, 20 Dec 2013 11:52:17 +0000 (11:52 +0000)]
Programmatically-inserted children lack accessibility events
https://bugs.webkit.org/show_bug.cgi?id=100275

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/children-changed-sends-notification.html

Emit children-changed::add and children-changed::remove whenever
an object has been added/removed to the accessibility hierarchy,
that is, when a new AtkObject is being attached/detached.

* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::detachWrapper): Added a new parameter and
updated all the prototypes in different ports.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::~AXObjectCache): Call detachWrapper()
specifying that we do it because the cache is being destroyed.
(WebCore::AXObjectCache::remove): Call detachWrapper() specifying
that we do it because an accessible element is being destroyed.

* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::detachWrapper): Emit the children-changed
signal when needed. We rely on the cached reference to the parent
AtkObject (using the implementation of atk_object_get_parent from
the AtkObject class) to find the right object to emit the signal
from here, since the accessibility hierarchy from WebCore will no
longer be accessible at this point.
(WebCore::AXObjectCache::attachWrapper): Emit the children-change
signal from here unless we are in the middle of a layout update,
trying to provide as much information (e.g. the offset) as possible.
(WebCore::AXObjectCache::postPlatformNotification): Make sure we
update (touch) the subtree under an accessibility object whenever
we receive AXChildrenChanded from WebCore, to ensure that those
objects will also be visible rightaway to ATs, and that those get
properly notified of the event at that very same moment.

* accessibility/ios/AXObjectCacheIOS.mm:
(WebCore::AXObjectCache::detachWrapper): Updated function signature.
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::detachWrapper): Ditto.
* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::detachWrapper): Ditto.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::children): Add the option ot
request the AccessibilityChildrenVector without updating it if
needed, to avoid maybe recreating the child subtree when trying to
get the offset of a newly attached element from attachWrapper.
* accessibility/AccessibilityObject.h:

Tools:

Update DRT and WebKitTestRunner to handle the children-changed
signal properly, considering the detail and optional parameters.

* DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp: Updated.
(axObjectEventListener):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp: Updated.

LayoutTests:

Add new test to chack that children-changed signals are properly
emitted when adding/removing elements in the accessibility hierarchy.

* accessibility/children-changed-sends-notification-expected.txt: Added.
* accessibility/children-changed-sends-notification.html: Added.

Update test to filter out unrelated non-loading events.
* accessibility/loading-iframe-sends-notification.html: Updated.

Skip the test on the Mac as it does not expose these kind of
notifications when children are being added or removed.
* platform/mac/TestExpectations: Skip newly added test.

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

7 years agoRemoved unused BUILDER_BASE_URL.
ossy@webkit.org [Fri, 20 Dec 2013 11:28:40 +0000 (11:28 +0000)]
Removed unused BUILDER_BASE_URL.
https://bugs.webkit.org/show_bug.cgi?id=125442

Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2013-12-20
Reviewed by Csaba Osztrogonác.

* Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
(JSONGeneratorTest._test_json_generation): Trivial test fix after r160900.

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

7 years agoMove function calls outside loop in dom
commit-queue@webkit.org [Fri, 20 Dec 2013 11:02:18 +0000 (11:02 +0000)]
Move function calls outside loop in dom
https://bugs.webkit.org/show_bug.cgi?id=125916

Patch by Laszlo Vidacs <lvidacs.u-szeged@partner.samsung.com> on 2013-12-20
Reviewed by Csaba Osztrogonác.

Do not call length() in each iteration.

* dom/Element.cpp:
(WebCore::Element::cloneAttributesFromElement):
* dom/Node.cpp:
(WebCore::Node::dumpStatistics):

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

7 years agoRemoved unused BUILDER_BASE_URL.
commit-queue@webkit.org [Fri, 20 Dec 2013 11:00:51 +0000 (11:00 +0000)]
Removed unused BUILDER_BASE_URL.
https://bugs.webkit.org/show_bug.cgi?id=125442

Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2013-12-20
Reviewed by Csaba Osztrogonác.

The string constant BUILDER_BASE_URL is passed around several times,
but we don't use it anywhere. It is a leftover from Chromium, cleaned it up.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._upload_json_files):
* Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
(JSONLayoutResultsGenerator.__init__):
* Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
(JSONResultsGenerator.__init__):

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

7 years agoBuild fails in debug mode after r160834.
commit-queue@webkit.org [Fri, 20 Dec 2013 10:52:32 +0000 (10:52 +0000)]
Build fails in debug mode after r160834.
https://bugs.webkit.org/show_bug.cgi?id=126059

Patch by Tamas Gergely <tgergely.u-szeged@partner.samsung.com> on 2013-12-20
Reviewed by Csaba Osztrogonác.

Debug mode build failed due to comparing signed and unsigned in
ASSERT(). Now both values are unsigned.

* wtf/dtoa/double-conversion.cc:

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

7 years agoREGRESSION: cnn.com will continue to reveal 1 px of overhang after rubber-banding
bdakin@apple.com [Fri, 20 Dec 2013 07:20:20 +0000 (07:20 +0000)]
REGRESSION: cnn.com will continue to reveal 1 px of overhang after rubber-banding
at the top
https://bugs.webkit.org/show_bug.cgi?id=126054

Reviewed by Simon Fraser.

This regression was caused by http://trac.webkit.org/changeset/160791 It turns out
that the line of code I removed was not always a no-op. In some instances, like on
cnn.com, it would ensure that our final scroll position after a rubber-band was
not something within the overhang area. It was still wrong in its assumption that
rubber-band is always bouncing back the spot it originated from. So this patch
continues to ignore the rubber-bands origin, and instead finds the nearest point
that is not in the overhang area, and scrolls to that point instead of the origin.

* page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary):
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::adjustScrollPositionToBoundsIfNecessary):
* platform/mac/ScrollElasticityController.h:
* platform/mac/ScrollElasticityController.mm:
(WebCore::ScrollElasticityController::snapRubberBandTimerFired):

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

7 years agoWeb Inspector: Frontend Error when selecting Database folder in Resources Sidebar
commit-queue@webkit.org [Fri, 20 Dec 2013 05:52:56 +0000 (05:52 +0000)]
Web Inspector: Frontend Error when selecting Database folder in Resources Sidebar
https://bugs.webkit.org/show_bug.cgi?id=126029

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

Treat the DatabaseHostTreeElement tree element like a folder. It pretty much
is a folder, but inherits from StorageTreeElement to share some code there.

* UserInterface/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._treeElementSelected):

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

7 years agoREGRESSION(r160847): fast/events/overflowchanged-inside-selection-collapse-crash...
rniwa@webkit.org [Fri, 20 Dec 2013 04:01:34 +0000 (04:01 +0000)]
REGRESSION(r160847): fast/events/overflowchanged-inside-selection-collapse-crash.html fails
https://bugs.webkit.org/show_bug.cgi?id=126037

Reviewed by Anders Carlsson.

Since overflowchanged event is now asynchronous, make the call to testRunner.notifyDone() also asynchronous.

* TestExpectations:
* fast/dynamic/paused-event-dispatch.html:

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

7 years agocheck-webkit-style mistakenly flags assigning to a dereferenced pointer
commit-queue@webkit.org [Fri, 20 Dec 2013 03:49:53 +0000 (03:49 +0000)]
check-webkit-style mistakenly flags assigning to a dereferenced pointer
https://bugs.webkit.org/show_bug.cgi?id=126041

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-12-19
Reviewed by Ryosuke Niwa.

When checking for lines like "Foo *bar;", check-webkit-style doesn't make
sure that there is a declaration. This patch makes sure that there is a
declaration in order to flag spacing around asterisks.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_pointer_reference_marker_location):

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

7 years agoClarify the behavior of composited canvases
simon.fraser@apple.com [Fri, 20 Dec 2013 03:48:10 +0000 (03:48 +0000)]
Clarify the behavior of composited canvases
https://bugs.webkit.org/show_bug.cgi?id=126042

Reviewed by Tim Horton.

Different platforms composite 2D and 3D canvases in different ways.

"Accelerated 2D" canvases, and WebGL are always set as GraphicsLayer
contents.

"IOSurface" canvases (Mac and iOS-only) get a compositing layer, but
paint into it (because this is fast, and a convenient way to get
synchronization).

So make these behaviors explicit in RenderLayerBacking and RenderLayerCompositor.
No behavior changes on OS X, bug fix on iOS.

* rendering/RenderLayerBacking.cpp:
(WebCore::canvasCompositingStrategy):
(WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
(WebCore::RenderLayerBacking::containsPaintedContent):
(WebCore::RenderLayerBacking::contentChanged):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForCanvas):

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

7 years agoVersioning.
lforschler@apple.com [Fri, 20 Dec 2013 02:58:16 +0000 (02:58 +0000)]
Versioning.

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

7 years agoWeb Inspector: Uncaught Exception: NavigationSidebarPanel.js: TypeError: undefined...
commit-queue@webkit.org [Fri, 20 Dec 2013 02:00:15 +0000 (02:00 +0000)]
Web Inspector: Uncaught Exception: NavigationSidebarPanel.js: TypeError: undefined is not a function
https://bugs.webkit.org/show_bug.cgi?id=126018

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

ERROR: TypeError: undefined is not a function (evaluating 'representedObject.saveIdentityToCookie(candidateObjectCookie)')

There are some TreeElements (Folders, and the special Databases Folder)
which do not have a represented object, and would throw an exception
when trying to use saveIdentityToCookie.

We should always provide a saveIdentityToCookie when possible. So just
blacklist the tree element types we know do not have representedObjects,
and where we don't want to save identity. This will continue to throw
exceptions in the future for tree elements that don't have the save
function implemented, but should.

Note that even if a TreeElement is constructed with a null represented
object, it becomes an empty object (representedObject || {}).

* UserInterface/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype.saveStateToCookie):
(WebInspector.NavigationSidebarPanel.prototype._isTreeElementWithoutRepresentedObject):
(WebInspector.NavigationSidebarPanel.prototype.treeElementMatchesCookie):
(WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):

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

7 years agoWeb Inspector: Add InspectorFrontendHost.debuggableType to let the frontend know...
commit-queue@webkit.org [Fri, 20 Dec 2013 01:59:19 +0000 (01:59 +0000)]
Web Inspector: Add InspectorFrontendHost.debuggableType to let the frontend know it's backend is JavaScript or Web
https://bugs.webkit.org/show_bug.cgi?id=126016

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

Source/JavaScriptCore:

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::listingForDebuggable):
* inspector/remote/RemoteInspectorConstants.h:
Include a debuggable type identifier in the debuggable listing,
so the remote frontend can know if it is debugging a Web Page
or JS Context.

Source/WebCore:

* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::debuggableType):
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
Expose the debuggableType to the frontend. In WebCore it is always a "web" type.

Source/WebInspectorUI:

* UserInterface/LoadInspectorBackendCommands.js:
If the debuggable target is "web" load both JS and Web backend commands.
Otherwise, we only load the default, js backend commands.

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

7 years ago[WK2][iOS] Enable multiprocess by default
benjamin@webkit.org [Fri, 20 Dec 2013 01:41:22 +0000 (01:41 +0000)]
[WK2][iOS] Enable multiprocess by default
https://bugs.webkit.org/show_bug.cgi?id=126030

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-12-19
Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKProcessGroup.mm:
(-[WKProcessGroup initWithInjectedBundleURL:]):

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

7 years agoAdd an utility class to simplify generating function calls
benjamin@webkit.org [Fri, 20 Dec 2013 01:39:09 +0000 (01:39 +0000)]
Add an utility class to simplify generating function calls
https://bugs.webkit.org/show_bug.cgi?id=125972

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Split branchTest32 in two functions: test32AndSetFlags and branchOnFlags.
This is done to allow code where the flags are set, multiple operation that
do not modify the flags occur, then the flags are used.

This is used for function calls to test the return value while discarding the
return register.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::test32AndSetFlags):
(JSC::MacroAssemblerX86Common::branchOnFlags):
(JSC::MacroAssemblerX86Common::branchTest32):

Source/WebCore:

FunctionCall is a little helper class to make function calls from the JIT
in 3 or 4 lines.

FunctionCall takes a StackAllocator, a RegisterAllocator and a function pointer.
When the call is generated, the helper saves the registers as necessary, aligns
the stack, does the call, restores the stack, and restore the registers.

* cssjit/FunctionCall.h: Added.
(WebCore::FunctionCall::FunctionCall):
(WebCore::FunctionCall::setFunctionAddress):
(WebCore::FunctionCall::setFirstArgument):
(WebCore::FunctionCall::call):

(WebCore::FunctionCall::callAndBranchOnCondition): Most test functions used
with FunctionCall return a boolean. When the boolean is the sole purpose of the function
call, this provides an easy way to branch on the boolean without worrying about registers.

The return register is tested first, then all the saved registers are restored from the stack
(which can include the return register), finally the flags are used for a jump.

(WebCore::FunctionCall::prepareAndCall):
(WebCore::FunctionCall::cleanupPostCall):
(WebCore::FunctionCall::saveAllocatedRegisters):
(WebCore::FunctionCall::restoreAllocatedRegisters):
* WebCore.xcodeproj/project.pbxproj:
* cssjit/FunctionCall.h: Added.
(WebCore::FunctionCall::FunctionCall):
(WebCore::FunctionCall::setFunctionAddress):
(WebCore::FunctionCall::setFirstArgument):
(WebCore::FunctionCall::call):
(WebCore::FunctionCall::callAndBranchOnCondition):
(WebCore::FunctionCall::prepareAndCall):
(WebCore::FunctionCall::cleanupPostCall):
(WebCore::FunctionCall::saveAllocatedRegisters):
(WebCore::FunctionCall::restoreAllocatedRegisters):

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

7 years agoBegin stubbing out the KeyedDecoder class
andersca@apple.com [Fri, 20 Dec 2013 01:18:49 +0000 (01:18 +0000)]
Begin stubbing out the KeyedDecoder class
https://bugs.webkit.org/show_bug.cgi?id=126031

Reviewed by Andreas Kling.

KeyedDecoder is going to be the new way to decode back forward trees.

* history/HistoryItem.cpp:
(WebCore::HistoryItem::decodeBackForwardTree):
* history/HistoryItem.h:
* platform/KeyedCoding.h:
(WebCore::KeyedDecoder::~KeyedDecoder):

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

7 years agoDOM bindings should use thisValue for attributes
oliver@apple.com [Fri, 20 Dec 2013 00:52:06 +0000 (00:52 +0000)]
DOM bindings should use thisValue for attributes
https://bugs.webkit.org/show_bug.cgi?id=126011

Reviewed by Antti Koivisto.

Source/WebCore:

Make all standard DOM attributes use the thisValue instead
of the slot object.  This requires using a dynamic cast in
the attribute getters. Happily for normal uses this a single
indirect load and pointer compare, and we were already doing
it for many attributes.

Alas it's too expensive to do this on the window object still
due to the proxy indirection that intercepts global variable
access.  I'll correct this in a follow on patch (bug 126013).

A number of custom getters have also been updated to use the
thisValue and full type checks.

This patch still leaves the index and generic named getters
on the slot based model as fixing these cases requires more
complicated changes.

* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::cssPropertyGetterPixelOrPosPrefixCallback):
(WebCore::cssPropertyGetterCallback):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementPropertyGetter):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectExcitingAttr):
(WebCore::jsTestActiveDOMObjectConstructor):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::jsTestCustomNamedGetterConstructor):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::jsTestEventConstructorAttr1):
(WebCore::jsTestEventConstructorAttr2):
(WebCore::jsTestEventConstructorConstructor):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::jsTestEventTargetConstructor):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::jsTestExceptionName):
(WebCore::jsTestExceptionConstructor):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::jsTestGenerateIsReachableConstructor):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttr):
(WebCore::jsTestInterfaceConstructorImplementsStaticAttr):
(WebCore::jsTestInterfaceImplementsStr1):
(WebCore::jsTestInterfaceImplementsStr2):
(WebCore::jsTestInterfaceImplementsStr3):
(WebCore::jsTestInterfaceImplementsNode):
(WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
(WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
(WebCore::jsTestInterfaceSupplementalStr1):
(WebCore::jsTestInterfaceSupplementalStr2):
(WebCore::jsTestInterfaceSupplementalStr3):
(WebCore::jsTestInterfaceSupplementalNode):
(WebCore::jsTestInterfaceConstructor):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::jsTestMediaQueryListListenerConstructor):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::jsTestNamedConstructorConstructor):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::jsTestNodeConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjReadOnlyLongAttr):
(WebCore::jsTestObjReadOnlyStringAttr):
(WebCore::jsTestObjReadOnlyTestObjAttr):
(WebCore::jsTestObjConstructorStaticReadOnlyLongAttr):
(WebCore::jsTestObjConstructorStaticStringAttr):
(WebCore::jsTestObjConstructorTestSubObj):
(WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
(WebCore::jsTestObjEnumAttr):
(WebCore::jsTestObjByteAttr):
(WebCore::jsTestObjOctetAttr):
(WebCore::jsTestObjShortAttr):
(WebCore::jsTestObjUnsignedShortAttr):
(WebCore::jsTestObjLongAttr):
(WebCore::jsTestObjLongLongAttr):
(WebCore::jsTestObjUnsignedLongLongAttr):
(WebCore::jsTestObjStringAttr):
(WebCore::jsTestObjTestObjAttr):
(WebCore::jsTestObjXMLObjAttr):
(WebCore::jsTestObjCreate):
(WebCore::jsTestObjReflectedStringAttr):
(WebCore::jsTestObjReflectedIntegralAttr):
(WebCore::jsTestObjReflectedUnsignedIntegralAttr):
(WebCore::jsTestObjReflectedBooleanAttr):
(WebCore::jsTestObjReflectedURLAttr):
(WebCore::jsTestObjReflectedCustomIntegralAttr):
(WebCore::jsTestObjReflectedCustomBooleanAttr):
(WebCore::jsTestObjReflectedCustomURLAttr):
(WebCore::jsTestObjTypedArrayAttr):
(WebCore::jsTestObjAttrWithGetterException):
(WebCore::jsTestObjAttrWithSetterException):
(WebCore::jsTestObjStringAttrWithGetterException):
(WebCore::jsTestObjStringAttrWithSetterException):
(WebCore::jsTestObjCustomAttr):
(WebCore::jsTestObjWithScriptStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAttribute):
(WebCore::jsTestObjWithScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
(WebCore::jsTestObjConditionalAttr1):
(WebCore::jsTestObjConditionalAttr2):
(WebCore::jsTestObjConditionalAttr3):
(WebCore::jsTestObjConditionalAttr4Constructor):
(WebCore::jsTestObjConditionalAttr5Constructor):
(WebCore::jsTestObjConditionalAttr6Constructor):
(WebCore::jsTestObjCachedAttribute1):
(WebCore::jsTestObjCachedAttribute2):
(WebCore::jsTestObjAnyAttribute):
(WebCore::jsTestObjContentDocument):
(WebCore::jsTestObjMutablePoint):
(WebCore::jsTestObjImmutablePoint):
(WebCore::jsTestObjStrawberry):
(WebCore::jsTestObjStrictFloat):
(WebCore::jsTestObjDescription):
(WebCore::jsTestObjId):
(WebCore::jsTestObjHash):
(WebCore::jsTestObjReplaceableAttribute):
(WebCore::jsTestObjNullableDoubleAttribute):
(WebCore::jsTestObjNullableLongAttribute):
(WebCore::jsTestObjNullableBooleanAttribute):
(WebCore::jsTestObjNullableStringAttribute):
(WebCore::jsTestObjNullableLongSettableAttribute):
(WebCore::jsTestObjNullableStringValue):
(WebCore::jsTestObjAttribute):
(WebCore::jsTestObjAttributeWithReservedEnumType):
(WebCore::jsTestObjConstructor):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::jsTestOverloadedConstructorsConstructor):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::jsTestSerializedScriptValueInterfaceValue):
(WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
(WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
(WebCore::jsTestSerializedScriptValueInterfacePorts):
(WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
(WebCore::jsTestSerializedScriptValueInterfaceConstructor):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsUnsignedLongLongAttr):
(WebCore::jsTestTypedefsImmutableSerializedScriptValue):
(WebCore::jsTestTypedefsConstructorTestSubObj):
(WebCore::jsTestTypedefsAttrWithGetterException):
(WebCore::jsTestTypedefsAttrWithSetterException):
(WebCore::jsTestTypedefsStringAttrWithGetterException):
(WebCore::jsTestTypedefsStringAttrWithSetterException):
(WebCore::jsTestTypedefsConstructor):
* bindings/scripts/test/JS/JSattribute.cpp:
(WebCore::jsattributeReadonly):
(WebCore::jsattributeConstructor):
* bindings/scripts/test/JS/JSreadonly.cpp:
(WebCore::jsreadonlyConstructor):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::lengthGetter):
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::lengthGetter):

LayoutTests:

* js/dom/dom-attributes-on-mismatch-type.html: Added.
* js/dom/dom-attributes-on-mismatch-type-expected.txt: Added.

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

7 years agoPut write barriers in the right places in the baseline JIT
mhahnenberg@apple.com [Fri, 20 Dec 2013 00:49:58 +0000 (00:49 +0000)]
Put write barriers in the right places in the baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=125975

Reviewed by Filip Pizlo.

* jit/JIT.cpp:
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
(JSC::JIT::emitArrayProfilingSite):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_enter):
(JSC::JIT::emitSlow_op_enter):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_enter):
(JSC::JIT::emitSlow_op_enter):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitArrayStoragePutByVal):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitPutGlobalProperty):
(JSC::JIT::emitPutGlobalVar):
(JSC::JIT::emitPutClosureVar):
(JSC::JIT::emit_op_init_global_const):
(JSC::JIT::checkMarkWord):
(JSC::JIT::emitWriteBarrier):
(JSC::JIT::privateCompilePutByVal):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitGenericContiguousPutByVal):
(JSC::JIT::emitArrayStoragePutByVal):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitSlow_op_put_by_id):
(JSC::JIT::emitPutGlobalProperty):
(JSC::JIT::emitPutGlobalVar):
(JSC::JIT::emitPutClosureVar):
(JSC::JIT::emit_op_init_global_const):
* jit/Repatch.cpp:
(JSC::emitPutReplaceStub):
(JSC::emitPutTransitionStub):
(JSC::repatchPutByID):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:

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

7 years agoRemove WebFilterEvaluator wrappers from WebKitSystemInterface
aestes@apple.com [Fri, 20 Dec 2013 00:48:27 +0000 (00:48 +0000)]
Remove WebFilterEvaluator wrappers from WebKitSystemInterface
https://bugs.webkit.org/show_bug.cgi?id=126028

Reviewed by Anders Carlsson.

Source/WebCore:

It's overkill to pipe access to WebFilterEvaluator through
WebKitSystemInterface. Instead, include WebFilterEvaluator.h when it
exists and re-declare WebFilterEvaluator when it doesn't.

WebKitSystemInterface used to soft-link WebContentAnalysis.framework
since OS X 10.7 didn't contain this framework. Since we no longer
support 10.7, we can now directly link against the framework.

* Configurations/WebCore.xcconfig: Add /System/Library/PrivateHeaders
to the system framework search path at both compile and link time so
that we can find WebContentAnalysis.framework.
* WebCore.exp.in: Don't export removed symbols.
* WebCore.xcodeproj/project.pbxproj: Added WebContentAnalysis.framework
to the 'Link Binary With Libraries' build phase.
* platform/mac/ContentFilterMac.mm: Included WebFilterEvaluator.h when
it exists and re-declared WebFilterEvaluator when it doesn't.
(WebCore::ContentFilter::ContentFilter): Directly called a method on
m_platformContentFilter rather than going through WKSI.
(WebCore::ContentFilter::isEnabled): Ditto.
(WebCore::ContentFilter::addData): Ditto.
(WebCore::ContentFilter::finishedAddingData): Ditto.
(WebCore::ContentFilter::needsMoreData): Ditto.
(WebCore::ContentFilter::didBlockData): Ditto.
* platform/mac/WebCoreSystemInterface.h: Removed function pointers for
calling into WKSI.
* platform/mac/WebCoreSystemInterface.mm: Ditto.

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Don't INIT() removed function pointers.

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Don't INIT() removed function pointers.

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

7 years agoImplement ArrayBuffer.isView
bfulgham@apple.com [Fri, 20 Dec 2013 00:42:47 +0000 (00:42 +0000)]
Implement ArrayBuffer.isView
https://bugs.webkit.org/show_bug.cgi?id=126004

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Test coverage in webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html

* runtime/JSArrayBufferConstructor.cpp:
(JSC::JSArrayBufferConstructor::finishCreation): Add 'isView' to object constructor.
(JSC::arrayBufferFuncIsView): New method.

LayoutTests:

* webgl/1.0.2/resources/webgl_test_files/conformance/typedarrays/array-unit-tests.html:
Correct test for 'isView' to actually check for 'isView' function.

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

7 years agoLayout Test plugins/destroy-during-npp-new.html is flaky
ap@apple.com [Fri, 20 Dec 2013 00:39:14 +0000 (00:39 +0000)]
Layout Test plugins/destroy-during-npp-new.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=126027

* plugins/destroy-during-npp-new.html: Streamlined the test a little bit to see
what changes, if anything. There should be no effect on what is tested.

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

7 years agoRemove WKContentViewPrivate.h, WKContentView.h is private now
benjamin@webkit.org [Fri, 20 Dec 2013 00:22:50 +0000 (00:22 +0000)]
Remove WKContentViewPrivate.h, WKContentView.h is private now
https://bugs.webkit.org/show_bug.cgi?id=125981

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-12-19
Reviewed by Dan Bernstein.

There is no need for a separate header, WKContentView has become an implementation
detail of WKView.

* UIProcess/API/ios/WKContentView.h:
* UIProcess/API/ios/WKContentViewInternal.h:
* UIProcess/API/ios/WKContentViewPrivate.h: Removed.
* UIProcess/API/ios/WKView.mm:

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

7 years agoFix broken C loop LLINT build.
mark.lam@apple.com [Fri, 20 Dec 2013 00:09:35 +0000 (00:09 +0000)]
Fix broken C loop LLINT build.
https://bugs.webkit.org/show_bug.cgi?id=126024.

Reviewed by Oliver Hunt.

* runtime/VM.h:

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

7 years agoREGRESSION (r160515): Frequent assertion failures on printing/print-close-crash.html
ap@apple.com [Thu, 19 Dec 2013 23:32:50 +0000 (23:32 +0000)]
REGRESSION (r160515): Frequent assertion failures on printing/print-close-crash.html
https://bugs.webkit.org/show_bug.cgi?id=126014

Rolled out r160515 while Chris is investigating. Added FIXME comments in other
places where we use this pattern.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::runJavaScriptAlert):
(WebKit::WebChromeClient::runJavaScriptConfirm):
(WebKit::WebChromeClient::runJavaScriptPrompt):
(WebKit::WebChromeClient::print):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):

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

7 years agoTest that text-decoration-skip: ink is the same as regular underlines if no descenders
commit-queue@webkit.org [Thu, 19 Dec 2013 23:24:30 +0000 (23:24 +0000)]
Test that text-decoration-skip: ink is the same as regular underlines if no descenders
https://bugs.webkit.org/show_bug.cgi?id=125985

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-12-19
Reviewed by Simon Fraser.

If there are no descenders in the underlined text, using the text-decoration-skip: ink
CSS property should behave as if it wasn't specified (and the underline is a normal one)

* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-no-descenders-expected.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-no-descenders.html: Added.

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

7 years agocheck-webkit-style marks rvalue references as violations
commit-queue@webkit.org [Thu, 19 Dec 2013 23:23:37 +0000 (23:23 +0000)]
check-webkit-style marks rvalue references as violations
https://bugs.webkit.org/show_bug.cgi?id=126000

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-12-19
Reviewed by Ryosuke Niwa.

Previously, check-webkit-style was making sure that any line with "&&" had
spaces around it. However, we can now legitimately use "&&" without a previous
space when declaring an rvalue reference. This patch relaxes this check.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_spacing_for_binary_ops):

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

7 years agocheck-webkit-style marks auto return types for functions as violations
commit-queue@webkit.org [Thu, 19 Dec 2013 23:22:09 +0000 (23:22 +0000)]
check-webkit-style marks auto return types for functions as violations
https://bugs.webkit.org/show_bug.cgi?id=125999

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-12-19
Reviewed by Ryosuke Niwa.

If a function declaration ends with a "->" followed by a non whitespace
string, don't mark as an invalid "{" on its own line

* Scripts/webkitpy/style/checkers/cpp.py:
(check_braces):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_brace_at_begin_of_line):

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

7 years agoAdd WebKit2 API for clearing the back-forward list
commit-queue@webkit.org [Thu, 19 Dec 2013 23:14:27 +0000 (23:14 +0000)]
Add WebKit2 API for clearing the back-forward list
https://bugs.webkit.org/show_bug.cgi?id=126005

Patch by Ricky Mondello <rmondello@apple.com> on 2013-12-19
Reviewed by Anders Carlsson.

* UIProcess/API/C/WKBackForwardListRef.cpp:
(WKBackForwardListClear): Call through to the back-forward list's `clear()`.
* UIProcess/API/C/WKBackForwardListRef.h: Declare new API.

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

7 years agoOne more URTBF to make GTK build happy after r160853.
ossy@webkit.org [Thu, 19 Dec 2013 22:41:05 +0000 (22:41 +0000)]
One more URTBF to make GTK build happy after r160853.

* UIProcess/API/gtk/WebKitDownloadClient.cpp:
* UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
(didReceiveWebViewMessageFromInjectedBundle):
* UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
(webkitResponsePolicyDecisionCreate):
* UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h:

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

7 years agoURTBF for GTK after r160853.
ossy@webkit.org [Thu, 19 Dec 2013 22:08:39 +0000 (22:08 +0000)]
URTBF for GTK after r160853.

* GNUmakefile.list.am:

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

7 years ago[WinCairo] More GStreamer preparations.
alex.christensen@flexsim.com [Thu, 19 Dec 2013 22:07:08 +0000 (22:07 +0000)]
[WinCairo] More GStreamer preparations.

Unreviewed.

* WinLauncher/WinLauncher.vcxproj/WinLauncherCFLite.props:
Include FeatureDefinesCairo and WinCairo to compile the GLib part of WinLauncher.

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

7 years agoAdd Apple Mavericks perf bot.
lforschler@apple.com [Thu, 19 Dec 2013 22:04:26 +0000 (22:04 +0000)]
Add Apple Mavericks perf bot.

Unreviewed.

* BuildSlaveSupport/build.webkit.org-config/config.json:

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

7 years agoUnreviewed EFL build fix attempt after r160853
m.pakula@samsung.com [Thu, 19 Dec 2013 21:52:15 +0000 (21:52 +0000)]
Unreviewed EFL build fix attempt after r160853

* CMakeLists.txt: Change WebURLResponse.cpp to APIURLResponse.cpp.

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

7 years agoFinal preparations for GStreamer on Windows.
commit-queue@webkit.org [Thu, 19 Dec 2013 21:38:12 +0000 (21:38 +0000)]
Final preparations for GStreamer on Windows.
https://bugs.webkit.org/show_bug.cgi?id=125958

Patch by Alex Christensen <achristensen@webkit.org> on 2013-12-19
Reviewed by Benjamin Poulain.

Source/WTF:

* WTF.vcxproj/WTFDebugWinCairo.props:
* WTF.vcxproj/WTFReleaseWinCairo.props:
Include WinCairo.props.
* wtf/Platform.h:
Use GLib and GStreamer on WinCairo with video.

WebKitLibraries:

* win/tools/vsprops/FeatureDefinesCairo.props:
Removed duplicate ENABLE_VIDEO_TRACK definition.

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

7 years ago[WK2] Rename WebURLResponse to API::URLResponse
weinig@apple.com [Thu, 19 Dec 2013 21:32:15 +0000 (21:32 +0000)]
[WK2] Rename WebURLResponse to API::URLResponse
https://bugs.webkit.org/show_bug.cgi?id=125910

Reviewed by Andreas Kling.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/API/c/WKURLResponse.cpp:
(WKURLResponseGetTypeID):
* Shared/API/c/mac/WKURLResponseNS.mm:
(WKURLResponseCreateWithNSURLResponse):
* Shared/APIURLRequest.cpp:
* Shared/APIURLResponse.cpp: Copied from Source/WebKit2/Shared/WebURLResponse.cpp.
(API::URLResponse::URLResponse):
(API::URLResponse::encode):
(API::URLResponse::decode):
* Shared/APIURLResponse.h: Copied from Source/WebKit2/Shared/WebURLResponse.h.
(API::URLResponse::create):
* Shared/UserMessageCoders.h:
(WebKit::UserMessageEncoder::baseEncode):
(WebKit::UserMessageDecoder::baseDecode):
* Shared/WebURLResponse.cpp: Removed.
* Shared/WebURLResponse.h: Removed.
* UIProcess/WebDownloadClient.cpp:
(WebKit::WebDownloadClient::didReceiveResponse):
* UIProcess/WebPolicyClient.cpp:
(WebKit::WebPolicyClient::decidePolicyForResponse):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
(WebKit::InjectedBundlePagePolicyClient::decidePolicyForResponse):

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

7 years agoUse CascadedProperties for page and keyframe style resolution as well.
akling@apple.com [Thu, 19 Dec 2013 21:15:12 +0000 (21:15 +0000)]
Use CascadedProperties for page and keyframe style resolution as well.
<https://webkit.org/b/125997>

Port StyleResolver's styleForKeyframe() and styleForPage() over to
the new property cascading code. Neither of them care about !important
or matched properties caches, so the code is very simple.

Removed the old applyMatchedProperties and applyProperties code with
low/high priority passes.

Reviewed by Antti Koivisto.

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

7 years agoAdd a failing test expectation to fast/dynamic/paused-event-dispatch.html
rniwa@webkit.org [Thu, 19 Dec 2013 20:42:07 +0000 (20:42 +0000)]
Add a failing test expectation to fast/dynamic/paused-event-dispatch.html
while I investigate.

* TestExpectations:

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

7 years agoUnreviewed, rolling out r160842.
commit-queue@webkit.org [Thu, 19 Dec 2013 19:49:35 +0000 (19:49 +0000)]
Unreviewed, rolling out r160842.
http://trac.webkit.org/changeset/160842
https://bugs.webkit.org/show_bug.cgi?id=126003

broke accessibility/loading-iframe-updates-axtree.html
(Requested by ap on #webkit).

Tools:

* DumpRenderTree/AccessibilityUIElement.cpp:
(AccessibilityUIElement::makeJSAccessibilityUIElement):
* DumpRenderTree/AccessibilityUIElement.h:
(AccessibilityUIElement::platformUIElement):

LayoutTests:

* accessibility/deleting-iframe-destroys-axcache.html:
* accessibility/loading-iframe-updates-axtree-expected.txt:
* accessibility/loading-iframe-updates-axtree.html:
* accessibility/non-data-table-cell-title-ui-element.html:
* platform/gtk/accessibility/roles-exposed-expected.txt:
* platform/gtk/accessibility/roles-exposed.html:
* platform/mac-wk2/TestExpectations:
* platform/mac/accessibility/search-predicate-expected.txt:
* platform/mac/accessibility/search-predicate.html:
* platform/mac/accessibility/search-when-element-starts-in-table-expected.txt:
* platform/mac/accessibility/search-when-element-starts-in-table.html:

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

7 years agotryAddEventListener uses local PassRefPtr<>
eric.carlson@apple.com [Thu, 19 Dec 2013 19:42:22 +0000 (19:42 +0000)]
tryAddEventListener uses local PassRefPtr<>
https://bugs.webkit.org/show_bug.cgi?id=126001

Reviewed by Daniel Bates.

* dom/Node.cpp:
(WebCore::tryAddEventListener): Put PassRefPtr<EventListener> parameter into a local RefPtr
    because it is sometimes used twice.

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

7 years agoget_test_baseline should get Host from test_config
commit-queue@webkit.org [Thu, 19 Dec 2013 19:32:02 +0000 (19:32 +0000)]
get_test_baseline should get Host from test_config
https://bugs.webkit.org/show_bug.cgi?id=125989

Patch by Dániel Bátyai <dbatyai.u-szeged@partner.samsung.com> on 2013-12-19
Reviewed by Ryosuke Niwa.

* Scripts/webkitpy/tool/commands/rebaselineserver.py:
(TestConfig.__init__):
(RebaselineServer._prepare_config):
* Scripts/webkitpy/tool/servers/rebaselineserver.py:
(get_test_baselines):
* Scripts/webkitpy/tool/servers/rebaselineserver_unittest.py:
(get_test_config):

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

7 years agooverflowchanged event could cause a crash
rniwa@webkit.org [Thu, 19 Dec 2013 19:10:31 +0000 (19:10 +0000)]
overflowchanged event could cause a crash
https://bugs.webkit.org/show_bug.cgi?id=125978

Reviewed by Tim Horton.

Source/WebCore:

Made the event asynchrnous by re-using Document's event queuing ability. Also removed
the infrastructure to queue up events in FrameView.

Test: fast/events/overflowchanged-inside-selection-collapse-crash.html

* dom/Document.cpp:
(WebCore::Document::recalcStyle):
(WebCore::Document::enqueueOverflowEvent):
* dom/Document.h:
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::~FrameView):
(WebCore::FrameView::layout):
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::updateOverflowStatus):
* page/FrameView.h:
* rendering/RenderBlock.cpp:
(WebCore::OverflowEventDispatcher::~OverflowEventDispatcher):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::start):

LayoutTests:

Add a regression test.

* fast/events/overflowchanged-inside-selection-collapse-crash-expected.txt: Added.
* fast/events/overflowchanged-inside-selection-collapse-crash.html: Added.

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

7 years agoDon't check VSINSTALLDIR when looking for Visual Studio install directory.
roger_fong@apple.com [Thu, 19 Dec 2013 19:10:01 +0000 (19:10 +0000)]
Don't check VSINSTALLDIR when looking for Visual Studio install directory.
https://bugs.webkit.org/show_bug.cgi?id=125998.

Reviewed by Alexey Proskuryakov.

* Scripts/webkitdirs.pm:
(visualStudioInstallDir):
Get rid of the VSINSTALLDIR check. We can't build on anything besides VS2013 now anyways.

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

7 years agoFix the Windows build after <http://trac.webkit.org/changeset/160841>
dbates@webkit.org [Thu, 19 Dec 2013 18:58:26 +0000 (18:58 +0000)]
Fix the Windows build after <trac.webkit.org/changeset/160841>
(https://bugs.webkit.org/show_bug.cgi?id=125879)

Add ENABLE(CACHE_PARTITIONING)-guard around call to ResourceRequest::setCachePartition()
as this function is only compiled when building with cache partitioning enabled.

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):

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

7 years ago[iOS] Upstream WebCore/accessibility changes
dbates@webkit.org [Thu, 19 Dec 2013 18:46:06 +0000 (18:46 +0000)]
[iOS] Upstream WebCore/accessibility changes
https://bugs.webkit.org/show_bug.cgi?id=125925

Reviewed by Chris Fleizach.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::visiblePositionForPoint): Opt out of code when building for iOS.

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

7 years ago[WinCairo] Compile fix for VS2013 when using ACCELERATED_COMPOSITING.
commit-queue@webkit.org [Thu, 19 Dec 2013 18:25:17 +0000 (18:25 +0000)]
[WinCairo] Compile fix for VS2013 when using ACCELERATED_COMPOSITING.
https://bugs.webkit.org/show_bug.cgi?id=124866

Patch by Alex Christensen <achristensen@webkit.org> on 2013-12-19
Reviewed by Darin Adler.

* platform/graphics/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::TiledBackingStore):
* platform/graphics/TiledBackingStore.h:
Added constructor overload to avoid compile errors
from using MSVC's make_unique as a default parameter.

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

7 years ago[ATK] [WK2] platform/gtk/accessibility/roles-exposed.html is failing
mario.prada@samsung.com [Thu, 19 Dec 2013 18:14:32 +0000 (18:14 +0000)]
[ATK] [WK2] platform/gtk/accessibility/roles-exposed.html is failing
https://bugs.webkit.org/show_bug.cgi?id=125854

Reviewed by Chris Fleizach.

Tools:

Ensure we don't ever create instances of AccessibilityUIElement
wrapping invalid platform-specific accessibility objects in DRT,
both for consistency with what WKTR does (so we avoid situations
where some tests fail in WK2 and not in WK1) and also to avoid
overlooking tests that might not be checking the right thing.

* DumpRenderTree/AccessibilityUIElement.cpp:
(AccessibilityUIElement::makeJSAccessibilityUIElement): Return a
nullPtr if the platformUIElement() is not a valid one.
* DumpRenderTree/AccessibilityUIElement.h:
(AccessibilityUIElement::platformUIElement): Added const modifier.

LayoutTests:

Updated tests and expectations to keep them passing after the
change done in DRT, without changing their actual purpose.

* platform/gtk/accessibility/roles-exposed.html: Make sure we
print "AXRole: (no element)" when accessibilityElementByID() does
not return a valid object, not to confuse it with cases where the
returned string for the role is an empty string.
* platform/gtk/accessibility/roles-exposed-expected.txt: Update
test expectations to reflect the "AXRole: (no element)" string
that is now being exposed. Also, replace the (wrongly added) PASS
expectations with FAIL for rowgroups, which are currently not
being exposed for ATK either.

* accessibility/deleting-iframe-destroys-axcache.html: Just
consider the first and third sons of the accessibility object for
the body (instead of the grandsons), so the test can run both in
Mac, where sons and grandsons are exposed, and ATK, where only
sons are exposed (no StaticText objects exposed there).

* accessibility/non-data-table-cell-title-ui-element.html: Use
accessibilityElementById() to get the accessibility object for the
"skip" table header instead of navigating with childAtIndex(),
since the hierarchy is not the same for Mac and ATK based ports.

* accessibility/loading-iframe-updates-axtree.html: Use the new
web area inside the iframe to compare against the old one, instead
of doing it the other way around, to avoid calling isEqual for an
undefined value (the old web area).
* accessibility/loading-iframe-updates-axtree-expected.txt:
Removed line comparing the old and new web areas inside the iframe.

* platform/mac/accessibility/search-predicate.html: Do not rely on
shouldBe() together with the string "AXRole: " when asking for the
role of objects that should no longer be in the accessibility
tree, and use shouldBeUndefined() instead.
* platform/mac/accessibility/search-when-element-starts-in-table.html: Ditto.

* platform/mac/accessibility/search-predicate-expected.txt: Update
expectations according to the usage of shouldBeUndefined().
* platform/mac/accessibility/search-when-element-starts-in-table-expected.txt: Ditto.

* platform/mac-wk2/TestExpectations: Add search-when-element-starts-in-table.html
here, since it does not return an undefined object in WebKit2 when
the search query should return no results (see bug 125996).

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

7 years ago[iOS] Upstream WebCore/loader changes
dbates@webkit.org [Thu, 19 Dec 2013 18:10:07 +0000 (18:10 +0000)]
[iOS] Upstream WebCore/loader changes
https://bugs.webkit.org/show_bug.cgi?id=125879

Reviewed by Darin Adler.

* WebCore.exp.in: Added symbols for MemoryCache::{addImageToCache, removeImageFromCache}().
* loader/DocumentLoader.cpp:
(WebCore::areAllLoadersPageCacheAcceptable): Added.
(WebCore::DocumentLoader::DocumentLoader): Initialize m_subresourceLoadersArePageCacheAcceptable.
(WebCore::DocumentLoader::stopLoading): Modified to conditionally call areAllLoadersPageCacheAcceptable().
(WebCore::DocumentLoader::handleSubstituteDataLoadSoon): Modified to query FrameLoader::loadsSynchronously()
whether to load substitute data immediately or to schedule a load.
(WebCore::DocumentLoader::responseReceived): Modified to create a content filer when the response protocol
is either HTTP or HTTPS, assuming content filtering is enabled.
(WebCore::DocumentLoader::dataReceived): Modified to call DocumentLoader::setContentFilterForBlockedLoad()
as appropriate.
(WebCore::DocumentLoader::clearMainResourceLoader): Added PLATFORM(IOS)-guarded code. Also added a
FIXME comment to remove the PLATFORM(IOS)-guard once we upstream the iOS changes to ResourceRequest.h.
(WebCore::DocumentLoader::setResponseMIMEType): Added; guard by PLATFORM(IOS). Also added FIXME comment.
(WebCore::DocumentLoader::startLoadingMainResource): Added PLATFORM(IOS)-guarded code. Also added a
FIXME comment to remove the PLATFORM(IOS)-guard once we upstream the iOS changes to ResourceRequest.h.
I also substituted static NeverDestroyed<> for DEFINE_STATIC_LOCAL.
(WebCore::DocumentLoader::setContentFilterForBlockedLoad): Added; guarded by USE(CONTENT_FILTERING).
(WebCore::DocumentLoader::handleContentFilterRequest): Added; guarded by USE(CONTENT_FILTERING) and PLATFORM(IOS).
Also added a FIXME comment to remove the PLATFORM(IOS) guard inside its function body once we upstream
file ContentFilterIOS.mm and implement ContentFilter::requestUnblockAndDispatchIfSuccessful() for Mac.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setResponse): Added; guard by PLATFORM(IOS). Also added a FIXME comment as
this method seems to violate the encapsulation of DocumentLoader.
(WebCore::DocumentLoader::subresourceLoadersArePageCacheAcceptable): Added.
(WebCore::DocumentLoader::documentURL): Added; returns the URL of the document resulting from the DocumentLoader.
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::createDocument): Added iOS-specific code to create a PDF document.
* loader/EmptyClients.cpp:
(WebCore::EmptyChromeClient::openDateTimeChooser): Opt out of compiling this code for iOS. Also substituted
nullptr for 0.
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameProgressTracker::~FrameProgressTracker):
(WebCore::FrameLoader::FrameLoader): Initialize m_loadsSynchronously.
(WebCore::FrameLoader::initForSynthesizedDocument): Added; guarded by PLATFORM(IOS). Also added FIXME comment.
(WebCore::FrameLoader::checkCompleted): Added iOS-specific code with FIXME comment.
(WebCore::FrameLoader::willLoadMediaElementURL): Added iOS-specific code.
(WebCore::FrameLoader::stopForUserCancel): Added iOS-specific code and FIXME comment.
(WebCore::FrameLoader::commitProvisionalLoad): Added iOS-specific code and FIXME comment.
(WebCore::FrameLoader::transitionToCommitted): Opt out of ENABLE(TOUCH_EVENTS) logic when building for iOS.
(WebCore::FrameLoader::didFirstLayout): Added iOS-specific code.
(WebCore::FrameLoader::connectionProperties): Added; guarded by PLATFORM(IOS).
(WebCore::createWindow): Added iOS-specific code and FIXME comment.
* loader/FrameLoader.h:
(WebCore::FrameLoader::setLoadsSynchronously): Added.
(WebCore::FrameLoader::loadsSynchronously): Added.
* loader/FrameLoaderClient.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::restoreScrollPositionAndViewState): Opt out of scroll position logic when building for iOS.
(WebCore::HistoryController::replaceCurrentItem): Added.
* loader/HistoryController.h:
* loader/PlaceholderDocument.h: Changed access control of constructor from private to protected and removed the FINAL
keyword from the class so that we can subclass PlaceholderDocument on iOS.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy): Added USE(QUICK_LOOK)- and USE(CONTENT_FILTERING)-guarded code.
* loader/ResourceBuffer.cpp:
(WebCore::ResourceBuffer::shouldUsePurgeableMemory): Added; guarded by PLATFORM(IOS).
* loader/ResourceBuffer.h:
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchWillSendRequest): Added USE(QUICK_LOOK)-guarded code.
* loader/ResourceLoadScheduler.cpp:
(WebCore::ResourceLoadScheduler::scheduleSubresourceLoad): Added iOS-specific code.
(WebCore::ResourceLoadScheduler::scheduleLoad): Ditto.
(WebCore::ResourceLoadScheduler::remove): Added iOS-specific code with FIXME comment.
(WebCore::ResourceLoadScheduler::crossOriginRedirectReceived): Added null-check for variable oldHost. Also added
iOS-specific code.
(WebCore::ResourceLoadScheduler::servePendingRequests): Added iOS-specific code.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init): Ditto.
(WebCore::ResourceLoader::willSendRequest): Ditto.
(WebCore::ResourceLoader::connectionProperties): Added; guarded by PLATFORM(IOS).
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::startLoading): Added; guarded by PLATFORM(IOS).
(WebCore::ResourceLoader::iOSOriginalRequest): Added; iOS-specific.
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadPlugin): Added iOS-specific code.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::create): Ditto.
(WebCore::SubresourceLoader::startLoading): Added; guarded by PLATFORM(IOS).
(WebCore::SubresourceLoader::didFinishLoading): Added iOS-specific code.
(WebCore::SubresourceLoader::willCancel): Ditto.
(WebCore::SubresourceLoader::notifyDone): Ditto.
(WebCore::SubresourceLoader::releaseResources): Ditto.
* loader/SubresourceLoader.h:
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::loadCacheGroup): Added iOS-specific code.
(WebCore::ApplicationCacheStorage::loadManifestHostHashes): Ditto.
(WebCore::ApplicationCacheStorage::cacheGroupForURL): Ditto.
(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): Ditto.
(WebCore::ApplicationCacheStorage::calculateQuotaForOrigin): Ditto.
(WebCore::ApplicationCacheStorage::calculateUsageForOrigin): Ditto.
(WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache): Ditto.
(WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin): Ditto.
(WebCore::ApplicationCacheStorage::executeSQLCommand): Ditto.
(WebCore::ApplicationCacheStorage::verifySchemaVersion): Ditto.
(WebCore::ApplicationCacheStorage::openDatabase): Ditto.
(WebCore::ApplicationCacheStorage::executeStatement): Ditto.
(WebCore::ApplicationCacheStorage::store): Ditto.
(WebCore::ApplicationCacheStorage::storeUpdatedType): Ditto.
(WebCore::ApplicationCacheStorage::ensureOriginRecord): Ditto.
(WebCore::ApplicationCacheStorage::loadCache): Ditto.
(WebCore::ApplicationCacheStorage::remove): Ditto.
(WebCore::ApplicationCacheStorage::empty): Ditto.
(WebCore::ApplicationCacheStorage::storeCopyOfCache): Ditto.
(WebCore::ApplicationCacheStorage::manifestURLs): Ditto.
(WebCore::ApplicationCacheStorage::cacheGroupSize): Ditto.
(WebCore::ApplicationCacheStorage::deleteCacheGroup): Ditto.
(WebCore::ApplicationCacheStorage::vacuumDatabaseFile): Ditto.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage): Added.
(WebCore::CachedImage::imageSizeForRenderer): Added iOS-specific code.
(WebCore::CachedImageManual::CachedImageManual): Added; guarded by USE(CF). Also added FIXME comment to incorporate
the functionality of this class into CachedImage and to remove the USE(CF)-guard once we make MemoryCache::addImageToCache()
platform-independent.
(WebCore::CachedImageManual::mustRevalidateDueToCacheHeaders): Added; guarded by USE(CF).
* loader/cache/CachedImage.h: Removed FINAL keyword from class so that we can define derived class CachedImageManual.
(WebCore::CachedImage::isManual): Added; guarded by USE(CF). Also added FIXME comment.
(WebCore::CachedImageManual::addFakeClient): Added; guarded by USE(CF).
(WebCore::CachedImageManual::removeFakeClient): Added; guarded by USE(CF).
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load): Added iOS-specific code.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::loadDone): Added argument shouldPerformPostLoadActions, defaults to true. Modified
to conditionally call performPostLoadActions() with respect to the argument shouldPerformPostLoadActions.
(WebCore::CachedResourceLoader::preload): Added iOS-specific code.
(WebCore::CachedResourceLoader::checkForPendingPreloads): Ditto.
* loader/cache/CachedResourceLoader.h:
* loader/cache/MemoryCache.cpp:
(WebCore::memoryCache):
(WebCore::MemoryCache::add): Added iOS-specific code.
(WebCore::MemoryCache::revalidationFailed): Ditto.
(WebCore::MemoryCache::resourceForRequest): Ditto.
(WebCore::MemoryCache::addImageToCache): Added; guarded by USE(CF). Also added FIXME comment.
(WebCore::MemoryCache::removeImageFromCache): Added; guarded by USE(CF). Also added FIXME comment.
(WebCore::MemoryCache::pruneLiveResources): Modified to take argument shouldDestroyDecodedDataForAllLiveResources.
(WebCore::MemoryCache::pruneLiveResourcesToSize): Modified to take argument shouldDestroyDecodedDataForAllLiveResources,
defaults to false. When this argument is true we destroy the decoded data for all live resources from the memory cache.
Such functionality is useful when the system is running low on memory.
(WebCore::MemoryCache::evict): Added iOS-specific code.
* loader/cache/MemoryCache.h:
* loader/cf/SubresourceLoaderCF.cpp:
(WebCore::SubresourceLoader::didReceiveDataArray): Actually make this code compile. In particular, there is no
method called sendDataToResource on SubresourceLoader or in its class hierarchy.
* loader/mac/DocumentLoaderMac.cpp:
(WebCore::DocumentLoader::schedule): This method has an empty implementation when building for iOS.
(WebCore::DocumentLoader::unschedule): Ditto.
* platform/graphics/BitmapImage.h: Exposed decodedSize() to access the decoded size of the bitmap image.
This functionality is used in MemoryCache::addImageToCache().

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

7 years agoplatform/mac/editing/attributed-string tests all flakily assert
ap@apple.com [Thu, 19 Dec 2013 18:03:29 +0000 (18:03 +0000)]
platform/mac/editing/attributed-string tests all flakily assert
https://bugs.webkit.org/show_bug.cgi?id=123029

* platform/mac/TestExpectations: Marked as flakily asserting.

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

7 years agoBuild fix for platforms which do not define -[AVSampleBufferAudioRenderer muted].
jer.noble@apple.com [Thu, 19 Dec 2013 17:51:04 +0000 (17:51 +0000)]
Build fix for platforms which do not define -[AVSampleBufferAudioRenderer muted].
Rubber-stamped by Eric Carlson.

To work around platforms with broken AVSampleBufferAudioRenderer headers, just
declare only those functions we need, and update isAvalable to bail out early if
those methods are not present.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:

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

7 years agoWTF, JavaScriptCore fails to build with trunk clang: operators new, new[],
dbates@webkit.org [Thu, 19 Dec 2013 17:50:01 +0000 (17:50 +0000)]
WTF, JavaScriptCore fails to build with trunk clang: operators new, new[],
delete, delete[] cannot be declared inline
https://bugs.webkit.org/show_bug.cgi?id=124186
<rdar://problem/15644039>

Reviewed by Geoffrey Garen and Anders Carlsson.

Following <http://llvm.org/viewvc/llvm-project?view=revision&revision=193044>
(http://llvm.org/bugs/show_bug.cgi?id=17591>), Clang emits warnings when
operator new, delete are inlined. Such definitions cannot be inline per
replacement.functions (17.6.4.6/3) of the C++ standard. For now,
disable these warnings instead of exporting these functions.

* wtf/FastMalloc.h:

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

7 years agoImprove "bad parent" and "bad child list" assertions in line boxes
darin@apple.com [Thu, 19 Dec 2013 17:40:53 +0000 (17:40 +0000)]
Improve "bad parent" and "bad child list" assertions in line boxes
https://bugs.webkit.org/show_bug.cgi?id=125656

Reviewed by Sam Weinig.

* rendering/InlineBox.cpp:
(WebCore::InlineBox::root): Use parent() function with assertions rather than
using m_parent function, which skips the assertions.
* rendering/RenderText.cpp:
(WebCore::RenderText::removeAndDestroyTextBoxes): Call invalidateParentChildLists
if we are in the optimized document-destruction code path and destroying children
without removing them from their parents.
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::invalidateParentChildLists): Added.
* rendering/RenderTextLineBoxes.h: Added invalidateParentChildLists.

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

7 years ago<rdar://problem/15696824> [CFNetwork] Loading stops at server redirects
mitz@apple.com [Thu, 19 Dec 2013 17:32:49 +0000 (17:32 +0000)]
<rdar://problem/15696824> [CFNetwork] Loading stops at server redirects
https://bugs.webkit.org/show_bug.cgi?id=125984

Reviewed by Anders Carlsson.

* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::willSendRequest): If the client uses async callbacks, call its
willSendRequestAsync callback instead if willSendRequest.

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

7 years agoWTF fails to compile with gcc 4.8.2 and -Werror=array-bounds
hugo.lima@openbossa.org [Thu, 19 Dec 2013 17:11:35 +0000 (17:11 +0000)]
WTF fails to compile with gcc 4.8.2 and -Werror=array-bounds
https://bugs.webkit.org/show_bug.cgi?id=125936

Reviewed by Anders Carlsson.

* wtf/dtoa/double-conversion.cc: Use a unsigned instead of int on buffer_pos type.

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

7 years ago[CoordinatedGraphics] Regressions in WebView's contentScaleFactor/contentPosition
commit-queue@webkit.org [Thu, 19 Dec 2013 16:30:51 +0000 (16:30 +0000)]
[CoordinatedGraphics] Regressions in WebView's contentScaleFactor/contentPosition
https://bugs.webkit.org/show_bug.cgi?id=125943

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-12-19
Reviewed by Noam Rosenthal.

When WebView::pageDidRequestScroll is called it is scaling position requested
to scroll before store it as contentPosition, that is not necessary since WebView
already stores the requested contentScaleFactor so it's able to do that internally
when needed, what simplifies the API and improves the readability of webview's code.
This patch reverts changes from https://bugs.webkit.org/show_bug.cgi?id=118548, which
was causing some regressions in contentScaleFactor/contentPosition related stuff.
Besides that WebView::pageDidRequestScroll calls viewClient callback with the wrong
position (different from the position stored in WebView).

* UIProcess/API/efl/EwkView.cpp:
(EwkView::scrollBy):
* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::transformToScene):
(WebKit::WebView::updateViewportSize):
(WebKit::WebView::pageDidRequestScroll):
* UIProcess/efl/PageViewportControllerClientEfl.cpp:
(WebKit::PageViewportControllerClientEfl::setViewportPosition):

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

7 years agoDelete RVCT related code parts.
ossy@webkit.org [Thu, 19 Dec 2013 16:21:47 +0000 (16:21 +0000)]
Delete RVCT related code parts.
https://bugs.webkit.org/show_bug.cgi?id=125626

Patch by Peter Szanka <h868064@stud.u-szeged.hu> on 2013-12-19
Reviewed by Csaba Osztrogonác.

* wtf/Compiler.h: follow-up fix for r160648, remove an unnecessary comment.

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

7 years agoCascadedProperties: Deferred properties should have inline capacity.
akling@apple.com [Thu, 19 Dec 2013 15:24:10 +0000 (15:24 +0000)]
CascadedProperties: Deferred properties should have inline capacity.
<https://webkit.org/b/125994>

Give CascadedProperties::m_deferredProperties an inline capacity
of 8 to sidestep malloc churn (0.2% of HTML5-8266 profile.)

Reviewed by Antti Koivisto.

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

7 years agoTwo small refinements to matched properties cache.
akling@apple.com [Thu, 19 Dec 2013 13:59:11 +0000 (13:59 +0000)]
Two small refinements to matched properties cache.
<https://webkit.org/b/125992>

- Avoid computing the matched properties hash if we're banned from
  using the cache anyway.

- When adding a new entry to the cache, use move semantics to avoid
  creating a transient copy of all the data.

Reviewed by Antti Koivisto.

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

7 years agoCascadedProperties should use a bitset to track property presence.
akling@apple.com [Thu, 19 Dec 2013 12:15:44 +0000 (12:15 +0000)]
CascadedProperties should use a bitset to track property presence.
<https://webkit.org/b/125991>

Avoid zeroing out a bunch of memory in the CascadedProperties ctor
by using a bitset to track whether each property is present in the
cascaded set.

Reviewed by Antti Koivisto.

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

7 years agoWeb Inspector: Fix description of parameters in Page.setGeolocationOverride
seokju@webkit.org [Thu, 19 Dec 2013 09:20:36 +0000 (09:20 +0000)]
Web Inspector: Fix description of parameters in Page.setGeolocationOverride
https://bugs.webkit.org/show_bug.cgi?id=125983

Reviewed by Joseph Pecoraro.

No new tests, no changes in behavior.

* inspector/protocol/Page.json:

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

7 years agoRebaseline the test I added in r160819.
rniwa@webkit.org [Thu, 19 Dec 2013 07:19:02 +0000 (07:19 +0000)]
Rebaseline the test I added in r160819.

* svg/text/select-text-inside-non-static-position-expected.txt:

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

7 years ago[MSE][Mac] Add AVSampleBufferRendererSynchronizer support.
jer.noble@apple.com [Thu, 19 Dec 2013 07:01:59 +0000 (07:01 +0000)]
[MSE][Mac] Add AVSampleBufferRendererSynchronizer support.
https://bugs.webkit.org/show_bug.cgi?id=125954

Reviewed by NOBODY (OOPS!).

Instead of slaving all the various renderer's CMTimebases to one master timebase,
use AVSampleBufferRenderSynchronizer, which essentially does the same thing.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::CMTimebaseEffectiveRateChangedCallback): Added; call effectiveRateChanged().
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): Set up
    the synchronizer and all the observers.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC): Tear down
    the same.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): Require the
    AVSampleBufferRenderSynchronizer class.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal): Convert Clock -> Synchronizer.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paused): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setRateDouble): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::effectiveRateChanged): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): Ditto.

Drive-by fix; audio samples can't be subdivided, and video samples are
rarely combined, so remove the call to CMSampleBufferCallForEachSample:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID):

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

7 years ago[WinCairo] Unreviewed build fix after r160798.
alex.christensen@flexsim.com [Thu, 19 Dec 2013 04:47:16 +0000 (04:47 +0000)]
[WinCairo] Unreviewed build fix after r160798.

* win/tools/vsprops/FeatureDefinesCairo.props:
Removed ENABLE_MEDIA_CONTROLS_SCRIPT definition for now.

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

7 years agoDelayedReleaseScope is in the wrong place
mhahnenberg@apple.com [Thu, 19 Dec 2013 04:30:02 +0000 (04:30 +0000)]
DelayedReleaseScope is in the wrong place
https://bugs.webkit.org/show_bug.cgi?id=125876

Reviewed by Geoffrey Garen.

The DelayedReleaseScope needs to be around the free list sweeping in MarkedAllocator::tryAllocateHelper.
This location gives us a good safe point between getting ready to allocate  (i.e. identifying a non-empty
free list) and doing the actual allocation (popping the free list).

* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::tryAllocateHelper):
(JSC::MarkedAllocator::allocateSlowCase):
(JSC::MarkedAllocator::addBlock):
* runtime/JSCellInlines.h:
(JSC::allocateCell):

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

7 years agoCSS: Fall back to cache-less cascade when encountering explicitly inherited value.
akling@apple.com [Thu, 19 Dec 2013 03:13:18 +0000 (03:13 +0000)]
CSS: Fall back to cache-less cascade when encountering explicitly inherited value.
<https://webkit.org/b/125968>

When encountering an explicitly inherited value for a property that's not
"statically inherited", drop out of the matched properties cache path
immediately instead of waiting for some coincidence to trigger it later on.

Fixes 3 asserting table tests:

- fast/table/border-collapsing/cached-69296.html
- tables/mozilla/bugs/bug27038-3.html
- tables/mozilla_expected_failures/marvin/backgr_border-table-row-group.html

Reviewed by Antti Koivisto.

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

7 years agoCrash in WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches
rniwa@webkit.org [Thu, 19 Dec 2013 03:09:56 +0000 (03:09 +0000)]
Crash in WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches
https://bugs.webkit.org/show_bug.cgi?id=125970

Reviewed by Antti Koivisto.

Source/WebCore:

The bug was caused by containingBlockForAbsolutePosition returning a non-RenderBlock render object.
Fixed the bug by obtaining its containg block.

Also changed the return type of containingBlockForFixedPosition, containingBlockForAbsolutePosition,
containingBlockForObjectInFlow from RenderElement to RenderBlock as all callers of these functions
had assumed the return value to be an instance of RenderBlock.

Test: svg/text/select-text-inside-non-static-position.html

* rendering/LogicalSelectionOffsetCaches.h:
(WebCore::containingBlockForFixedPosition):
(WebCore::containingBlockForAbsolutePosition):
(WebCore::containingBlockForObjectInFlow):
(WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):

LayoutTests:

Added a regression test.

* svg/text/select-text-inside-non-static-position-expected.txt: Added.
* svg/text/select-text-inside-non-static-position.html: Added.

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

7 years agoWebKit2 View Gestures: Move WebProcess-side geometry collection into its own class
timothy_horton@apple.com [Thu, 19 Dec 2013 02:33:33 +0000 (02:33 +0000)]
WebKit2 View Gestures: Move WebProcess-side geometry collection into its own class
https://bugs.webkit.org/show_bug.cgi?id=125967

Reviewed by Anders Carlsson.

Move the messages dispatched by ViewGestureController that grab geometry
from the WebProcess out of the DrawingArea and into ViewGestureGeometryCollector.
This class will grow when smart magnification is implemented.

* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
Remove BeginTransientZoom() message.

* DerivedSources.make:
* UIProcess/DrawingAreaProxy.h:

* UIProcess/mac/ViewGestureController.cpp:
(WebKit::ViewGestureController::didCollectGeometryForMagnificationGesture):
(WebKit::ViewGestureController::handleMagnificationGesture):
* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureController.messages.in:
Make use of ViewGestureGeometryCollector and rename didBeginTransientZoom to didCollectGeometryForMagnificationGesture.

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

* WebProcess/WebPage/ViewGestureGeometryCollector.cpp: Added.
(WebKit::ViewGestureGeometryCollector::ViewGestureGeometryCollector):
(WebKit::ViewGestureGeometryCollector::~ViewGestureGeometryCollector):
(WebKit::ViewGestureGeometryCollector::collectGeometryForMagnificationGesture):
* WebProcess/WebPage/ViewGestureGeometryCollector.h: Added.
* WebProcess/WebPage/ViewGestureGeometryCollector.messages.in: Added.
Move the code to collect the visible content rect and return it to the ViewGestureController into its own class.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
Move m_pageID to the top of WebPage's initialization list so that
it can be safely used from other members' constructors.

Add a ViewGestureGeometryCollector member and construct it.

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