Diff
Modified: trunk/LayoutTests/ChangeLog (145449 => 145450)
--- trunk/LayoutTests/ChangeLog 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/LayoutTests/ChangeLog 2013-03-12 01:10:35 UTC (rev 145450)
@@ -1,3 +1,19 @@
+2013-03-11 Lamarque V. Souza <[email protected]>
+
+ [css3-text] Add partial parsing support for text-underline-position property from CSS3 Text
+ https://bugs.webkit.org/show_bug.cgi?id=102491
+
+ Reviewed by Julien Chaffraix.
+
+ Added getComputedStyle layout tests for 'text-underline-position' CSS3
+ property, with 'webkit' prefix.
+
+ * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position-expected.txt: Added.
+ * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html: Added.
+ * fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-underline-position.js: Added.
+ (testElementStyle):
+ (testComputedStyle):
+
2013-03-11 Christian Biesinger <[email protected]>
Hit testing should use ancestorInThisScope to get the non-shadow ancestor
Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position-expected.txt (0 => 145450)
--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position-expected.txt 2013-03-12 01:10:35 UTC (rev 145450)
@@ -0,0 +1,71 @@
+Test to make sure -webkit-text-underline-position property returns values properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Initial value:
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position') is null
+PASS computedStyle.webkitTextUnderlinePosition is 'auto'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'auto'
+
+Value '':
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position') is null
+PASS computedStyle.webkitTextUnderlinePosition is 'auto'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'auto'
+
+Initial value (explicit):
+PASS e.style.webkitTextUnderlinePosition is 'initial'
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position').toString() is '[object CSSValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'initial'
+PASS computedStyle.webkitTextUnderlinePosition is 'auto'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'auto'
+
+Value 'auto':
+PASS e.style.webkitTextUnderlinePosition is 'auto'
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position').toString() is '[object CSSPrimitiveValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'auto'
+PASS computedStyle.webkitTextUnderlinePosition is 'auto'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'auto'
+
+Value 'alphabetic':
+PASS e.style.webkitTextUnderlinePosition is 'alphabetic'
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position').toString() is '[object CSSPrimitiveValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'alphabetic'
+PASS computedStyle.webkitTextUnderlinePosition is 'alphabetic'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'alphabetic'
+
+Value 'under':
+PASS e.style.webkitTextUnderlinePosition is 'under'
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position').toString() is '[object CSSPrimitiveValue]'
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'under'
+PASS computedStyle.webkitTextUnderlinePosition is 'under'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'under'
+
+Ancestor inherits values from parent:
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position') is null
+PASS computedStyle.webkitTextUnderlinePosition is 'under'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').toString() is '[object CSSPrimitiveValue]'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'under'
+
+Value 'auto alphabetic':
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position') is null
+
+Value 'auto under':
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position') is null
+
+Value 'under under':
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position') is null
+
+Value 'under under under':
+PASS e.style.getPropertyCSSValue('-webkit-text-underline-position') is null
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html (0 => 145450)
--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html 2013-03-12 01:10:35 UTC (rev 145450)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-underline-position.js (0 => 145450)
--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-underline-position.js (rev 0)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-underline-position.js 2013-03-12 01:10:35 UTC (rev 145450)
@@ -0,0 +1,94 @@
+function testElementStyle(propertyJS, propertyCSS, type, value)
+{
+ if (type != null) {
+ shouldBe("e.style." + propertyJS, "'" + value + "'");
+ shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').toString()", "'" + type + "'");
+ shouldBe("e.style.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'");
+ } else
+ shouldBeNull("e.style.getPropertyCSSValue('" + propertyCSS + "')");
+}
+
+function testComputedStyle(propertyJS, propertyCSS, type, value)
+{
+ computedStyle = window.getComputedStyle(e, null);
+ shouldBe("computedStyle." + propertyJS, "'" + value + "'");
+ shouldBe("computedStyle.getPropertyCSSValue('" + propertyCSS + "').toString()", "'" + type + "'");
+ shouldBe("computedStyle.getPropertyCSSValue('" + propertyCSS + "').cssText", "'" + value + "'");
+}
+
+description("Test to make sure -webkit-text-underline-position property returns values properly.")
+
+// FIXME: This test tests property values 'auto', 'alphabetic' and 'under'. We don't fully match
+// the specification as we don't support [ left | right ] and this is left for another implementation
+// as the rendering will need to be added.
+
+var testContainer = document.createElement("div");
+testContainer.contentEditable = true;
+document.body.appendChild(testContainer);
+
+testContainer.innerHTML = '<div id="test">hello world</div>';
+
+debug("Initial value:");
+e = document.getElementById('test');
+testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", null, '');
+testComputedStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "auto");
+debug('');
+
+debug("Value '':");
+e.style.webkitTextUnderlinePosition = '';
+testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", null, '');
+testComputedStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "auto");
+debug('');
+
+debug("Initial value (explicit):");
+e.style.webkitTextUnderlinePosition = 'initial';
+testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSValue]", "initial");
+testComputedStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "auto");
+debug('');
+
+debug("Value 'auto':");
+e.style.webkitTextUnderlinePosition = 'auto';
+testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "auto");
+testComputedStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "auto");
+debug('');
+
+debug("Value 'alphabetic':");
+e.style.webkitTextUnderlinePosition = 'alphabetic';
+testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "alphabetic");
+testComputedStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "alphabetic");
+debug('');
+
+debug("Value 'under':");
+e.style.webkitTextUnderlinePosition = 'under';
+testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "under");
+testComputedStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "under");
+debug('');
+
+testContainer.innerHTML = '<div id="test-parent" style="-webkit-text-underline-position: under;">hello <span id="test-ancestor">world</span></div>';
+debug("Ancestor inherits values from parent:");
+e = document.getElementById('test-ancestor');
+testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", null, "");
+testComputedStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "under");
+debug('');
+
+debug("Value 'auto alphabetic':");
+e.style.webkitTextUnderlinePosition = 'auto alphabetic';
+testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", null, "");
+debug('');
+
+debug("Value 'auto under':");
+e.style.webkitTextUnderlinePosition = 'auto under';
+testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", null, "");
+debug('');
+
+debug("Value 'under under':");
+e.style.webkitTextUnderlinePosition = 'under under';
+testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", null, "");
+debug('');
+
+debug("Value 'under under under':");
+e.style.webkitTextUnderlinePosition = 'auto alphabetic under';
+testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", null, "");
+debug('');
+
+document.body.removeChild(testContainer);
Modified: trunk/Source/WebCore/ChangeLog (145449 => 145450)
--- trunk/Source/WebCore/ChangeLog 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/ChangeLog 2013-03-12 01:10:35 UTC (rev 145450)
@@ -1,3 +1,49 @@
+2013-03-11 Lamarque V. Souza <[email protected]>
+
+ [css3-text] Add partial parsing support for text-underline-position property from CSS3 Text
+ https://bugs.webkit.org/show_bug.cgi?id=102491
+
+ Reviewed by Julien Chaffraix.
+
+ This patch extends the existing parsing to support 'auto', 'alphabetic' and 'under'. We don't fully match
+ the specification as we don't support [ left | right ] and this is left for another implementation
+ as the rendering will need to be added.
+
+ Test: fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ (WebCore::CSSParser::parseTextUnderlinePosition):
+ * css/CSSParser.h:
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ (WebCore::CSSPrimitiveValue::operator TextUnderlinePosition):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ Added parsing-related checks for text-underline-position property.
+ * css/CSSPropertyNames.in: Added '-webkit-underline-position' property.
+ * css/CSSValueKeywords.in:
+ * css/SVGCSSValueKeywords.in:
+ * css/StyleBuilder.cpp:
+ (ApplyPropertyTextUnderlinePosition):
+ (WebCore::ApplyPropertyTextUnderlinePosition::applyValue):
+ (WebCore::ApplyPropertyTextUnderlinePosition::createHandler):
+ (WebCore::StyleBuilder::StyleBuilder):
+ Set property handler for text-underline-position.
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::applyProperty):
+ * rendering/style/RenderStyle.h:
+ * rendering/style/RenderStyleConstants.h:
+ * rendering/style/StyleRareInheritedData.cpp:
+ (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+ (WebCore::StyleRareInheritedData::operator==):
+ Added support for m_textUnderlinePosition on copy constructor and operator
+ assignment functions.
+ * rendering/style/StyleRareInheritedData.h:
+ (StyleRareInheritedData): Added m_textUnderlinePosition here as it won't be used regularly.
+
2013-03-11 Christian Biesinger <[email protected]>
Hit testing should use ancestorInThisScope to get the non-shadow ancestor
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (145449 => 145450)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2013-03-12 01:10:35 UTC (rev 145450)
@@ -191,6 +191,7 @@
CSSPropertyWebkitTextDecorationLine,
CSSPropertyWebkitTextDecorationStyle,
CSSPropertyWebkitTextAlignLast,
+ CSSPropertyWebkitTextUnderlinePosition,
#endif // CSS3_TEXT
CSSPropertyTextIndent,
CSSPropertyTextRendering,
@@ -2155,6 +2156,8 @@
return renderTextDecorationStyleFlagsToCSSValue(style->textDecorationStyle());
case CSSPropertyWebkitTextAlignLast:
return cssValuePool().createValue(style->textAlignLast());
+ case CSSPropertyWebkitTextUnderlinePosition:
+ return cssValuePool().createValue(style->textUnderlinePosition());
#endif // CSS3_TEXT
case CSSPropertyWebkitTextDecorationsInEffect:
return renderTextDecorationFlagsToCSSValue(style->textDecorationsInEffect());
Modified: trunk/Source/WebCore/css/CSSParser.cpp (145449 => 145450)
--- trunk/Source/WebCore/css/CSSParser.cpp 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/css/CSSParser.cpp 2013-03-12 01:10:35 UTC (rev 145450)
@@ -2296,6 +2296,10 @@
if (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy)
validPrimitive = true;
break;
+
+ case CSSPropertyWebkitTextUnderlinePosition:
+ // auto | alphabetic | under
+ return parseTextUnderlinePosition(important);
#endif // CSS3_TEXT
case CSSPropertyZoom: // normal | reset | document | <number> | <percentage> | inherit
@@ -9141,6 +9145,27 @@
return false;
}
+#if ENABLE(CSS3_TEXT)
+bool CSSParser::parseTextUnderlinePosition(bool important)
+{
+ // The text-underline-position property has sintax "auto | alphabetic | [ under || [ left | right ] ]".
+ // However, values 'left' and 'right' are not implemented yet, so we will parse sintax
+ // "auto | alphabetic | under" for now.
+ CSSParserValue* value = m_valueList->current();
+ switch (value->id) {
+ case CSSValueAuto:
+ case CSSValueAlphabetic:
+ case CSSValueUnder:
+ if (m_valueList->next())
+ return false;
+
+ addProperty(CSSPropertyWebkitTextUnderlinePosition, cssValuePool().createIdentifierValue(value->id), important);
+ return true;
+ }
+ return false;
+}
+#endif // CSS3_TEXT
+
bool CSSParser::parseTextEmphasisStyle(bool important)
{
unsigned valueListSize = m_valueList->size();
Modified: trunk/Source/WebCore/css/CSSParser.h (145449 => 145450)
--- trunk/Source/WebCore/css/CSSParser.h 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/css/CSSParser.h 2013-03-12 01:10:35 UTC (rev 145450)
@@ -264,6 +264,9 @@
void addTextDecorationProperty(CSSPropertyID, PassRefPtr<CSSValue>, bool important);
bool parseTextDecoration(CSSPropertyID propId, bool important);
+#if ENABLE(CSS3_TEXT)
+ bool parseTextUnderlinePosition(bool important);
+#endif // CSS3_TEXT
bool parseLineBoxContain(bool important);
bool parseCalculation(CSSParserValue*, CalculationPermittedValueRange);
Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (145449 => 145450)
--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h 2013-03-12 01:10:35 UTC (rev 145450)
@@ -2397,6 +2397,42 @@
ASSERT_NOT_REACHED();
return TextDecorationStyleSolid;
}
+
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextUnderlinePosition e)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_IDENT;
+ switch (e) {
+ case TextUnderlinePositionAuto:
+ m_value.ident = CSSValueAuto;
+ break;
+ case TextUnderlinePositionAlphabetic:
+ m_value.ident = CSSValueAlphabetic;
+ break;
+ case TextUnderlinePositionUnder:
+ m_value.ident = CSSValueUnder;
+ break;
+ }
+
+ // FIXME: Implement support for 'under left' and 'under right' values.
+}
+
+template<> inline CSSPrimitiveValue::operator TextUnderlinePosition() const
+{
+ switch (m_value.ident) {
+ case CSSValueAuto:
+ return TextUnderlinePositionAuto;
+ case CSSValueAlphabetic:
+ return TextUnderlinePositionAlphabetic;
+ case CSSValueUnder:
+ return TextUnderlinePositionUnder;
+ }
+
+ // FIXME: Implement support for 'under left' and 'under right' values.
+
+ ASSERT_NOT_REACHED();
+ return TextUnderlinePositionAuto;
+}
#endif // CSS3_TEXT
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextSecurity e)
Modified: trunk/Source/WebCore/css/CSSProperty.cpp (145449 => 145450)
--- trunk/Source/WebCore/css/CSSProperty.cpp 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/css/CSSProperty.cpp 2013-03-12 01:10:35 UTC (rev 145450)
@@ -332,6 +332,7 @@
#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextDecorationLine:
case CSSPropertyWebkitTextAlignLast:
+ case CSSPropertyWebkitTextUnderlinePosition:
#endif // CSS3_TEXT
case CSSPropertyWebkitTextDecorationsInEffect:
case CSSPropertyWebkitTextEmphasis:
Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (145449 => 145450)
--- trunk/Source/WebCore/css/CSSPropertyNames.in 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in 2013-03-12 01:10:35 UTC (rev 145450)
@@ -372,6 +372,7 @@
-webkit-text-decoration-line
-webkit-text-decoration-style
-webkit-text-align-last
+-webkit-text-underline-position
#endif
-webkit-text-decorations-in-effect
-webkit-text-emphasis
Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (145449 => 145450)
--- trunk/Source/WebCore/css/CSSValueKeywords.in 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in 2013-03-12 01:10:35 UTC (rev 145450)
@@ -952,6 +952,10 @@
// -webkit-line-align
edges
+#if (defined(ENABLE_SVG) && ENABLE_SVG) || (defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT)
+alphabetic
+#endif
+
// position
#if defined(ENABLE_CSS_STICKY_POSITION) && ENABLE_CSS_STICKY_POSITION
-webkit-sticky
Modified: trunk/Source/WebCore/css/SVGCSSValueKeywords.in (145449 => 145450)
--- trunk/Source/WebCore/css/SVGCSSValueKeywords.in 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/css/SVGCSSValueKeywords.in 2013-03-12 01:10:35 UTC (rev 145450)
@@ -241,7 +241,6 @@
text-before-edge
text-after-edge
ideographic
-alphabetic
hanging
mathematical
Modified: trunk/Source/WebCore/css/StyleBuilder.cpp (145449 => 145450)
--- trunk/Source/WebCore/css/StyleBuilder.cpp 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/css/StyleBuilder.cpp 2013-03-12 01:10:35 UTC (rev 145450)
@@ -1149,6 +1149,35 @@
}
};
+#if ENABLE(CSS3_TEXT)
+class ApplyPropertyTextUnderlinePosition {
+public:
+ static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
+ {
+ // This is true if value is 'auto' or 'alphabetic'.
+ if (value->isPrimitiveValue()) {
+ TextUnderlinePosition t = *static_cast<CSSPrimitiveValue*>(value);
+ styleResolver->style()->setTextUnderlinePosition(t);
+ return;
+ }
+
+ unsigned t = 0;
+ for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
+ CSSValue* item = i.value();
+ ASSERT(item->isPrimitiveValue());
+ TextUnderlinePosition t2 = *static_cast<CSSPrimitiveValue*>(item);
+ t |= t2;
+ }
+ styleResolver->style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t));
+ }
+ static PropertyHandler createHandler()
+ {
+ PropertyHandler handler = ApplyPropertyDefaultBase<TextUnderlinePosition, &RenderStyle::textUnderlinePosition, TextUnderlinePosition, &RenderStyle::setTextUnderlinePosition, TextUnderlinePosition, &RenderStyle::initialTextUnderlinePosition>::createHandler();
+ return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
+ }
+};
+#endif // CSS3_TEXT
+
class ApplyPropertyLineHeight {
public:
static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
@@ -1903,6 +1932,7 @@
setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler());
setPropertyHandler(CSSPropertyWebkitTextDecorationStyle, ApplyPropertyDefault<TextDecorationStyle, &RenderStyle::textDecorationStyle, TextDecorationStyle, &RenderStyle::setTextDecorationStyle, TextDecorationStyle, &RenderStyle::initialTextDecorationStyle>::createHandler());
setPropertyHandler(CSSPropertyWebkitTextAlignLast, ApplyPropertyDefault<TextAlignLast, &RenderStyle::textAlignLast, TextAlignLast, &RenderStyle::setTextAlignLast, TextAlignLast, &RenderStyle::initialTextAlignLast>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitTextUnderlinePosition, ApplyPropertyTextUnderlinePosition::createHandler());
#endif // CSS3_TEXT
setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
setPropertyHandler(CSSPropertyTextOverflow, ApplyPropertyDefault<TextOverflow, &RenderStyle::textOverflow, TextOverflow, &RenderStyle::setTextOverflow, TextOverflow, &RenderStyle::initialTextOverflow>::createHandler());
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (145449 => 145450)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2013-03-12 01:10:35 UTC (rev 145450)
@@ -3804,6 +3804,7 @@
case CSSPropertyWebkitTextDecorationLine:
case CSSPropertyWebkitTextDecorationStyle:
case CSSPropertyWebkitTextAlignLast:
+ case CSSPropertyWebkitTextUnderlinePosition:
#endif // CSS3_TEXT
case CSSPropertyWebkitTextEmphasisColor:
case CSSPropertyWebkitTextEmphasisPosition:
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (145449 => 145450)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2013-03-12 01:10:35 UTC (rev 145450)
@@ -575,6 +575,7 @@
#if ENABLE(CSS3_TEXT)
TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rareInheritedData->m_textAlignLast); }
+ TextUnderlinePosition textUnderlinePosition() const { return static_cast<TextUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); }
#else
TextDecorationStyle textDecorationStyle() const { return TextDecorationStyleSolid; }
#endif // CSS3_TEXT
@@ -1137,6 +1138,7 @@
#if ENABLE(CSS3_TEXT)
void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAlignLast, v); }
+ void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInheritedData, m_textUnderlinePosition, v); }
#endif // CSS3_TEXT
void setDirection(TextDirection v) { inherited_flags._direction = v; }
void setLineHeight(Length specifiedLineHeight);
@@ -1611,6 +1613,7 @@
#if ENABLE(CSS3_TEXT)
static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; }
+ static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnderlinePositionAuto; }
#endif // CSS3_TEXT
static float initialZoom() { return 1.0f; }
static int initialOutlineOffset() { return 0; }
Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (145449 => 145450)
--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h 2013-03-12 01:10:35 UTC (rev 145450)
@@ -358,6 +358,11 @@
enum TextAlignLast {
TextAlignLastAuto, TextAlignLastStart, TextAlignLastEnd, TextAlignLastLeft, TextAlignLastRight, TextAlignLastCenter, TextAlignLastJustify
};
+
+enum TextUnderlinePosition {
+ // FIXME: Implement support for 'under left' and 'under right' values.
+ TextUnderlinePositionAuto = 0x1, TextUnderlinePositionAlphabetic = 0x2, TextUnderlinePositionUnder = 0x4
+};
#endif // CSS3_TEXT
enum EPageBreak {
Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (145449 => 145450)
--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp 2013-03-12 01:10:35 UTC (rev 145450)
@@ -103,6 +103,7 @@
#endif
#if ENABLE(CSS3_TEXT)
, m_textAlignLast(RenderStyle::initialTextAlignLast())
+ , m_textUnderlinePosition(RenderStyle::initialTextUnderlinePosition())
#endif // CSS3_TEXT
, m_rubyPosition(RenderStyle::initialRubyPosition())
, hyphenationLimitBefore(-1)
@@ -172,6 +173,7 @@
#endif
#if ENABLE(CSS3_TEXT)
, m_textAlignLast(o.m_textAlignLast)
+ , m_textUnderlinePosition(o.m_textUnderlinePosition)
#endif // CSS3_TEXT
, m_rubyPosition(o.m_rubyPosition)
, hyphenationString(o.hyphenationString)
@@ -267,6 +269,7 @@
#endif
#if ENABLE(CSS3_TEXT)
&& m_textAlignLast == o.m_textAlignLast
+ && m_textUnderlinePosition == o.m_textUnderlinePosition
#endif // CSS3_TEXT
&& m_rubyPosition == o.m_rubyPosition
&& m_lineSnap == o.m_lineSnap
Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h (145449 => 145450)
--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h 2013-03-12 01:10:14 UTC (rev 145449)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h 2013-03-12 01:10:35 UTC (rev 145450)
@@ -117,6 +117,7 @@
#endif
#if ENABLE(CSS3_TEXT)
unsigned m_textAlignLast : 3; // TextAlignLast
+ unsigned m_textUnderlinePosition : 3; // TextUnderlinePosition
#endif // CSS3_TEXT
unsigned m_rubyPosition : 1; // RubyPosition