Bug 1369903 Part 1: Remove over-specified stylesheet calls in nsDocument.
MozReview-Commit-ID: 6YHC0vvvrtn
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -10084,47 +10084,37 @@ nsIDocument::CreateStaticClone(nsIDocShe
clonedDoc->mOriginalDocument->mStaticCloneCount++;
int32_t sheetsCount = GetNumberOfStyleSheets();
for (int32_t i = 0; i < sheetsCount; ++i) {
RefPtr<StyleSheet> sheet = GetStyleSheetAt(i);
if (sheet) {
if (sheet->IsApplicable()) {
- // XXXheycam Need to make ServoStyleSheet cloning work.
- if (sheet->IsGecko()) {
- RefPtr<StyleSheet> clonedSheet =
- sheet->Clone(nullptr, nullptr, clonedDoc, nullptr);
- NS_WARNING_ASSERTION(clonedSheet,
- "Cloning a stylesheet didn't work!");
- if (clonedSheet) {
- clonedDoc->AddStyleSheet(clonedSheet);
- }
- } else {
- NS_ERROR("stylo: ServoStyleSheet doesn't support cloning");
+ RefPtr<StyleSheet> clonedSheet =
+ sheet->Clone(nullptr, nullptr, clonedDoc, nullptr);
+ NS_WARNING_ASSERTION(clonedSheet,
+ "Cloning a stylesheet didn't work!");
+ if (clonedSheet) {
+ clonedDoc->AddStyleSheet(clonedSheet);
}
}
}
}
// Iterate backwards to maintain order
for (StyleSheet* sheet : Reversed(thisAsDoc->mOnDemandBuiltInUASheets)) {
if (sheet) {
if (sheet->IsApplicable()) {
- // XXXheycam Need to make ServoStyleSheet cloning work.
- if (sheet->IsGecko()) {
- RefPtr<StyleSheet> clonedSheet =
- sheet->Clone(nullptr, nullptr, clonedDoc, nullptr);
- NS_WARNING_ASSERTION(clonedSheet,
- "Cloning a stylesheet didn't work!");
- if (clonedSheet) {
- clonedDoc->AddOnDemandBuiltInUASheet(clonedSheet);
- }
- } else {
- NS_ERROR("stylo: ServoStyleSheet doesn't support cloning");
+ RefPtr<StyleSheet> clonedSheet =
+ sheet->Clone(nullptr, nullptr, clonedDoc, nullptr);
+ NS_WARNING_ASSERTION(clonedSheet,
+ "Cloning a stylesheet didn't work!");
+ if (clonedSheet) {
+ clonedDoc->AddOnDemandBuiltInUASheet(clonedSheet);
}
}
}
}
}
}
mCreatingStaticClone = false;
return clonedDoc.forget();