Title: [170270] trunk
- Revision
- 170270
- Author
- [email protected]
- Date
- 2014-06-22 11:35:32 -0700 (Sun, 22 Jun 2014)
Log Message
[WK2] Frameset frames are not scrollable after loading (and should be)
https://bugs.webkit.org/show_bug.cgi?id=134151
<rdar://problem/17403365>
Reviewed by Dan Bates.
Source/WebCore:
When loading a <frameset>, we could end up with an empty non-fast-scrollable
region for the main frame, because after the initial frameset document layout,
nothing updated the non-fast scrollable region as the subframes added their
scrollable areas to the the main frame's scrollable area set.
Fix by having addScrollableArea() and removeScrollableArea() trigger an update
of the non-fast scrollable region.
Test: platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html
* page/FrameView.cpp:
(WebCore::FrameView::addScrollableArea):
(WebCore::FrameView::removeScrollableArea):
(WebCore::FrameView::scrollableAreaSetChanged):
* page/FrameView.h:
LayoutTests:
Frameset test that dumps the scrolling tree.
* platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html: Added.
* platform/mac-wk2/tiled-drawing/scrolling/frames/resources/scrollable-page.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (170269 => 170270)
--- trunk/LayoutTests/ChangeLog 2014-06-22 18:21:49 UTC (rev 170269)
+++ trunk/LayoutTests/ChangeLog 2014-06-22 18:35:32 UTC (rev 170270)
@@ -1,5 +1,18 @@
2014-06-20 Simon Fraser <[email protected]>
+ [WK2] Frameset frames are not scrollable after loading (and should be)
+ https://bugs.webkit.org/show_bug.cgi?id=134151
+ <rdar://problem/17403365>
+
+ Reviewed by Dan Bates.
+
+ Frameset test that dumps the scrolling tree.
+
+ * platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html: Added.
+ * platform/mac-wk2/tiled-drawing/scrolling/frames/resources/scrollable-page.html: Added.
+
+2014-06-20 Simon Fraser <[email protected]>
+
Have scrollingTreeAsText() dump the non-fast-scrollable region
https://bugs.webkit.org/show_bug.cgi?id=134149
Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability-expected.txt (0 => 170270)
--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability-expected.txt 2014-06-22 18:35:32 UTC (rev 170270)
@@ -0,0 +1,7 @@
+(Frame scrolling node
+ (scrollable area size 800 600)
+ (contents size 800 600)
+ (non-fast-scrollable region
+ at (0,0) size 800x594)
+)
+
Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html (0 => 170270)
--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html 2014-06-22 18:35:32 UTC (rev 170270)
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ function frameDidChange()
+ {
+ window.setTimeout(function() {
+ if (window.testRunner) {
+ var scrollingTree = window.internals.scrollingStateTreeAsText();
+ document.open();
+ document.write('<pre>');
+ document.write(scrollingTree);
+ document.write('</pre>');
+ document.close();
+ testRunner.notifyDone();
+ }
+ }, 0);
+ }
+ </script>
+</head>
+
+<frameset rows="100%,0%">
+<frame src=""
+</frameset>
+</html>
Added: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/scrollable-page.html (0 => 170270)
--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/scrollable-page.html (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/frames/resources/scrollable-page.html 2014-06-22 18:35:32 UTC (rev 170270)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ body {
+ background-image: repeating-linear-gradient(white, silver 300px);
+ }
+ </style>
+
+ <script>
+ function doTest()
+ {
+ window.setTimeout(function() {
+ document.body.style.height = "2000px";
+ window.parent.frameDidChange();
+ }, 0);
+ }
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (170269 => 170270)
--- trunk/Source/WebCore/ChangeLog 2014-06-22 18:21:49 UTC (rev 170269)
+++ trunk/Source/WebCore/ChangeLog 2014-06-22 18:35:32 UTC (rev 170270)
@@ -1,3 +1,27 @@
+2014-06-20 Simon Fraser <[email protected]>
+
+ [WK2] Frameset frames are not scrollable after loading (and should be)
+ https://bugs.webkit.org/show_bug.cgi?id=134151
+ <rdar://problem/17403365>
+
+ Reviewed by Dan Bates.
+
+ When loading a <frameset>, we could end up with an empty non-fast-scrollable
+ region for the main frame, because after the initial frameset document layout,
+ nothing updated the non-fast scrollable region as the subframes added their
+ scrollable areas to the the main frame's scrollable area set.
+
+ Fix by having addScrollableArea() and removeScrollableArea() trigger an update
+ of the non-fast scrollable region.
+
+ Test: platform/mac-wk2/tiled-drawing/scrolling/frames/frameset-frame-scrollability.html
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::addScrollableArea):
+ (WebCore::FrameView::removeScrollableArea):
+ (WebCore::FrameView::scrollableAreaSetChanged):
+ * page/FrameView.h:
+
2014-06-22 Commit Queue <[email protected]>
Unreviewed, rolling out r170265.
Modified: trunk/Source/WebCore/page/FrameView.cpp (170269 => 170270)
--- trunk/Source/WebCore/page/FrameView.cpp 2014-06-22 18:21:49 UTC (rev 170269)
+++ trunk/Source/WebCore/page/FrameView.cpp 2014-06-22 18:35:32 UTC (rev 170270)
@@ -4045,12 +4045,22 @@
{
if (!m_scrollableAreas)
m_scrollableAreas = std::make_unique<ScrollableAreaSet>();
- return m_scrollableAreas->add(scrollableArea).isNewEntry;
+
+ if (m_scrollableAreas->add(scrollableArea).isNewEntry) {
+ scrollableAreaSetChanged();
+ return true;
+ }
+
+ return false;
}
bool FrameView::removeScrollableArea(ScrollableArea* scrollableArea)
{
- return m_scrollableAreas && m_scrollableAreas->remove(scrollableArea);
+ if (m_scrollableAreas && m_scrollableAreas->remove(scrollableArea)) {
+ scrollableAreaSetChanged();
+ return true;
+ }
+ return false;
}
bool FrameView::containsScrollableArea(ScrollableArea* scrollableArea) const
@@ -4058,6 +4068,14 @@
return m_scrollableAreas && m_scrollableAreas->contains(scrollableArea);
}
+void FrameView::scrollableAreaSetChanged()
+{
+ if (auto* page = frame().page()) {
+ if (auto* scrollingCoordinator = page->scrollingCoordinator())
+ scrollingCoordinator->frameViewNonFastScrollableRegionChanged(this);
+ }
+}
+
void FrameView::removeChild(Widget* widget)
{
if (widget->isFrameView())
Modified: trunk/Source/WebCore/page/FrameView.h (170269 => 170270)
--- trunk/Source/WebCore/page/FrameView.h 2014-06-22 18:21:49 UTC (rev 170269)
+++ trunk/Source/WebCore/page/FrameView.h 2014-06-22 18:35:32 UTC (rev 170270)
@@ -593,6 +593,7 @@
void updateEmbeddedObject(RenderEmbeddedObject&);
void scrollToAnchor();
void scrollPositionChanged(const IntPoint& oldPosition, const IntPoint& newPosition);
+ void scrollableAreaSetChanged();
bool hasCustomScrollbars() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes