[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
hyatt at apple.com
hyatt at apple.com
Wed Dec 22 15:35:32 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 13869a61a5907266141adfc7908558dc826fd849
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 8 22:21:35 2010 +0000
https://bugs.webkit.org/show_bug.cgi?id=48587
Reviewed by Simon Fraser.
Make Ruby work with vertical text. Ruby already nearly does work. The only big issue I found was with
flipped lines writing modes. Make sure to mutate the writing-mode of the RenderRubyRun to ensure that
the ruby text is on the correct side of the ruby base.
Added fast/blockflow tests of the various writing modes.
WebCore:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::baselinePosition):
(WebCore::RenderBlock::firstLineBoxBaseline):
(WebCore::RenderBlock::lastLineBoxBaseline):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::staticCreateRubyRun):
LayoutTests:
* fast/blockflow/japanese-ruby-horizontal-bt.html: Added.
* fast/blockflow/japanese-ruby-vertical-lr.html: Added.
* fast/blockflow/japanese-ruby-vertical-rl.html: Added.
* platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.checksum: Added.
* platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.png: Added.
* platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.txt: Added.
* platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.checksum: Added.
* platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.png: Added.
* platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.txt: Added.
* platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.checksum: Added.
* platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.png: Added.
* platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.txt: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71572 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 06027bd..853fe9c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,28 @@
+2010-11-08 David Hyatt <hyatt at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48587
+
+ Make Ruby work with vertical text. Ruby already nearly does work. The only big issue I found was with
+ flipped lines writing modes. Make sure to mutate the writing-mode of the RenderRubyRun to ensure that
+ the ruby text is on the correct side of the ruby base.
+
+ Added fast/blockflow tests of the various writing modes.
+
+ * fast/blockflow/japanese-ruby-horizontal-bt.html: Added.
+ * fast/blockflow/japanese-ruby-vertical-lr.html: Added.
+ * fast/blockflow/japanese-ruby-vertical-rl.html: Added.
+ * platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.checksum: Added.
+ * platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.png: Added.
+ * platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.txt: Added.
+ * platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.checksum: Added.
+ * platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.png: Added.
+ * platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.txt: Added.
+ * platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.checksum: Added.
+ * platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.png: Added.
+ * platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.txt: Added.
+
2010-11-08 James Robinson <jamesr at chromium.org>
Reviewed by Dimitri Glazkov.
diff --git a/LayoutTests/fast/blockflow/japanese-ruby-horizontal-bt.html b/LayoutTests/fast/blockflow/japanese-ruby-horizontal-bt.html
new file mode 100644
index 0000000..2f3bb1d
--- /dev/null
+++ b/LayoutTests/fast/blockflow/japanese-ruby-horizontal-bt.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html style="border:10px solid maroon; -webkit-writing-mode:horizontal-bt">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<style>
+body {
+ font-family: "HiraMinPro-W3";
+ font-size: 40px;
+}
+</style>
+</head>
+<body>
+攻殻 機動隊 <ruby lang="ja">攻殻<rp>(</rp><rt>こうかく</rt><rp>)</rp>機動隊<rp>(</rp><rt>きどうたい</rt><rp>)</rp></ruby>
diff --git a/LayoutTests/fast/blockflow/japanese-ruby-vertical-lr.html b/LayoutTests/fast/blockflow/japanese-ruby-vertical-lr.html
new file mode 100644
index 0000000..a69433c
--- /dev/null
+++ b/LayoutTests/fast/blockflow/japanese-ruby-vertical-lr.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html style="border:10px solid maroon; -webkit-writing-mode:vertical-lr">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<style>
+body {
+ font-family: "HiraMinPro-W3";
+ font-size: 40px;
+}
+</style>
+</head>
+<body>
+攻殻 機動隊 <ruby lang="ja">攻殻<rp>(</rp><rt>こうかく</rt><rp>)</rp>機動隊<rp>(</rp><rt>きどうたい</rt><rp>)</rp></ruby>
diff --git a/LayoutTests/fast/blockflow/japanese-ruby-vertical-rl.html b/LayoutTests/fast/blockflow/japanese-ruby-vertical-rl.html
new file mode 100644
index 0000000..3e12657
--- /dev/null
+++ b/LayoutTests/fast/blockflow/japanese-ruby-vertical-rl.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<html style="border:10px solid maroon; -webkit-writing-mode:vertical-rl">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<style>
+body {
+ font-family: "HiraMinPro-W3";
+ font-size: 40px;
+}
+</style>
+</head>
+<body>
+攻殻 機動隊 <ruby lang="ja">攻殻<rp>(</rp><rt>こうかく</rt><rp>)</rp>機動隊<rp>(</rp><rt>きどうたい</rt><rp>)</rp></ruby>
diff --git a/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.checksum b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.checksum
new file mode 100644
index 0000000..2b9e8f5
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.checksum
@@ -0,0 +1 @@
+abb029bd26dd5a6e0d4b11cb99f60f2a
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.png b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.png
new file mode 100644
index 0000000..ce910f0
Binary files /dev/null and b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.txt b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.txt
new file mode 100644
index 0000000..ad0891a
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-horizontal-bt-expected.txt
@@ -0,0 +1,23 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,468) size 800x132
+ RenderBlock {HTML} at (0,0) size 800x132 [border: (10px solid #800000)]
+ RenderBody {BODY} at (18,18) size 764x96
+ RenderText {#text} at (0,10) size 226x40
+ text run at (0,10) width 226: "\x{653B}\x{6BBB} \x{6A5F}\x{52D5}\x{968A} "
+ RenderRuby (inline) {RUBY} at (0,0) size 216x40
+ RenderRubyRun (anonymous) at (226,0) size 96x96
+ RenderRubyText {RT} at (0,0) size 96x36
+ RenderText {#text} at (0,6) size 96x24
+ text run at (0,6) width 96: "\x{3053}\x{3046}\x{304B}\x{304F}"
+ RenderRubyBase (anonymous) at (0,36) size 96x60
+ RenderText {#text} at (8,10) size 80x40
+ text run at (8,10) width 80: "\x{653B}\x{6BBB}"
+ RenderRubyRun (anonymous) at (322,0) size 120x96
+ RenderRubyText {RT} at (0,0) size 120x36
+ RenderText {#text} at (0,6) size 120x24
+ text run at (0,6) width 120: "\x{304D}\x{3069}\x{3046}\x{305F}\x{3044}"
+ RenderRubyBase (anonymous) at (0,36) size 120x60
+ RenderText {#text} at (0,10) size 120x40
+ text run at (0,10) width 120: "\x{6A5F}\x{52D5}\x{968A}"
+ RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.checksum b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.checksum
new file mode 100644
index 0000000..10ec8f8
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.checksum
@@ -0,0 +1 @@
+b536de010a0a8998fcce5715d2cbf8bf
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.png b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.png
new file mode 100644
index 0000000..c4feb0d
Binary files /dev/null and b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.txt b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.txt
new file mode 100644
index 0000000..b44d8f2
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-lr-expected.txt
@@ -0,0 +1,23 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 132x600
+ RenderBlock {HTML} at (0,0) size 132x600 [border: (10px solid #800000)]
+ RenderBody {BODY} at (18,18) size 96x564
+ RenderText {#text} at (10,0) size 40x228
+ text run at (10,0) width 228: "\x{653B}\x{6BBB} \x{6A5F}\x{52D5}\x{968A} "
+ RenderRuby (inline) {RUBY} at (0,0) size 40x225
+ RenderRubyRun (anonymous) at (0,228) size 96x100
+ RenderRubyText {RT} at (0,0) size 36x100
+ RenderText {#text} at (6,0) size 24x100
+ text run at (6,0) width 100: "\x{3053}\x{3046}\x{304B}\x{304F}"
+ RenderRubyBase (anonymous) at (36,0) size 60x100
+ RenderText {#text} at (10,9) size 40x82
+ text run at (10,9) width 82: "\x{653B}\x{6BBB}"
+ RenderRubyRun (anonymous) at (0,328) size 96x125
+ RenderRubyText {RT} at (0,0) size 36x125
+ RenderText {#text} at (6,0) size 24x125
+ text run at (6,0) width 125: "\x{304D}\x{3069}\x{3046}\x{305F}\x{3044}"
+ RenderRubyBase (anonymous) at (36,0) size 60x125
+ RenderText {#text} at (10,1) size 40x123
+ text run at (10,1) width 123: "\x{6A5F}\x{52D5}\x{968A}"
+ RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.checksum b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.checksum
new file mode 100644
index 0000000..671c430
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.checksum
@@ -0,0 +1 @@
+19c108cb9b514aa7b28fc376b16a7ba8
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.png b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.png
new file mode 100644
index 0000000..75ef35b
Binary files /dev/null and b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.txt b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.txt
new file mode 100644
index 0000000..a490a6b
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/japanese-ruby-vertical-rl-expected.txt
@@ -0,0 +1,23 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (668,0) size 132x600
+ RenderBlock {HTML} at (0,0) size 132x600 [border: (10px solid #800000)]
+ RenderBody {BODY} at (18,18) size 96x564
+ RenderText {#text} at (46,0) size 40x228
+ text run at (46,0) width 228: "\x{653B}\x{6BBB} \x{6A5F}\x{52D5}\x{968A} "
+ RenderRuby (inline) {RUBY} at (0,0) size 40x225
+ RenderRubyRun (anonymous) at (0,228) size 96x100
+ RenderRubyText {RT} at (0,0) size 36x100
+ RenderText {#text} at (6,0) size 24x100
+ text run at (6,0) width 100: "\x{3053}\x{3046}\x{304B}\x{304F}"
+ RenderRubyBase (anonymous) at (36,0) size 60x100
+ RenderText {#text} at (10,9) size 40x82
+ text run at (10,9) width 82: "\x{653B}\x{6BBB}"
+ RenderRubyRun (anonymous) at (0,328) size 96x125
+ RenderRubyText {RT} at (0,0) size 36x125
+ RenderText {#text} at (6,0) size 24x125
+ text run at (6,0) width 125: "\x{304D}\x{3069}\x{3046}\x{305F}\x{3044}"
+ RenderRubyBase (anonymous) at (36,0) size 60x125
+ RenderText {#text} at (10,1) size 40x123
+ text run at (10,1) width 123: "\x{6A5F}\x{52D5}\x{968A}"
+ RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8ce6ab3..09c9fd9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-11-08 David Hyatt <hyatt at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=48587
+
+ Make Ruby work with vertical text. Ruby already nearly does work. The only big issue I found was with
+ flipped lines writing modes. Make sure to mutate the writing-mode of the RenderRubyRun to ensure that
+ the ruby text is on the correct side of the ruby base.
+
+ Added fast/blockflow tests of the various writing modes.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::baselinePosition):
+ (WebCore::RenderBlock::firstLineBoxBaseline):
+ (WebCore::RenderBlock::lastLineBoxBaseline):
+ * rendering/RenderRubyRun.cpp:
+ (WebCore::RenderRubyRun::staticCreateRubyRun):
+
2010-11-08 Brent Fulgham <bfulgham at webkit.org>
Unreviewed build correction after @70369/@70846.
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index f7ab9eb..863b5a3 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -5275,7 +5275,8 @@ int RenderBlock::baselinePosition(bool firstLine, LineDirectionMode direction, L
// vertically (e.g., an overflow:hidden block that has had scrollTop moved) or if the baseline is outside
// of our content box.
bool ignoreBaseline = (layer() && (layer()->marquee() || (direction == HorizontalLine ? (layer()->verticalScrollbar() || layer()->scrollYOffset() != 0)
- : (layer()->horizontalScrollbar() || layer()->scrollXOffset() != 0)))) || isWritingModeRoot();
+ : (layer()->horizontalScrollbar() || layer()->scrollXOffset() != 0)))) || (isWritingModeRoot() && !isRubyRun());
+
int baselinePos = ignoreBaseline ? -1 : lastLineBoxBaseline();
int bottomOfContent = direction == HorizontalLine ? borderTop() + paddingTop() + contentHeight() : borderRight() + paddingRight() + contentWidth();
@@ -5291,7 +5292,7 @@ int RenderBlock::baselinePosition(bool firstLine, LineDirectionMode direction, L
int RenderBlock::firstLineBoxBaseline() const
{
- if (!isBlockFlow() || isWritingModeRoot())
+ if (!isBlockFlow() || (isWritingModeRoot() && !isRubyRun()))
return -1;
if (childrenInline()) {
@@ -5315,7 +5316,7 @@ int RenderBlock::firstLineBoxBaseline() const
int RenderBlock::lastLineBoxBaseline() const
{
- if (!isBlockFlow() || isWritingModeRoot())
+ if (!isBlockFlow() || (isWritingModeRoot() && !isRubyRun()))
return -1;
LineDirectionMode lineDirection = style()->isHorizontalWritingMode() ? HorizontalLine : VerticalLine;
diff --git a/WebCore/rendering/RenderRubyRun.cpp b/WebCore/rendering/RenderRubyRun.cpp
index d48646b..ad0f640 100644
--- a/WebCore/rendering/RenderRubyRun.cpp
+++ b/WebCore/rendering/RenderRubyRun.cpp
@@ -221,6 +221,15 @@ 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;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list