Support text-orientation: sideways-right (and sideways when it maps to sideways-right)
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 06:18:22 +0000 (06:18 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 06:18:22 +0000 (06:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=104035

Reviewed by Anders Carlsson.

Test: fast/text/orientation-sideways.html

* GNUmakefile.list.am: Updated for rename of TextOrientation.h.

* WebCore.gypi: Ditto.

* WebCore.xcodeproj/project.pbxproj: Ditto.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Changed to retrieve
text-orientation from RenderStyle rather than from the font description.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Added sideways and sideways-right as acceptable
text-orientation values.

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added mappings for sideways and
sideways-right.
(WebCore::CSSPrimitiveValue::operator TextOrientation): Ditto.

* css/CSSValueKeywords.in: Added sideways and sideways-right.

* css/StyleBuilder.cpp:
(WebCore::StyleBuilder::StyleBuilder): Removed text-orientation property handler, as it is
now handled in CSSStyleResolver.

* css/StyleResolver.cpp:
(WebCore::getFontAndGlyphOrientation): Added this helper function that determines the font
orientation and non-CJK glyph orientation based on writing-mode and text-orientation.
(WebCore::StyleResolver::styleForDocument): Added code to set the font orientation and
non-CJK glyph orientation in the document style.
(WebCore::checkForOrientationChange): Added. Sets the font orientation and non-CJK glyph
orientation in the child style if the difference between the parent and child styles requires
doing so.
(WebCore::StyleResolver::updateFont): Added call to checkForOrientationChange().
(WebCore::StyleResolver::applyProperty): Changed the writing-mode case to call the new
setWritingMode helper, which dirties the font as needed, rather than changing the font
here. Moved handling of text-orientation here, by calling setTextOrientation, which also
dirties the font as needed.

* css/StyleResolver.h:
(WebCore::StyleResolver::setWritingMode): Added. Dirties the font if the writing mode changes.
(WebCore::StyleResolver::setTextOrientation): Ditto for text orientation.

* platform/graphics/FontDescription.h:
(WebCore::FontDescription::FontDescription): Updated initializer for rename.
(WebCore::FontDescription::nonCJKGlyphOrientation): Renamed textOrientation to this.
(WebCore::FontDescription::setNonCJKGlyphOrientation): Renamed setTextOrientation to this.
(FontDescription): Renamed member variable m_textOrientation to m_nonCJKGlyphOrientation.
(WebCore::FontDescription::operator==): Updated for rename.

* platform/graphics/FontFastPath.cpp:
(WebCore::glyphDataAndPageForNonCJKCharacterWithGlyphOrientation): Renamed
glyphDataAndPageForCharacterWithTextOrientation to this and changed the parameter type from
TextOrientation to NonCJKGlyphOrientation.
(WebCore::Font::glyphDataAndPageForCharacter): Updated for above rename.

* platform/graphics/mac/FontComplexTextMac.cpp:
(WebCore::Font::fontDataForCombiningCharacterSequence): Updated for rename of
FontDescription::textOrientation().

* platform/text/NonCJKGlyphOrientation.h: Renamed TextOrientation.h to this, and renamed
the enum and its values to better reflect that they describe how glyphs for non-CJK
characters are to be rendered in vertical text.

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::requiresIdeographicBaseline): Updated for rename of
FontDescription::textOrientation().

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff): Made text-orientation change a layout change.

* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setTextOrientation): Added.

* rendering/style/RenderStyleConstants.h: Added a new TextOrientation enum here.

* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData): Added initialization and copying
of m_textOrientation member variable.
(WebCore::StyleRareInheritedData::operator==): Added comparing of m_textOrientation.

* rendering/style/StyleRareInheritedData.h:
(StyleRareInheritedData): Added m_textOrientation member variable.

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

26 files changed:
LayoutTests/fast/text/orientation-sideways.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/mac/fast/text/orientation-sideways-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/orientation-sideways-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/StyleBuilder.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/platform/graphics/FontDescription.h
Source/WebCore/platform/graphics/FontFastPath.cpp
Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
Source/WebCore/platform/text/NonCJKGlyphOrientation.h [new file with mode: 0644]
Source/WebCore/platform/text/TextOrientation.h [deleted file]
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleRareInheritedData.cpp
Source/WebCore/rendering/style/StyleRareInheritedData.h

