Title: [112526] trunk
- Revision
- 112526
- Author
- [email protected]
- Date
- 2012-03-29 05:53:08 -0700 (Thu, 29 Mar 2012)
Log Message
Remove redundant updateViewportArguments() call when page is restored from page cache.
https://bugs.webkit.org/show_bug.cgi?id=82500
Patch by Zalan Bujtas <[email protected]> on 2012-03-29
Reviewed by Kenneth Rohde Christiansen.
.:
Add manual test for history navigation with viewport width check.
* ManualTests/viewport-width-test-after-history-navigation.html: Added.
Source/WebCore:
Document::updateViewportArguments() is called twice, while restoring a page from page cache.
First, it is called when the document is set on the mainframe and later, it is called
when page cache finished the restoration. Since viewport arguments don't change between
the 2 calls, it's safe to remove the second.
Manual test added. Viewport value updates heavily depend on UI process code.
* dom/Document.cpp:
(WebCore::Document::documentDidResumeFromPageCache):
Modified Paths
Added Paths
Diff
Modified: trunk/ChangeLog (112525 => 112526)
--- trunk/ChangeLog 2012-03-29 12:45:37 UTC (rev 112525)
+++ trunk/ChangeLog 2012-03-29 12:53:08 UTC (rev 112526)
@@ -1,3 +1,14 @@
+2012-03-29 Zalan Bujtas <[email protected]>
+
+ Remove redundant updateViewportArguments() call when page is restored from page cache.
+ https://bugs.webkit.org/show_bug.cgi?id=82500
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add manual test for history navigation with viewport width check.
+
+ * ManualTests/viewport-width-test-after-history-navigation.html: Added.
+
2012-03-28 Kevin Ollivier <[email protected]>
[wx] Unreviewed. Build fix, move WTF back into JSCore target
Added: trunk/ManualTests/viewport-width-test-after-history-navigation.html (0 => 112526)
--- trunk/ManualTests/viewport-width-test-after-history-navigation.html (rev 0)
+++ trunk/ManualTests/viewport-width-test-after-history-navigation.html 2012-03-29 12:53:08 UTC (rev 112526)
@@ -0,0 +1,40 @@
+<html>
+<head>
+ <meta name="viewport" content="width=700">
+ <script>
+ var originalViewportWidth;
+
+ function checkViewportWidthAfterHistoryNavigation() {
+ if (originalViewportWidth == window.innerWidth)
+ document.body.innerHTML = "<div style='color:green'>PASS, viewport width is OK after history navigation.</div>";
+ else
+ document.body.innerHTML = "<div style='color:red'>FAIL, viewport width is different after history navigation.</div>";
+ }
+
+ function navigateAwayAndBack() {
+ // Force layout before getting viewport width.
+ document.body.offsetTop;
+ originalViewportWidth = window.innerWidth;
+
+ // Assigning to window.location does not create a history entry, so instead link click is simulated.
+ var evt = document.createEvent("MouseEvents");
+ evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ document.getElementById('anchor').dispatchEvent(evt);
+ // Initiate timer to do final verification as we have navigated back to the cached version of this page.
+ // This test makes use of the behavior where timers are restored on a cached page.
+ setTimeout('checkViewportWidthAfterHistoryNavigation()', 1000);
+
+ }
+ </script>
+</head>
+<body _onload_='setTimeout("navigateAwayAndBack()", 0 );'>
+ <a id='anchor' href=''>
+ </a>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (112525 => 112526)
--- trunk/Source/WebCore/ChangeLog 2012-03-29 12:45:37 UTC (rev 112525)
+++ trunk/Source/WebCore/ChangeLog 2012-03-29 12:53:08 UTC (rev 112526)
@@ -1,3 +1,20 @@
+2012-03-29 Zalan Bujtas <[email protected]>
+
+ Remove redundant updateViewportArguments() call when page is restored from page cache.
+ https://bugs.webkit.org/show_bug.cgi?id=82500
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Document::updateViewportArguments() is called twice, while restoring a page from page cache.
+ First, it is called when the document is set on the mainframe and later, it is called
+ when page cache finished the restoration. Since viewport arguments don't change between
+ the 2 calls, it's safe to remove the second.
+
+ Manual test added. Viewport value updates heavily depend on UI process code.
+
+ * dom/Document.cpp:
+ (WebCore::Document::documentDidResumeFromPageCache):
+
2012-03-29 Charles Wei <[email protected]>
[BlackBerry] Add Internal test support for blackberry porting.
Modified: trunk/Source/WebCore/dom/Document.cpp (112525 => 112526)
--- trunk/Source/WebCore/dom/Document.cpp 2012-03-29 12:45:37 UTC (rev 112525)
+++ trunk/Source/WebCore/dom/Document.cpp 2012-03-29 12:53:08 UTC (rev 112526)
@@ -4222,8 +4222,6 @@
ASSERT(m_frame);
m_frame->loader()->client()->dispatchDidBecomeFrameset(isFrameSet());
-
- updateViewportArguments();
}
void Document::registerForPageCacheSuspensionCallbacks(Element* e)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes