Summary: | Document.p.contains returns true for nodes in shadow tree | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Justin Ridgewell <jridgewell> | ||||||
Component: | DOM | Assignee: | Ryosuke Niwa <rniwa> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cdumez, darin, jridgewell, rniwa, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | Safari Technology Preview | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=216656 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 148695 | ||||||||
Attachments: |
|
Description
Justin Ridgewell
2018-08-30 11:18:04 PDT
This works for me now. I tested with Safari TP 113, and it still fails. Is there a recent commit that fixes the behavior? To be clear, we do not want to see any output on the test page, it should be blank. Safari still shows "Doc contains node in shadow tree" for me. (In reply to Justin Ridgewell from comment #2) > I tested with Safari TP 113, and it still fails. Is there a recent commit > that fixes the behavior? > > To be clear, we do not want to see any output on the test page, it should be > blank. Safari still shows "Doc contains node in shadow tree" for me. Oh, weird. I don't know what I was testing but you're right this is definitely broken. Ah, okay, I know what happened there. Darin fixed this in https://trac.webkit.org/r267220. Node::isDescendantOf has a special code for when "other" node is a document node. Before r267220, we had the following code, which incorrectly assumed that any node which is connected to "other" is a descendent of "other": if (other.isDocumentNode()) return &document() == &other && !isDocumentNode() && isConnected(); After r267220, now correctly checks that the root node of the current tree is same as "other": if (other.isDocumentNode()) return &treeScope().rootNode() == &other && !isDocumentNode() && isConnected(); I expect this bug will be fixed the next STP. Actually, let's add a test for this. Adding a test. I knew I was fixing a bug. I’m embarrassed that I didn’t add a test case for it. And really surprised WPT doesn’t already have one! (In reply to Darin Adler from comment #9) > And really surprised WPT doesn’t already have one! Yeah! Created attachment 409929 [details]
Adds a test
Committed r267719: <https://trac.webkit.org/changeset/267719> |