Bug 1369903 Part 2: Allow HTMLEditor to enable/disable any type of stylesheet. r=emilio
authorBrad Werth <bwerth@mozilla.com>
Mon, 05 Jun 2017 09:00:20 -0700
changeset 362528 66a0bce9a2997f5d7bd8bdbc67dd432bdd2c1f61
parent 362527 ea5ac39685cd2712a7f48ddca1de10eabb3d8a28
child 362529 42669f4e317b9d18024c431a00f06d2701e72fde
push id31982
push userkwierso@gmail.com
push dateTue, 06 Jun 2017 23:18:26 +0000
treeherdermozilla-central@fd04166b7114 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1369903
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1369903 Part 2: Allow HTMLEditor to enable/disable any type of stylesheet. r=emilio 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.