https://bugs.webkit.org/show_bug.cgi?id=96158
Need API to suppress scrollbar animations
-and corresponding-
<rdar://problem/12210972>

Reviewed by Sam Weinig.

Source/WebCore: 

This patch re-names ScrollableAre::isOnActivePage() to 
ScrollableArea::scrollbarsCanBeActive(). The new name better reflects 
how the function is actually used, and it allows us to use the same 
function for the new API that has been added to WebKit2. Now when a 
client has used that API to indicate that scrollbars should be 
suppressed, ScrollableArea::scrollbarsCanBeActive() will return 
false.

Page has a new member variable which indicated whether scrollbar 
animations for all scrollbars associated with that page should be 
suppressed. Whenever it is set to true (meaning the animations 
should be suppressed), Page iterates through all of the 
ScrollableAreas to tell each one to finishCurrentScrollAnimations().
* WebCore.exp.in:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setShouldSuppressScrollbarAnimations):
(WebCore):
* page/Page.h:
(WebCore::Page::shouldSuppressScrollbarAnimations):
(Page):

FrameView::isOnActivePage() is renamed to scrollbarsCanBeActive () 
and it will now return false if the Page says that scrollbar 
animations should be suppressed. 
* page/FrameView.cpp:
(WebCore::FrameView::scrollbarsCanBeActive):

scrollbarsCanBeActive() must now be a public member of FrameView so  
that it can be called from RenderLayer and RenderListBox.
* page/FrameView.h:
(FrameView):

New ScrollAnimator function calls hideOverlayScrollers.
* platform/ScrollAnimator.h:
(WebCore::ScrollAnimator::finishCurrentScrollAnimations):
(ScrollAnimator):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::finishCurrentScrollAnimations):
(WebCore):
* platform/ScrollableArea.h:
(ScrollableArea):
* platform/mac/ScrollAnimatorMac.h:
(ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::finishCurrentScrollAnimations):

Re-name. isOnActivePage() -> scrollbarsCanBeActive()
(WebCore::FrameView::setAnimatorsAreActive):
(WebCore::FrameView::notifyPageThatContentAreaWillPaint):
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollbarPainterControllerDelegate scrollerImpPair:setContentAreaNeedsDisplayInRect:]):
(WebCore::ScrollAnimatorMac::contentAreaWillPaint):
(WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
(WebCore::ScrollAnimatorMac::mouseExitedContentArea):
(WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
(WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
(WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
(WebCore::ScrollAnimatorMac::willStartLiveResize):
(WebCore::ScrollAnimatorMac::contentsResized):
(WebCore::ScrollAnimatorMac::willEndLiveResize):
(WebCore::ScrollAnimatorMac::contentAreaDidShow):
(WebCore::ScrollAnimatorMac::contentAreaDidHide):
(WebCore::ScrollAnimatorMac::didBeginScrollGesture):
(WebCore::ScrollAnimatorMac::didEndScrollGesture):
(WebCore::ScrollAnimatorMac::mayBeginScrollGesture):
(WebCore):
(WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
* rendering/RenderLayer.cpp:

RenderLayer and RenderListBox should call into FrameView's 
scrollbarsCanBeActive() so that they also return false when Page:: 
shouldSuppressScrollbarAnimations() is true.
(WebCore::RenderLayer::scrollbarsCanBeActive):
* rendering/RenderLayer.h:
(RenderLayer):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::scrollbarsCanBeActive):
* rendering/RenderListBox.h:

This is the one caller of ScrollableArea:: scrollbarsCanBeActive() 
that needs to distinguish between the scrollbar-suppressing scenario 
and the in-the-page-cache scenario.
* page/FocusController.cpp:
(WebCore::FocusController::setContainingWindowIsVisible):

Source/WebKit/chromium: 

ScrollableArea::isOnActivePage() has been re-named to
ScrollableArea:: scrollbarsCanBeActive().
* src/ScrollbarGroup.cpp:
(WebKit::ScrollbarGroup::scrollbarsCanBeActive):
* src/ScrollbarGroup.h:
* tests/GraphicsLayerChromiumTest.cpp:
* tests/ScrollAnimatorNoneTest.cpp:
(MockScrollableArea):

Source/WebKit/win: 

ScrollableArea::isOnActivePage() has been re-named to
ScrollableArea:: scrollbarsCanBeActive().
* WebScrollBar.cpp:
(WebScrollBar::scrollbarsCanBeActive):
* WebScrollBar.h:
(WebScrollBar):

Source/WebKit2: 

Add suppressScrollbarAnimations as a WebCreationParameter.
* Shared/WebPageCreationParameters.h:
(WebPageCreationParameters):

New API. Calls into the web process for the setter but not the 
getter.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetSuppressScrollbarAnimations):
(WKPageAreScrollbarAnimationsSuppressed):
* UIProcess/API/C/WKPage.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setSuppressScrollbarAnimations):
(WebKit):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
(WebKit::WebPageProxy::areScrollbarAnimationsSuppressed):
* WebProcess/WebPage/WebPage.messages.in:

Call into WebCore.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setSuppressScrollbarAnimations):
(WebKit):
* WebProcess/WebPage/WebPage.h:
(WebPage):

This ScrollableArea area function is re-named by this patch in 
WebCore.
* WebProcess/Plugins/PDF/BuiltInPDFView.h:
* WebProcess/Plugins/PDF/BuiltInPDFView.mm:
(WebKit::BuiltInPDFView::scrollbarsCanBeActive):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] createFunctionOnlyCallback should be in V8Callback.h with the other callback functions
https://bugs.webkit.org/show_bug.cgi?id=96336

