Changeset 95350 in webkit
- Timestamp:
- Sep 16, 2011 6:36:07 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 12 added
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r95346 r95350 1 2011-09-16 Kentaro Hara <haraken@google.com> 2 3 Overhangs a ruby by no more than half the width of the neighboring text. 4 https://bugs.webkit.org/show_bug.cgi?id=62684 5 6 Reviewed by Dan Bernstein. 7 8 Assume two rubies between which a narrow text exists, like 9 "<ruby>x<rt>xxxxxx</rt></ruby>l<ruby>y<rt>yyyyyy</rt></ruby>". 10 In order to avoid the two rubies overlapping with each other, 11 this patch overhangs the ruby by no more than half the ruby font 12 size and no more than half the width of the neighboring text. 13 14 * fast/ruby/overhang-horizontal-no-overlap1-expected.png: Added. 15 * fast/ruby/overhang-horizontal-no-overlap1-expected.txt: Added. 16 * fast/ruby/overhang-horizontal-no-overlap1.html: Added. Tests if two rubies do not overlap with each other when a narrow text exists between the two rubies. Split into two test files in order to fit each test result within one page. 17 * fast/ruby/overhang-horizontal-no-overlap2-expected.png: Added. 18 * fast/ruby/overhang-horizontal-no-overlap2-expected.txt: Added. 19 * fast/ruby/overhang-horizontal-no-overlap2.html: Added. Tests if two rubies do not overlap with each other when a narrow text exists between the two rubies. Split into two test files in order to fit each test result within one page. 20 * fast/ruby/overhang-vertical-no-overlap1-expected.png: Added. 21 * fast/ruby/overhang-vertical-no-overlap1-expected.txt: Added. 22 * fast/ruby/overhang-vertical-no-overlap1.html: Added. Tests if two rubies do not overlap with each other when a narrow text exists between the two rubies. Split into two test files in order to fit each test result within one page. 23 * fast/ruby/overhang-vertical-no-overlap2-expected.png: Added. 24 * fast/ruby/overhang-vertical-no-overlap2-expected.txt: Added. 25 * fast/ruby/overhang-vertical-no-overlap2.html: Added. Tests if two rubies do not overlap with each other when a narrow text exists between the two rubies. Split into two test files in order to fit each test result within one page. 26 * platform/chromium-linux/fast/ruby/overhang-vertical-expected.png: Removed. 27 * platform/chromium-win/fast/ruby/overhang-horizontal-expected.png: Removed. 28 * platform/chromium/test_expectations.txt: Skips overhang-horizontal.html. We will update the result image as a rebase line. 29 1 30 2011-09-16 Ben Wells <benwells@chromium.org> 2 31 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r95343 r95350 3687 3687 BUGJAMESR LINUX : svg/transforms/text-with-pattern-with-svg-transform.svg = IMAGE PASS 3688 3688 3689 // Temporary failure. This failure is going to be removed as a rebase line 3690 // after WebKit bug r62684 is landed. 3691 BUGWK62684 : fast/ruby/overhang-horizontal.html = FAIL 3692 3689 3693 // We don't seem to load this glyph on windows 3690 3694 BUGJAMESR WIN : fast/text/fallback-traits-fixup.html = IMAGE+TEXT -
trunk/Source/WebCore/ChangeLog
r95349 r95350 1 2011-09-16 Kentaro Hara <haraken@google.com> 2 3 Overhangs a ruby by no more than half the width of the neighboring text. 4 https://bugs.webkit.org/show_bug.cgi?id=62684 5 6 Reviewed by Dan Bernstein. 7 8 Assume two rubies between which a narrow text exists, like 9 "<ruby>x<rt>xxxxxx</rt></ruby>l<ruby>y<rt>yyyyyy</rt></ruby>". 10 In order to avoid the two rubies overlapping with each other, 11 this patch overhangs the ruby by no more than half the ruby font 12 size and no more than half the width of the neighboring text. 13 14 Tests: fast/ruby/overhang-horizontal-no-overlap1.html 15 fast/ruby/overhang-horizontal-no-overlap2.html 16 fast/ruby/overhang-vertical-no-overlap1.html 17 fast/ruby/overhang-vertical-no-overlap2.html 18 19 * rendering/RenderRubyRun.cpp: 20 (WebCore::RenderRubyRun::getOverhang): Calculates the width of ruby overhanging. 21 1 22 2011-09-16 Sheriff Bot <webkit.review.bot@gmail.com> 2 23 -
trunk/Source/WebCore/rendering/RenderRubyRun.cpp
r90302 r95350 35 35 #include "RenderRubyBase.h" 36 36 #include "RenderRubyText.h" 37 #include "RenderText.h" 37 38 #include "RenderView.h" 38 39 … … 286 287 287 288 int logicalWidth = this->logicalWidth(); 288 289 // No more than half a ruby is allowed to overhang. 290 int logicalLeftOverhang = rubyText->style(firstLine)->fontSize() / 2; 291 int logicalRightOverhang = logicalLeftOverhang; 292 289 int logicalLeftOverhang = numeric_limits<int>::max(); 290 int logicalRightOverhang = numeric_limits<int>::max(); 293 291 for (RootInlineBox* rootInlineBox = rubyBase->firstRootBox(); rootInlineBox; rootInlineBox = rootInlineBox->nextRootBox()) { 294 292 logicalLeftOverhang = min<int>(logicalLeftOverhang, rootInlineBox->logicalLeft()); … … 304 302 if (!endRenderer || !endRenderer->isText() || endRenderer->style(firstLine)->fontSize() > rubyBase->style(firstLine)->fontSize()) 305 303 endOverhang = 0; 304 305 // We overhang a ruby only if the neighboring render object is a text. 306 // We can overhang the ruby by no more than half the width of the neighboring text 307 // and no more than half the font size. 308 int halfWidthOfFontSize = rubyText->style(firstLine)->fontSize() / 2; 309 if (startOverhang) 310 startOverhang = min<int>(startOverhang, min<int>(toRenderText(startRenderer)->minLogicalWidth(), halfWidthOfFontSize)); 311 if (endOverhang) 312 endOverhang = min<int>(endOverhang, min<int>(toRenderText(endRenderer)->minLogicalWidth(), halfWidthOfFontSize)); 306 313 } 307 314
Note: See TracChangeset
for help on using the changeset viewer.