AuthorShadowDOM support for textarea element.
authorshinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2012 07:19:55 +0000 (07:19 +0000)
committershinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2012 07:19:55 +0000 (07:19 +0000)
commit46bcea767d2e3be7bd720a9bffae1e98ddbdc95c
treeba749d58bcd68559ef846b2858e605a11af796f8
parent0ccafd4dad5feea6eafddb410dc0b102db655b19
AuthorShadowDOM support for textarea element.
https://bugs.webkit.org/show_bug.cgi?id=91485

Reviewed by Dimitri Glazkov.

Source/WebCore:

We add AuthorShadowDOM support for textarea element.

Unlike other replaced elements (e.g. meter, progress, img), we do not need to add
extra RenderBlock when we add AuthorShadowDOM. However, since inner element will not have
renderer when AuthorShadowDOM does not have any shadow insertion point, we have to check
the existence of the renderer of inner element.

Tests: fast/dom/shadow/shadowdom-for-textarea-with-attribute.html
       fast/dom/shadow/shadowdom-for-textarea-with-placeholder.html
       fast/dom/shadow/shadowdom-for-textarea-with-style.html
       fast/dom/shadow/shadowdom-for-textarea.html

* dom/ShadowRoot.cpp:
(WebCore::allowsAuthorShadowRoot): Needs allow textarea to have AuthorShadowRoot.
* rendering/RenderTextControl.cpp: When AuthorShadowDOM does not have any insertion point,
innerTextElement() will not have any renderer. We have to tweak these renderers not to be crashed.
(WebCore::RenderTextControl::textBlockWidth):
(WebCore::RenderTextControl::updateFromElement):
(WebCore::RenderTextControl::computeLogicalHeight):
(WebCore::RenderTextControl::hitInnerTextElement):
(WebCore::RenderTextControl::computePreferredLogicalWidths):

LayoutTests:

We have the following tests.
(1) having only <shadow> insertion point.
(2) not having <shadow> insertion point.
(3) having <shadow> and <content> insertion point.
(4) with rows/cols attribute
(5) with placeholder attribute

* fast/dom/shadow/shadow-disable-expected.txt:
* fast/dom/shadow/shadow-disable.html:
* fast/dom/shadow/shadowdom-for-textarea-complex-shadow-expected.html:
* fast/dom/shadow/shadowdom-for-textarea-complex-shadow.html:
* fast/dom/shadow/shadowdom-for-textarea-expected.html: Added.
* fast/dom/shadow/shadowdom-for-textarea-only-shadow-expected.html:
* fast/dom/shadow/shadowdom-for-textarea-only-shadow.html:
* fast/dom/shadow/shadowdom-for-textarea-with-attribute-expected.html: Copied from LayoutTests/fast/dom/shadow/shadowdom-for-textarea-only-shadow-expected.html.
* fast/dom/shadow/shadowdom-for-textarea-with-attribute.html: Copied from LayoutTests/fast/dom/shadow/shadowdom-for-textarea-only-shadow.html.
* fast/dom/shadow/shadowdom-for-textarea-with-placeholder-expected.html: Added.
* fast/dom/shadow/shadowdom-for-textarea-with-placeholder.html: Added.
* fast/dom/shadow/shadowdom-for-textarea-with-style-expected.html: Added.
* fast/dom/shadow/shadowdom-for-textarea-with-style.html: Copied from LayoutTests/fast/dom/shadow/shadowdom-for-textarea-only-shadow.html.
* fast/dom/shadow/shadowdom-for-textarea-without-shadow.html:
* fast/dom/shadow/shadowdom-for-textarea.html: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/shadow-disable-expected.txt
LayoutTests/fast/dom/shadow/shadow-disable.html
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-complex-shadow-expected.html
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-complex-shadow.html
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-only-shadow-expected.html
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-only-shadow.html
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-with-attribute-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-with-attribute.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-with-placeholder-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-with-placeholder.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-with-style-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-with-style.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/shadowdom-for-textarea-without-shadow.html
LayoutTests/fast/dom/shadow/shadowdom-for-textarea.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/ShadowRoot.cpp
Source/WebCore/rendering/RenderTextControl.cpp