Skip to content

Instantly share code, notes, and snippets.

@emilio
Created August 7, 2018 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emilio/ec55c2753fa4d3784df952c3785cdf1d to your computer and use it in GitHub Desktop.
Save emilio/ec55c2753fa4d3784df952c3785cdf1d to your computer and use it in GitHub Desktop.
diff --git a/dom/base/nsStyleLinkElement.cpp b/dom/base/nsStyleLinkElement.cpp
index 021b9b6320d8..8ebe471cab21 100644
--- a/dom/base/nsStyleLinkElement.cpp
+++ b/dom/base/nsStyleLinkElement.cpp
@@ -398,16 +398,27 @@ nsStyleLinkElement::DoUpdateStyleSheet(nsIDocument* aOldDocument,
thisContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::integrity,
integrity);
if (!integrity.IsEmpty()) {
MOZ_LOG(SRILogHelper::GetSriLog(), mozilla::LogLevel::Debug,
("nsStyleLinkElement::DoUpdateStyleSheet, integrity=%s",
NS_ConvertUTF16toUTF8(integrity).get()));
}
}
+
+ if (info.mContent && info.mContent->IsInVideoControlsShadowTree()) {
+ RefPtr<StyleSheet> sheet;
+ nsresult rv =
+ doc->CSSLoader()->LoadSheetSync(info.mURI,
+ mozilla::css::eAuthorSheetFeatures,
+ /* aUseSystemPrincipal = */ false,
+ &sheet);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+ }
+
auto resultOrError = doc->CSSLoader()->LoadStyleLink(*info, aObserver);
if (resultOrError.isErr()) {
// Don't propagate LoadStyleLink() errors further than this, since some
// consumers (e.g. nsXMLContentSink) will completely abort on innocuous
// things like a stylesheet load being blocked by the security system.
return Update { };
}
return resultOrError;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment