[CSS Regions]Rename NamedFlow::overflow to NamedFlow::overset

https://bugs.webkit.org/show_bug.cgi?id=87491

This patch updates the CSSOM property name overflow to overset. There are no changes in functionality.
Link to spec: http://www.w3.org/TR/2012/WD-css3-regions-20120503/

Source/WebCore:

Patch by Andrei Bucur <abucur@adobe.com> on 2012-05-29
Reviewed by Andreas Kling.

Test: fast/regions/webkit-named-flow-overset.html

* dom/WebKitNamedFlow.cpp:
(WebCore::WebKitNamedFlow::overset):
* dom/WebKitNamedFlow.h:
(WebKitNamedFlow):
* dom/WebKitNamedFlow.idl:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
(WebCore::RenderFlowThread::computeOverflowStateForRegions):
* rendering/RenderFlowThread.h:

LayoutTests:

The test was refactored to be more similar to the other script tests (by using make-new-script-test)

Patch by Andrei Bucur <abucur@adobe.com> on 2012-05-29
Reviewed by Andreas Kling.

* fast/regions/webkit-named-flow-overflow-expected.txt: Removed.
* fast/regions/webkit-named-flow-overflow.html: Removed.
* fast/regions/webkit-named-flow-overset-expected.txt: Added.
* fast/regions/webkit-named-flow-overset.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent db57003d
2012-05-29 Andrei Bucur <abucur@adobe.com>
[CSS Regions]Rename NamedFlow::overflow to NamedFlow::overset
https://bugs.webkit.org/show_bug.cgi?id=87491
This patch updates the CSSOM property name overflow to overset. There are no changes in functionality.
Link to spec: http://www.w3.org/TR/2012/WD-css3-regions-20120503/
The test was refactored to be more similar to the other script tests (by using make-new-script-test)
Reviewed by Andreas Kling.
* fast/regions/webkit-named-flow-overflow-expected.txt: Removed.
* fast/regions/webkit-named-flow-overflow.html: Removed.
* fast/regions/webkit-named-flow-overset-expected.txt: Added.
* fast/regions/webkit-named-flow-overset.html: Added.
2012-05-29 Csaba Osztrogonác <ossy@webkit.org>
[Qt] REGRESSION(r118568): It broke fast/forms/textarea-maxlength.html on Qt 4.8
......
Test for [CSSRegions]Implement NamedFlow::overflow
On success, you should see a series of PASS below.
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="resources/region-style.css">
<script src="resources/helper.js"></script>
<style>
body { font-family: monospace; }
.flow { -webkit-flow-into: flow }
.region { -webkit-flow-from: flow; }
#region { width: 250px; height: 50px; }
#region2 { width: 250px; height: 50px; }
#region3 { width: 250px; height: 50px; }
</style>
</head>
<body>
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=78880">
[CSSRegions]Implement NamedFlow::overflow</a></p>
<p>On success, you should see a series of PASS below.</p>
<div id="console"></div>
<div id="article" class="flow">
<p>Content inside article</p>
</div>
<script>
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
// Flow article does not have any regions yet
var namedFlow = document.webkitGetFlowByName("flow");
assert(namedFlow.overflow == false, "Overflow should be false for a flow without regions");
// Add a region to take the content, overflow should be false since the content first the regions.
var region = document.createElement("div");
document.body.appendChild(region);
region.id = "region";
region.className = "region";
assert(namedFlow.overflow == false, "Overflow should be false since the content fits the regions");
// Add more content to the flow, overflow should be true.
var p = document.createElement("p");
p.appendChild(document.createTextNode("Content inside article"));
document.getElementById("article").appendChild(p);
assert(namedFlow.overflow, "Overflow should be true since the content does not fit the regions");
// Add another region, overflow should be false
var region2 = document.createElement("div");
document.body.appendChild(region2);
region2.id = "region2";
region2.className = "region";
assert(namedFlow.overflow == false, "Overflow should be false since the content fits in the regions");
// Add visual overflow, overflow should be true.
document.getElementById("article").style.webkitBoxShadow="0px 50px lime";
assert(namedFlow.overflow, "Overflow should be true since the content does not fit in regions");
// Add the third region, overflow should be false.
var region3 = document.createElement("div");
document.body.appendChild(region3);
region3.id = "region3";
region3.className = "region";
assert(namedFlow.overflow == false, "Overflow should be false since the content fits in regions");
// Remove the first region from the flow, overflow should be true.
region.className = "";
assert(namedFlow.overflow, "Overflow should be true since the content does not fit the regions");
// Remove the content from the flow, overflow should be false.
document.getElementById("article").className = "";
assert(namedFlow.overflow == false, "Overflow should be false since the flow does not have any content");
document.getElementById("article").style.visibility = "hidden";
</script>
</body>
</html>
Test for https://bugs.webkit.org/show_bug.cgi?id=87491 [CSS Regions]Rename NamedFlow::overflow to NamedFlow::overset. For more details see http://www.w3.org/TR/2012/WD-css3-regions-20120503/
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS namedFlow.overset is false
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../js/resources/js-test-pre.js"></script>
<style>
body { font-family: monospace; }
.flow { -webkit-flow-into: flow }
.region { -webkit-flow-from: flow; }
#region { width: 250px; height: 50px; }
#region2 { width: 250px; height: 50px; }
#region3 { width: 250px; height: 50px; }
</style>
</head>
<body>
<div id="article" class="flow">
<p>Content inside article</p>
</div>
<script>
description("Test for https://bugs.webkit.org/show_bug.cgi?id=87491 [CSS Regions]Rename NamedFlow::overflow to NamedFlow::overset. \
For more details see http://www.w3.org/TR/2012/WD-css3-regions-20120503/");
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
// 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");
// Add a region to take the content, overflow 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
shouldBe("namedFlow.overset", "false");
// Add more content to the flow, overflow 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
shouldBe("namedFlow.overset", "true");
// Add another region, overflow 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
shouldBe("namedFlow.overset", "false");
// Add visual overflow, overflow should be true.
document.getElementById("article").style.webkitBoxShadow="0px 50px lime";
// Overflow should be true since the content does not fit in regions
shouldBe("namedFlow.overset", "true");
// Add the third region, overflow 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
shouldBe("namedFlow.overset", "false");
// Remove the first region from the flow, overflow should be true.
region.className = "";
// Overflow 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.
document.getElementById("article").className = "";
// Overflow should be false since the flow does not have any content
shouldBe("namedFlow.overset", "false");
document.getElementById("article").style.display = "none";
region.style.display = "none";
region2.style.display = "none";
region3.style.display = "none";
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>
2012-05-29 Andrei Bucur <abucur@adobe.com>
[CSS Regions]Rename NamedFlow::overflow to NamedFlow::overset
https://bugs.webkit.org/show_bug.cgi?id=87491
This patch updates the CSSOM property name overflow to overset. There are no changes in functionality.
Link to spec: http://www.w3.org/TR/2012/WD-css3-regions-20120503/
Reviewed by Andreas Kling.
Test: fast/regions/webkit-named-flow-overset.html
* dom/WebKitNamedFlow.cpp:
(WebCore::WebKitNamedFlow::overset):
* dom/WebKitNamedFlow.h:
(WebKitNamedFlow):
* dom/WebKitNamedFlow.idl:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
(WebCore::RenderFlowThread::computeOverflowStateForRegions):
* rendering/RenderFlowThread.h:
2012-05-29 Andreas Kling <kling@webkit.org>
Give StylePropertySet a proper mutability flag.
......
......@@ -50,10 +50,10 @@ String WebKitNamedFlow::name() const
return m_parentFlowThread->flowThreadName();
}
bool WebKitNamedFlow::overflow() const
bool WebKitNamedFlow::overset() const
{
m_parentFlowThread->document()->updateLayoutIgnorePendingStylesheets();
return m_parentFlowThread->overflow();
return m_parentFlowThread->overset();
}
PassRefPtr<NodeList> WebKitNamedFlow::getRegionsByContentNode(Node* contentNode)
......
......@@ -50,7 +50,7 @@ public:
~WebKitNamedFlow();
String name() const;
bool overflow() const;
bool overset() const;
PassRefPtr<NodeList> getRegionsByContentNode(Node*);
PassRefPtr<NodeList> contentNodes() const;
......
......@@ -32,7 +32,7 @@ module core {
JSGenerateToJSObject
] WebKitNamedFlow {
readonly attribute DOMString name;
readonly attribute boolean overflow;
readonly attribute boolean overset;
NodeList getRegionsByContentNode(in Node contentNode);
readonly attribute NodeList contentNodes;
};
......
......@@ -51,7 +51,7 @@ RenderFlowThread::RenderFlowThread(Node* node)
, m_regionsInvalidated(false)
, m_regionsHaveUniformLogicalWidth(true)
, m_regionsHaveUniformLogicalHeight(true)
, m_overflow(false)
, m_overset(false)
, m_regionLayoutUpdateEventTimer(this, &RenderFlowThread::regionLayoutUpdateEventTimerFired)
{
ASSERT(node->document()->cssRegionsEnabled());
......@@ -729,7 +729,7 @@ void RenderFlowThread::computeOverflowStateForRegions(LayoutUnit oldClientAfterE
// With the regions overflow state computed we can also set the overflow for the named flow.
RenderRegion* lastReg = lastRegion();
m_overflow = lastReg && (lastReg->regionState() == RenderRegion::RegionOverflow);
m_overset = lastReg && (lastReg->regionState() == RenderRegion::RegionOverflow);
}
void RenderFlowThread::regionLayoutUpdateEventTimerFired(Timer<RenderFlowThread>*)
......
......@@ -124,7 +124,7 @@ public:
void computeOverflowStateForRegions(LayoutUnit oldClientAfterEdge);
bool overflow() const { return m_overflow; }
bool overset() const { return m_overset; }
// Check if the object is in region and the region is part of this flow thread.
bool objectInFlowRegion(const RenderObject*, const RenderRegion*) const;
......@@ -172,7 +172,7 @@ protected:
bool m_regionsInvalidated;
bool m_regionsHaveUniformLogicalWidth;
bool m_regionsHaveUniformLogicalHeight;
bool m_overflow;
bool m_overset;
bool m_hasRegionsWithStyling;
Timer<RenderFlowThread> m_regionLayoutUpdateEventTimer;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment