- Revision
- 120071
- Author
- commit-qu...@webkit.org
- Date
- 2012-06-12 07:21:41 -0700 (Tue, 12 Jun 2012)
Log Message
[CSSRegions]NamedFlow::overset should return true when there's no region chain attached
https://bugs.webkit.org/show_bug.cgi?id=88515
The CSS Regions specifies that the "overset" attribute needs to return true if the content overflows, there's no region attached to the flow
or if the NamedFlow is in the NULL state:
http://www.w3.org/TR/css3-regions/#dom-named-flow-overset
Source/WebCore:
This patch updates WebKit's behavior in the last two situations to match the one in the spec.
Patch by Andrei Bucur <abu...@adobe.com> on 2012-06-12
Reviewed by Andreas Kling.
Test: fast/regions/webkit-named-flow-overset.html was updated
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
(WebCore::RenderFlowThread::computeOverflowStateForRegions): If the last valid region is null, the flow has not region chain attached or it's in the NULL state.
LayoutTests:
The overset test was updated to cover the attribute value in case of a flow in the NULL state.
Patch by Andrei Bucur <abu...@adobe.com> on 2012-06-12
Reviewed by Andreas Kling.
* fast/regions/webkit-named-flow-overset-expected.txt:
* fast/regions/webkit-named-flow-overset.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (120070 => 120071)
--- trunk/LayoutTests/ChangeLog 2012-06-12 13:58:05 UTC (rev 120070)
+++ trunk/LayoutTests/ChangeLog 2012-06-12 14:21:41 UTC (rev 120071)
@@ -1,3 +1,19 @@
+2012-06-12 Andrei Bucur <abu...@adobe.com>
+
+ [CSSRegions]NamedFlow::overset should return true when there's no region chain attached
+ https://bugs.webkit.org/show_bug.cgi?id=88515
+
+ The CSS Regions specifies that the "overset" attribute needs to return true if the content overflows, there's no region attached to the flow
+ or if the NamedFlow is in the NULL state:
+ http://www.w3.org/TR/css3-regions/#dom-named-flow-overset
+
+ The overset test was updated to cover the attribute value in case of a flow in the NULL state.
+
+ Reviewed by Andreas Kling.
+
+ * fast/regions/webkit-named-flow-overset-expected.txt:
+ * fast/regions/webkit-named-flow-overset.html:
+
2012-06-12 Mario Sanchez Prada <msanc...@igalia.com>
Unreviewed gardening. Skip test failing randomly in GTK bots after r120040.
Modified: trunk/LayoutTests/fast/regions/webkit-named-flow-overset-expected.txt (120070 => 120071)
--- trunk/LayoutTests/fast/regions/webkit-named-flow-overset-expected.txt 2012-06-12 13:58:05 UTC (rev 120070)
+++ trunk/LayoutTests/fast/regions/webkit-named-flow-overset-expected.txt 2012-06-12 14:21:41 UTC (rev 120071)
@@ -3,14 +3,15 @@
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+PASS namedFlow.overset is true
PASS namedFlow.overset is false
+PASS namedFlow.overset is true
PASS namedFlow.overset is false
PASS namedFlow.overset is true
PASS namedFlow.overset is false
PASS namedFlow.overset is true
PASS namedFlow.overset is false
PASS namedFlow.overset is true
-PASS namedFlow.overset is false
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/regions/webkit-named-flow-overset.html (120070 => 120071)
--- trunk/LayoutTests/fast/regions/webkit-named-flow-overset.html 2012-06-12 13:58:05 UTC (rev 120070)
+++ trunk/LayoutTests/fast/regions/webkit-named-flow-overset.html 2012-06-12 14:21:41 UTC (rev 120071)
@@ -26,62 +26,68 @@
// Flow article does not have any regions yet
var namedFlow = document.webkitGetFlowByName("flow");
- // Overflow should be false for a flow without regions
- shouldBe("namedFlow.overset", "false");
+ // Overset should be false for a flow without regions
+ shouldBe("namedFlow.overset", "true");
- // Add a region to take the content, overflow should be false since the content first the regions.
+ // Add a region to take the content, overset should be false since the content first the regions.
var region = document.createElement("div");
document.body.appendChild(region);
region.id = "region";
region.className = "region";
- // Overflow should be false since the content fits the regions
+ // Overset should be false since the content fits the regions
shouldBe("namedFlow.overset", "false");
- // Add more content to the flow, overflow should be true.
+ // Add more content to the flow, overset should be true.
var p = document.createElement("p");
p.appendChild(document.createTextNode("Content inside article"));
document.getElementById("article").appendChild(p);
- // Overflow should be true since the content does not fit the regions
+ // Overset should be true since the content does not fit the regions
shouldBe("namedFlow.overset", "true");
- // Add another region, overflow should be false
+ // Add another region, overset should be false
var region2 = document.createElement("div");
document.body.appendChild(region2);
region2.id = "region2";
region2.className = "region";
- // Overflow should be false since the content fits in the regions
+ // Overset should be false since the content fits in the regions
shouldBe("namedFlow.overset", "false");
- // Add visual overflow, overflow should be true.
+ // Add visual overset, overset should be true.
document.getElementById("article").style.webkitBoxShadow="0px 50px lime";
- // Overflow should be true since the content does not fit in regions
+ // Overset should be true since the content does not fit in regions
shouldBe("namedFlow.overset", "true");
- // Add the third region, overflow should be false.
+ // Add the third region, overset should be false.
var region3 = document.createElement("div");
document.body.appendChild(region3);
region3.id = "region3";
region3.className = "region";
- // Overflow should be false since the content fits in regions
+ // Overset should be false since the content fits in regions
shouldBe("namedFlow.overset", "false");
- // Remove the first region from the flow, overflow should be true.
+ // Remove the first region from the flow, overset should be true.
region.className = "";
- // Overflow should be true since the content does not fit the regions
+ // Overset should be true since the content does not fit the regions
shouldBe("namedFlow.overset", "true");
- // Remove the content from the flow, overflow should be false.
+ // Remove the content from the flow, overset should be false.
document.getElementById("article").className = "";
- // Overflow should be false since the flow does not have any content
+ // Overset should be false since the flow does not have any content
shouldBe("namedFlow.overset", "false");
+ // Remove all the regions from the flow
+ region2.className = region3.className = "";
+
+ // Overset should be true since the flow does not have any region chain
+ shouldBe("namedFlow.overset", "true");
+
document.getElementById("article").style.display = "none";
region.style.display = "none";
region2.style.display = "none";
Modified: trunk/Source/WebCore/ChangeLog (120070 => 120071)
--- trunk/Source/WebCore/ChangeLog 2012-06-12 13:58:05 UTC (rev 120070)
+++ trunk/Source/WebCore/ChangeLog 2012-06-12 14:21:41 UTC (rev 120071)
@@ -1,3 +1,22 @@
+2012-06-12 Andrei Bucur <abu...@adobe.com>
+
+ [CSSRegions]NamedFlow::overset should return true when there's no region chain attached
+ https://bugs.webkit.org/show_bug.cgi?id=88515
+
+ The CSS Regions specifies that the "overset" attribute needs to return true if the content overflows, there's no region attached to the flow
+ or if the NamedFlow is in the NULL state:
+ http://www.w3.org/TR/css3-regions/#dom-named-flow-overset
+
+ This patch updates WebKit's behavior in the last two situations to match the one in the spec.
+
+ Reviewed by Andreas Kling.
+
+ Test: fast/regions/webkit-named-flow-overset.html was updated
+
+ * rendering/RenderFlowThread.cpp:
+ (WebCore::RenderFlowThread::RenderFlowThread):
+ (WebCore::RenderFlowThread::computeOverflowStateForRegions): If the last valid region is null, the flow has not region chain attached or it's in the NULL state.
+
2012-06-12 Rahul Tiwari <rahultiwari.cse.i...@gmail.com>
Web Inspector: Provide context menu for deleting recorded profile on Profiles Panel
Modified: trunk/Source/WebCore/rendering/RenderFlowThread.cpp (120070 => 120071)
--- trunk/Source/WebCore/rendering/RenderFlowThread.cpp 2012-06-12 13:58:05 UTC (rev 120070)
+++ trunk/Source/WebCore/rendering/RenderFlowThread.cpp 2012-06-12 14:21:41 UTC (rev 120071)
@@ -51,7 +51,7 @@
, m_regionsInvalidated(false)
, m_regionsHaveUniformLogicalWidth(true)
, m_regionsHaveUniformLogicalHeight(true)
- , m_overset(false)
+ , m_overset(true)
, m_regionLayoutUpdateEventTimer(this, &RenderFlowThread::regionLayoutUpdateEventTimerFired)
{
ASSERT(node->document()->cssRegionsEnabled());
@@ -717,9 +717,10 @@
region->setDispatchRegionLayoutUpdateEvent(true);
}
- // With the regions overflow state computed we can also set the overflow for the named flow.
+ // With the regions overflow state computed we can also set the overset flag for the named flow.
+ // If there are no valid regions in the chain, overset is true
RenderRegion* lastReg = lastRegion();
- m_overset = lastReg && (lastReg->regionState() == RenderRegion::RegionOverflow);
+ m_overset = lastReg ? lastReg->regionState() == RenderRegion::RegionOverflow : true;
}
void RenderFlowThread::regionLayoutUpdateEventTimerFired(Timer<RenderFlowThread>*)