ButtonInputType creates a ButtonRenderer, and its text is rendered using ButtonRenderer::setText. Since the renderer of its text is always appended as last child of RenderButton, we cannot get text for <shadow> element. We should create some inner element for ButtonInputType to make <input> AuthorShadowDOM ready.
Created attachment 162474 [details] WIP
Needs a lot of rebaseline and a few tests have image diff. We have to fix them. editing/selection/3690703.html
Comment on attachment 162474 [details] WIP Wow, this patch certainly cleans up the guts of the RenderButton nicely! Do we still need the RenderButton?
Comment on attachment 162474 [details] WIP View in context: https://bugs.webkit.org/attachment.cgi?id=162474&action=review > Source/WebCore/html/BaseButtonInputType.cpp:70 > + element()->userAgentShadowRoot()->replaceChild(text, element()->userAgentShadowRoot()->firstChild()); Is there a reason why this uses replaceChild instead of updating the existing text node using setData
(In reply to comment #4) > (From update of attachment 162474 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=162474&action=review > > > Source/WebCore/html/BaseButtonInputType.cpp:70 > > + element()->userAgentShadowRoot()->replaceChild(text, element()->userAgentShadowRoot()->firstChild()); > > Is there a reason why this uses replaceChild instead of updating the existing text node using setData Thanks! I've searched only Text class. I should have checked CharacterData.
(In reply to comment #3) > (From update of attachment 162474 [details]) > Wow, this patch certainly cleans up the guts of the RenderButton nicely! Do we still need the RenderButton? When we could remove m_inner block, we might be able to do it. It's beyond the scope of this patch, though.
Hmm. According to this discussion, we should not be able to select text in a button. https://bugs.webkit.org/show_bug.cgi?id=13624
Created attachment 162682 [details] Patch
Now we're using TextFragment.
Comment on attachment 162682 [details] Patch Clearing flags on attachment: 162682 Committed r129086: <http://trac.webkit.org/changeset/129086>
All reviewed patches have been landed. Closing bug.
Re-opened since this is blocked by 97312
Check this https://bugs.webkit.org/show_bug.cgi?id=97310
Shadow DOM API was removed.