diff options
Diffstat (limited to 'WebCore/rendering/RenderRubyRun.cpp')
-rw-r--r-- | WebCore/rendering/RenderRubyRun.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/WebCore/rendering/RenderRubyRun.cpp b/WebCore/rendering/RenderRubyRun.cpp index d48646b..a83a3e2 100644 --- a/WebCore/rendering/RenderRubyRun.cpp +++ b/WebCore/rendering/RenderRubyRun.cpp @@ -30,7 +30,6 @@ #include "config.h" -#if ENABLE(RUBY) #include "RenderRubyRun.h" #include "RenderRubyBase.h" @@ -221,10 +220,17 @@ RenderRubyRun* RenderRubyRun::staticCreateRubyRun(const RenderObject* parentRuby RefPtr<RenderStyle> newStyle = RenderStyle::create(); newStyle->inheritFrom(parentRuby->style()); newStyle->setDisplay(INLINE_BLOCK); + if (parentRuby->style()->isFlippedLinesWritingMode()) { + // Ruby text is always in the line direction, so invert our block flow relative to the parent to + // ensure that the Ruby ends up on the correct side. + if (parentRuby->style()->isHorizontalWritingMode()) + newStyle->setWritingMode(TopToBottomWritingMode); + else + newStyle->setWritingMode(RightToLeftWritingMode); + } + rr->setStyle(newStyle.release()); return rr; } } // namespace WebCore - -#endif // ENABLE(RUBY) |