Bug 1313293 followup - Fix small issue of ServoCSSRuleList::InsertRule.
authorXidorn Quan <me@upsuper.org>
Wed, 30 Nov 2016 14:36:00 +1100
changeset 324768 18cd502c7f016e863db54669cb26d1013412f3dd
parent 324767 cceff8069b0b623ee59e63f77fbe74ef4f97aa79
child 324769 f78f86eaba8dfba74c41d150bf166abf0e17e7ff
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
bugs1313293
milestone53.0a1
Bug 1313293 followup - Fix small issue of ServoCSSRuleList::InsertRule. MozReview-Commit-ID: GGN5mXQSp7f
layout/style/ServoCSSRuleList.cpp
--- a/layout/style/ServoCSSRuleList.cpp
+++ b/layout/style/ServoCSSRuleList.cpp
@@ -92,17 +92,17 @@ ServoCSSRuleList::InsertRule(const nsASt
   NS_ConvertUTF16toUTF8 rule(aRule);
   // XXX This needs to actually reflect whether it is nested when we
   // support using CSSRuleList in CSSGroupingRules.
   bool nested = false;
   uint16_t type;
   nsresult rv = Servo_CssRules_InsertRule(mRawRules, mStyleSheet->RawSheet(),
                                           &rule, aIndex, nested, &type);
   if (!NS_FAILED(rv)) {
-    mRules.InsertElementAt(type);
+    mRules.InsertElementAt(aIndex, type);
   }
   return rv;
 }
 
 nsresult
 ServoCSSRuleList::DeleteRule(uint32_t aIndex)
 {
   nsresult rv = Servo_CssRules_DeleteRule(mRawRules, aIndex);