Changeset 141235 in webkit


Ignore:
Timestamp:
Jan 30, 2013 1:41:34 AM (11 years ago)
Author:
esprehn@chromium.org
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r141232 r141235  
     12013-01-30  Elliott Sprehn  <esprehn@chromium.org>
     2
     3        getDecorationRootAndDecoratedRoot should add new user agent shadow roots
     4        https://bugs.webkit.org/show_bug.cgi?id=108301
     5
     6        Reviewed by Hajime Morita.
     7
     8        getDecorationRootAndDecoratedRoot intended to add a second UserAgentShadowRoot
     9        to the input, not just reuse the existing one so it could insert icons into
     10        the inputs. Add back in this behavior for now so we can sort out the right thing
     11        to do.
     12
     13        This behavior is wrong in the current architecture since it means if you had an
     14        input type=submit, add an author shadow root, and then change the type to text
     15        and then the browser decorates it your shadow magically becomes inaccessible since
     16        input.shadowRoot is no longer available. This feature is currently only used for
     17        decorating type=password fields in Chromium with an icon for password generation.
     18
     19        No new tests, there's no way to test this because it's only used in Chromium
     20        by way of the ChromeClient.
     21
     22        * html/shadow/TextFieldDecorationElement.cpp:
     23        (WebCore::getDecorationRootAndDecoratedRoot):
     24
    1252013-01-30  Huang Dongsung  <luxtella@company100.net>
    226
  • trunk/Source/WebCore/html/shadow/TextFieldDecorationElement.cpp

    r141175 r141235  
    5555// TextFieldDecorationElement ----------------------------------------------------------------
    5656
     57// FIXME: This class is only used in Chromium, and has no layout tests!!
     58
    5759TextFieldDecorationElement::TextFieldDecorationElement(Document* document, TextFieldDecorator* decorator)
    5860    : HTMLDivElement(HTMLNames::divTag, document)
     
    9092    if (newRoot)
    9193        newRoot->removeChild(newRoot->firstChild());
    92     else
    93         newRoot = input->ensureUserAgentShadowRoot();
     94    else {
     95        // FIXME: This interacts really badly with author shadow roots because now
     96        // we can interleave user agent and author shadow roots on the element meaning
     97        // input.shadowRoot may be inaccessible if the browser has decided to decorate
     98        // the input.
     99        newRoot = input->ensureShadow()->addShadowRoot(input, ShadowRoot::UserAgentShadowRoot);
     100    }
    94101    decorationRoot = newRoot;
    95102    decoratedRoot = existingRoot;
Note: See TracChangeset for help on using the changeset viewer.