[CSS3-Text] Adjust text-justify implementation to the latest spec
authorzoltan@webkit.org <zoltan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Jul 2014 15:05:14 +0000 (15:05 +0000)
committerzoltan@webkit.org <zoltan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Jul 2014 15:05:14 +0000 (15:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=135317

Reviewed by Darin Adler.

Source/WebCore:
Text-justify no longer accepts the following values: Inter-ideograph, inter-
cluster, and kashida. This patch removes them and updates the tests as well.

[1] http://dev.w3.org/csswg/css-text-3/#propdef-text-justify

Updated existing tests.

* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextJustify):
* css/CSSValueKeywords.in:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.h:

LayoutTests:
* fast/css3-text/css3-text-justify/getComputedStyle/script-tests/getComputedStyle-text-justify-inherited.js:
* fast/css3-text/css3-text-justify/getComputedStyle/script-tests/getComputedStyle-text-justify.js:

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

LayoutTests/ChangeLog
LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/script-tests/getComputedStyle-text-justify-inherited.js
LayoutTests/fast/css3-text/css3-text-justify/getComputedStyle/script-tests/getComputedStyle-text-justify.js
Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleRareInheritedData.h

index 3ae8fa5..e78d150 100644 (file)
@@ -1,3 +1,13 @@
+2014-07-28  Zoltan Horvath  <zoltan@webkit.org>
+
+        [CSS3-Text] Adjust text-justify implementation to the latest spec
+        https://bugs.webkit.org/show_bug.cgi?id=135317
+
+        Reviewed by Darin Adler.
+
+        * fast/css3-text/css3-text-justify/getComputedStyle/script-tests/getComputedStyle-text-justify-inherited.js:
+        * fast/css3-text/css3-text-justify/getComputedStyle/script-tests/getComputedStyle-text-justify.js:
+
 2014-07-28  Radu Stavila  <stavila@adobe.com>
 
         REGRESSION (r169105): Crash in selection
index c50b31f..b3d7667 100644 (file)
@@ -28,10 +28,7 @@ child = document.getElementById('child');
 inheritanceTest("auto");
 inheritanceTest("none");
 inheritanceTest("inter-word");
-inheritanceTest("inter-ideograph");
-inheritanceTest("inter-cluster");
 inheritanceTest("distribute");
-inheritanceTest("kashida");
 
-ownValueTest("inter-word", "inter-cluster");
-ownValueTest("inter-ideograph", "distribute");
+ownValueTest("inter-word", "distribute");
+ownValueTest("distribute", "none");
index e3bda5d..1430acb 100644 (file)
@@ -49,10 +49,7 @@ debug('');
 valueSettingTest('auto');
 valueSettingTest('none');
 valueSettingTest('inter-word');
-valueSettingTest('inter-ideograph');
-valueSettingTest('inter-cluster');
 valueSettingTest('distribute');
-valueSettingTest('kashida');
 
 defaultValue = 'auto'
 e.style.webkitTextJustify = defaultValue;
@@ -66,6 +63,9 @@ invalidValueSettingTest('normal', defaultValue);
 invalidValueSettingTest('bold', defaultValue);
 invalidValueSettingTest('background', defaultValue);
 invalidValueSettingTest('ltr', defaultValue);
+invalidValueSettingTest('inter-ideograph', defaultValue);
+invalidValueSettingTest('inter-cluster', defaultValue);
+invalidValueSettingTest('kashida', defaultValue);
 
 computedValueSettingTest('inherit', 'auto');
 computedValueSettingTest('initial', 'auto');
index aa5dcdb..b0cb912 100644 (file)
@@ -1,3 +1,28 @@
+2014-07-28  Zoltan Horvath  <zoltan@webkit.org>
+
+        [CSS3-Text] Adjust text-justify implementation to the latest spec
+        https://bugs.webkit.org/show_bug.cgi?id=135317
+
+        Reviewed by Darin Adler.
+
+        Text-justify no longer accepts the following values: Inter-ideograph, inter-
+        cluster, and kashida. This patch removes them and updates the tests as well.
+
+        [1] http://dev.w3.org/csswg/css-text-3/#propdef-text-justify
+
+        Updated existing tests.
+
+        * css/CSSParser.cpp:
+        (WebCore::isValidKeywordPropertyAndValue):
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator TextJustify):
+        * css/CSSValueKeywords.in:
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::changeRequiresLayout):
+        * rendering/style/RenderStyleConstants.h:
+        * rendering/style/StyleRareInheritedData.h:
+
 2014-07-28  Radu Stavila  <stavila@adobe.com>
 
         REGRESSION (r169105): Crash in selection
