Bug 59012 - Shadows should be imported along with their host nodes
Summary: Shadows should be imported along with their host nodes
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Roland Steiner
Depends on:
Blocks: 52962 61909
  Show dependency treegraph
Reported: 2011-04-20 11:43 PDT by Dominic Cooney
Modified: 2011-06-01 23:35 PDT (History)
3 users (show)

See Also:

Patch (5.14 KB, patch)
2011-04-20 19:30 PDT, Roland Steiner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominic Cooney 2011-04-20 11:43:39 PDT
Document::importedNode doesn’t import new-style shadows. This means that as nodes are imported, they lose their shadows.
Comment 1 Dominic Cooney 2011-04-20 11:44:11 PDT
Comment 2 Roland Steiner 2011-04-20 19:30:18 PDT
Created attachment 90478 [details]
Comment 3 Kent Tamura 2011-04-20 19:33:41 PDT
Comment on attachment 90478 [details]

Looks good
Comment 4 Kent Tamura 2011-04-20 19:51:36 PDT
BTW, what about Node::cloneNode()?
Comment 5 Roland Steiner 2011-04-21 09:59:09 PDT
(In reply to comment #4)
> BTW, what about Node::cloneNode()?

Both importNode() and cloneNode() call copyNonAttributeProperties for nodes they clone, so both are handled by this patch.

But note that a direct call to cloneNode() and importNode() is currently forbidden. It the end it depends on the JS API we will have for shadowRoot, I think. If you can assign directly to element.shadowRoot, e.g.,

    myBoundElement.shadowRoot = myOtherBoundElement.shadowRoot.cloneNode()

then we will need to allow a direct call to cloneNode and importNode on a ShadowRoot.
Comment 6 WebKit Commit Bot 2011-04-21 11:32:31 PDT
Comment on attachment 90478 [details]

Clearing flags on attachment: 90478

Committed r84528: <http://trac.webkit.org/changeset/84528>
Comment 7 WebKit Commit Bot 2011-04-21 11:32:35 PDT
All reviewed patches have been landed.  Closing bug.