Bug 1247865 - Fix assertion to handle restyling of a table::after. r?birtles
I confirmed locally that this patch does fix the assertion in the
crashtest.
MozReview-Commit-ID: 8LHhJhNzDz9
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -131,13 +131,13 @@ load 1206105-1.html
load 1223688-1.html
load 1223694-1.html
load 1226400-1.html
load 1227501-1.html
load 1230408-1.html
load 1233135-1.html
load 1233135-2.html
load 1238660-1.html
-asserts(1) load 1247865-1.html # bug 1247865
+load 1247865-1.html
load border-image-visited-link.html
load font-face-truncated-src.html
load large_border_image_width.html
load long-url-list-stack-overflow.html
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -1709,22 +1709,27 @@ nsStyleSet::ResolveStyleWithReplacement(
// if we're dealing with a replacement (such as style attribute
// replacement) that could lead to the animation property changing,
// and we explicitly do NOT want to call CheckAnimationRule when
// we're trying to do an animation-only update.
if (aReplacements & ~(eRestyle_CSSTransitions | eRestyle_CSSAnimations)) {
flags |= eDoAnimation;
}
elementForAnimation = aElement;
- NS_ASSERTION(pseudoType == nsCSSPseudoElements::ePseudo_NotPseudoElement ||
- !elementForAnimation->GetPrimaryFrame() ||
- elementForAnimation->GetPrimaryFrame()->StyleContext()->
- GetPseudoType() ==
- nsCSSPseudoElements::ePseudo_NotPseudoElement,
- "aElement should be the element and not the pseudo-element");
+#ifdef DEBUG
+ {
+ nsIFrame* styleFrame = nsLayoutUtils::GetStyleFrame(elementForAnimation);
+ NS_ASSERTION(pseudoType ==
+ nsCSSPseudoElements::ePseudo_NotPseudoElement ||
+ !styleFrame ||
+ styleFrame->StyleContext()->GetPseudoType() ==
+ nsCSSPseudoElements::ePseudo_NotPseudoElement,
+ "aElement should be the element and not the pseudo-element");
+ }
+#endif
}
if (aElement && aElement->IsRootOfAnonymousSubtree()) {
// For anonymous subtree roots, don't tweak "display" value based on whether
// or not the parent is styled as a flex/grid container. (If the parent
// has anonymous-subtree kids, then we know it's not actually going to get
// a flex/grid container frame, anyway.)
flags |= eSkipParentDisplayBasedStyleFixup;