Title: [123192] trunk
Revision
123192
Author
[email protected]
Date
2012-07-20 01:06:36 -0700 (Fri, 20 Jul 2012)

Log Message

Needs pseudo id to point the inner element of an img elemnet for styling
https://bugs.webkit.org/show_bug.cgi?id=91590

Reviewed by Hajime Morita.

Source/WebCore:

We introduce pseudo id to point the element in UserAgentShadowDOM.
This enables us to style the inner element of an img element shadow.
Please see also http://trac.webkit.org/wiki/ShadowDOMForReplacedElements

Test: fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html

* html/shadow/ImageInnerElement.cpp:
(WebCore::ImageInnerElement::shadowPseudoId):
(WebCore):
* html/shadow/ImageInnerElement.h:
(ImageInnerElement):

LayoutTests:

Uses pseudo id to confirm the style is applied to the inner element of an img element shadow.

* fast/dom/shadow/shadowdom-for-image-with-pseudo-id-expected.html: Added.
* fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (123191 => 123192)


--- trunk/LayoutTests/ChangeLog	2012-07-20 08:03:59 UTC (rev 123191)
+++ trunk/LayoutTests/ChangeLog	2012-07-20 08:06:36 UTC (rev 123192)
@@ -1,3 +1,15 @@
+2012-07-20  Shinya Kawanaka  <[email protected]>
+
+        Needs pseudo id to point the inner element of an img elemnet for styling
+        https://bugs.webkit.org/show_bug.cgi?id=91590
+
+        Reviewed by Hajime Morita.
+
+        Uses pseudo id to confirm the style is applied to the inner element of an img element shadow.
+
+        * fast/dom/shadow/shadowdom-for-image-with-pseudo-id-expected.html: Added.
+        * fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html: Added.
+
 2012-07-20  Yoshifumi Inoue  <[email protected]>
 
         Unreviewed. Set svn:mime-type to image/png for PNG files without svn:mime-type.

Added: trunk/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id-expected.html (0 => 123192)


--- trunk/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id-expected.html	2012-07-20 08:06:36 UTC (rev 123192)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div id="container">
+    <div>
+        <div style="display: inline-block">(before)<img src="" width="100" height="100">(after)</div>
+    </div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html (0 => 123192)


--- trunk/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html	2012-07-20 08:06:36 UTC (rev 123192)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<style>
+#host::-webkit-image-inner-element {
+    width: 100px;
+    height: 100px;
+}
+</style>
+
+<div id="container">
+    <div>
+        <img id="host" src=""
+    </div>
+</div>
+
+<script>
+function addShadowDOM(host) {
+    var shadowRoot = new WebKitShadowRoot(host);
+    shadowRoot.innerHTML = "(before)<shadow></shadow>(after)";
+}
+
+addShadowDOM(host);
+</script>
+
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (123191 => 123192)


--- trunk/Source/WebCore/ChangeLog	2012-07-20 08:03:59 UTC (rev 123191)
+++ trunk/Source/WebCore/ChangeLog	2012-07-20 08:06:36 UTC (rev 123192)
@@ -1,3 +1,22 @@
+2012-07-20  Shinya Kawanaka  <[email protected]>
+
+        Needs pseudo id to point the inner element of an img elemnet for styling
+        https://bugs.webkit.org/show_bug.cgi?id=91590
+
+        Reviewed by Hajime Morita.
+
+        We introduce pseudo id to point the element in UserAgentShadowDOM.
+        This enables us to style the inner element of an img element shadow.
+        Please see also http://trac.webkit.org/wiki/ShadowDOMForReplacedElements
+
+        Test: fast/dom/shadow/shadowdom-for-image-with-pseudo-id.html
+
+        * html/shadow/ImageInnerElement.cpp:
+        (WebCore::ImageInnerElement::shadowPseudoId):
+        (WebCore):
+        * html/shadow/ImageInnerElement.h:
+        (ImageInnerElement):
+
 2012-07-20  Kent Tamura  <[email protected]>
 
         REGRESSION(r121420): Performance regression of form state saving for pages with multiple forms

Modified: trunk/Source/WebCore/html/shadow/ImageInnerElement.cpp (123191 => 123192)


--- trunk/Source/WebCore/html/shadow/ImageInnerElement.cpp	2012-07-20 08:03:59 UTC (rev 123191)
+++ trunk/Source/WebCore/html/shadow/ImageInnerElement.cpp	2012-07-20 08:06:36 UTC (rev 123192)
@@ -68,4 +68,10 @@
     return createRendererForImage(this, arena);
 }
 
+const AtomicString& ImageInnerElement::shadowPseudoId() const
+{
+    DEFINE_STATIC_LOCAL(AtomicString, pseudoId, ("-webkit-image-inner-element"));
+    return pseudoId;
 }
+
+}

Modified: trunk/Source/WebCore/html/shadow/ImageInnerElement.h (123191 => 123192)


--- trunk/Source/WebCore/html/shadow/ImageInnerElement.h	2012-07-20 08:03:59 UTC (rev 123191)
+++ trunk/Source/WebCore/html/shadow/ImageInnerElement.h	2012-07-20 08:06:36 UTC (rev 123192)
@@ -53,6 +53,8 @@
 
     virtual void attach() OVERRIDE;
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
+
+    virtual const AtomicString& shadowPseudoId() const OVERRIDE;
 };
 
 inline PassRefPtr<ImageInnerElement> ImageInnerElement::create(Document* document)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to