Bug 1319568 - Resolve default styles for XUL tree pseudos for now if we're styled by Servo. r=xidorn draft
authorCameron McCormack <cam@mcc.id.au>
Tue, 29 Nov 2016 12:31:32 +0800
changeset 445123 f92fa2af36caf6d6cf58b537682a75fd9edf6e04
parent 443817 6cd80e49535f5d17cd134ceeee79efd0f7d1445f
child 538441 6f41164a58a8129a93c813e2dd9086b0b823c379
push id37421
push userbmo:cam@mcc.id.au
push dateTue, 29 Nov 2016 04:35:13 +0000
reviewersxidorn
bugs1319568
milestone53.0a1
Bug 1319568 - Resolve default styles for XUL tree pseudos for now if we're styled by Servo. r=xidorn MozReview-Commit-ID: H3qDwPldmP2
layout/xul/tree/nsTreeStyleCache.cpp
--- a/layout/xul/tree/nsTreeStyleCache.cpp
+++ b/layout/xul/tree/nsTreeStyleCache.cpp
@@ -74,22 +74,26 @@ nsTreeStyleCache::GetStyleContext(nsICSS
   // Look up our style context for this state.
   nsStyleContext* result = nullptr;
   if (mCache) {
     result = mCache->GetWeak(currState);
   }
   if (!result) {
     // We missed the cache. Resolve this pseudo-style.
     // XXXheycam ServoStyleSets do not support XUL tree styles.
+    RefPtr<nsStyleContext> newResult;
     if (aPresContext->StyleSet()->IsServo()) {
-      MOZ_CRASH("stylo: ServoStyleSets should not support XUL tree styles yet");
+      NS_ERROR("stylo: ServoStyleSets should not support XUL tree styles yet");
+      newResult = aPresContext->StyleSet()->
+        ResolveStyleForOtherNonElement(aContext);
+    } else {
+      newResult = aPresContext->StyleSet()->AsGecko()->
+        ResolveXULTreePseudoStyle(aContent->AsElement(), aPseudoElement,
+                                  aContext, aComparator);
     }
-    RefPtr<nsStyleContext> newResult = aPresContext->StyleSet()->AsGecko()->
-      ResolveXULTreePseudoStyle(aContent->AsElement(), aPseudoElement,
-                                aContext, aComparator);
 
     // Put the style context in our table, transferring the owning reference to the table.
     if (!mCache) {
       mCache = new StyleContextCache();
     }
     result = newResult.get();
     mCache->Put(currState, newResult.forget());
   }