- Revision
- 160905
- Author
- stav...@adobe.com
- Date
- 2013-12-20 05:44:45 -0800 (Fri, 20 Dec 2013)
Log Message
[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.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (160904 => 160905)
--- trunk/LayoutTests/ChangeLog 2013-12-20 12:11:45 UTC (rev 160904)
+++ trunk/LayoutTests/ChangeLog 2013-12-20 13:44:45 UTC (rev 160905)
@@ -1,3 +1,18 @@
+2013-12-20 Radu Stavila <stav...@adobe.com>
+
+ [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.
+
+ 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.
+
2013-12-20 Mario Sanchez Prada <mario.pr...@samsung.com>
Programmatically-inserted children lack accessibility events
Added: trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow-expected.html (0 => 160905)
--- trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow-expected.html (rev 0)
+++ trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow-expected.html 2013-12-20 13:44:45 UTC (rev 160905)
@@ -0,0 +1,23 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <style>
+ p, div {
+ font: 12px/1 monospace;
+ }
+ #region {
+ width: 300px;
+ height: 190px;
+ border: 5px solid green;
+ border-left: 100px solid green;
+ border-color: darkred;
+ background-color: #ddddff;
+ }
+ </style>
+</head>
+<body>
+ <a href="" Regions] When changing flow-from/flow-into on :hover, elements overflowing the region are not correctly repainted</a>
+ <p>When hovering the <span style="color:green"><b>region</b></span>, the <span style="color:blue"><b>blue</b></span> box <b>and its overflow</b> should disappear (the region's <b>flow-from</b> will change to "none")</p>
+ <div id="region"></div>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow-top-expected.html (0 => 160905)
--- trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow-top-expected.html (rev 0)
+++ trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow-top-expected.html 2013-12-20 13:44:45 UTC (rev 160905)
@@ -0,0 +1,25 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <style>
+ p, div {
+ font: 12px/1 monospace;
+ }
+ #region {
+ width: 300px;
+ height: 190px;
+ border: 5px solid green;
+ border-left: 100px solid green;
+ border-color: darkred;
+ background-color: #ddddff;
+ margin-top: 50px;
+ margin-left: 50px;
+ }
+ </style>
+</head>
+<body>
+ <a href="" Regions] When changing flow-from/flow-into on :hover, elements overflowing the region are not correctly repainted</a>
+ <p>When hovering the <span style="color:green"><b>region</b></span>, the <span style="color:blue"><b>blue</b></span> box <b>and its overflow</b> should disappear (the region's <b>flow-from</b> will change to "none")</p>
+ <div id="region"></div>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow-top.html (0 => 160905)
--- trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow-top.html (rev 0)
+++ trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow-top.html 2013-12-20 13:44:45 UTC (rev 160905)
@@ -0,0 +1,62 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <style>
+ p, div {
+ font: 12px/1 monospace;
+ }
+ .box {
+ width: 260px;
+ padding: 5px;
+ margin: 10px;
+ }
+
+ #region {
+ -webkit-flow-from: flow;
+ width: 300px;
+ height: 190px;
+ border: 5px solid green;
+ border-left: 100px solid green;
+ background-color: #ddddff;
+ margin-top: 50px;
+ margin-left: 50px;
+ }
+ #region:hover {
+ border-color: darkred;
+ -webkit-flow-from: none;
+ }
+
+ #content {
+ -webkit-flow-into: flow;
+ border: 5px solid blue;
+ margin-top: -50px;
+ margin-left: -130px;
+ height: 250px;
+ }
+ </style>
+</head>
+
+<script type="text/_javascript_">
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ function beginTest() {
+ if (window.eventSender) {
+ var region = document.querySelector("#region");
+
+ // move mouse on the hover test object
+ eventSender.mouseMoveTo(region.offsetLeft + 280, region.offsetTop + 20);
+ eventSender.mouseDown(0);
+
+ testRunner.notifyDone();
+ }
+ }
+</script>
+
+<body _onload_="beginTest()">
+ <a href="" Regions] When changing flow-from/flow-into on :hover, elements overflowing the region are not correctly repainted</a>
+ <p>When hovering the <span style="color:green"><b>region</b></span>, the <span style="color:blue"><b>blue</b></span> box <b>and its overflow</b> should disappear (the region's <b>flow-from</b> will change to "none")</p>
+ <div id="region"></div>
+ <div id="content" class="box">This box is flowed into the <span style="color:green"><b>region</b></span></div>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow.html (0 => 160905)
--- trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow.html (rev 0)
+++ trunk/LayoutTests/fast/regions/hover-single-flow-from-none-overflow.html 2013-12-20 13:44:45 UTC (rev 160905)
@@ -0,0 +1,59 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <style>
+ p, div {
+ font: 12px/1 monospace;
+ }
+ .box {
+ width: 260px;
+ height: 120px;
+ padding: 5px;
+ margin: 10px;
+ }
+
+ #region {
+ -webkit-flow-from: flow;
+ width: 300px;
+ height: 190px;
+ border: 5px solid green;
+ border-left: 100px solid green;
+ background-color: #ddddff;
+ }
+ #region:hover {
+ border-color: darkred;
+ -webkit-flow-from: none;
+ }
+
+ #content {
+ -webkit-flow-into: flow;
+ border: 5px solid blue;
+ height: 250px;
+ }
+ </style>
+</head>
+
+<script type="text/_javascript_">
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ function beginTest() {
+ if (window.eventSender) {
+ var region = document.querySelector("#region");
+
+ // move mouse on the hover test object
+ eventSender.mouseMoveTo(region.offsetLeft + 20, region.offsetTop + 20);
+ eventSender.mouseDown(0);
+
+ testRunner.notifyDone();
+ }
+ }
+</script>
+
+<body _onload_="beginTest()">
+ <a href="" Regions] When changing flow-from/flow-into on :hover, elements overflowing the region are not correctly repainted</a>
+ <p>When hovering the <span style="color:green"><b>region</b></span>, the <span style="color:blue"><b>blue</b></span> box <b>and its overflow</b> should disappear (the region's <b>flow-from</b> will change to "none")</p>
+ <div id="region"></div>
+ <div id="content" class="box">This box is flowed into the <span style="color:green"><b>region</b></span></div>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/LayoutTests/fast/regions/repaint/repaint-regions-overflow-expected.txt (160904 => 160905)
--- trunk/LayoutTests/fast/regions/repaint/repaint-regions-overflow-expected.txt 2013-12-20 12:11:45 UTC (rev 160904)
+++ trunk/LayoutTests/fast/regions/repaint/repaint-regions-overflow-expected.txt 2013-12-20 13:44:45 UTC (rev 160905)
@@ -5,15 +5,15 @@
LAST LINE
(repaint rects
- (rect 106 206 300 100)
+ (rect 106 306 300 160)
(rect 14 72 300 210)
(rect 106 122 300 210)
(rect 14 298 300 18)
(rect 106 348 300 18)
(rect 14 56 300 260)
(rect 106 106 300 260)
- (rect 60 150 312 112)
- (rect 100 200 312 112)
+ (rect 60 150 312 266)
+ (rect 100 200 312 266)
(rect 14 56 300 260)
(rect 106 106 300 260)
(rect 14 56 300 260)
Modified: trunk/Source/WebCore/ChangeLog (160904 => 160905)
--- trunk/Source/WebCore/ChangeLog 2013-12-20 12:11:45 UTC (rev 160904)
+++ trunk/Source/WebCore/ChangeLog 2013-12-20 13:44:45 UTC (rev 160905)
@@ -1,3 +1,21 @@
+2013-12-20 Radu Stavila <stav...@adobe.com>
+
+ [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.
+
+ 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:
+
2013-12-20 Mario Sanchez Prada <mario.pr...@samsung.com>
Programmatically-inserted children lack accessibility events
Modified: trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp (160904 => 160905)
--- trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp 2013-12-20 12:11:45 UTC (rev 160904)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp 2013-12-20 13:44:45 UTC (rev 160905)
@@ -266,4 +266,15 @@
return toRenderNamedFlowThread(flowThread());
}
+LayoutRect RenderNamedFlowFragment::visualOverflowRect() const
+{
+ if (isValid()) {
+ RenderBoxRegionInfo* boxInfo = renderBoxRegionInfo(flowThread());
+ if (boxInfo && boxInfo->overflow())
+ return boxInfo->overflow()->visualOverflowRect();
+ }
+
+ return RenderRegion::visualOverflowRect();
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/rendering/RenderNamedFlowFragment.h (160904 => 160905)
--- trunk/Source/WebCore/rendering/RenderNamedFlowFragment.h 2013-12-20 12:11:45 UTC (rev 160904)
+++ trunk/Source/WebCore/rendering/RenderNamedFlowFragment.h 2013-12-20 13:44:45 UTC (rev 160905)
@@ -74,6 +74,8 @@
void setRegionObjectsRegionStyle();
void restoreRegionObjectsOriginalStyle();
+
+ virtual LayoutRect visualOverflowRect() const OVERRIDE;
RenderNamedFlowThread* namedFlowThread() const;