mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
Issue #2135 - Bug 1410578: Make <link rel="stylesheet"> work in shadow trees
This commit is contained in:
parent
45c179d01b
commit
588c2154a5
4 changed files with 21 additions and 49 deletions
|
|
@ -162,7 +162,8 @@ HTMLLinkElement::HasDeferredDNSPrefetchRequest()
|
|||
}
|
||||
|
||||
nsresult
|
||||
HTMLLinkElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
HTMLLinkElement::BindToTree(nsIDocument* aDocument,
|
||||
nsIContent* aParent,
|
||||
nsIContent* aBindingParent,
|
||||
bool aCompileEventHandlers)
|
||||
{
|
||||
|
|
@ -173,12 +174,8 @@ HTMLLinkElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|||
aCompileEventHandlers);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Link must be inert in ShadowRoot.
|
||||
if (aDocument && !GetContainingShadow()) {
|
||||
aDocument->RegisterPendingLinkUpdate(this);
|
||||
}
|
||||
|
||||
if (IsInComposedDoc()) {
|
||||
if (nsIDocument* doc = GetComposedDoc()) {
|
||||
doc->RegisterPendingLinkUpdate(this);
|
||||
TryDNSPrefetchPreconnectOrPrefetch();
|
||||
}
|
||||
|
||||
|
|
@ -222,11 +219,7 @@ HTMLLinkElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
|||
// If this is reinserted back into the document it will not be
|
||||
// from the parser.
|
||||
nsCOMPtr<nsIDocument> oldDoc = GetUncomposedDoc();
|
||||
|
||||
// Check for a ShadowRoot because link elements are inert in a
|
||||
// ShadowRoot.
|
||||
ShadowRoot* oldShadowRoot = GetBindingParent() ?
|
||||
GetBindingParent()->GetShadowRoot() : nullptr;
|
||||
ShadowRoot* oldShadowRoot = GetContainingShadow();
|
||||
|
||||
OwnerDoc()->UnregisterPendingLinkUpdate(this);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue