mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 992521 - Part 5: Bind native anonymous content to null document when node is contained by a ShadowRoot. r=smaug
This commit is contained in:
parent
d5a9346ba8
commit
00bef8c70a
@ -1797,7 +1797,12 @@ nsCSSFrameConstructor::CreateGeneratedContentItem(nsFrameConstructorState& aStat
|
||||
return;
|
||||
container->SetIsNativeAnonymousRoot();
|
||||
|
||||
rv = container->BindToTree(mDocument, aParentContent, aParentContent, true);
|
||||
// If the parent is in a shadow tree, make sure we don't
|
||||
// bind with a document because shadow roots and its descendants
|
||||
// are not in document.
|
||||
nsIDocument* bindDocument =
|
||||
aParentContent->HasFlag(NODE_IS_IN_SHADOW_TREE) ? nullptr : mDocument;
|
||||
rv = container->BindToTree(bindDocument, aParentContent, aParentContent, true);
|
||||
if (NS_FAILED(rv)) {
|
||||
container->UnbindFromTree();
|
||||
return;
|
||||
@ -4050,7 +4055,13 @@ nsCSSFrameConstructor::GetAnonymousContent(nsIContent* aParent,
|
||||
ConnectAnonymousTreeDescendants(content, aContent[i].mChildren);
|
||||
|
||||
bool anonContentIsEditable = content->HasFlag(NODE_IS_EDITABLE);
|
||||
rv = content->BindToTree(mDocument, aParent, aParent, true);
|
||||
|
||||
// If the parent is in a shadow tree, make sure we don't
|
||||
// bind with a document because shadow roots and its descendants
|
||||
// are not in document.
|
||||
nsIDocument* bindDocument =
|
||||
aParent->HasFlag(NODE_IS_IN_SHADOW_TREE) ? nullptr : mDocument;
|
||||
rv = content->BindToTree(bindDocument, aParent, aParent, true);
|
||||
// If the anonymous content creator requested that the content should be
|
||||
// editable, honor its request.
|
||||
// We need to set the flag on the whole subtree, because existing
|
||||
|
Loading…
x
Reference in New Issue
Block a user