Bug 1359217 part 5 - Fix reversed condition for inserting import rule. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Mon, 19 Jun 2017 09:02:47 +1000
changeset 596241 d6d6c57ccdb0d0851e98f1ed79b4449b2ab7f6e9
parent 596240 76dc9330e9dabaa6db159128f28b9ba29733cf1c
child 596242 f44aedc25b08531e76c906c242d1c71d1e58ffa0
child 596343 0f2bc306d27b8ab22f1aa08aa9d44af0dba4694d
push id64551
push userxquan@mozilla.com
push dateMon, 19 Jun 2017 02:08:42 +0000
reviewersheycam
bugs1359217
milestone56.0a1
Bug 1359217 part 5 - Fix reversed condition for inserting import rule. r?heycam MozReview-Commit-ID: 7LU4l83lQ0t
layout/style/ServoCSSRuleList.cpp
--- a/layout/style/ServoCSSRuleList.cpp
+++ b/layout/style/ServoCSSRuleList.cpp
@@ -270,17 +270,17 @@ ServoCSSRuleList::InsertRule(const nsASt
       StyleSheet* sheet = mStyleSheet->GetMostRecentlyAddedChildSheet();
       MOZ_ASSERT(sheet, "Should have at least one "
                  "child stylesheet after inserting @import rule");
       ServoStyleSheet* servoSheet = sheet->AsServo();
       // This should always be that case, but currently ServoStyleSheet
       // may be reused and the reused stylesheet doesn't refer to the
       // right raw sheet, which is bug 1368381. This should be converted
       // to an assertion after that bug gets fixed.
-      if (servoSheet->RawSheet() == raw) {
+      if (servoSheet->RawSheet() != raw) {
         NS_WARNING("New child sheet should always be prepended to the list");
         return static_cast<ServoStyleSheet*>(nullptr);
       }
       return servoSheet;
     });
   }
   return rv;
 }