Diff
Modified: trunk/LayoutTests/ChangeLog (90540 => 90541)
--- trunk/LayoutTests/ChangeLog 2011-07-07 05:24:28 UTC (rev 90540)
+++ trunk/LayoutTests/ChangeLog 2011-07-07 05:36:13 UTC (rev 90541)
@@ -1,3 +1,18 @@
+2011-07-06 Mihnea Ovidenie <[email protected]>
+
+ Reviewed by David Hyatt.
+
+ [CSSRegions] Parse flow property
+ https://bugs.webkit.org/show_bug.cgi?id=61730
+
+ * fast/regions/script-tests/TEMPLATE.html: Added.
+ * fast/regions/script-tests/webkit-flow-parsing.js: Added.
+ (test):
+ (testComputedStyle):
+ (testNotInherited):
+ * fast/regions/webkit-flow-parsing-expected.txt: Added.
+ * fast/regions/webkit-flow-parsing.html: Added.
+
2011-07-06 MORITA Hajime <[email protected]>
[ShadowContentElement] Redundant RenderText objects are created on the content boundaries.
Added: trunk/LayoutTests/fast/regions/script-tests/TEMPLATE.html (0 => 90541)
--- trunk/LayoutTests/fast/regions/script-tests/TEMPLATE.html (rev 0)
+++ trunk/LayoutTests/fast/regions/script-tests/TEMPLATE.html 2011-07-07 05:36:13 UTC (rev 90541)
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/regions/script-tests/webkit-flow-parsing.js (0 => 90541)
--- trunk/LayoutTests/fast/regions/script-tests/webkit-flow-parsing.js (rev 0)
+++ trunk/LayoutTests/fast/regions/script-tests/webkit-flow-parsing.js 2011-07-07 05:36:13 UTC (rev 90541)
@@ -0,0 +1,64 @@
+description('Test parsing of the CSS webkit-flow property.');
+
+function test(declaration) {
+ var div = document.createElement("div");
+ div.setAttribute("style", declaration);
+ return div.style.webkitFlow;
+}
+
+function testComputedStyle(value) {
+ var div = document.createElement("div");
+ document.body.appendChild(div);
+ div.style.setProperty("-webkit-flow", value);
+ var webkitFlowComputedValue = getComputedStyle(div).getPropertyValue("-webkit-flow");
+ document.body.removeChild(div);
+ return webkitFlowComputedValue;
+}
+
+function testNotInherited(parentValue, childValue) {
+ var parentDiv = document.createElement("div");
+ document.body.appendChild(parentDiv);
+ parentDiv.style.setProperty("-webkit-flow", parentValue);
+
+ var childDiv = document.createElement("div");
+ parentDiv.appendChild(childDiv);
+ childDiv.style.setProperty("-webkit-flow", childValue);
+
+ var childWebKitFlowComputedValue = getComputedStyle(childDiv).getPropertyValue("-webkit-flow");
+
+ parentDiv.removeChild(childDiv);
+ document.body.removeChild(parentDiv);
+
+ return childWebKitFlowComputedValue;
+}
+
+shouldBeEqualToString('test("-webkit-flow: auto")', "auto");
+shouldBeEqualToString('test("-webkit-flow: initial")', "initial");
+shouldBeEqualToString('test("-webkit-flow: inherit")', "inherit");
+shouldBeEqualToString('test("-webkit-flow: \'first-flow\'")', "first-flow");
+shouldBeEqualToString('test("-webkit-flow: \'first flow\'")', "'first flow'");
+shouldBeEqualToString('test("-webkit-flow: \'auto\';")', "auto");
+shouldBeEqualToString('test("-webkit-flow: \'\'")', "auto");
+shouldBeEqualToString('test("-webkit-flow: ;")', "");
+shouldBeEqualToString('test("-webkit-flow: 1")', "");
+shouldBeEqualToString('test("-webkit-flow: 1.2")', "");
+shouldBeEqualToString('test("-webkit-flow: -1")', "");
+shouldBeEqualToString('test("-webkit-flow: 12px")', "");
+shouldBeEqualToString('test("-webkit-flow: first-flow;")', "");
+shouldBeEqualToString('test("-webkit-flow: first flow")', "");
+
+shouldBeEqualToString('testComputedStyle("auto")', "auto");
+shouldBeEqualToString('testComputedStyle("")', "auto");
+shouldBeEqualToString('testComputedStyle("\'auto\'")', "auto");
+shouldBeEqualToString('testComputedStyle("\'first-flow\'")', "first-flow");
+shouldBeEqualToString('testComputedStyle("first-flow")', "auto");
+shouldBeEqualToString('testComputedStyle("inherited")', "auto");
+shouldBeEqualToString('testComputedStyle("initial")', "auto");
+shouldBeEqualToString('testComputedStyle("12px")', "auto");
+
+shouldBeEqualToString('testNotInherited("auto", "auto")', "auto");
+shouldBeEqualToString('testNotInherited("auto", "\'child-flow\'")', "child-flow");
+shouldBeEqualToString('testNotInherited("\'parent-flow\'", "auto")', "auto");
+shouldBeEqualToString('testNotInherited("\'parent-flow\'", "\'child-flow\'")', "child-flow");
+
+successfullyParsed = true;
Added: trunk/LayoutTests/fast/regions/webkit-flow-parsing-expected.txt (0 => 90541)
--- trunk/LayoutTests/fast/regions/webkit-flow-parsing-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/regions/webkit-flow-parsing-expected.txt 2011-07-07 05:36:13 UTC (rev 90541)
@@ -0,0 +1,35 @@
+Test parsing of the CSS webkit-flow property.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS test("-webkit-flow: auto") is "auto"
+PASS test("-webkit-flow: initial") is "initial"
+PASS test("-webkit-flow: inherit") is "inherit"
+PASS test("-webkit-flow: 'first-flow'") is "first-flow"
+PASS test("-webkit-flow: 'first flow'") is "'first flow'"
+PASS test("-webkit-flow: 'auto';") is "auto"
+PASS test("-webkit-flow: ''") is "auto"
+PASS test("-webkit-flow: ;") is ""
+PASS test("-webkit-flow: 1") is ""
+PASS test("-webkit-flow: 1.2") is ""
+PASS test("-webkit-flow: -1") is ""
+PASS test("-webkit-flow: 12px") is ""
+PASS test("-webkit-flow: first-flow;") is ""
+PASS test("-webkit-flow: first flow") is ""
+PASS testComputedStyle("auto") is "auto"
+PASS testComputedStyle("") is "auto"
+PASS testComputedStyle("'auto'") is "auto"
+PASS testComputedStyle("'first-flow'") is "first-flow"
+PASS testComputedStyle("first-flow") is "auto"
+PASS testComputedStyle("inherited") is "auto"
+PASS testComputedStyle("initial") is "auto"
+PASS testComputedStyle("12px") is "auto"
+PASS testNotInherited("auto", "auto") is "auto"
+PASS testNotInherited("auto", "'child-flow'") is "child-flow"
+PASS testNotInherited("'parent-flow'", "auto") is "auto"
+PASS testNotInherited("'parent-flow'", "'child-flow'") is "child-flow"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/regions/webkit-flow-parsing.html (0 => 90541)
--- trunk/LayoutTests/fast/regions/webkit-flow-parsing.html (rev 0)
+++ trunk/LayoutTests/fast/regions/webkit-flow-parsing.html 2011-07-07 05:36:13 UTC (rev 90541)
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (90540 => 90541)
--- trunk/Source/WebCore/ChangeLog 2011-07-07 05:24:28 UTC (rev 90540)
+++ trunk/Source/WebCore/ChangeLog 2011-07-07 05:36:13 UTC (rev 90541)
@@ -1,3 +1,32 @@
+2011-07-06 Mihnea Ovidenie <[email protected]>
+
+ Reviewed by David Hyatt.
+
+ [CSSRegions] Parse flow property
+ https://bugs.webkit.org/show_bug.cgi?id=61730
+
+ Test: fast/regions/webkit-flow-parsing.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ (WebCore::CSSParser::parseFlowThread):
+ * css/CSSParser.h:
+ * css/CSSPropertyNames.in:
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff):
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::flowThread):
+ (WebCore::InheritedFlags::setFlowThread):
+ (WebCore::InheritedFlags::initialFlowThread):
+ * rendering/style/StyleRareNonInheritedData.cpp:
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+ (WebCore::StyleRareNonInheritedData::operator==):
+ * rendering/style/StyleRareNonInheritedData.h:
+
2011-07-06 MORITA Hajime <[email protected]>
[ShadowContentElement] Redundant RenderText objects are created on the content boundaries.
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (90540 => 90541)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2011-07-07 05:24:28 UTC (rev 90540)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2011-07-07 05:36:13 UTC (rev 90541)
@@ -246,7 +246,9 @@
CSSPropertyWebkitUserModify,
CSSPropertyWebkitUserSelect,
CSSPropertyWebkitWritingMode
-
+#if ENABLE(CSS_REGIONS)
+ , CSSPropertyWebkitFlow
+#endif
#if ENABLE(SVG)
,
CSSPropertyClipPath,
@@ -1656,7 +1658,12 @@
return counterToCSSValue(style.get(), propertyID, primitiveValueCache);
case CSSPropertyCounterReset:
return counterToCSSValue(style.get(), propertyID, primitiveValueCache);
-
+#if ENABLE(CSS_REGIONS)
+ case CSSPropertyWebkitFlow:
+ if (style->flowThread().isNull())
+ return primitiveValueCache->createIdentifierValue(CSSValueAuto);
+ return primitiveValueCache->createValue(style->flowThread(), CSSPrimitiveValue::CSS_STRING);
+#endif
/* Shorthand properties, currently not supported see bug 13658*/
case CSSPropertyBackground:
case CSSPropertyBorder:
Modified: trunk/Source/WebCore/css/CSSParser.cpp (90540 => 90541)
--- trunk/Source/WebCore/css/CSSParser.cpp 2011-07-07 05:24:28 UTC (rev 90540)
+++ trunk/Source/WebCore/css/CSSParser.cpp 2011-07-07 05:36:13 UTC (rev 90541)
@@ -1587,6 +1587,10 @@
validPrimitive = validUnit(value, FTime | FInteger | FNonNeg, m_strict);
break;
#endif
+#if ENABLE(CSS_REGIONS)
+ case CSSPropertyWebkitFlow:
+ return parseFlowThread(propId, important);
+#endif
case CSSPropertyWebkitUserDrag: // auto | none | element
if (id == CSSValueAuto || id == CSSValueNone || id == CSSValueElement)
validPrimitive = true;
@@ -5832,6 +5836,37 @@
return list.release();
}
+#if ENABLE(CSS_REGIONS)
+// auto | <flow_name>
+bool CSSParser::parseFlowThread(int propId, bool important)
+{
+ ASSERT(propId == CSSPropertyWebkitFlow);
+
+ if (m_valueList->size() != 1)
+ return false;
+
+ CSSParserValue* value = m_valueList->current();
+ if (!value)
+ return false;
+
+ if (value->id == CSSValueAuto) {
+ addProperty(propId, primitiveValueCache()->createIdentifierValue(value->id), important);
+ return true;
+ }
+
+ if (!value->id && value->unit == CSSPrimitiveValue::CSS_STRING) {
+ String inputProperty = String(value->string);
+ if (!inputProperty.isEmpty())
+ addProperty(propId, primitiveValueCache()->createValue(inputProperty, CSSPrimitiveValue::CSS_STRING), important);
+ else
+ addProperty(propId, primitiveValueCache()->createIdentifierValue(CSSValueAuto), important);
+ return true;
+ }
+
+ return false;
+}
+#endif
+
bool CSSParser::parseTransformOrigin(int propId, int& propId1, int& propId2, int& propId3, RefPtr<CSSValue>& value, RefPtr<CSSValue>& value2, RefPtr<CSSValue>& value3)
{
propId1 = propId;
Modified: trunk/Source/WebCore/css/CSSParser.h (90540 => 90541)
--- trunk/Source/WebCore/css/CSSParser.h 2011-07-07 05:24:28 UTC (rev 90540)
+++ trunk/Source/WebCore/css/CSSParser.h 2011-07-07 05:36:13 UTC (rev 90541)
@@ -156,6 +156,9 @@
PassRefPtr<CSSValue> parseWCSSInputProperty();
#endif
+#if ENABLE(CSS_REGIONS)
+ bool parseFlowThread(int propId, bool important);
+#endif
// CSS3 Parsing Routines (for properties specific to CSS3)
bool parseShadow(int propId, bool important);
bool parseBorderImage(int propId, bool important, RefPtr<CSSValue>&);
Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (90540 => 90541)
--- trunk/Source/WebCore/css/CSSPropertyNames.in 2011-07-07 05:24:28 UTC (rev 90540)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in 2011-07-07 05:36:13 UTC (rev 90541)
@@ -326,3 +326,6 @@
-webkit-user-drag
-webkit-user-modify
-webkit-user-select
+#if defined(ENABLE_CSS_REGIONS) && ENABLE_CSS_REGIONS
+-webkit-flow
+#endif
Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (90540 => 90541)
--- trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-07-07 05:24:28 UTC (rev 90540)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-07-07 05:36:13 UTC (rev 90541)
@@ -4869,6 +4869,20 @@
}
return;
#endif
+#if ENABLE(CSS_REGIONS)
+ case CSSPropertyWebkitFlow:
+ if (isInitial)
+ HANDLE_INITIAL_COND(CSSPropertyWebkitFlow, FlowThread);
+ if (isInherit) {
+ m_style->setFlowThread(nullAtom);
+ return;
+ }
+ if (primitiveValue->getIdent() == CSSValueAuto)
+ m_style->setFlowThread(nullAtom);
+ else
+ m_style->setFlowThread(primitiveValue->getStringValue());
+ return;
+#endif
case CSSPropertyWebkitMarqueeDirection:
HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marqueeDirection, MarqueeDirection)
return;
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (90540 => 90541)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2011-07-07 05:24:28 UTC (rev 90540)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2011-07-07 05:36:13 UTC (rev 90541)
@@ -344,6 +344,10 @@
|| rareNonInheritedData->textOverflow != other->rareNonInheritedData->textOverflow)
return StyleDifferenceLayout;
+#if ENABLE(CSS_REGIONS)
+ if (rareNonInheritedData->m_flowThread != other->rareNonInheritedData->m_flowThread)
+ return StyleDifferenceLayout;
+#endif
if (rareNonInheritedData->m_deprecatedFlexibleBox.get() != other->rareNonInheritedData->m_deprecatedFlexibleBox.get()
&& *rareNonInheritedData->m_deprecatedFlexibleBox.get() != *other->rareNonInheritedData->m_deprecatedFlexibleBox.get())
return StyleDifferenceLayout;
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (90540 => 90541)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2011-07-07 05:24:28 UTC (rev 90540)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2011-07-07 05:36:13 UTC (rev 90541)
@@ -743,6 +743,10 @@
bool hasTextCombine() const { return textCombine() != TextCombineNone; }
// End CSS3 Getters
+#if ENABLE(CSS_REGIONS)
+ const AtomicString& flowThread() const { return rareNonInheritedData->m_flowThread; }
+#endif
+
// Apple-specific property getter methods
EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(inherited_flags._pointerEvents); }
const AnimationList* animations() const { return rareNonInheritedData->m_animations.get(); }
@@ -1091,6 +1095,10 @@
void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareInheritedData, textEmphasisPosition, position); }
// End CSS3 Setters
+#if ENABLE(CSS_REGIONS)
+ void setFlowThread(const AtomicString& flowThread) { SET_VAR(rareNonInheritedData, m_flowThread, flowThread); }
+#endif
+
// Apple-specific property setters
void setPointerEvents(EPointerEvents p) { inherited_flags._pointerEvents = p; }
@@ -1320,6 +1328,10 @@
static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; }
static EImageRendering initialImageRendering() { return ImageRenderingAuto; }
+#if ENABLE(CSS_REGIONS)
+ static const AtomicString& initialFlowThread() { return nullAtom; }
+#endif
+
// Keep these at the end.
static LineClampValue initialLineClamp() { return LineClampValue(); }
static bool initialTextSizeAdjust() { return true; }
Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (90540 => 90541)
--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp 2011-07-07 05:24:28 UTC (rev 90540)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp 2011-07-07 05:36:13 UTC (rev 90541)
@@ -55,6 +55,9 @@
, m_perspectiveOriginY(RenderStyle::initialPerspectiveOriginY())
, m_pageSize()
, m_pageSizeType(PAGE_SIZE_AUTO)
+#if ENABLE(CSS_REGIONS)
+ , m_flowThread(RenderStyle::initialFlowThread())
+#endif
{
}
@@ -94,6 +97,9 @@
, m_perspectiveOriginY(o.m_perspectiveOriginY)
, m_pageSize(o.m_pageSize)
, m_pageSizeType(o.m_pageSizeType)
+#if ENABLE(CSS_REGIONS)
+ , m_flowThread(o.m_flowThread)
+#endif
{
}
@@ -140,6 +146,9 @@
&& (m_perspectiveOriginY == o.m_perspectiveOriginY)
&& (m_pageSize == o.m_pageSize)
&& (m_pageSizeType == o.m_pageSizeType)
+#if ENABLE(CSS_REGIONS)
+ && (m_flowThread == o.m_flowThread)
+#endif
;
}
Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (90540 => 90541)
--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h 2011-07-07 05:24:28 UTC (rev 90540)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h 2011-07-07 05:36:13 UTC (rev 90541)
@@ -131,6 +131,10 @@
LengthSize m_pageSize;
PageSizeType m_pageSizeType;
+#if ENABLE(CSS_REGIONS)
+ AtomicString m_flowThread;
+#endif
+
private:
StyleRareNonInheritedData();
StyleRareNonInheritedData(const StyleRareNonInheritedData&);