Patch by Adam Barth <abarth@chromium.org> on 2012-09-10
Reviewed by Kentaro Hara.

Moving this function to V8Callback.h also lets us delete
setTypeMismatchException because we no longer have a header inclusion
cycle.

* bindings/v8/V8Callback.h:
(WebCore::createFunctionOnlyCallback):
(WebCore):
* bindings/v8/V8Utilities.cpp:
* bindings/v8/V8Utilities.h:
(WebCore):
* bindings/v8/custom/V8GeolocationCustom.cpp:
* bindings/v8/custom/V8NotificationCustom.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: IDBFactory.deleteDatabase() is slow
https://bugs.webkit.org/show_bug.cgi?id=96036

Reviewed by Tony Chang.

The deleteDatabase() operation is implemented by creating a LevelDBTansaction to accumulate
the records to delete, then committing it. The transaction is a tree of key/operation pairs.
As each (key, delete) entry is added to the tree compares need to be made, potentially
requiring full key decodes. Since this temporary transaction is never read from, this is
overkill.

Add a new "write only" transaction type that simply wraps a write batch, which provides
transaction integrity but avoids the insertion overhead and has a minimal interface.

No new tests - no functional changes, only perf improvement.

* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::deleteDatabase): Use new write-only transaction type.
* platform/leveldb/LevelDBTransaction.cpp:
(WebCore::LevelDBWriteOnlyTransaction::create):
(WebCore):
(WebCore::LevelDBWriteOnlyTransaction::LevelDBWriteOnlyTransaction):
(WebCore::LevelDBWriteOnlyTransaction::~LevelDBWriteOnlyTransaction):
(WebCore::LevelDBWriteOnlyTransaction::remove):
(WebCore::LevelDBWriteOnlyTransaction::commit):
* platform/leveldb/LevelDBTransaction.h:
(WebCore):
(LevelDBWriteOnlyTransaction):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Fix trace event macro naming issue
https://bugs.webkit.org/show_bug.cgi?id=96337

Patch by John Bates <jbates@google.com> on 2012-09-10
Reviewed by James Robinson.

* platform/chromium/TraceEvent.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128137 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] We don't us the global handle map for anything useful---let's remove it
https://bugs.webkit.org/show_bug.cgi?id=96343

Patch by Adam Barth <abarth@chromium.org> on 2012-09-10
Reviewed by Kentaro Hara.

The global handle map was a dream of tracking all the persistent V8
handles in WebCore. Unfortunately, it has never been complete, and I'm
not aware of us using it for anything. This patch removes what little
is left of it.

* bindings/v8/NPV8Object.cpp:
(WebCore::freeV8NPObject):
(WebCore::npCreateV8ScriptObject):
* bindings/v8/V8GCController.cpp:
(WebCore):
(WebCore::V8GCController::gcEpilogue):
(WebCore::V8GCController::collectGarbage):
* bindings/v8/V8GCController.h:
(V8GCController):
* bindings/v8/V8PerIsolateData.h:
(WebCore):
(V8PerIsolateData):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Code assumes that getScriptExecutionContext can return 0
https://bugs.webkit.org/show_bug.cgi?id=96340

Patch by Adam Barth <abarth@chromium.org> on 2012-09-10
Reviewed by Eric Seidel.

This function can never return 0 (as long as V8 is on the stack).
There's no reason to try to handle a 0 return as an error.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateCallWith):
(GenerateConstructorCallback):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(WebCore::TestInterfaceV8Internal::supplementalMethod2Callback):
(WebCore::V8TestInterface::constructorCallback):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::withScriptExecutionContextAttributeAttrGetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAttributeAttrSetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrGetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrSetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeAttrGetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeAttrSetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrGetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrGetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextCallback):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateCallback):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateObjExceptionCallback):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesCallback):
* bindings/v8/custom/V8BlobCustom.cpp:
(WebCore::V8Blob::constructorCallback):
* bindings/v8/custom/V8CustomXPathNSResolver.cpp:
(WebCore::V8CustomXPathNSResolver::lookupNamespaceURI):
* bindings/v8/custom/V8MessageChannelConstructor.cpp:
(WebCore::V8MessageChannel::constructorCallback):
* bindings/v8/custom/V8MutationObserverCustom.cpp:
(WebCore::V8MutationObserver::constructorCallback):
* bindings/v8/custom/V8SQLTransactionCustom.cpp:
(WebCore::V8SQLTransaction::executeSqlCallback):
* bindings/v8/custom/V8WebSocketCustom.cpp:
(WebCore::V8WebSocket::constructorCallback):
* bindings/v8/custom/V8XMLHttpRequestConstructor.cpp:
(WebCore::V8XMLHttpRequest::constructorCallback):
* bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
(WebCore::V8XMLHttpRequest::openCallback):

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