diff --git a/LayoutTests/fast/text/orientation-sideways.html b/LayoutTests/fast/text/orientation-sideways.html
new file mode 100644 (file)
index 0000000..afc6b81
--- /dev/null
@@ -0,0 +1,50 @@
+<style>
+    .vertical-rl { -webkit-writing-mode: vertical-rl; padding: 10px 0; }
+    .vertical-lr { -webkit-writing-mode: vertical-lr; }
+
+    .upright { -webkit-text-orientation: upright; color: blue; }
+    .sideways { -webkit-text-orientation: sideways; color: brown; }
+    .sideways-right { -webkit-text-orientation: sideways-right; color: teal; }
+
+    .hiragino { font-family: "hiragino mincho pron"; }
+    .times { font-family: "times"; }
+</style>
+<body style="font-size: 24px;">
+    <!--
+        U+653B and U+6BBB are CJK ideographs
+        U+2307 doesn't have a separate vertical glyph in Hiragino Mincho ProN
+        U+2307 doesn't have a separate vertical glyph in Hiragino Mincho ProN
+        U+30FC is a CJK symbol which has a vertical glyph in Hiragino Mincho ProN
+               which looks like a rotated version of the horizontal glyphs, with
+               the tip pointing to the left
+        U+FF1C is a CJK symbol which has a vertical glyph in Hiragino Mincho ProN
+               which is identical to the horizontal glyph
+        U+FF1D is a CJK symbol which has a vertical glyph in Hiragino Mincho ProN
+               which is a rotated version of the horizontal glyph
+        U+0034 has a vertical glyph in Hiragino Mincho ProN which is a rotated
+               version of the horizontal glyph
+    -->
+
+    <div class="hiragino">&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+
+    <div class="vertical-rl hiragino">
+        <div>&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+        <div class="upright">&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+        <div class="sideways-right">&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+        <div class="sideways">&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+    </div>
+
+    <div class="vertical-rl times">
+        <div>&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+        <div class="upright">&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+        <div class="sideways-right">&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+        <div class="sideways">&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+    </div>
+
+    <div class="vertical-lr hiragino">
+        <div>&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+        <div class="upright">&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+        <div class="sideways-right">&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+        <div class="sideways">&#x653b;&#x6bbb;&#x2307;&#x30fc;&#xff1c;&#xff1d;4</div>
+    </div>
+</body>
index 1198a25..8491ea3 100644 (file)
@@ -4336,3 +4336,6 @@ webkit.org/b/99800 fast/harness/perftests/runs-per-second-log.html [ Failure ]
 
 # Flaky on mac debug since r136472 or earlier
 webkit.org/b/104023 [ Mac Debug ] fast/dom/HTMLTemplateElement/inertContents.html [ Failure Pass ]
