Bug 1369903 Part 2: Allow HTMLEditor to enable/disable any type of stylesheet. draft
authorBrad Werth <bwerth@mozilla.com>
Mon, 05 Jun 2017 09:00:20 -0700
changeset 589113 291fbaf5a525fe054a270fb37778acc7a7213351
parent 589112 cd6b99cf5c86977c2eceea18c24b6eebc20ba713
child 589114 ac00ded2299e8d8b315892262ca4c1a2bc7460fa
push id62254
push userbwerth@mozilla.com
push dateMon, 05 Jun 2017 17:07:03 +0000
bugs1369903
milestone55.0a1
Bug 1369903 Part 2: Allow HTMLEditor to enable/disable any type of stylesheet. MozReview-Commit-ID: JSlJ8yhqLXm
editor/libeditor/HTMLEditor.cpp
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -2962,22 +2962,17 @@ HTMLEditor::EnableStyleSheet(const nsASt
 {
   RefPtr<StyleSheet> sheet = GetStyleSheetForURL(aURL);
   NS_ENSURE_TRUE(sheet, NS_OK); // Don't fail if sheet not found
 
   // Ensure the style sheet is owned by our document.
   nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocWeak);
   sheet->SetAssociatedDocument(doc, StyleSheet::NotOwnedByDocument);
 
-  if (sheet->IsServo()) {
-    // XXXheycam ServoStyleSheets don't support being enabled/disabled yet.
-    NS_ERROR("stylo: ServoStyleSheets can't be disabled yet");
-    return NS_ERROR_FAILURE;
-  }
-  return sheet->AsGecko()->SetDisabled(!aEnable);
+  return sheet->SetDisabled(!aEnable);
 }
 
 bool
 HTMLEditor::EnableExistingStyleSheet(const nsAString& aURL)
 {
   RefPtr<StyleSheet> sheet = GetStyleSheetForURL(aURL);
 
   // Enable sheet if already loaded.