Bug 91596 - ShadowRoot.innerHTML should not use the host's parsing rule.
Summary: ShadowRoot.innerHTML should not use the host's parsing rule.
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 72352
  Show dependency treegraph
 
Reported: 2012-07-18 00:31 PDT by Shinya Kawanaka
Modified: 2012-08-08 00:34 PDT (History)
7 users (show)

See Also:


Attachments
Repro (411 bytes, text/html)
2012-07-18 00:54 PDT, Shinya Kawanaka
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shinya Kawanaka 2012-07-18 00:31:51 PDT
In ShadowRoot::setInnerHTML, host() is used for context element to createFragmentForInnerOuterHTML().
This changes the behavior of  shadowRoot.innerHTML = "..." if the host element is changed.

e.g. For <textarea>, almost of tags will be ignored.
Comment 1 Shinya Kawanaka 2012-07-18 00:54:30 PDT
Created attachment 152955 [details]
Repro
Comment 2 Shinya Kawanaka 2012-07-18 00:56:39 PDT
In the repro, shadowRoot1.innerHTML.firstChild and shadowRoot2.innerHTML.firstChild should be the same. However, since xmp does not accept any tag, shadowRoot1.firstChild is a text node and shadowRoot2.firstChild is an anchor node.
Comment 3 Shinya Kawanaka 2012-07-18 02:52:12 PDT
I'm trying to attack this now. Changing Element to ContainerNode worked, but I'm not sure It's OK.
Comment 4 Shinya Kawanaka 2012-07-18 19:10:30 PDT
I've filed the Bug in the spec...
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18321

Using the host element's parsing rule seems natural to me now, but we have to care about what the host element is when using innerHTML.
Comment 5 Shinya Kawanaka 2012-08-08 00:34:16 PDT
Since the spec was updated so that the host element is used for parsing context element, this bug is now invalid.