+
+# Needs platform-specific results
+webkit.org/b/104035 fast/text/orientation-sideways.html [ Missing ]
diff --git a/LayoutTests/platform/mac/fast/text/orientation-sideways-expected.png b/LayoutTests/platform/mac/fast/text/orientation-sideways-expected.png
new file mode 100644 (file)
index 0000000..428185a
Binary files /dev/null and b/LayoutTests/platform/mac/fast/text/orientation-sideways-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/text/orientation-sideways-expected.txt b/LayoutTests/platform/mac/fast/text/orientation-sideways-expected.txt
new file mode 100644 (file)
index 0000000..898067b
--- /dev/null
@@ -0,0 +1,47 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 784x36
+        RenderText {#text} at (0,6) size 158x24
+          text run at (0,6) width 158: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+      RenderBlock {DIV} at (0,36) size 144x188
+        RenderBlock {DIV} at (0,10) size 36x168
+          RenderText {#text} at (6,0) size 24x159
+            text run at (6,0) width 159: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+        RenderBlock {DIV} at (36,10) size 36x168 [color=#0000FF]
+          RenderText {#text} at (6,0) size 24x168
+            text run at (6,0) width 168: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+        RenderBlock {DIV} at (72,10) size 36x168 [color=#008080]
+          RenderText {#text} at (6,0) size 24x158
+            text run at (6,0) width 158: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+        RenderBlock {DIV} at (108,10) size 36x168 [color=#A52A2A]
+          RenderText {#text} at (6,0) size 24x158
+            text run at (6,0) width 158: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+      RenderBlock {DIV} at (0,224) size 144x183
+        RenderBlock {DIV} at (0,10) size 36x163
+          RenderText {#text} at (4,0) size 28x156
+            text run at (4,0) width 156: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+        RenderBlock {DIV} at (36,10) size 36x163 [color=#0000FF]
+          RenderText {#text} at (4,0) size 28x163
+            text run at (4,0) width 163: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+        RenderBlock {DIV} at (72,10) size 36x163 [color=#008080]
+          RenderText {#text} at (5,0) size 28x156
+            text run at (5,0) width 156: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+        RenderBlock {DIV} at (108,10) size 36x163 [color=#A52A2A]
+          RenderText {#text} at (5,0) size 28x156
+            text run at (5,0) width 156: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+      RenderBlock {DIV} at (0,406) size 144x169
+        RenderBlock {DIV} at (0,0) size 36x168
+          RenderText {#text} at (6,0) size 24x159
+            text run at (6,0) width 159: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+        RenderBlock {DIV} at (36,0) size 36x168 [color=#0000FF]
+          RenderText {#text} at (6,0) size 24x168
+            text run at (6,0) width 168: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+        RenderBlock {DIV} at (72,0) size 36x168 [color=#008080]
+          RenderText {#text} at (6,0) size 24x158
+            text run at (6,0) width 158: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
+        RenderBlock {DIV} at (108,0) size 36x168 [color=#A52A2A]
+          RenderText {#text} at (6,0) size 24x159
+            text run at (6,0) width 159: "\x{653B}\x{6BBB}\x{2307}\x{30FC}\x{FF1C}\x{FF1D}4"
index 5aa22b1..ecf1334 100644 (file)
@@ -1,3 +1,96 @@
+2012-12-04  Dan Bernstein  <mitz@apple.com>
+
+        Support text-orientation: sideways-right (and sideways when it maps to sideways-right)
+        https://bugs.webkit.org/show_bug.cgi?id=104035
+
+        Reviewed by Anders Carlsson.
+
+        Test: fast/text/orientation-sideways.html
+
+        * GNUmakefile.list.am: Updated for rename of TextOrientation.h.
+
+        * WebCore.gypi: Ditto.
+
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Changed to retrieve
+        text-orientation from RenderStyle rather than from the font description.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue): Added sideways and sideways-right as acceptable
+        text-orientation values.
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added mappings for sideways and
+        sideways-right.
+        (WebCore::CSSPrimitiveValue::operator TextOrientation): Ditto.
+
+        * css/CSSValueKeywords.in: Added sideways and sideways-right.
+
+        * css/StyleBuilder.cpp:
+        (WebCore::StyleBuilder::StyleBuilder): Removed text-orientation property handler, as it is
+        now handled in CSSStyleResolver.
+
+        * css/StyleResolver.cpp:
+        (WebCore::getFontAndGlyphOrientation): Added this helper function that determines the font
+        orientation and non-CJK glyph orientation based on writing-mode and text-orientation.
+        (WebCore::StyleResolver::styleForDocument): Added code to set the font orientation and
+        non-CJK glyph orientation in the document style.
+        (WebCore::checkForOrientationChange): Added. Sets the font orientation and non-CJK glyph
+        orientation in the child style if the difference between the parent and child styles requires
+        doing so.
+        (WebCore::StyleResolver::updateFont): Added call to checkForOrientationChange().
+        (WebCore::StyleResolver::applyProperty): Changed the writing-mode case to call the new
+        setWritingMode helper, which dirties the font as needed, rather than changing the font
+        here. Moved handling of text-orientation here, by calling setTextOrientation, which also
+        dirties the font as needed.
+
+        * css/StyleResolver.h:
+        (WebCore::StyleResolver::setWritingMode): Added. Dirties the font if the writing mode changes.
+        (WebCore::StyleResolver::setTextOrientation): Ditto for text orientation.
+
+        * platform/graphics/FontDescription.h:
+        (WebCore::FontDescription::FontDescription): Updated initializer for rename.
+        (WebCore::FontDescription::nonCJKGlyphOrientation): Renamed textOrientation to this.
+        (WebCore::FontDescription::setNonCJKGlyphOrientation): Renamed setTextOrientation to this.
+        (FontDescription): Renamed member variable m_textOrientation to m_nonCJKGlyphOrientation.
+        (WebCore::FontDescription::operator==): Updated for rename.
+
+        * platform/graphics/FontFastPath.cpp:
+        (WebCore::glyphDataAndPageForNonCJKCharacterWithGlyphOrientation): Renamed
+        glyphDataAndPageForCharacterWithTextOrientation to this and changed the parameter type from
+        TextOrientation to NonCJKGlyphOrientation.
+        (WebCore::Font::glyphDataAndPageForCharacter): Updated for above rename.
+
+        * platform/graphics/mac/FontComplexTextMac.cpp:
+        (WebCore::Font::fontDataForCombiningCharacterSequence): Updated for rename of
+        FontDescription::textOrientation().
+
+        * platform/text/NonCJKGlyphOrientation.h: Renamed TextOrientation.h to this, and renamed
+        the enum and its values to better reflect that they describe how glyphs for non-CJK
+        characters are to be rendered in vertical text.
+
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::requiresIdeographicBaseline): Updated for rename of
+        FontDescription::textOrientation().
+
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::diff): Made text-orientation change a layout change.
+
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::setTextOrientation): Added.
+
+        * rendering/style/RenderStyleConstants.h: Added a new TextOrientation enum here.
+
+        * rendering/style/StyleRareInheritedData.cpp:
+        (WebCore::StyleRareInheritedData::StyleRareInheritedData): Added initialization and copying
+        of m_textOrientation member variable.
+        (WebCore::StyleRareInheritedData::operator==): Added comparing of m_textOrientation.
+
+        * rendering/style/StyleRareInheritedData.h:
+        (StyleRareInheritedData): Added m_textOrientation member variable.
+
 2012-12-04  Kentaro Hara  <haraken@chromium.org>
 
         [V8] Use ScopedPersistent for IntegerCache::smallIntegers
index ba7deec..be7cf23 100644 (file)
@@ -5862,6 +5862,7 @@ webcore_platform_sources += \
        Source/WebCore/platform/text/LocaleNone.cpp \
        Source/WebCore/platform/text/LocaleToScriptMapping.h \
        Source/WebCore/platform/text/LocaleToScriptMappingDefault.cpp \
+       Source/WebCore/platform/text/NonCJKGlyphOrientation.h \
        Source/WebCore/platform/text/ParserUtilities.h \
        Source/WebCore/platform/text/PlatformLocale.cpp \
        Source/WebCore/platform/text/PlatformLocale.h \
@@ -5897,7 +5898,6 @@ webcore_platform_sources += \
        Source/WebCore/platform/text/TextEncoding.h \
        Source/WebCore/platform/text/TextEncodingRegistry.cpp \
        Source/WebCore/platform/text/TextEncodingRegistry.h \
-       Source/WebCore/platform/text/TextOrientation.h \
        Source/WebCore/platform/text/TextStream.cpp \
        Source/WebCore/platform/text/TextStream.h \
        Source/WebCore/platform/text/transcoder/FontTranscoder.cpp \
index 2649443..045239d 100644 (file)
             'platform/text/DecodeEscapeSequences.h',
             'platform/text/LineBreakIteratorPoolICU.h',
             'platform/text/LineEnding.h',
+            'platform/text/NonCJKGlyphOrientation.h',
             'platform/text/QuotedPrintable.h',
             'platform/text/RegularExpression.h',
             'platform/text/SegmentedString.h',
             'platform/text/TextDirection.h',
             'platform/text/TextEncoding.h',
             'platform/text/TextEncodingRegistry.h',
-            'platform/text/TextOrientation.h',
             'platform/text/TextStream.h',
             'platform/text/UnicodeBidi.h',
             'platform/text/UnicodeRange.h',
index c20c1c5..c48e903 100644 (file)
                BCD0E0FC0E972C3500265DEA /* SecurityOriginHash.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD0E0F90E972C3500265DEA /* SecurityOriginHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCD0FBD00DBD625E00B2F630 /* DOMAbstractView.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCD0FBCF0DBD625E00B2F630 /* DOMAbstractView.mm */; };
                BCD0FC4F0DBD720B00B2F630 /* DOMRGBColorInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD0FC4E0DBD720B00B2F630 /* DOMRGBColorInternal.h */; };
-               BCD3F9831326C93700098A60 /* TextOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD3F9821326C93700098A60 /* TextOrientation.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               BCD3F9831326C93700098A60 /* NonCJKGlyphOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD3F9821326C93700098A60 /* NonCJKGlyphOrientation.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCD41ABB0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */; };
                BCD533640ED6848900887468 /* CachedScriptSourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */; };
                BCD8A5F015F56F2C0098D071 /* TextBreakIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD8A5EF15F56F2C0098D071 /* TextBreakIterator.cpp */; };
                BCD0E0F90E972C3500265DEA /* SecurityOriginHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecurityOriginHash.h; sourceTree = "<group>"; };
                BCD0FBCF0DBD625E00B2F630 /* DOMAbstractView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMAbstractView.mm; sourceTree = "<group>"; };
                BCD0FC4E0DBD720B00B2F630 /* DOMRGBColorInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMRGBColorInternal.h; sourceTree = "<group>"; };
-               BCD3F9821326C93700098A60 /* TextOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextOrientation.h; sourceTree = "<group>"; };
+               BCD3F9821326C93700098A60 /* NonCJKGlyphOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NonCJKGlyphOrientation.h; sourceTree = "<group>"; };
                BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFrameSetElementCustom.cpp; sourceTree = "<group>"; };
                BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedScriptSourceProvider.h; sourceTree = "<group>"; };
                BCD8A5EF15F56F2C0098D071 /* TextBreakIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBreakIterator.cpp; sourceTree = "<group>"; };
                                89B5EAA011E8003D00F2367E /* LineEnding.h */,
                                7633A72413D8B33A008501B6 /* LocaleToScriptMapping.h */,
                                7633A72513D8B33A008501B6 /* LocaleToScriptMappingDefault.cpp */,
+                               BCD3F9821326C93700098A60 /* NonCJKGlyphOrientation.h */,
                                BC76AC110DD7AD5C00415F34 /* ParserUtilities.h */,
                                F544F78615CFB2A800AF33A8 /* PlatformLocale.cpp */,
                                F544F78715CFB2A800AF33A8 /* PlatformLocale.h */,
                                C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */,
                                B2C3DA180D006C1D00EF6F26 /* TextEncodingRegistry.cpp */,
                                B2C3DA190D006C1D00EF6F26 /* TextEncodingRegistry.h */,
-                               BCD3F9821326C93700098A60 /* TextOrientation.h */,
                                B2C3DA1A0D006C1D00EF6F26 /* TextStream.cpp */,
                                B2C3DA1B0D006C1D00EF6F26 /* TextStream.h */,
                                A863E2001343412000274926 /* UnicodeBidi.h */,
                                CECADFCE1537791D00E37068 /* TextInsertionBaseCommand.h in Headers */,
                                93309E1C099E64920056E581 /* TextIterator.h in Headers */,
                                BCEF45E90E687767001C1287 /* TextMetrics.h in Headers */,
-                               BCD3F9831326C93700098A60 /* TextOrientation.h in Headers */,
+                               BCD3F9831326C93700098A60 /* NonCJKGlyphOrientation.h in Headers */,
                                930FC68A1072B9280045293E /* TextRenderingMode.h in Headers */,
                                93F198F608245E59001E9ABC /* TextResourceDecoder.h in Headers */,
                                A824B4650E2EF2EA0081A7B7 /* TextRun.h in Headers */,
index 0d9b439..0c70c06 100644 (file)
@@ -2486,7 +2486,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
         case CSSPropertyWebkitTextCombine:
             return cssValuePool().createValue(style->textCombine());
         case CSSPropertyWebkitTextOrientation:
-            return CSSPrimitiveValue::create(style->fontDescription().textOrientation());
+            return CSSPrimitiveValue::create(style->textOrientation());
         case CSSPropertyWebkitLineBoxContain:
             return createLineBoxContainValue(style->lineBoxContain());
         case CSSPropertyContent:
index 2cd94a1..ae96f1c 100644 (file)
@@ -2719,8 +2719,8 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
         return parseTextEmphasisStyle(important);
 
     case CSSPropertyWebkitTextOrientation:
-        // FIXME: For now just support upright and vertical-right.
-        if (id == CSSValueVerticalRight || id == CSSValueUpright)
+        // FIXME: For now just support sideways, sideways-right, upright and vertical-right.
+        if (id == CSSValueSideways || id == CSSValueSidewaysRight || id == CSSValueVerticalRight || id == CSSValueUpright)
             validPrimitive = true;
         break;
 
index 2c31ba6..2be0992 100644 (file)
@@ -46,7 +46,6 @@
 #include "RenderStyleConstants.h"
 #include "SVGRenderStyleDefs.h"
 #include "TextDirection.h"
-#include "TextOrientation.h"
 #include "TextRenderingMode.h"
 #include "ThemeTypes.h"
 #include "UnicodeBidi.h"
@@ -2984,6 +2983,12 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOrientation e)
 {
     m_primitiveUnitType = CSS_IDENT;
     switch (e) {
+    case TextOrientationSideways:
+        m_value.ident = CSSValueSideways;
+        break;
+    case TextOrientationSidewaysRight:
+        m_value.ident = CSSValueSidewaysRight;
+        break;
     case TextOrientationVerticalRight:
         m_value.ident = CSSValueVerticalRight;
         break;
@@ -2996,6 +3001,10 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextOrientation e)
 template<> inline CSSPrimitiveValue::operator TextOrientation() const
 {
     switch (m_value.ident) {
+    case CSSValueSideways:
+        return TextOrientationSideways;
+    case CSSValueSidewaysRight:
+        return TextOrientationSidewaysRight;
     case CSSValueVerticalRight:
         return TextOrientationVerticalRight;
     case CSSValueUpright:
index 10ba6ea..b2636b7 100644 (file)
@@ -895,6 +895,8 @@ farthest-corner
 // cover
 
 // -webkit-text-orientation
+sideways
+sideways-right
 upright
 vertical-right
 
index ea4766f..846f474 100644 (file)
@@ -2055,7 +2055,6 @@ StyleBuilder::StyleBuilder()
     setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, ApplyPropertyDefault<TextEmphasisPosition, &RenderStyle::textEmphasisPosition, TextEmphasisPosition, &RenderStyle::setTextEmphasisPosition, TextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition>::createHandler());
     setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
     setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitTextOrientation, ApplyPropertyFont<TextOrientation, &FontDescription::textOrientation, &FontDescription::setTextOrientation, TextOrientationVerticalRight>::createHandler());
     setPropertyHandler(CSSPropertyWebkitTextSecurity, ApplyPropertyDefault<ETextSecurity, &RenderStyle::textSecurity, ETextSecurity, &RenderStyle::setTextSecurity, ETextSecurity, &RenderStyle::initialTextSecurity>::createHandler());
     setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler());
     setPropertyHandler(CSSPropertyWebkitTransformOrigin, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitTransformOriginX, CSSPropertyWebkitTransformOriginY, CSSPropertyWebkitTransformOriginZ>::createHandler());
index 6675f24..fb903b6 100644 (file)
@@ -1406,6 +1406,40 @@ static void setStylesForPaginationMode(Pagination::Mode paginationMode, RenderSt
     }
 }
 
+static void getFontAndGlyphOrientation(const RenderStyle* style, FontOrientation& fontOrientation, NonCJKGlyphOrientation& glyphOrientation)
+{
+    if (style->isHorizontalWritingMode()) {
+        fontOrientation = Horizontal;
+        glyphOrientation = NonCJKGlyphOrientationVerticalRight;
+        return;
+    }
+
+    switch (style->textOrientation()) {
+    case TextOrientationVerticalRight:
+        fontOrientation = Vertical;
+        glyphOrientation = NonCJKGlyphOrientationVerticalRight;
+        return;
+    case TextOrientationUpright:
+        fontOrientation = Vertical;
+        glyphOrientation = NonCJKGlyphOrientationUpright;
+        return;
+    case TextOrientationSideways:
+        if (style->writingMode() == LeftToRightWritingMode) {
+            // FIXME: This should map to sideways-left, which is not supported yet.
+            fontOrientation = Vertical;
+            glyphOrientation = NonCJKGlyphOrientationVerticalRight;
+            return;
+        }
+        fontOrientation = Horizontal;
+        glyphOrientation = NonCJKGlyphOrientationVerticalRight;
+        return;
+    case TextOrientationSidewaysRight:
+        fontOrientation = Horizontal;
+        glyphOrientation = NonCJKGlyphOrientationVerticalRight;
+        return;
+    }
+}
+
 PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document* document, CSSFontSelector* fontSelector)
 {
     Frame* frame = document->frame();
@@ -1487,6 +1521,12 @@ PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document* document, CSSF
     } else
         fontDescription.setUsePrinterFont(document->printing());
 
+    FontOrientation fontOrientation;
+    NonCJKGlyphOrientation glyphOrientation;
+    getFontAndGlyphOrientation(documentStyle.get(), fontOrientation, glyphOrientation);
+    fontDescription.setOrientation(fontOrientation);
+    fontDescription.setNonCJKGlyphOrientation(glyphOrientation);
+
     documentStyle->setFontDescription(fontDescription);
     documentStyle->font().update(fontSelector);
 
@@ -2104,6 +2144,26 @@ bool StyleResolver::checkRegionStyle(Element* regionElement)
     return false;
 }
 
+static void checkForOrientationChange(RenderStyle* style, const RenderStyle* parentStyle)
+{
+    FontOrientation childFontOrientation;
+    NonCJKGlyphOrientation childGlyphOrientation;
+    getFontAndGlyphOrientation(style, childFontOrientation, childGlyphOrientation);
+
+    FontOrientation parentFontOrientation;
+    NonCJKGlyphOrientation parentGlyphOrientation;
+    getFontAndGlyphOrientation(parentStyle, parentFontOrientation, parentGlyphOrientation);
+
+    if (childFontOrientation == parentFontOrientation && childGlyphOrientation == parentGlyphOrientation)
+        return;
+
+    const FontDescription& childFont = style->fontDescription();
+    FontDescription newFontDescription(childFont);
+    newFontDescription.setNonCJKGlyphOrientation(childGlyphOrientation);
+    newFontDescription.setOrientation(childFontOrientation);
+    style->setFontDescription(newFontDescription);
+}
+
 void StyleResolver::updateFont()
 {
     if (!m_fontDirty)
@@ -2112,6 +2172,7 @@ void StyleResolver::updateFont()
     checkForTextSizeAdjust();
     checkForGenericFamilyChange(style(), m_parentStyle);
     checkForZoomChange(style(), m_parentStyle);
+    checkForOrientationChange(style(), m_parentStyle);
     m_style->font().update(m_fontSelector);
     m_fontDirty = false;
 }
@@ -3536,14 +3597,21 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
         HANDLE_INHERIT_AND_INITIAL(writingMode, WritingMode);
         
         if (primitiveValue)
-            m_style->setWritingMode(*primitiveValue);
-        
+            setWritingMode(*primitiveValue);
+
         // FIXME: It is not ok to modify document state while applying style.
         if (m_element && m_element == m_element->document()->documentElement())
             m_element->document()->setWritingModeSetOnDocumentElement(true);
-        FontDescription fontDescription = m_style->fontDescription();
-        fontDescription.setOrientation(m_style->isHorizontalWritingMode() ? Horizontal : Vertical);
-        setFontDescription(fontDescription);
+
+        return;
+    }
+
+    case CSSPropertyWebkitTextOrientation: {
+        HANDLE_INHERIT_AND_INITIAL(textOrientation, TextOrientation);
+
+        if (primitiveValue)
+            setTextOrientation(*primitiveValue);
+
         return;
     }
 
@@ -3869,7 +3937,6 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
     case CSSPropertyWebkitTextEmphasisPosition:
     case CSSPropertyWebkitTextEmphasisStyle:
     case CSSPropertyWebkitTextFillColor:
-    case CSSPropertyWebkitTextOrientation:
     case CSSPropertyWebkitTextSecurity:
     case CSSPropertyWebkitTextStrokeColor:
     case CSSPropertyWebkitTransformOrigin:
index bbc987c..ceeb741 100644 (file)
@@ -165,6 +165,8 @@ public:
     void setZoom(float f) { m_fontDirty |= style()->setZoom(f); }
     void setEffectiveZoom(float f) { m_fontDirty |= style()->setEffectiveZoom(f); }
     void setTextSizeAdjust(bool b) { m_fontDirty |= style()->setTextSizeAdjust(b); }
+    void setWritingMode(WritingMode writingMode) { m_fontDirty |= style()->setWritingMode(writingMode); }
+    void setTextOrientation(TextOrientation textOrientation) { m_fontDirty |= style()->setTextOrientation(textOrientation); }
     bool hasParentNode() const { return m_parentNode; }
 
     void resetAuthorStyle();
index 4436875..6cfb85c 100644 (file)
@@ -32,7 +32,7 @@
 #include "FontSmoothingMode.h"
 #include "FontTraitsMask.h"
 #include "FontWidthVariant.h"
-#include "TextOrientation.h"
+#include "NonCJKGlyphOrientation.h"
 #include "TextRenderingMode.h"
 #include "WebKitFontFamilyNames.h"
 #include <wtf/MathExtras.h>
@@ -80,7 +80,7 @@ public:
         : m_specifiedSize(0)
         , m_computedSize(0)
         , m_orientation(Horizontal)
-        , m_textOrientation(TextOrientationVerticalRight)
+        , m_nonCJKGlyphOrientation(NonCJKGlyphOrientationVerticalRight)
         , m_widthVariant(RegularWidth)
         , m_italic(FontItalicOff)
         , m_smallCaps(FontSmallCapsOff)
@@ -132,7 +132,7 @@ public:
     FontTraitsMask traitsMask() const;
     bool isSpecifiedFont() const { return m_isSpecifiedFont; }
     FontOrientation orientation() const { return static_cast<FontOrientation>(m_orientation); }
-    TextOrientation textOrientation() const { return static_cast<TextOrientation>(m_textOrientation); }
+    NonCJKGlyphOrientation nonCJKGlyphOrientation() const { return static_cast<NonCJKGlyphOrientation>(m_nonCJKGlyphOrientation); }
     FontWidthVariant widthVariant() const { return static_cast<FontWidthVariant>(m_widthVariant); }
     FontFeatureSettings* featureSettings() const { return m_featureSettings.get(); }
     FontDescription makeNormalFeatureSettings() const;
@@ -162,7 +162,7 @@ public:
     void setTextRenderingMode(TextRenderingMode rendering) { m_textRendering = rendering; }
     void setIsSpecifiedFont(bool isSpecifiedFont) { m_isSpecifiedFont = isSpecifiedFont; }
     void setOrientation(FontOrientation orientation) { m_orientation = orientation; }
-    void setTextOrientation(TextOrientation textOrientation) { m_textOrientation = textOrientation; }
+    void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJKGlyphOrientation = orientation; }
     void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; }
     void setScript(UScriptCode s) { m_script = s; }
     void setFeatureSettings(PassRefPtr<FontFeatureSettings> settings) { m_featureSettings = settings; }
@@ -176,7 +176,7 @@ private:
     float m_computedSize;    // Computed size adjusted for the minimum font size and the zoom factor.  
 
     unsigned m_orientation : 1; // FontOrientation - Whether the font is rendering on a horizontal line or a vertical line.
-    unsigned m_textOrientation : 1; // TextOrientation - Only used by vertical text. Determines the default orientation for non-ideograph glyphs.
+    unsigned m_nonCJKGlyphOrientation : 1; // NonCJKGlyphOrientation - Only used by vertical text. Determines the default orientation for non-ideograph glyphs.
 
     unsigned m_widthVariant : 2; // FontWidthVariant
 
@@ -226,7 +226,7 @@ inline bool FontDescription::operator==(const FontDescription& other) const
         && m_textRendering == other.m_textRendering
         && m_isSpecifiedFont == other.m_isSpecifiedFont
         && m_orientation == other.m_orientation
-        && m_textOrientation == other.m_textOrientation
+        && m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation
         && m_widthVariant == other.m_widthVariant
         && m_script == other.m_script
         && m_featureSettings == other.m_featureSettings;
index 7ed7a97..a158b56 100644 (file)
@@ -42,9 +42,9 @@ using namespace std;
 
 namespace WebCore {
 
-static inline std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacterWithTextOrientation(UChar32 character, TextOrientation orientation, GlyphData& data, GlyphPage* page, unsigned pageNumber)
+static inline std::pair<GlyphData, GlyphPage*> glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, GlyphData& data, GlyphPage* page, unsigned pageNumber)
 {
-    if (orientation == TextOrientationVerticalRight) {
+    if (orientation == NonCJKGlyphOrientationVerticalRight) {
         RefPtr<SimpleFontData> verticalRightFontData = data.fontData->verticalRightOrientationFontData();
         GlyphPageTreeNode* verticalRightNode = GlyphPageTreeNode::getRootChild(verticalRightFontData.get(), pageNumber);
         GlyphPage* verticalRightPage = verticalRightNode->page();
@@ -58,7 +58,7 @@ static inline std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacterWithT
             if (verticalRightData.fontData)
                 return make_pair(verticalRightData, verticalRightPage);
         }
-    } else if (orientation == TextOrientationUpright) {
+    } else if (orientation == NonCJKGlyphOrientationUpright) {
         RefPtr<SimpleFontData> uprightFontData = data.fontData->uprightOrientationFontData();
         GlyphPageTreeNode* uprightNode = GlyphPageTreeNode::getRootChild(uprightFontData.get(), pageNumber);
         GlyphPage* uprightPage = uprightNode->page();
@@ -125,7 +125,7 @@ std::pair<GlyphData, GlyphPage*> Font::glyphDataAndPageForCharacter(UChar32 c, b
                             break;
                         }
                     } else
-                        return glyphDataAndPageForCharacterWithTextOrientation(c, m_fontDescription.textOrientation(), data, page, pageNumber);
+                        return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, m_fontDescription.nonCJKGlyphOrientation(), data, page, pageNumber);
 
                     return make_pair(data, page);
                 }
@@ -221,7 +221,7 @@ std::pair<GlyphData, GlyphPage*> Font::glyphDataAndPageForCharacter(UChar32 c, b
             page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
             data.fontData->setMaxGlyphPageTreeLevel(max(data.fontData->maxGlyphPageTreeLevel(), node->level()));
             if (!isCJKIdeographOrSymbol(c) && data.fontData->platformData().orientation() != Horizontal && !data.fontData->isTextOrientationFallback())
-                return glyphDataAndPageForCharacterWithTextOrientation(c, m_fontDescription.textOrientation(), data, fallbackPage, pageNumber);
+                return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, m_fontDescription.nonCJKGlyphOrientation(), data, fallbackPage, pageNumber);
 #endif
         }
         return make_pair(data, page);
index 9dd95e8..b6fdc73 100644 (file)
@@ -192,7 +192,7 @@ const SimpleFontData* Font::fontDataForCombiningCharacterSequence(const UChar* c
                 if (isCJKIdeographOrSymbol(baseCharacter) && !simpleFontData->hasVerticalGlyphs()) {
                     variant = BrokenIdeographVariant;
                     simpleFontData = simpleFontData->brokenIdeographFontData().get();
-                } else if (m_fontDescription.textOrientation() == TextOrientationVerticalRight) {
+                } else if (m_fontDescription.nonCJKGlyphOrientation() == NonCJKGlyphOrientationVerticalRight) {
                     SimpleFontData* verticalRightFontData = simpleFontData->verticalRightOrientationFontData().get();
                     Glyph verticalRightGlyph = verticalRightFontData->glyphForCharacter(baseCharacter);
                     if (verticalRightGlyph == baseCharacterGlyphData.glyph)
diff --git a/Source/WebCore/platform/text/NonCJKGlyphOrientation.h b/Source/WebCore/platform/text/NonCJKGlyphOrientation.h
new file mode 100644 (file)
index 0000000..515c23b
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NonCJKGlyphOrientation_h
+#define NonCJKGlyphOrientation_h
+
+namespace WebCore {
+
+enum NonCJKGlyphOrientation { NonCJKGlyphOrientationVerticalRight, NonCJKGlyphOrientationUpright };
+
+}
+
+#endif // NonCJKGlyphOrientation_h
diff --git a/Source/WebCore/platform/text/TextOrientation.h b/Source/WebCore/platform/text/TextOrientation.h
deleted file mode 100644 (file)
index e229f1e..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef TextOrientation_h
-#define TextOrientation_h
-
-namespace WebCore {
-
-enum TextOrientation { TextOrientationVerticalRight, TextOrientationUpright };
-
-}
-
-#endif
index f2eed4b..27dc310 100644 (file)
@@ -442,7 +442,7 @@ bool InlineFlowBox::requiresIdeographicBaseline(const GlyphOverflowAndFallbackFo
     if (isHorizontal())
         return false;
     
-    if (renderer()->style(isFirstLineStyle())->fontDescription().textOrientation() == TextOrientationUpright
+    if (renderer()->style(isFirstLineStyle())->fontDescription().nonCJKGlyphOrientation() == NonCJKGlyphOrientationUpright
         || renderer()->style(isFirstLineStyle())->font().primaryFont()->hasVerticalGlyphs())
         return true;
 
index a51658b..60bfe3c 100644 (file)
@@ -481,6 +481,7 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
             || rareInheritedData->textEmphasisMark != other->rareInheritedData->textEmphasisMark
             || rareInheritedData->textEmphasisPosition != other->rareInheritedData->textEmphasisPosition
             || rareInheritedData->textEmphasisCustomMark != other->rareInheritedData->textEmphasisCustomMark
+            || rareInheritedData->m_textOrientation != other->rareInheritedData->m_textOrientation
             || rareInheritedData->m_tabSize != other->rareInheritedData->m_tabSize
             || rareInheritedData->m_lineBoxContain != other->rareInheritedData->m_lineBoxContain
             || rareInheritedData->m_lineGrid != other->rareInheritedData->m_lineGrid
index 4bc2808..c0f8f1c 100644 (file)
@@ -64,7 +64,6 @@
 #include "StyleTransformData.h"
 #include "StyleVisualData.h"
 #include "TextDirection.h"
-#include "TextOrientation.h"
 #include "ThemeTypes.h"
 #include "TransformOperations.h"
 #include "UnicodeBidi.h"
@@ -835,6 +834,8 @@ public:
     const AtomicString& textEmphasisCustomMark() const { return rareInheritedData->textEmphasisCustomMark; }
     TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextEmphasisPosition>(rareInheritedData->textEmphasisPosition); }
     const AtomicString& textEmphasisMarkString() const;
+
+    TextOrientation textOrientation() const { return static_cast<TextOrientation>(rareInheritedData->m_textOrientation); }
     
     // Return true if any transform related property (currently transform, transformStyle3D or perspective) 
     // indicates that we are transforming
@@ -1299,6 +1300,7 @@ public:
     void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); }
     void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInheritedData, textEmphasisCustomMark, mark); }
     void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareInheritedData, textEmphasisPosition, position); }
+    bool setTextOrientation(TextOrientation);
 
 #if ENABLE(CSS_FILTERS)
     void setFilter(const FilterOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_filter, m_operations, ops); }
