2010-11-03 takano takumi <takano1@asia.apple.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Nov 2010 07:45:29 +0000 (07:45 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Nov 2010 07:45:29 +0000 (07:45 +0000)
        Reviewed by Dan Bernstein.

        Add text-combine property to our property list. Reflect the setting to a RenderStyle object.
        https://bugs.webkit.org/show_bug.cgi?id=48608

        * fast/css/getComputedStyle/computed-style-expected.txt: Updated.
        * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Updated.
        * fast/text/international/text-combine-parser-test-expected.txt: Added.
        * fast/text/international/text-combine-parser-test.html: Added.
        * platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Updated.
        * svg/css/getComputedStyle-basic-expected.txt: Updated.
2010-11-03  takano takumi  <takano1@asia.apple.com>

        Reviewed by Dan Bernstein.

        Add text-combine property to our property list. Reflect the setting to a RenderStyle object.
        https://bugs.webkit.org/show_bug.cgi?id=48608

        Test: fast/text/international/text-combine-parser-test.html

        * css/CSSComputedStyleDeclaration.cpp: Added text-combine property support.
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
        * css/CSSParser.cpp: Added text-combine property support.
        (WebCore::CSSParser::parseValue):
        * css/CSSPrimitiveValueMappings.h: Added a primitive value mapper for text-combine
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator TextCombine):
        * css/CSSPropertyNames.in: Added "text-combine".
        * css/CSSStyleSelector.cpp: Added text-combine property support.
        (WebCore::CSSStyleSelector::applyProperty):
        * css/CSSValueKeywords.in: Added values for text-combine.
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::diff): Added check of text-combine value.
        * rendering/style/RenderStyle.h: Added accessors for text-combine.
        (WebCore::InheritedFlags::textCombine):
        (WebCore::InheritedFlags::setTextCombine):
        (WebCore::InheritedFlags::initialTextCombine):
        * rendering/style/RenderStyleConstants.h:
        * rendering/style/StyleRareNonInheritedData.cpp: Added text-combine property support.
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
        (WebCore::StyleRareNonInheritedData::operator==):
        * rendering/style/StyleRareNonInheritedData.h: Added text-combine entry for RenderStyle object here.

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

19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/fast/text/international/text-combine-parser-test-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/international/text-combine-parser-test.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/svg/css/getComputedStyle-basic-expected.txt
WebCore/ChangeLog
WebCore/css/CSSComputedStyleDeclaration.cpp
WebCore/css/CSSParser.cpp
WebCore/css/CSSPrimitiveValueMappings.h
WebCore/css/CSSPropertyNames.in
WebCore/css/CSSStyleSelector.cpp
WebCore/css/CSSValueKeywords.in
WebCore/rendering/style/RenderStyle.cpp
WebCore/rendering/style/RenderStyle.h
WebCore/rendering/style/RenderStyleConstants.h
WebCore/rendering/style/StyleRareNonInheritedData.cpp
WebCore/rendering/style/StyleRareNonInheritedData.h

index 7d02a26..db993f4 100644 (file)
@@ -1,3 +1,17 @@
+2010-11-03  takano takumi  <takano1@asia.apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Add text-combine property to our property list. Reflect the setting to a RenderStyle object.
+        https://bugs.webkit.org/show_bug.cgi?id=48608
+
+        * fast/css/getComputedStyle/computed-style-expected.txt: Updated.
+        * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Updated.
+        * fast/text/international/text-combine-parser-test-expected.txt: Added.
+        * fast/text/international/text-combine-parser-test.html: Added.
+        * platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: Updated.
+        * svg/css/getComputedStyle-basic-expected.txt: Updated.
+
 2010-11-02  Benjamin Kalman  <kalman@chromium.org>
 
         Reviewed by Ojan Vafai.
index 25303a9..dd21e2b 100644 (file)
@@ -157,6 +157,7 @@ zoom: 1;
 -webkit-perspective: none;
 -webkit-perspective-origin: 392px 288px;
 -webkit-rtl-ordering: logical;
+-webkit-text-combine: none;
 -webkit-text-decorations-in-effect: none;
 -webkit-text-fill-color: rgb(0, 0, 0);
 -webkit-text-security: none;
index e6e29a1..bfe5942 100644 (file)
@@ -156,6 +156,7 @@ Computed style of an element whose parent's 'display' value is 'none':
     -webkit-perspective: none
     -webkit-perspective-origin: 50% 50%
     -webkit-rtl-ordering: logical
