Bug 1321157 - Remove some unnecessary stylo NS_ERROR in nsDocument. r?heycam
MozReview-Commit-ID: JJeArvlHKs6
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1186,22 +1186,17 @@ nsDOMStyleSheetSetList::EnsureFresh()
// no document, for sure
}
int32_t count = mDocument->GetNumberOfStyleSheets();
nsAutoString title;
for (int32_t index = 0; index < count; index++) {
StyleSheet* sheet = mDocument->GetStyleSheetAt(index);
NS_ASSERTION(sheet, "Null sheet in sheet list!");
- // XXXheycam ServoStyleSheets don't expose their title yet.
- if (sheet->IsServo()) {
- NS_ERROR("stylo: ServoStyleSets don't expose their title yet");
- continue;
- }
- sheet->AsGecko()->GetTitle(title);
+ sheet->GetTitle(title);
if (!title.IsEmpty() && !mNames.Contains(title) && !Add(title)) {
return;
}
}
}
// ==================================================================
nsIDocument::SelectorCache::SelectorCache()
@@ -3963,21 +3958,17 @@ nsDocument::AddStyleSheetToStyleSets(Sty
}
}
#define DO_STYLESHEET_NOTIFICATION(className, type, memberName, argName) \
do { \
className##Init init; \
init.mBubbles = true; \
init.mCancelable = true; \
- /* XXXheycam ServoStyleSheet doesn't implement DOM interfaces yet */ \
- if (aSheet->IsServo()) { \
- NS_ERROR("stylo: can't dispatch events for ServoStyleSheets yet"); \
- } \
- init.mStylesheet = aSheet->IsGecko() ? aSheet->AsGecko() : nullptr; \
+ init.mStylesheet = aSheet; \
init.memberName = argName; \
\
RefPtr<className> event = \
className::Constructor(this, NS_LITERAL_STRING(type), init); \
event->SetTrusted(true); \
event->SetTarget(this); \
RefPtr<AsyncEventDispatcher> asyncDispatcher = \
new AsyncEventDispatcher(this, event); \
@@ -6000,30 +5991,22 @@ nsIDocument::GetSelectedStyleSheetSet(ns
// Look through our sheets, find the selected set title
int32_t count = GetNumberOfStyleSheets();
nsAutoString title;
for (int32_t index = 0; index < count; index++) {
StyleSheet* sheet = GetStyleSheetAt(index);
NS_ASSERTION(sheet, "Null sheet in sheet list!");
- // XXXheycam Make this work with ServoStyleSheets.
- if (sheet->IsServo()) {
- NS_ERROR("stylo: can't handle alternate ServoStyleSheets yet");
- continue;
- }
-
- bool disabled;
- sheet->AsGecko()->GetDisabled(&disabled);
- if (disabled) {
+ if (sheet->Disabled()) {
// Disabled sheets don't affect the currently selected set
continue;
}
- sheet->AsGecko()->GetTitle(title);
+ sheet->GetTitle(title);
if (aSheetSet.IsEmpty()) {
aSheetSet = title;
} else if (!title.IsEmpty() && !aSheetSet.Equals(title)) {
// Sheets from multiple sets enabled; return null string, per spec.
SetDOMStringToNull(aSheetSet);
return;
}