Diff
Modified: trunk/LayoutTests/ChangeLog (94990 => 94991)
--- trunk/LayoutTests/ChangeLog 2011-09-12 23:43:08 UTC (rev 94990)
+++ trunk/LayoutTests/ChangeLog 2011-09-13 00:02:33 UTC (rev 94991)
@@ -1,3 +1,13 @@
+2011-09-12 Dan Bernstein <m...@apple.com>
+
+ <rdar://problem/10054615> Floats in ruby text intrude into the base
+
+ Reviewed by Darin Adler.
+
+ * fast/ruby/float-overhang-from-ruby-text-expected.png: Added.
+ * fast/ruby/float-overhang-from-ruby-text-expected.txt: Added.
+ * fast/ruby/float-overhang-from-ruby-text.html: Added.
+
2011-09-12 Ryosuke Niwa <rn...@webkit.org>
REGRESSION: Moving up doesn't work in some cases
Added: trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.png
(Binary files differ)
Property changes on: trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.png
___________________________________________________________________
Added: svn:mime-type
Added: trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.txt (0 => 94991)
--- trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.txt 2011-09-13 00:02:33 UTC (rev 94991)
@@ -0,0 +1,23 @@
+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 784x75
+ RenderRuby (inline) {RUBY} at (0,0) size 100x50
+ RenderRubyRun (anonymous) at (0,25) size 100x50
+ RenderRubyText {RT} at (0,-25) size 100x25
+ RenderText {#text} at (50,0) size 25x25
+ text run at (50,0) width 25: "a"
+ RenderBlock (floating) {DIV} at (0,0) size 50x50 [bgcolor=#ADD8E6]
+ RenderRubyBase (anonymous) at (0,0) size 100x50
+ RenderText {#text} at (0,0) size 100x50
+ text run at (0,0) width 100: "aa"
+ RenderText {#text} at (0,0) size 0x0
+ RenderBlock {DIV} at (0,75) size 784x50
+ RenderRuby (inline) {RUBY} at (0,0) size 100x50
+ RenderRubyRun (anonymous) at (0,0) size 100x50
+ RenderRubyBase (anonymous) at (0,0) size 100x50
+ RenderText {#text} at (0,0) size 100x50
+ text run at (0,0) width 100: "aa"
+ RenderText {#text} at (0,0) size 0x0
Added: trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text.html (0 => 94991)
--- trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text.html (rev 0)
+++ trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text.html 2011-09-13 00:02:33 UTC (rev 94991)
@@ -0,0 +1,15 @@
+<style>
+ ruby { font-family: ahem; font-size: 50px; -webkit-font-smoothing: none; }
+ .float { height: 50px; width: 50px; float: left; background-color: lightblue; }
+</style>
+<div>
+ <ruby>aa<rt>a<div class="float"></div></rt></ruby>
+</div>
+<div>
+ <ruby>aa<rt id="target">a<div class="float"></div></rt></ruby>
+</div>
+<script>
+ document.body.offsetTop;
+ var target = document.getElementById("target");
+ target.parentNode.removeChild(target);
+</script>
Modified: trunk/Source/WebCore/ChangeLog (94990 => 94991)
--- trunk/Source/WebCore/ChangeLog 2011-09-12 23:43:08 UTC (rev 94990)
+++ trunk/Source/WebCore/ChangeLog 2011-09-13 00:02:33 UTC (rev 94991)
@@ -1,3 +1,16 @@
+2011-09-12 Dan Bernstein <m...@apple.com>
+
+ <rdar://problem/10054615> Floats in ruby text intrude into the base
+
+ Reviewed by Darin Adler.
+
+ Test: fast/ruby/float-overhang-from-ruby-text.html
+
+ * rendering/RenderRubyText.cpp:
+ (WebCore::RenderRubyText::avoidsFloats): Added. Returns true. This ensures that
+ RenderBlock::clearFloats() will not consider ruby text as having intruding floats.
+ * rendering/RenderRubyText.h:
+
2011-09-12 David Hyatt <hy...@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=67970
Modified: trunk/Source/WebCore/rendering/RenderRubyText.cpp (94990 => 94991)
--- trunk/Source/WebCore/rendering/RenderRubyText.cpp 2011-09-12 23:43:08 UTC (rev 94990)
+++ trunk/Source/WebCore/rendering/RenderRubyText.cpp 2011-09-13 00:02:33 UTC (rev 94991)
@@ -81,4 +81,9 @@
logicalWidth -= inset;
}
+bool RenderRubyText::avoidsFloats() const
+{
+ return true;
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/rendering/RenderRubyText.h (94990 => 94991)
--- trunk/Source/WebCore/rendering/RenderRubyText.h 2011-09-12 23:43:08 UTC (rev 94990)
+++ trunk/Source/WebCore/rendering/RenderRubyText.h 2011-09-13 00:02:33 UTC (rev 94991)
@@ -47,6 +47,8 @@
virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
private:
+ virtual bool avoidsFloats() const;
+
virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
virtual void adjustInlineDirectionLineBounds(int expansionOpportunityCount, float& logicalLeft, float& logicalWidth) const;
};