+    -webkit-text-combine: none
     -webkit-text-decorations-in-effect: none
     -webkit-text-fill-color: rgb(0, 0, 0)
     -webkit-text-security: none
diff --git a/LayoutTests/fast/text/international/text-combine-parser-test-expected.txt b/LayoutTests/fast/text/international/text-combine-parser-test-expected.txt
new file mode 100644 (file)
index 0000000..4cda7b5
--- /dev/null
@@ -0,0 +1,11 @@
+text-combine parser test
+
+-webkit-text-combine:none
+-webkit-text-combine:cluster
+-webkit-text-combine:upright
+Okay if -webkit-text-combine values above and below are the same.
+
+-webkit-text-combine:none
+-webkit-text-combine:cluster
+-webkit-text-combine:upright
+
diff --git a/LayoutTests/fast/text/international/text-combine-parser-test.html b/LayoutTests/fast/text/international/text-combine-parser-test.html
new file mode 100644 (file)
index 0000000..61fd180
--- /dev/null
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>text-combine parser test</title>
+<script>
+function print(message)
+{
+    var paragraph = document.createElement("li");
+    paragraph.appendChild(document.createTextNode(message));
+    document.getElementById("console").appendChild(paragraph);
+}
+function test()
+{
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var textCombineValues = ["none", "cluster", "upright"];
+    var pElems = document.getElementsByTagName("div");
+    for ( i = 0 ; i < pElems.length ; ++i )
+    {
+        var elem = pElems[i];
+        elem.style.webkitTextCombine = textCombineValues[i];
+        print("-webkit-text-combine:" + elem.style.webkitTextCombine);
+    }
+}
+</script>
+</head>
+<body onload="test()">
+<p>text-combine parser test</p>
+<div>-webkit-text-combine:none</div>
+<div>-webkit-text-combine:cluster</div>
+<div>-webkit-text-combine:upright</div>
+<p>Okay if -webkit-text-combine values above and below are the same.</p>
+<hr>
+<p><ol id=console></ol></p>
+</body>
+</html>
index e6e29a1..bfe5942 100644 (file)
@@ -156,6 +156,7 @@ Computed style of an element whose parent's 'display' value is 'none':
     -webkit-perspective: none
     -webkit-perspective-origin: 50% 50%
     -webkit-rtl-ordering: logical
+    -webkit-text-combine: none
     -webkit-text-decorations-in-effect: none
     -webkit-text-fill-color: rgb(0, 0, 0)
     -webkit-text-security: none
index d8c7504..1755873 100644 (file)
@@ -312,6 +312,8 @@ rect: style.getPropertyValue(-webkit-perspective-origin) : 0px 0px
 rect: style.getPropertyCSSValue(-webkit-perspective-origin) : [object CSSValueList]
 rect: style.getPropertyValue(-webkit-rtl-ordering) : logical
 rect: style.getPropertyCSSValue(-webkit-rtl-ordering) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-text-combine) : none
+rect: style.getPropertyCSSValue(-webkit-text-combine) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-text-decorations-in-effect) : none
 rect: style.getPropertyCSSValue(-webkit-text-decorations-in-effect) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-text-fill-color) : rgb(0, 0, 0)
@@ -734,6 +736,8 @@ g: style.getPropertyValue(-webkit-perspective-origin) : 0px 0px
 g: style.getPropertyCSSValue(-webkit-perspective-origin) : [object CSSValueList]
 g: style.getPropertyValue(-webkit-rtl-ordering) : logical
 g: style.getPropertyCSSValue(-webkit-rtl-ordering) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-text-combine) : none
+g: style.getPropertyCSSValue(-webkit-text-combine) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-text-decorations-in-effect) : none
 g: style.getPropertyCSSValue(-webkit-text-decorations-in-effect) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-text-fill-color) : rgb(0, 0, 0)