@@ -1468,7 +1470,14 @@ public:
             || display() == LIST_ITEM;
     }
 
-    void setWritingMode(WritingMode v) { inherited_flags.m_writingMode = v; }
+    bool setWritingMode(WritingMode v)
+    {
+        if (v == writingMode())
+            return false;
+
+        inherited_flags.m_writingMode = v;
+        return true;
+    }
 
     // A unique style is one that has matches something that makes it impossible to share.
     bool unique() const { return noninherited_flags.unique; }
@@ -1787,6 +1796,15 @@ inline bool RenderStyle::setTextSizeAdjust(bool b)
     return true;
 }
 
+inline bool RenderStyle::setTextOrientation(TextOrientation textOrientation)
+{
+    if (compareEqual(rareInheritedData->m_textOrientation, textOrientation))
+        return false;
+
+    rareInheritedData.access()->m_textOrientation = textOrientation;
+    return true;
+}
+
 } // namespace WebCore
 
 #endif // RenderStyle_h
index 08be14b..4fc9c39 100644 (file)
@@ -454,6 +454,8 @@ enum TextEmphasisMark { TextEmphasisMarkNone, TextEmphasisMarkAuto, TextEmphasis
 
 enum TextEmphasisPosition { TextEmphasisPositionOver, TextEmphasisPositionUnder };
 
+enum TextOrientation { TextOrientationVerticalRight, TextOrientationUpright, TextOrientationSideways, TextOrientationSidewaysRight };
+
 enum TextOverflow { TextOverflowClip = 0, TextOverflowEllipsis };
 
 enum EImageRendering { ImageRenderingAuto, ImageRenderingOptimizeSpeed, ImageRenderingOptimizeQuality, ImageRenderingOptimizeContrast };
index c02c105..ea10aeb 100644 (file)
@@ -85,6 +85,7 @@ StyleRareInheritedData::StyleRareInheritedData()
     , textEmphasisFill(TextEmphasisFillFilled)
     , textEmphasisMark(TextEmphasisMarkNone)
     , textEmphasisPosition(TextEmphasisPositionOver)
+    , m_textOrientation(TextOrientationVerticalRight)
     , m_lineBoxContain(RenderStyle::initialLineBoxContain())
 #if ENABLE(CSS_IMAGE_ORIENTATION)
     , m_imageOrientation(RenderStyle::initialImageOrientation())
@@ -151,6 +152,7 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
     , textEmphasisFill(o.textEmphasisFill)
     , textEmphasisMark(o.textEmphasisMark)
     , textEmphasisPosition(o.textEmphasisPosition)
+    , m_textOrientation(o.m_textOrientation)
     , m_lineBoxContain(o.m_lineBoxContain)
 #if ENABLE(CSS_IMAGE_ORIENTATION)
     , m_imageOrientation(o.m_imageOrientation)
@@ -241,6 +243,7 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
         && textEmphasisFill == o.textEmphasisFill
         && textEmphasisMark == o.textEmphasisMark
         && textEmphasisPosition == o.textEmphasisPosition
+        && m_textOrientation == o.m_textOrientation
         && m_lineBoxContain == o.m_lineBoxContain
         && hyphenationString == o.hyphenationString
         && locale == o.locale
index 2238833..1df0352 100644 (file)
@@ -98,6 +98,7 @@ public:
     unsigned textEmphasisFill : 1; // TextEmphasisFill
     unsigned textEmphasisMark : 3; // TextEmphasisMark
     unsigned textEmphasisPosition : 1; // TextEmphasisPosition
+    unsigned m_textOrientation : 2; // TextOrientation
     unsigned m_lineBoxContain: 7; // LineBoxContain
     // CSS Image Values Level 3
 #if ENABLE(CSS_IMAGE_ORIENTATION)