Bug 1383988 - stylo: Ensure editor handle elements are styled before attempting to construct frames for them. r=hiro

MozReview-Commit-ID: 2T0ZjP00U7A

--HG--
extra : rebase_source : 02e527baac50c2267afb3ed199aee91e72a08b02
This commit is contained in:
Cameron McCormack 2017-07-25 14:08:19 +08:00
parent bb0627f06b
commit 7b2f841ea9

View File

@ -236,6 +236,12 @@ HTMLEditor::CreateAnonymousElement(nsIAtom* aTag,
}
nac->AppendElement(newContent);
// Must style the new element, otherwise the PostRecreateFramesFor call
// below will do nothing.
if (ServoStyleSet* styleSet = ps->StyleSet()->GetAsServo()) {
styleSet->StyleNewSubtree(newContent);
}
ElementDeletionObserver* observer =
new ElementDeletionObserver(newContent, parentContent);
NS_ADDREF(observer); // NodeWillBeDestroyed releases.