Bug 1348746 - stylo: Only eagerly style newly appended children from bindings when the pres shell has been initialized. r=bholley

MozReview-Commit-ID: 9kxbgiw78AB

--HG--
extra : rebase_source : e3b05c4cc79d8b7d3026030d5514b4e18d954a9b
This commit is contained in:
Cameron McCormack 2017-03-20 17:08:15 +08:00
parent e4ec1eb1d3
commit 96685b05f7

View File

@ -416,8 +416,10 @@ public:
~AutoStyleNewChildren()
{
nsIPresShell* presShell = mElement->OwnerDoc()->GetShell();
ServoStyleSet* servoSet = presShell ? presShell->StyleSet()->GetAsServo() : nullptr;
if (servoSet) {
if (!presShell || !presShell->DidInitialize()) {
return;
}
if (ServoStyleSet* servoSet = presShell->StyleSet()->GetAsServo()) {
// In general the element is always styled by the time we're applying XBL
// bindings, because we need to style the element to know what the binding
// URI is. However, programmatic consumers of the XBL service (like the