Bug 1290276 Part 7 - Restyle element and its descendant after loading XBL bindings. r=heycam

MozReview-Commit-ID: 1WiioW3xxMX

--HG--
extra : rebase_source : fd0820151911e7c1b69ed2524282ecbd72a42c57
This commit is contained in:
Ting-Yu Lin 2017-06-05 14:21:32 +08:00
Родитель 414fb7a11d
Коммит a8f560ec17
1 изменённых файлов: 20 добавлений и 7 удалений

Просмотреть файл

@ -5819,14 +5819,27 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
aState.AddPendingBinding(newPendingBinding.forget());
}
if (aContent->IsStyledByServo()) {
NS_WARNING("stylo: Skipping Unsupported binding re-resolve. This needs fixing.");
resolveStyle = false;
}
if (resolveStyle) {
styleContext =
ResolveStyleContext(styleContext->GetParent(), aContent, &aState);
if (aContent->IsStyledByServo()) {
Element* element = aContent->AsElement();
ServoStyleSet* styleSet = mPresShell->StyleSet()->AsServo();
// XXX: We should have a better way to restyle ourselves.
ServoRestyleManager::ClearServoDataFromSubtree(element);
styleSet->StyleNewSubtree(element);
// Servo's should_traverse_children() in traversal.rs skips
// styling descendants of elements with a -moz-binding the
// first time. Thus call StyleNewChildren() again.
styleSet->StyleNewChildren(element);
styleContext =
styleSet->ResolveStyleFor(element, nullptr, LazyComputeBehavior::Allow);
} else {
styleContext =
ResolveStyleContext(styleContext->GetParent(), aContent, &aState);
}
display = styleContext->StyleDisplay();
aStyleContext = styleContext;
}