Update to match text-orientation spec
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 17:13:24 +0000 (17:13 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 17:13:24 +0000 (17:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150765

Reviewed by Darin Adler.

Source/WebCore:

The CSS spec has removed the "sideways-right" value of text-orientation in favor
of "sideways." This patch makes the parser treat "sideways-right" the same as
"sideways."

Test: fast/text/orientation-sideways-right.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator TextOrientation):
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Deleted.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::fontAndGlyphOrientation): Deleted.
* rendering/style/RenderStyleConstants.h:

LayoutTests:

* fast/text/orientation-sideways-right-expected.html: Added.
* fast/text/orientation-sideways-right.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/text/orientation-sideways-right-expected.html [new file with mode: 0644]
LayoutTests/fast/text/orientation-sideways-right.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyleConstants.h

index edec0ad..da2632e 100644 (file)
@@ -1,3 +1,13 @@
+2015-11-03  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Update to match text-orientation spec
+        https://bugs.webkit.org/show_bug.cgi?id=150765
+
+        Reviewed by Darin Adler.
+
+        * fast/text/orientation-sideways-right-expected.html: Added.
+        * fast/text/orientation-sideways-right.html: Added.
+
 2015-11-03  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         Move webkitGetUserMedia to JS Builtin
diff --git a/LayoutTests/fast/text/orientation-sideways-right-expected.html b/LayoutTests/fast/text/orientation-sideways-right-expected.html
new file mode 100644 (file)
index 0000000..b6abe57
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
+<div id="placeholder"></div>
+<div style="text-orientation: upright;">
+<div id="t" style="-webkit-writing-mode: vertical-rl; -webkit-text-orientation: sideways;">abcd</div>
+</div>
+<script>
+var t = document.getElementById("t");
+var receiver = document.getElementById("placeholder");
+receiver.textContent = window.getComputedStyle(t).getPropertyValue("-webkit-text-orientation");
+</script>
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/fast/text/orientation-sideways-right.html b/LayoutTests/fast/text/orientation-sideways-right.html
new file mode 100644 (file)
index 0000000..785b248
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
+<div id="placeholder"></div>
+<div style="text-orientation: upright;">
+<div id="t" style="-webkit-writing-mode: vertical-rl; -webkit-text-orientation: sideways-right;">abcd</div>
+</div>
+<script>
+var t = document.getElementById("t");
+var receiver = document.getElementById("placeholder");
+receiver.textContent = window.getComputedStyle(t).getPropertyValue("-webkit-text-orientation");
+</script>
+</body>
+</html>
\ No newline at end of file
index 4b1aef6..7b412dc 100644 (file)
@@ -1,3 +1,23 @@
+2015-11-03  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Update to match text-orientation spec
+        https://bugs.webkit.org/show_bug.cgi?id=150765
+
+        Reviewed by Darin Adler.
+
+        The CSS spec has removed the "sideways-right" value of text-orientation in favor
+        of "sideways." This patch makes the parser treat "sideways-right" the same as
+        "sideways."
+
+        Test: fast/text/orientation-sideways-right.html
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::operator TextOrientation):
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Deleted.
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::fontAndGlyphOrientation): Deleted.
+        * rendering/style/RenderStyleConstants.h:
+
 2015-11-03  Xabier Rodriguez Calvar  <calvaris@igalia.com>
 
         [Streams API] Rework promises to use @newPromiseCapability
index dc8b4d5..5325280 100644 (file)
@@ -3334,9 +3334,6 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOrientation e)
     case TextOrientation::Sideways:
         m_value.valueID = CSSValueSideways;
         break;
-    case TextOrientation::SidewaysRight:
-        m_value.valueID = CSSValueSidewaysRight;
-        break;
     case TextOrientation::Mixed:
         m_value.valueID = CSSValueMixed;
         break;
@@ -3354,7 +3351,7 @@ template<> inline CSSPrimitiveValue::operator TextOrientation() const
     case CSSValueSideways:
         return TextOrientation::Sideways;
     case CSSValueSidewaysRight:
-        return TextOrientation::SidewaysRight;
+        return TextOrientation::Sideways;
     case CSSValueVerticalRight:
         return TextOrientation::Mixed;
     case CSSValueMixed:
index fecbb59..2b4c6f6 100644 (file)
@@ -1833,8 +1833,6 @@ std::pair<FontOrientation, NonCJKGlyphOrientation> RenderStyle::fontAndGlyphOrie
         return { Vertical, NonCJKGlyphOrientation::Upright };
     case TextOrientation::Sideways:
         return { Horizontal, NonCJKGlyphOrientation::Mixed };
-    case TextOrientation::SidewaysRight:
-        return { Horizontal, NonCJKGlyphOrientation::Mixed };
     default:
         ASSERT_NOT_REACHED();
         return { Horizontal, NonCJKGlyphOrientation::Mixed };
index cc4c541..73b53db 100644 (file)
@@ -586,7 +586,7 @@ enum TextEmphasisPositions {
 };
 typedef unsigned TextEmphasisPosition;
 
-enum class TextOrientation { Mixed, Upright, Sideways, SidewaysRight };
+enum class TextOrientation { Mixed, Upright, Sideways };
 
 enum TextOverflow { TextOverflowClip = 0, TextOverflowEllipsis };