index 75c9bf8..f1b8bab 100644 (file)
@@ -973,8 +973,8 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
         break;
 #if ENABLE(CSS3_TEXT)
     case CSSPropertyWebkitTextJustify:
-        // auto | none | inter-word | inter-ideograph | inter-cluster | distribute | kashida
-        if ((valueID >= CSSValueInterWord && valueID <= CSSValueKashida) || valueID == CSSValueAuto || valueID == CSSValueNone)
+        // auto | none | inter-word | distribute
+        if (valueID == CSSValueInterWord || valueID == CSSValueDistribute || valueID == CSSValueAuto || valueID == CSSValueNone)
             return true;
         break;
 #endif // CSS3_TEXT
index ef2be89..67f1fe0 100644 (file)
@@ -2562,18 +2562,9 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextJustify e)
     case TextJustifyInterWord:
         m_value.valueID = CSSValueInterWord;
         break;
-    case TextJustifyInterIdeograph:
-        m_value.valueID = CSSValueInterIdeograph;
-        break;
-    case TextJustifyInterCluster:
-        m_value.valueID = CSSValueInterCluster;
-        break;
     case TextJustifyDistribute:
         m_value.valueID = CSSValueDistribute;
         break;
-    case TextJustifyKashida:
-        m_value.valueID = CSSValueKashida;
-        break;
     }
 }
 
@@ -2588,14 +2579,8 @@ template<> inline CSSPrimitiveValue::operator TextJustify() const
         return TextJustifyNone;
     case CSSValueInterWord:
         return TextJustifyInterWord;
-    case CSSValueInterIdeograph:
-        return TextJustifyInterIdeograph;
-    case CSSValueInterCluster:
-        return TextJustifyInterCluster;
     case CSSValueDistribute:
         return TextJustifyDistribute;
-    case CSSValueKashida:
-        return TextJustifyKashida;
     default:
         break;
     }
index f4b58f0..40523ef 100644 (file)
@@ -244,10 +244,7 @@ justify
 //auto
 //none
 inter-word
-inter-ideograph
-inter-cluster
 distribute
-kashida
 //
 // CSS_PROP_LIST_STYLE_POSITION:
 //
index 3320c02..fd5897c 100644 (file)
@@ -489,6 +489,7 @@ bool RenderStyle::changeRequiresLayout(const RenderStyle* other, unsigned& chang
         if (rareInheritedData->indent != other->rareInheritedData->indent
 #if ENABLE(CSS3_TEXT)
             || rareInheritedData->m_textAlignLast != other->rareInheritedData->m_textAlignLast
+            || rareInheritedData->m_textJustify != other->rareInheritedData->m_textJustify
             || rareInheritedData->m_textIndentLine != other->rareInheritedData->m_textIndentLine
 #endif
             || rareInheritedData->m_effectiveZoom != other->rareInheritedData->m_effectiveZoom
index 5aa63b4..4de435c 100644 (file)
@@ -384,7 +384,7 @@ enum TextAlignLast {
 };
 
 enum TextJustify {
-    TextJustifyAuto, TextJustifyNone, TextJustifyInterWord, TextJustifyInterIdeograph, TextJustifyInterCluster, TextJustifyDistribute, TextJustifyKashida
+    TextJustifyAuto, TextJustifyNone, TextJustifyInterWord, TextJustifyDistribute
 };
 #endif // CSS3_TEXT
 
index 7e9c60e..0ed60b2 100644 (file)
@@ -119,7 +119,7 @@ public:
 #endif
 #if ENABLE(CSS3_TEXT)
     unsigned m_textAlignLast : 3; // TextAlignLast
-    unsigned m_textJustify : 3; // TextJustify
+    unsigned m_textJustify : 2; // TextJustify
 #endif // CSS3_TEXT
     unsigned m_textDecorationSkip : 5; // TextDecorationSkip
     unsigned m_textUnderlinePosition : 3; // TextUnderlinePosition