Bug 1343078 part 5. Change the restyle manager to handle style contexts with no parent in ReparentStyleContext (by doing nothing with them). r?dbaron
MozReview-Commit-ID: 9a89RV8mKYn
--- a/layout/base/GeckoRestyleManager.cpp
+++ b/layout/base/GeckoRestyleManager.cpp
@@ -861,16 +861,22 @@ GeckoRestyleManager::ReparentStyleContex
nsIFrame* providerChild = nullptr;
if (isChild) {
ReparentStyleContext(providerFrame);
// Get the style context again after ReparentStyleContext() which might have
// changed it.
newParentContext = providerFrame->StyleContext();
providerChild = providerFrame;
}
+
+ if (!newParentContext && !oldContext->GetParent()) {
+ // No need to do anything here.
+ return NS_OK;
+ }
+
NS_ASSERTION(newParentContext, "Reparenting something that has no usable"
" parent? Shouldn't happen!");
// XXX need to do something here to produce the correct style context for
// an IB split whose first inline part is inside a first-line frame.
// Currently the first IB anonymous block's style context takes the first
// part's style context as parent, which is wrong since first-line style
// should not apply to the anonymous block.