Skip to content
  • shinyak@chromium.org's avatar
    Prohibit having AuthorShadowDOM of input or textarea element for a while and... · f5c4f8b3
    shinyak@chromium.org authored
    Prohibit having AuthorShadowDOM of input or textarea element for a while and having a flag to enable it in Internals.
    https://bugs.webkit.org/show_bug.cgi?id=92611
    
    Reviewed by Hajime Morita.
    
    .:
    
    * Source/autotools/symbols.filter:
    
    Source/WebCore:
    
    Prohibit having AuthorShadowDOM of input elemnet unless a flag in RuntimeEnabledFeatures is not enabled.
    The flag can be enabled in Internals.
    
    The elements in UserAgentShadowDOM of input element assume that they have a renderer when the input
    element has a renderer. However, this does not hold when AuthorShadowDOM is added to input element.
    So until we fix the issue, we should disable to have AuthorShadowDOM for input element, because it may
    cause crashes and security problems.
    
    Tests: fast/dom/shadow/input-with-validation-without-shadow.html
           fast/dom/shadow/input-with-validation.html
           fast/dom/shadow/shadow-disable.html
    
    * bindings/generic/RuntimeEnabledFeatures.cpp:
    (WebCore):
    * bindings/generic/RuntimeEnabledFeatures.h:
    (RuntimeEnabledFeatures):
    (WebCore::RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled):
    (WebCore::RuntimeEnabledFeatures::setAuthorShadowDOMForAnyElementEnabled):
    * dom/ShadowRoot.cpp:
    (WebCore::allowsAuthorShadowRoot): The input element or textarea element does not allow to have a ShadowDOM unless
    is a flag in RuntimeEnabledFeatures is not enabled.
    * html/HTMLInputElement.h:
    (WebCore::isHTMLInputElement):
    (WebCore):
    * html/HTMLTextAreaElement.h:
    (WebCore::isHTMLTextAreaElement):
    (WebCore):
    * testing/Internals.cpp:
    (WebCore::Internals::setAuthorShadowDOMForAnyElementEnabled):
    (WebCore):
    * testing/Internals.h:
    (Internals):
    * testing/Internals.idl:
    
    LayoutTests:
    
    * fast/dom/shadow/input-with-validation-without-shadow.html: Make the test runs even if
    new WebKitShadowRoot() throws an exception.
    * fast/dom/shadow/input-with-validation.html: Sets a flag to make AuthorShadowDOM available.
    * fast/dom/shadow/shadow-disable-expected.txt:
    * fast/dom/shadow/shadow-disable.html: Makes it unavailable for input and textarea to have an AuthorShadowDOM.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    f5c4f8b3