Title: [115681] trunk/Source
- Revision
- 115681
- Author
- [email protected]
- Date
- 2012-04-30 15:42:37 -0700 (Mon, 30 Apr 2012)
Log Message
ScrollingCoordinator::requestScrollPositionUpdate should not update the main frame scroll position
https://bugs.webkit.org/show_bug.cgi?id=85240
<rdar://problem/11286609>
Reviewed by Sam Weinig.
Source/WebCore:
The call to updateMainFrameScrollPosition was added to make the WebKit2 find overlay work, since it relies
on scroll position updates being synchronous. Change the find code in WebKit2 to handle asynchronous scroll
position updates and remove the call to updateMainFrameScrollPosition.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
Source/WebKit2:
The find machinery should cope with asynchronous scroll position updates.
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindUIAfterPageScroll):
Split the code that handles updating the find indicator and find overlay out into a separate function.
(WebKit::FindController::findString):
Call updateFindUIAfterPageScroll once we know that the scroll position has been updated.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (115680 => 115681)
--- trunk/Source/WebCore/ChangeLog 2012-04-30 22:41:45 UTC (rev 115680)
+++ trunk/Source/WebCore/ChangeLog 2012-04-30 22:42:37 UTC (rev 115681)
@@ -1,5 +1,20 @@
2012-04-30 Anders Carlsson <[email protected]>
+ ScrollingCoordinator::requestScrollPositionUpdate should not update the main frame scroll position
+ https://bugs.webkit.org/show_bug.cgi?id=85240
+ <rdar://problem/11286609>
+
+ Reviewed by Sam Weinig.
+
+ The call to updateMainFrameScrollPosition was added to make the WebKit2 find overlay work, since it relies
+ on scroll position updates being synchronous. Change the find code in WebKit2 to handle asynchronous scroll
+ position updates and remove the call to updateMainFrameScrollPosition.
+
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
+
+2012-04-30 Anders Carlsson <[email protected]>
+
Add a way to asynchronously call a function once the scroll position of a page has been updated
https://bugs.webkit.org/show_bug.cgi?id=85237
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (115680 => 115681)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-04-30 22:41:45 UTC (rev 115680)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-04-30 22:42:37 UTC (rev 115681)
@@ -224,13 +224,10 @@
return false;
#if ENABLE(THREADED_SCROLLING)
- // Update the main frame scroll position locally before asking the scrolling thread to scroll,
- // since FrameView expects scroll position updates to happen synchronously.
- updateMainFrameScrollPosition(scrollPosition);
-
if (frameView->frame()->document()->inPageCache()) {
// If this frame view's document is being put into the page cache, we don't want to update our
- // main frame scroll position.
+ // main frame scroll position. Just let the FrameView think that we did.
+ updateMainFrameScrollPosition(scrollPosition);
return true;
}
Modified: trunk/Source/WebKit2/ChangeLog (115680 => 115681)
--- trunk/Source/WebKit2/ChangeLog 2012-04-30 22:41:45 UTC (rev 115680)
+++ trunk/Source/WebKit2/ChangeLog 2012-04-30 22:42:37 UTC (rev 115681)
@@ -1,5 +1,22 @@
2012-04-30 Anders Carlsson <[email protected]>
+ ScrollingCoordinator::requestScrollPositionUpdate should not update the main frame scroll position
+ https://bugs.webkit.org/show_bug.cgi?id=85240
+ <rdar://problem/11286609>
+
+ Reviewed by Sam Weinig.
+
+ The find machinery should cope with asynchronous scroll position updates.
+
+ * WebProcess/WebPage/FindController.cpp:
+ (WebKit::FindController::updateFindUIAfterPageScroll):
+ Split the code that handles updating the find indicator and find overlay out into a separate function.
+
+ (WebKit::FindController::findString):
+ Call updateFindUIAfterPageScroll once we know that the scroll position has been updated.
+
+2012-04-30 Anders Carlsson <[email protected]>
+
Add a way to asynchronously call a function once the scroll position of a page has been updated
https://bugs.webkit.org/show_bug.cgi?id=85237
Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp (115680 => 115681)
--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp 2012-04-30 22:41:45 UTC (rev 115680)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp 2012-04-30 22:42:37 UTC (rev 115681)
@@ -33,6 +33,7 @@
#include "WebPageProxyMessages.h"
#include "WebProcess.h"
#include <WebCore/DocumentMarkerController.h>
+#include <WebCore/FloatQuad.h>
#include <WebCore/FocusController.h>
#include <WebCore/Frame.h>
#include <WebCore/FrameView.h>
@@ -89,12 +90,8 @@
return 0;
}
-void FindController::findString(const String& string, FindOptions options, unsigned maxMatchCount)
+void FindController::updateFindUIAfterPageScroll(bool found, const String& string, FindOptions options, unsigned maxMatchCount)
{
- m_webPage->corePage()->unmarkAllTextMatches();
-
- bool found = m_webPage->corePage()->findString(string, core(options));
-
Frame* selectedFrame = frameWithSelection(m_webPage->corePage());
bool shouldShowOverlay = false;
@@ -141,19 +138,27 @@
}
ASSERT(!m_findPageOverlay);
- return;
- }
-
- if (!m_findPageOverlay) {
- RefPtr<PageOverlay> findPageOverlay = PageOverlay::create(this);
- m_findPageOverlay = findPageOverlay.get();
- m_webPage->installPageOverlay(findPageOverlay.release());
} else {
- // The page overlay needs to be repainted.
- m_findPageOverlay->setNeedsDisplay();
+ if (!m_findPageOverlay) {
+ RefPtr<PageOverlay> findPageOverlay = PageOverlay::create(this);
+ m_findPageOverlay = findPageOverlay.get();
+ m_webPage->installPageOverlay(findPageOverlay.release());
+ } else {
+ // The page overlay needs to be repainted.
+ m_findPageOverlay->setNeedsDisplay();
+ }
}
}
+void FindController::findString(const String& string, FindOptions options, unsigned maxMatchCount)
+{
+ m_webPage->corePage()->unmarkAllTextMatches();
+
+ bool found = m_webPage->corePage()->findString(string, core(options));
+
+ m_webPage->drawingArea()->dispatchAfterEnsuringUpdatedScrollPosition(bind(&FindController::updateFindUIAfterPageScroll, this, found, string, options, maxMatchCount));
+}
+
void FindController::hideFindUI()
{
if (m_findPageOverlay)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.h (115680 => 115681)
--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.h 2012-04-30 22:41:45 UTC (rev 115680)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.h 2012-04-30 22:42:37 UTC (rev 115681)
@@ -70,7 +70,8 @@
Vector<WebCore::IntRect> rectsForTextMatches();
bool updateFindIndicator(WebCore::Frame* selectedFrame, bool isShowingOverlay, bool shouldAnimate = true);
-private:
+ void updateFindUIAfterPageScroll(bool found, const String&, FindOptions, unsigned maxMatchCount);
+
WebPage* m_webPage;
PageOverlay* m_findPageOverlay;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes