Bug 1319568 - Resolve default styles for XUL tree pseudos for now if we're styled by Servo. r=xidorn
MozReview-Commit-ID: H3qDwPldmP2
--- 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());
}