-webkit-text-underline-position should not be inherited
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 May 2013 13:44:15 +0000 (13:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 May 2013 13:44:15 +0000 (13:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116363

Patch by Lamarque V. Souza <Lamarque.Souza@basyskom.com> on 2013-05-20
Reviewed by Dean Jackson.

Source/WebCore:

Specification says text-underline-position should not be inherited.

No new tests, this updates existing tests.

* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty): Make
CSSPropertyWebkitTextUnderlinePosition return false.
* rendering/style/RenderStyle.h: Treat TextUnderlinePosition as
non-inherited.
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==): Remove m_textUnderlinePosition.
* rendering/style/StyleRareInheritedData.h:
(StyleRareInheritedData):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==): Add m_textUnderlinePosition.
* rendering/style/StyleRareNonInheritedData.h:
(StyleRareNonInheritedData):

LayoutTests:

Update expected results.

* fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position-expected.txt:
* fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-underline-position.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150366 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position-expected.txt
LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-underline-position.js
Source/WebCore/ChangeLog
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareInheritedData.cpp
Source/WebCore/rendering/style/StyleRareInheritedData.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h

index 33490ae3050faa6fc5385d9b34bd47aef383c5f6..f44d3e88cdd56a9786822d64f2741201f472cb0f 100644 (file)
@@ -1,3 +1,15 @@
+2013-05-20  Lamarque V. Souza  <Lamarque.Souza@basyskom.com>
+
+        -webkit-text-underline-position should not be inherited
+        https://bugs.webkit.org/show_bug.cgi?id=116363
+
+        Reviewed by Dean Jackson.
+
+        Update expected results.
+
+        * fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-underline-position-expected.txt:
+        * fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-underline-position.js:
+
 2013-05-20  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
 
         Unreviewed EFL gardening.
index 89c6f8ced66876f323b40e51738ab21c9a086919..e5b77ee2a4cedf070dc699295b731c5f9f4a9433 100644 (file)
@@ -47,11 +47,11 @@ 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:
+Ancestor does not inherit values from parent:
 PASS e.style.getPropertyCSSValue('-webkit-text-underline-position') is null
-PASS computedStyle.webkitTextUnderlinePosition is 'under'
+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 'under'
+PASS computedStyle.getPropertyCSSValue('-webkit-text-underline-position').cssText is 'auto'
 
 Value 'auto alphabetic':
 PASS e.style.getPropertyCSSValue('-webkit-text-underline-position') is null
index a9e1b15786698a20c995eff96dcf9bae1cf503fd..9bae5b7a11e1a85209ce2520411a138800474c7f 100644 (file)
@@ -65,10 +65,10 @@ testComputedStyle("webkitTextUnderlinePosition", "-webkit-text-underline-positio
 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:");
+debug("Ancestor does not inherit values from parent:");
 e = document.getElementById('test-ancestor');
 testElementStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", null, "");
-testComputedStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "under");
+testComputedStyle("webkitTextUnderlinePosition", "-webkit-text-underline-position", "[object CSSPrimitiveValue]", "auto");
 debug('');
 
 debug("Value 'auto alphabetic':");
index f4775e8f953c2190525f3c2927e351ef71be122e..f5c0cde64095125c7fe558162364077546896c15 100644 (file)
@@ -1,3 +1,30 @@
+2013-05-20  Lamarque V. Souza  <Lamarque.Souza@basyskom.com>
+
+        -webkit-text-underline-position should not be inherited
+        https://bugs.webkit.org/show_bug.cgi?id=116363
+
+        Reviewed by Dean Jackson.
+
+        Specification says text-underline-position should not be inherited.
+
+        No new tests, this updates existing tests.
+
+        * css/CSSProperty.cpp:
+        (WebCore::CSSProperty::isInheritedProperty): Make
+        CSSPropertyWebkitTextUnderlinePosition return false.
+        * rendering/style/RenderStyle.h: Treat TextUnderlinePosition as
+        non-inherited.
+        * rendering/style/StyleRareInheritedData.cpp:
+        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+        (WebCore::StyleRareInheritedData::operator==): Remove m_textUnderlinePosition.
+        * rendering/style/StyleRareInheritedData.h:
+        (StyleRareInheritedData):
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==): Add m_textUnderlinePosition.
+        * rendering/style/StyleRareNonInheritedData.h:
+        (StyleRareNonInheritedData):
+
 2013-05-20  Lamarque V. Souza  <Lamarque.Souza@basyskom.com>
 
         Add compile asserts for the size of RootInlineBox and InlineTextbox
index bedf7d7e84b6cfb28aa2910912690ce5537507f9..b3fa626f54a231e25f973d6e455fe42dae946d93 100644 (file)
@@ -332,7 +332,6 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
     case CSSPropertyWebkitTextDecorationLine:
     case CSSPropertyWebkitTextAlignLast:
     case CSSPropertyWebkitTextJustify:
-    case CSSPropertyWebkitTextUnderlinePosition:
 #endif // CSS3_TEXT
     case CSSPropertyWebkitTextDecorationsInEffect:
     case CSSPropertyWebkitTextEmphasis:
@@ -648,6 +647,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
 #if ENABLE(CSS3_TEXT)
     case CSSPropertyWebkitTextDecorationStyle:
     case CSSPropertyWebkitTextDecorationColor:
+    case CSSPropertyWebkitTextUnderlinePosition:
 #endif // CSS3_TEXT
     case CSSPropertyWebkitTransform:
     case CSSPropertyWebkitTransformOrigin:
