before/after generated content is not working with HTMLSummaryElement and HTMLDetails...
authorigor.o@sisa.samsung.com <igor.o@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Jun 2013 02:43:55 +0000 (02:43 +0000)
committerigor.o@sisa.samsung.com <igor.o@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Jun 2013 02:43:55 +0000 (02:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=117374

Source/WebCore:

Allow before/after pseudo generated content be added in HTMLDetailsElement and HTMLSumamaryElement.

Reviewed by Ryosuke Niwa.

Test: fast/css-generated-content/details-summary-before-after.html

* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::childShouldCreateRenderer):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::childShouldCreateRenderer):

LayoutTests:

Reviewed by Ryosuke Niwa.

* fast/css-generated-content/details-summary-before-after.html: Added.
* platform/mac/fast/css-generated-content/details-summary-before-after-expected.txt: Added.
* platform/mac/fast/css-generated-content/details-summary-before-after-expected.png: Added

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

LayoutTests/ChangeLog
LayoutTests/fast/css-generated-content/details-summary-before-after.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/css-generated-content/details-summary-before-after-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/css-generated-content/details-summary-before-after-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLDetailsElement.cpp
Source/WebCore/html/HTMLSummaryElement.cpp

index 63a4506..4ba9345 100644 (file)
@@ -1,3 +1,14 @@
+2013-06-08  Igor Oliveira  <igor.o@sisa.samsung.com>
+
+        before/after generated content is not working with HTMLSummaryElement and HTMLDetailsElement.
+        https://bugs.webkit.org/show_bug.cgi?id=117374
+
+        Reviewed by Ryosuke Niwa.
+
+        * fast/css-generated-content/details-summary-before-after.html: Added.
+        * platform/mac/fast/css-generated-content/details-summary-before-after-expected.txt: Added.
+        * platform/mac/fast/css-generated-content/details-summary-before-after-expected.png: Added
+
 2013-06-08  Kondapally Kalyan  <kalyan.kondapally@intel.com>
 
         [EFL][WebGL] Enable webgl-background-color test.
diff --git a/LayoutTests/fast/css-generated-content/details-summary-before-after.html b/LayoutTests/fast/css-generated-content/details-summary-before-after.html
new file mode 100644 (file)
index 0000000..c5d816f
--- /dev/null
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <style type="text/css">
+      div.outer, div.inner, details, summary { border: solid 1px black;}
+      details:after, summary:after {
+        content: "after";
+      }
+      details:before, summary:before {
+        content: "before";
+      }
+    </style>
+  </head>
+  <body>
+      <details open>
+        <summary>Summary
+          <div class="inner">Inner Div</div>
+        </summary>
+      Details
+      </details>
+  </body>
+</html>
diff --git a/LayoutTests/platform/mac/fast/css-generated-content/details-summary-before-after-expected.png b/LayoutTests/platform/mac/fast/css-generated-content/details-summary-before-after-expected.png
new file mode 100644 (file)
index 0000000..cfadb6d
Binary files /dev/null and b/LayoutTests/platform/mac/fast/css-generated-content/details-summary-before-after-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css-generated-content/details-summary-before-after-expected.txt b/LayoutTests/platform/mac/fast/css-generated-content/details-summary-before-after-expected.txt
new file mode 100644 (file)
index 0000000..677504c
--- /dev/null
@@ -0,0 +1,31 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x112
+  RenderBlock {HTML} at (0,0) size 800x112
+    RenderBody {BODY} at (8,8) size 784x96
+      RenderBlock {DETAILS} at (0,0) size 784x96 [border: (1px solid #000000)]
+        RenderBlock (anonymous) at (1,1) size 782x18
+          RenderInline (generated) at (0,0) size 40x18
+            RenderText at (0,0) size 40x18
+              text run at (0,0) width 40: "before"
+        RenderBlock {SUMMARY} at (1,19) size 782x58 [border: (1px solid #000000)]
+          RenderBlock (anonymous) at (1,1) size 780x18
+            RenderInline (generated) at (0,0) size 40x18
+              RenderText at (0,0) size 40x18
+                text run at (0,0) width 40: "before"
+            RenderDetailsMarker {DIV} at (40,4) size 10x10: down
+            RenderText {#text} at (56,0) size 61x18
+              text run at (56,0) width 61: "Summary"
+          RenderBlock {DIV} at (1,19) size 780x20 [border: (1px solid #000000)]
+            RenderText {#text} at (1,1) size 61x18
+              text run at (1,1) width 61: "Inner Div"
+          RenderBlock (anonymous) at (1,39) size 780x18
+            RenderInline (generated) at (0,0) size 28x18
+              RenderText at (0,0) size 28x18
+                text run at (0,0) width 28: "after"
+        RenderBlock (anonymous) at (1,77) size 782x18
+          RenderText {#text} at (0,0) size 48x18
+            text run at (0,0) width 48: "Details "
+          RenderInline (generated) at (0,0) size 28x18
+            RenderText at (48,0) size 28x18
+              text run at (48,0) width 28: "after"
index 1382a63..1c7edec 100644 (file)
@@ -1,3 +1,19 @@
+2013-06-08  Igor Oliveira  <igor.o@sisa.samsung.com>
+
+        before/after generated content is not working with HTMLSummaryElement and HTMLDetailsElement.
+        https://bugs.webkit.org/show_bug.cgi?id=117374
+
+        Allow before/after pseudo generated content be added in HTMLDetailsElement and HTMLSumamaryElement.
+
+        Reviewed by Ryosuke Niwa.
+
+        Test: fast/css-generated-content/details-summary-before-after.html
+
+        * html/HTMLDetailsElement.cpp:
+        (WebCore::HTMLDetailsElement::childShouldCreateRenderer):
+        * html/HTMLSummaryElement.cpp:
+        (WebCore::HTMLSummaryElement::childShouldCreateRenderer):
+
 2013-06-08  Peter Gal  <galpeter@inf.u-szeged.hu>
 
         [curl] Allow headers with empty value
index 887f540..ba529d9 100644 (file)
@@ -146,6 +146,9 @@ void HTMLDetailsElement::parseAttribute(const QualifiedName& name, const AtomicS
 
 bool HTMLDetailsElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
 {
+    if (childContext.node()->isPseudoElement())
+        return HTMLElement::childShouldCreateRenderer(childContext);
+
     if (!childContext.isOnEncapsulationBoundary())
         return false;
 
index 45fd850..af3be35 100644 (file)
@@ -73,6 +73,9 @@ RenderObject* HTMLSummaryElement::createRenderer(RenderArena* arena, RenderStyle
 
 bool HTMLSummaryElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
 {
+    if (childContext.node()->isPseudoElement())
+        return HTMLElement::childShouldCreateRenderer(childContext);
+
     return childContext.isOnEncapsulationBoundary() && HTMLElement::childShouldCreateRenderer(childContext);
 }