https://bugs.webkit.org/show_bug.cgi?id=133111
Reviewed by David Hyatt.
Source/WebCore:
When computing the repaint rect of an element flowed into a flow thread, if the element is flowed directly into
the flow thread (meaning its containing block is the flow thread itself), the region's position within the flow
must no longer be taken into consideration, because its already included in the element's |topLeft|.
Test: fast/regions/hover-element-flowed-second-region.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeRectForRepaint):
LayoutTests:
Added test for the correct repaint of an element flowed directly into the second region of a flow thread.
* fast/regions/hover-element-flowed-second-region-expected.html: Added.
* fast/regions/hover-element-flowed-second-region.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169120
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-05-20 Radu Stavila <stavila@adobe.com>
+
+ REGRESSION: [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted
+ https://bugs.webkit.org/show_bug.cgi?id=133111
+
+ Reviewed by David Hyatt.
+
+ Added test for the correct repaint of an element flowed directly into the second region of a flow thread.
+
+ * fast/regions/hover-element-flowed-second-region-expected.html: Added.
+ * fast/regions/hover-element-flowed-second-region.html: Added.
+
2014-05-20 Prashant Hiremath <hiremathprashants@gmail.com>
Only set title on SVG documents
--- /dev/null
+<!DOCTYPE html>
+
+<head>
+ <style>
+ .region {
+ -webkit-flow-from: flow;
+ border: 2px solid blue;
+ width: 100px;
+ height: 100px;
+ margin: 10px;
+ }
+ #region2 {
+ margin-top: 10px;
+ }
+ .content {
+ -webkit-flow-into: flow;
+ background-color: green;
+ width: 100px;
+ height: 100px;
+ }
+
+ #content2 {
+ background-color: red;
+ }
+ </style>
+</head>
+
+<body>
+ <a href="https://bugs.webkit.org/show_bug.cgi?id=133111">Bug 133111 - [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted</a>
+ <p>When hovered, the <span style="color:green"><b>green</b></span> content should turn <span style="color:red"><b>red</b></span>.</p>
+ <div class="region" id="region1"></div>
+ <div class="region" id="region2"></div>
+ <div class="content" id="content1"></div>
+ <div class="content" id="content2"></div>
+</body>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>
+
+<head>
+ <style>
+ .region {
+ -webkit-flow-from: flow;
+ border: 2px solid blue;
+ width: 100px;
+ height: 100px;
+ margin: 10px;
+ }
+ #region2 {
+ margin-top: 10px;
+ }
+ .content {
+ -webkit-flow-into: flow;
+ background-color: green;
+ width: 100px;
+ height: 100px;
+ }
+
+ .content:hover {
+ background-color: red;
+ }
+ </style>
+</head>
+
+<script type="text/javascript">
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+
+ function beginTest() {
+ if (window.eventSender) {
+
+ // move mouse on the hover test object
+ var content2 = document.getElementById("region2");
+ eventSender.mouseMoveTo(content2.offsetLeft + 20, content2.offsetTop + 20);
+ eventSender.mouseDown(0);
+
+ testRunner.notifyDone();
+ }
+ }
+</script>
+
+<body onload="beginTest()">
+ <a href="https://bugs.webkit.org/show_bug.cgi?id=133111">Bug 133111 - [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted</a>
+ <p>When hovered, the <span style="color:green"><b>green</b></span> content should turn <span style="color:red"><b>red</b></span>.</p>
+ <div class="region" id="region1"></div>
+ <div class="region" id="region2"></div>
+ <div class="content" id="content1"></div>
+ <div class="content" id="content2"></div>
+</body>
\ No newline at end of file
+2014-05-20 Radu Stavila <stavila@adobe.com>
+
+ REGRESSION: [CSS Regions] Content flowed directly into the flow thread that ends up in the second region is not properly repainted
+ https://bugs.webkit.org/show_bug.cgi?id=133111
+
+ Reviewed by David Hyatt.
+
+ When computing the repaint rect of an element flowed into a flow thread, if the element is flowed directly into
+ the flow thread (meaning its containing block is the flow thread itself), the region's position within the flow
+ must no longer be taken into consideration, because its already included in the element's |topLeft|.
+
+ Test: fast/regions/hover-element-flowed-second-region.html
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::computeRectForRepaint):
+
2014-05-20 Alex Christensen <achristensen@webkit.org>
Fix web timing assertion failure.
// elements because their absolute position already pushes them down through
// the regions so adding this here and then adding the topLeft again would cause
// us to add the height twice.
- if (o->isOutOfFlowRenderFlowThread() && position != AbsolutePosition) {
+ // The same logic applies for elements flowed directly into the flow thread. Their topLeft member
+ // will already contain the portion rect of the region.
+ if (o->isOutOfFlowRenderFlowThread() && position != AbsolutePosition && containingBlock() != flowThreadContainingBlock()) {
RenderRegion* firstRegion = nullptr;
RenderRegion* lastRegion = nullptr;
if (toRenderFlowThread(o)->getRegionRangeForBox(this, firstRegion, lastRegion))