Source/WebCore: Style not updated for :before, :after content
authorinferno@chromium.org <inferno@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2011 21:01:01 +0000 (21:01 +0000)
committerinferno@chromium.org <inferno@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Sep 2011 21:01:01 +0000 (21:01 +0000)
in ruby text.
https://bugs.webkit.org/show_bug.cgi?id=68625

Reviewed by Dave Hyatt.

Test: fast/ruby/ruby-text-before-after-content.html

* rendering/RenderRubyText.cpp:
(WebCore::RenderRubyText::updateBeforeAfterContent):
* rendering/RenderRubyText.h:

LayoutTests: Style not updated for :before, :after content
in ruby text.
https://bugs.webkit.org/show_bug.cgi?id=68625

Reviewed by Dave Hyatt.

* fast/ruby/ruby-text-before-after-content-expected.png: Added.
* fast/ruby/ruby-text-before-after-content-expected.txt: Added.
* fast/ruby/ruby-text-before-after-content.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95857 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/ruby/ruby-text-before-after-content-expected.png [new file with mode: 0644]
LayoutTests/fast/ruby/ruby-text-before-after-content-expected.txt [new file with mode: 0644]
LayoutTests/fast/ruby/ruby-text-before-after-content.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderRubyText.cpp
Source/WebCore/rendering/RenderRubyText.h

index 52d4c3b..3d9283f 100644 (file)
@@ -1,3 +1,15 @@
+2011-09-23  Abhishek Arya  <inferno@chromium.org>
+
+        Style not updated for :before, :after content
+        in ruby text.
+        https://bugs.webkit.org/show_bug.cgi?id=68625
+        
+        Reviewed by Dave Hyatt.
+
+        * fast/ruby/ruby-text-before-after-content-expected.png: Added.
+        * fast/ruby/ruby-text-before-after-content-expected.txt: Added.
+        * fast/ruby/ruby-text-before-after-content.html: Added.
+
 2011-09-23  David Hyatt  <hyatt@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=68719
diff --git a/LayoutTests/fast/ruby/ruby-text-before-after-content-expected.png b/LayoutTests/fast/ruby/ruby-text-before-after-content-expected.png
new file mode 100644 (file)
index 0000000..2ff31aa
Binary files /dev/null and b/LayoutTests/fast/ruby/ruby-text-before-after-content-expected.png differ
diff --git a/LayoutTests/fast/ruby/ruby-text-before-after-content-expected.txt b/LayoutTests/fast/ruby/ruby-text-before-after-content-expected.txt
new file mode 100644 (file)
index 0000000..69e384a
--- /dev/null
@@ -0,0 +1,25 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x87
+  RenderBlock {HTML} at (0,0) size 800x87
+    RenderBody {BODY} at (16,16) size 768x55 [color=#0000FF]
+      RenderRuby (inline) {RUBY} at (0,0) size 213x37
+        RenderRubyRun (anonymous) at (0,18) size 192x37
+          RenderRubyText {RT} at (0,-18) size 192x18
+            RenderInline (generated) at (0,0) size 63x18
+              RenderText at (0,0) size 63x18
+                text run at (0,0) width 63: "BEFORE"
+            RenderText {#text} at (63,0) size 77x18
+              text run at (63,0) width 77: "CONTENT"
+            RenderInline (generated) at (0,0) size 52x18
+              RenderText at (140,0) size 52x18
+                text run at (140,0) width 52: "AFTER"
+          RenderRubyBase (anonymous) at (0,0) size 192x37
+            RenderText {#text} at (84,0) size 24x37
+              text run at (84,0) width 24: "A"
+        RenderRubyRun (anonymous) at (192,18) size 21x37
+          RenderRubyBase (anonymous) at (0,0) size 21x37
+            RenderText {#text} at (0,0) size 21x37
+              text run at (0,0) width 21: "B"
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/fast/ruby/ruby-text-before-after-content.html b/LayoutTests/fast/ruby/ruby-text-before-after-content.html
new file mode 100644 (file)
index 0000000..c28b39e
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<!-- There should no text in black color. -->
+<html>
+<body>
+<style>
+rt:before 
+{
+   content: "BEFORE";
+}
+rt:after
+{
+   content: "AFTER";
+}
+</style>
+<ruby>
+A<rt>CONTENT</rt>B
+</ruby>
+<script>
+    document.body.offsetTop;
+    document.body.style.color = 'blue';
+       document.body.style.zoom = '200%';
+</script>
+</body>
+</html>
\ No newline at end of file
index d66af6b..8860965 100644 (file)
@@ -1,3 +1,17 @@
+2011-09-23  Abhishek Arya  <inferno@chromium.org>
+
+        Style not updated for :before, :after content
+        in ruby text.
+        https://bugs.webkit.org/show_bug.cgi?id=68625
+
+        Reviewed by Dave Hyatt.
+
+        Test: fast/ruby/ruby-text-before-after-content.html
+
+        * rendering/RenderRubyText.cpp:
+        (WebCore::RenderRubyText::updateBeforeAfterContent):
+        * rendering/RenderRubyText.h:
+
 2011-09-22  Ojan Vafai  <ojan@chromium.org>
 
         refactor RenderFlexibleBox to use flex-flow aware methods
index 93c684c..c49b4f6 100644 (file)
@@ -86,4 +86,15 @@ bool RenderRubyText::avoidsFloats() const
     return true;
 }
 
+void RenderRubyText::updateBeforeAfterContent(PseudoId pseudoId)
+{
+    // RenderRubyText manages its own :before and :after content
+    // and is not handled by its anonymous wrappers RenderRubyRun
+    // and RenderRuby. This contrasts with other ruby children, which
+    // are enclosed in RenderRubyBase and hence they are able to
+    // update their :before, :after content (since RenderRubyBase
+    // is not a anonymous wrapper).
+    return children()->updateBeforeAfterContent(this, pseudoId);
+}
+
 } // namespace WebCore
index 3a67926..f47304c 100644 (file)
@@ -46,6 +46,8 @@ public:
 
     virtual bool isChildAllowed(RenderObject*, RenderStyle*) const;
 
+    virtual void updateBeforeAfterContent(PseudoId);
+
 private:
     virtual bool avoidsFloats() const;