Bug 1398479 - Always return correct value for ServoSpecifiedValues::PropertyIsSet. r?Manishearth draft
authorXidorn Quan <me@upsuper.org>
Mon, 11 Sep 2017 12:33:03 +1000
changeset 662730 163e49a33618a7bd2f90ef5250d16fc66a2c3f6a
parent 662729 cd34b51a73389693c341c3c130a62a8f17c3451d
child 730958 53c13f7e90927ad2117b88fbef5381eb04cee685
push id79178
push userxquan@mozilla.com
push dateTue, 12 Sep 2017 01:07:22 +0000
reviewersManishearth
bugs1398479
milestone57.0a1
Bug 1398479 - Always return correct value for ServoSpecifiedValues::PropertyIsSet. r?Manishearth MozReview-Commit-ID: 8VMpLqcOhNz
layout/style/ServoSpecifiedValues.cpp
layout/style/crashtests/1398479.html
layout/style/crashtests/crashtests.list
--- a/layout/style/ServoSpecifiedValues.cpp
+++ b/layout/style/ServoSpecifiedValues.cpp
@@ -23,27 +23,17 @@ ServoSpecifiedValues::ServoSpecifiedValu
 
   : GenericSpecifiedValues(StyleBackendType::Servo, aContext, ALL_SIDS)
   , mDecl(aDecl)
 {}
 
 bool
 ServoSpecifiedValues::PropertyIsSet(nsCSSPropertyID aId)
 {
-  // We always create fresh ServoSpecifiedValues for each property
-  // mapping, so unlike Gecko there aren't existing properties from
-  // the cascade that we wish to avoid overwriting.
-  //
-  // If a property is being overwritten, that's a bug. Check for it
-  // in debug mode (this is O(n^2) behavior since Servo will traverse
-  // the array each time you add a new property)
-  MOZ_ASSERT(!Servo_DeclarationBlock_PropertyIsSet(mDecl, aId),
-             "Presentation attribute mappers should never attempt to set the "
-             "same property twice");
-  return false;
+  return Servo_DeclarationBlock_PropertyIsSet(mDecl, aId);
 }
 
 void
 ServoSpecifiedValues::SetIdentStringValue(nsCSSPropertyID aId,
                                           const nsString& aValue)
 {
   nsCOMPtr<nsIAtom> atom = NS_Atomize(aValue);
   SetIdentAtomValue(aId, atom);
new file mode 100644
--- /dev/null
+++ b/layout/style/crashtests/1398479.html
@@ -0,0 +1,1 @@
+<table align="center" hspace="1">
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -211,9 +211,10 @@ load 1390726.html
 load 1393791.html
 load 1384232.html
 load 1395725.html
 load 1396041.html
 load 1397363-1.html
 load 1397439-1.html
 load 1395719.html
 load 1397091.html
+load 1398479.html
 load 1398581.html