index 3dbf2f5..0391a3b 100644 (file)
@@ -1,3 +1,35 @@
+2010-11-03  takano takumi  <takano1@asia.apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Add text-combine property to our property list. Reflect the setting to a RenderStyle object.
+        https://bugs.webkit.org/show_bug.cgi?id=48608
+
+        Test: fast/text/international/text-combine-parser-test.html
+
+        * css/CSSComputedStyleDeclaration.cpp: Added text-combine property support.
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSParser.cpp: Added text-combine property support.
+        (WebCore::CSSParser::parseValue):
+        * css/CSSPrimitiveValueMappings.h: Added a primitive value mapper for text-combine
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator TextCombine):
+        * css/CSSPropertyNames.in: Added "text-combine".
+        * css/CSSStyleSelector.cpp: Added text-combine property support.
+        (WebCore::CSSStyleSelector::applyProperty):
+        * css/CSSValueKeywords.in: Added values for text-combine.
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::diff): Added check of text-combine value.
+        * rendering/style/RenderStyle.h: Added accessors for text-combine.
+        (WebCore::InheritedFlags::textCombine):
+        (WebCore::InheritedFlags::setTextCombine):
+        (WebCore::InheritedFlags::initialTextCombine):
+        * rendering/style/RenderStyleConstants.h:
+        * rendering/style/StyleRareNonInheritedData.cpp: Added text-combine property support.
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==):
+        * rendering/style/StyleRareNonInheritedData.h: Added text-combine entry for RenderStyle object here.
+
 2010-11-02  Daniel Bates  <dbates@rim.com>
 
         Reviewed by Adam Barth.
index faa1771..db61591 100644 (file)
@@ -211,6 +211,7 @@ static const int computedProperties[] = {
     CSSPropertyWebkitPerspective,
     CSSPropertyWebkitPerspectiveOrigin,
     CSSPropertyWebkitRtlOrdering,
+    CSSPropertyWebkitTextCombine,
     CSSPropertyWebkitTextDecorationsInEffect,
     CSSPropertyWebkitTextFillColor,
     CSSPropertyWebkitTextSecurity,
@@ -1533,6 +1534,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
             return CSSPrimitiveValue::create(style->colorSpace());
         case CSSPropertyWebkitWritingMode:
             return CSSPrimitiveValue::create(style->writingMode());
+        case CSSPropertyWebkitTextCombine:
+            return CSSPrimitiveValue::create(style->textCombine());
         
         /* Shorthand properties, currently not supported see bug 13658*/
         case CSSPropertyBackground:
index 26c3876..43df662 100644 (file)
@@ -1786,6 +1786,11 @@ bool CSSParser::parseValue(int propId, bool important)
             validPrimitive = true;
         break;
 
+    case CSSPropertyWebkitTextCombine:
+        if (id == CSSValueNone || id == CSSValueCluster || id == CSSValueUpright)
+            validPrimitive = true;
+        break;
+
 #if ENABLE(SVG)
     default:
         return parseSVGValue(propId, important);
index a57a882..c055875 100644 (file)
@@ -2040,6 +2040,38 @@ template<> inline CSSPrimitiveValue::operator WritingMode() const
     }
 }
 
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextCombine e)
+    : m_type(CSS_IDENT)
+    , m_hasCachedCSSText(false)
+{
+    switch (e) {
+    case TextCombineNone:
+        m_value.ident = CSSValueNone;
+        break;
+    case TextCombineCluster:
+        m_value.ident = CSSValueCluster;
+        break;
+    case TextCombineUpright:
+        m_value.ident = CSSValueUpright;
+        break;
+    }
+}
+
+template<> inline CSSPrimitiveValue::operator TextCombine() const
+{
+    switch (m_value.ident) {
+    case CSSValueNone:
+        return TextCombineNone;
+    case CSSValueCluster:
+        return TextCombineCluster;
+    case CSSValueUpright:
+        return TextCombineUpright;
+    default:
+        ASSERT_NOT_REACHED();
+        return TextCombineNone;
+    }
+}
+
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e)
     : m_type(CSS_IDENT)
     , m_hasCachedCSSText(false)
index 9fd2d2c..ab69fa7 100644 (file)
@@ -276,6 +276,7 @@ z-index
 -webkit-perspective-origin-x
 -webkit-perspective-origin-y
 -webkit-rtl-ordering
+-webkit-text-combine
 -webkit-text-decorations-in-effect
 -webkit-text-fill-color
 -webkit-text-security
index b902f59..d3eedb6 100644 (file)
@@ -5604,6 +5604,11 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
             m_fontDirty = true;
         return;
     }
+
+    case CSSPropertyWebkitTextCombine:
+        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(textCombine, TextCombine)
+        return;
+
 #if ENABLE(SVG)
     default:
         // Try the SVG properties
