Title: [96024] branches/chromium/835
Revision
96024
Author
c...@chromium.org
Date
2011-09-26 16:04:14 -0700 (Mon, 26 Sep 2011)

Log Message

Merge 94991 - <rdar://problem/10054615> Floats in ruby text intrude into the base

BUG=94810
Review URL: http://codereview.chromium.org/8044031

Modified Paths

Added Paths

Diff

Copied: branches/chromium/835/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.png (from rev 94991, trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.png)


(Binary files differ)

Copied: branches/chromium/835/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.txt (from rev 94991, trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.txt) (0 => 96024)


--- branches/chromium/835/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.txt	                        (rev 0)
+++ branches/chromium/835/LayoutTests/fast/ruby/float-overhang-from-ruby-text-expected.txt	2011-09-26 23:04:14 UTC (rev 96024)
@@ -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

Copied: branches/chromium/835/LayoutTests/fast/ruby/float-overhang-from-ruby-text.html (from rev 94991, trunk/LayoutTests/fast/ruby/float-overhang-from-ruby-text.html) (0 => 96024)


--- branches/chromium/835/LayoutTests/fast/ruby/float-overhang-from-ruby-text.html	                        (rev 0)
+++ branches/chromium/835/LayoutTests/fast/ruby/float-overhang-from-ruby-text.html	2011-09-26 23:04:14 UTC (rev 96024)
@@ -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: branches/chromium/835/Source/WebCore/rendering/RenderRubyText.cpp (96023 => 96024)


--- branches/chromium/835/Source/WebCore/rendering/RenderRubyText.cpp	2011-09-26 23:02:17 UTC (rev 96023)
+++ branches/chromium/835/Source/WebCore/rendering/RenderRubyText.cpp	2011-09-26 23:04:14 UTC (rev 96024)
@@ -92,4 +92,9 @@
     return children()->updateBeforeAfterContent(this, pseudoId);
 }
 
+bool RenderRubyText::avoidsFloats() const
+{
+    return true;
+}
+
 } // namespace WebCore

Modified: branches/chromium/835/Source/WebCore/rendering/RenderRubyText.h (96023 => 96024)


--- branches/chromium/835/Source/WebCore/rendering/RenderRubyText.h	2011-09-26 23:02:17 UTC (rev 96023)
+++ branches/chromium/835/Source/WebCore/rendering/RenderRubyText.h	2011-09-26 23:04:14 UTC (rev 96024)
@@ -49,6 +49,8 @@
     virtual void updateBeforeAfterContent(PseudoId);
 
 private:
+    virtual bool avoidsFloats() const;
+
     virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const;
     virtual void adjustInlineDirectionLineBounds(int expansionOpportunityCount, float& logicalLeft, float& logicalWidth) const;
 };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to