mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +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
|
|
@ -2024,9 +2024,7 @@ Loader::LoadInlineStyle(nsIContent* aElement,
|
|||
PrepareSheet(sheet, aTitle, aMedia, nullptr, aScopeElement, *aIsAlternate, *aIsExplicitlyEnabled);
|
||||
|
||||
if (aElement->HasFlag(NODE_IS_IN_SHADOW_TREE)) {
|
||||
ShadowRoot* containingShadow = aElement->GetContainingShadow();
|
||||
MOZ_ASSERT(containingShadow);
|
||||
containingShadow->InsertSheet(sheet, aElement);
|
||||
aElement->GetContainingShadow()->InsertSheet(sheet, aElement);
|
||||
} else {
|
||||
rv = InsertSheetInDoc(sheet, aElement, mDocument);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
|
@ -2120,8 +2118,12 @@ Loader::LoadStyleLink(nsIContent* aElement,
|
|||
|
||||
PrepareSheet(sheet, aTitle, aMedia, nullptr, nullptr, *aIsAlternate, *aIsExplicitlyEnabled);
|
||||
|
||||
rv = InsertSheetInDoc(sheet, aElement, mDocument);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (aElement->HasFlag(NODE_IS_IN_SHADOW_TREE)) {
|
||||
aElement->GetContainingShadow()->InsertSheet(sheet, aElement);
|
||||
} else {
|
||||
rv = InsertSheetInDoc(sheet, aElement, mDocument);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIStyleSheetLinkingElement> owningElement(do_QueryInterface(aElement));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue