Title: [141235] trunk/Source/WebCore
Revision
141235
Author
espr...@chromium.org
Date
2013-01-30 01:41:34 -0800 (Wed, 30 Jan 2013)

Log Message

getDecorationRootAndDecoratedRoot should add new user agent shadow roots
https://bugs.webkit.org/show_bug.cgi?id=108301

Reviewed by Hajime Morita.

getDecorationRootAndDecoratedRoot intended to add a second UserAgentShadowRoot
to the input, not just reuse the existing one so it could insert icons into
the inputs. Add back in this behavior for now so we can sort out the right thing
to do.

This behavior is wrong in the current architecture since it means if you had an
input type=submit, add an author shadow root, and then change the type to text
and then the browser decorates it your shadow magically becomes inaccessible since
input.shadowRoot is no longer available. This feature is currently only used for
decorating type=password fields in Chromium with an icon for password generation.

No new tests, there's no way to test this because it's only used in Chromium
by way of the ChromeClient.

* html/shadow/TextFieldDecorationElement.cpp:
(WebCore::getDecorationRootAndDecoratedRoot):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141234 => 141235)


--- trunk/Source/WebCore/ChangeLog	2013-01-30 09:37:54 UTC (rev 141234)
+++ trunk/Source/WebCore/ChangeLog	2013-01-30 09:41:34 UTC (rev 141235)
@@ -1,3 +1,27 @@
+2013-01-30  Elliott Sprehn  <espr...@chromium.org>
+
+        getDecorationRootAndDecoratedRoot should add new user agent shadow roots
+        https://bugs.webkit.org/show_bug.cgi?id=108301
+
+        Reviewed by Hajime Morita.
+
+        getDecorationRootAndDecoratedRoot intended to add a second UserAgentShadowRoot
+        to the input, not just reuse the existing one so it could insert icons into
+        the inputs. Add back in this behavior for now so we can sort out the right thing
+        to do.
+
+        This behavior is wrong in the current architecture since it means if you had an
+        input type=submit, add an author shadow root, and then change the type to text
+        and then the browser decorates it your shadow magically becomes inaccessible since
+        input.shadowRoot is no longer available. This feature is currently only used for
+        decorating type=password fields in Chromium with an icon for password generation.
+
+        No new tests, there's no way to test this because it's only used in Chromium
+        by way of the ChromeClient.
+
+        * html/shadow/TextFieldDecorationElement.cpp:
+        (WebCore::getDecorationRootAndDecoratedRoot):
+
 2013-01-30  Huang Dongsung  <luxte...@company100.net>
 
         Coordinated Graphics: Remove m_pendingSyncBackingStores in LayerTreeRenderer.

Modified: trunk/Source/WebCore/html/shadow/TextFieldDecorationElement.cpp (141234 => 141235)


--- trunk/Source/WebCore/html/shadow/TextFieldDecorationElement.cpp	2013-01-30 09:37:54 UTC (rev 141234)
+++ trunk/Source/WebCore/html/shadow/TextFieldDecorationElement.cpp	2013-01-30 09:41:34 UTC (rev 141235)
@@ -54,6 +54,8 @@
 
 // TextFieldDecorationElement ----------------------------------------------------------------
 
+// FIXME: This class is only used in Chromium, and has no layout tests!!
+
 TextFieldDecorationElement::TextFieldDecorationElement(Document* document, TextFieldDecorator* decorator)
     : HTMLDivElement(HTMLNames::divTag, document)
     , m_textFieldDecorator(decorator)
@@ -89,8 +91,13 @@
     }
     if (newRoot)
         newRoot->removeChild(newRoot->firstChild());
-    else
-        newRoot = input->ensureUserAgentShadowRoot();
+    else {
+        // FIXME: This interacts really badly with author shadow roots because now
+        // we can interleave user agent and author shadow roots on the element meaning
+        // input.shadowRoot may be inaccessible if the browser has decided to decorate
+        // the input.
+        newRoot = input->ensureShadow()->addShadowRoot(input, ShadowRoot::UserAgentShadowRoot);
+    }
     decorationRoot = newRoot;
     decoratedRoot = existingRoot;
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to