index fa0a214..cd37519 100644 (file)
@@ -764,3 +764,7 @@ horizontal-tb
 vertical-rl
 vertical-lr
 horizontal-bt
+
+# -webkit-text-combine
+cluster
+upright
index ec77367..3273821 100644 (file)
@@ -463,6 +463,10 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
     if (inherited_flags.m_writingMode != other->inherited_flags.m_writingMode)
         return StyleDifferenceLayout;
 
+    // Check text combine mode.
+    if (rareNonInheritedData->m_textCombine != other->rareNonInheritedData->m_textCombine)
+        return StyleDifferenceLayout;
+
     // Overflow returns a layout hint.
     if (noninherited_flags._overflowX != other->noninherited_flags._overflowX ||
         noninherited_flags._overflowY != other->noninherited_flags._overflowY)
index 86a5574..2345e05 100644 (file)
@@ -717,6 +717,8 @@ public:
     void setPageScaleTransform(float);
 
     bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
+
+    TextCombine textCombine() const { return static_cast<TextCombine>(rareNonInheritedData->m_textCombine); }
     // End CSS3 Getters
 
     // Apple-specific property getter methods
@@ -1053,6 +1055,7 @@ public:
     void setTransformOriginY(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_y, l); }
     void setTransformOriginZ(float f) { SET_VAR(rareNonInheritedData.access()->m_transform, m_z, f); }
     void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
+    void setTextCombine(TextCombine v) { SET_VAR(rareNonInheritedData, m_textCombine, v); }
     // End CSS3 Setters
 
     // Apple-specific property setters
@@ -1178,6 +1181,7 @@ public:
     static EClear initialClear() { return CNONE; }
     static TextDirection initialDirection() { return LTR; }
     static WritingMode initialWritingMode() { return TopToBottomWritingMode; }
+    static TextCombine initialTextCombine() { return TextCombineNone; }
     static EDisplay initialDisplay() { return INLINE; }
     static EEmptyCell initialEmptyCells() { return SHOW; }
     static EFloat initialFloating() { return FNONE; }
index 0112c03..b8e2079 100644 (file)
@@ -133,6 +133,10 @@ enum WritingMode {
     TopToBottomWritingMode, RightToLeftWritingMode, LeftToRightWritingMode, BottomToTopWritingMode
 };
 
+enum TextCombine {
+    TextCombineNone, TextCombineCluster, TextCombineUpright
+};
+
 enum EFillAttachment {
     ScrollBackgroundAttachment, LocalBackgroundAttachment, FixedBackgroundAttachment
 };
index e0f7f7a..42cf966 100644 (file)
@@ -42,6 +42,7 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
     , matchNearestMailBlockquoteColor(RenderStyle::initialMatchNearestMailBlockquoteColor())
     , m_appearance(RenderStyle::initialAppearance())
     , m_borderFit(RenderStyle::initialBorderFit())
+    , m_textCombine(RenderStyle::initialTextCombine())
     , m_counterIncrement(0)
     , m_counterReset(0)
 #if USE(ACCELERATED_COMPOSITING)
@@ -78,6 +79,7 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
     , matchNearestMailBlockquoteColor(o.matchNearestMailBlockquoteColor)
     , m_appearance(o.m_appearance)
     , m_borderFit(o.m_borderFit)
+    , m_textCombine(o.m_textCombine)
     , m_counterIncrement(o.m_counterIncrement)
     , m_counterReset(o.m_counterReset)
 #if USE(ACCELERATED_COMPOSITING)
@@ -123,6 +125,7 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
         && matchNearestMailBlockquoteColor == o.matchNearestMailBlockquoteColor
         && m_appearance == o.m_appearance
         && m_borderFit == o.m_borderFit
+        && m_textCombine == o.m_textCombine
         && m_counterIncrement == o.m_counterIncrement
         && m_counterReset == o.m_counterReset
 #if USE(ACCELERATED_COMPOSITING)
index 3f693f9..a53eee7 100644 (file)
@@ -103,6 +103,7 @@ public:
     unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added.
     unsigned m_appearance : 6; // EAppearance
     unsigned m_borderFit : 1; // EBorderFit
+    unsigned m_textCombine : 2; // CSS3 text-combine properties
     
     short m_counterIncrement;
     short m_counterReset;