index 6e309ef3857344919808b0176e37dddae5f92345..963abae87dc36314461c40c12f640ac529102904 100644 (file)
@@ -580,7 +580,7 @@ public:
     TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
     TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rareInheritedData->m_textAlignLast); }
     TextJustify textJustify() const { return static_cast<TextJustify>(rareInheritedData->m_textJustify); }
-    TextUnderlinePosition textUnderlinePosition() const { return static_cast<TextUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); }
+    TextUnderlinePosition textUnderlinePosition() const { return static_cast<TextUnderlinePosition>(rareNonInheritedData->m_textUnderlinePosition); }
 #else
     TextDecorationStyle textDecorationStyle() const { return TextDecorationStyleSolid; }
 #endif // CSS3_TEXT
@@ -1150,7 +1150,7 @@ public:
     void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
     void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAlignLast, v); }
     void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustify, v); }
-    void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInheritedData, m_textUnderlinePosition, v); }
+    void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareNonInheritedData, m_textUnderlinePosition, v); }
 #endif // CSS3_TEXT
     void setDirection(TextDirection v) { inherited_flags._direction = v; }
     void setLineHeight(Length specifiedLineHeight);
index 2e1d9d0a6a3952d6995b0a5bdf3a5bf4062fafc1..b73a9baa1969fd52be4671aabc2390d4cc3febc5 100644 (file)
@@ -106,7 +106,6 @@ StyleRareInheritedData::StyleRareInheritedData()
 #if ENABLE(CSS3_TEXT)
     , m_textAlignLast(RenderStyle::initialTextAlignLast())
     , m_textJustify(RenderStyle::initialTextJustify())
-    , m_textUnderlinePosition(RenderStyle::initialTextUnderlinePosition())
 #endif // CSS3_TEXT
     , m_rubyPosition(RenderStyle::initialRubyPosition())
     , hyphenationLimitBefore(-1)
@@ -181,7 +180,6 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
 #if ENABLE(CSS3_TEXT)
     , m_textAlignLast(o.m_textAlignLast)
     , m_textJustify(o.m_textJustify)
-    , m_textUnderlinePosition(o.m_textUnderlinePosition)
 #endif // CSS3_TEXT
     , m_rubyPosition(o.m_rubyPosition)
     , hyphenationString(o.hyphenationString)
@@ -291,7 +289,6 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
 #if ENABLE(CSS3_TEXT)
         && m_textAlignLast == o.m_textAlignLast
         && m_textJustify == o.m_textJustify
-        && m_textUnderlinePosition == o.m_textUnderlinePosition
 #endif // CSS3_TEXT
         && m_rubyPosition == o.m_rubyPosition
         && m_lineSnap == o.m_lineSnap
index 34b80ea525b47c53922699e270405c054e85e906..d8c0da0e84a15b343b4401c90298cb190f99360b 100644 (file)
@@ -120,7 +120,6 @@ public:
 #if ENABLE(CSS3_TEXT)
     unsigned m_textAlignLast : 3; // TextAlignLast
     unsigned m_textJustify : 3; // TextJustify
-    unsigned m_textUnderlinePosition : 3; // TextUnderlinePosition
 #endif // CSS3_TEXT
     unsigned m_rubyPosition : 1; // RubyPosition
 
index f5c6bb828b09e01050372fc3d8038ff5cb775c6c..556c3dd58fd4b0ebebfc6b13c6c8509855c0a342 100644 (file)
@@ -75,6 +75,7 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
     , m_textCombine(RenderStyle::initialTextCombine())
 #if ENABLE(CSS3_TEXT)
     , m_textDecorationStyle(RenderStyle::initialTextDecorationStyle())
+    , m_textUnderlinePosition(RenderStyle::initialTextUnderlinePosition())
 #endif // CSS3_TEXT
     , m_wrapFlow(RenderStyle::initialWrapFlow())
     , m_wrapThrough(RenderStyle::initialWrapThrough())
@@ -158,6 +159,7 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
     , m_textCombine(o.m_textCombine)
 #if ENABLE(CSS3_TEXT)
     , m_textDecorationStyle(o.m_textDecorationStyle)
+    , m_textUnderlinePosition(o.m_textUnderlinePosition)
 #endif // CSS3_TEXT
     , m_wrapFlow(o.m_wrapFlow)
     , m_wrapThrough(o.m_wrapThrough)
@@ -247,6 +249,7 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
         && m_textCombine == o.m_textCombine
 #if ENABLE(CSS3_TEXT)
         && m_textDecorationStyle == o.m_textDecorationStyle
+        && m_textUnderlinePosition == o.m_textUnderlinePosition
 #endif // CSS3_TEXT
         && m_wrapFlow == o.m_wrapFlow
         && m_wrapThrough == o.m_wrapThrough
index 0a3c7a8cac1bc20a0e445d9733d705a605bd11cc..8edf5216f96c9b8439aaee3eb7ff4dc0eb135a42 100644 (file)
@@ -183,6 +183,7 @@ public:
 
 #if ENABLE(CSS3_TEXT)
     unsigned m_textDecorationStyle : 3; // TextDecorationStyle
+    unsigned m_textUnderlinePosition : 3; // TextUnderlinePosition
 #endif // CSS3_TEXT
     unsigned m_wrapFlow: 3; // WrapFlow
     unsigned m_wrapThrough: 1; // WrapThrough