Bug 1365902: Make ServoStyleSet::RebuildAllStyleData async. r=heycam

MozReview-Commit-ID: D9Ri4gO3F6G

--HG--
extra : rebase_source : 7bcd208994a7140eadc54fa32f209643a8570b72
This commit is contained in:
Emilio Cobos Álvarez 2017-05-17 18:33:32 +02:00
Родитель 0f7f82d4bf
Коммит 5a98022984
2 изменённых файлов: 13 добавлений и 21 удалений

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

@ -74,21 +74,9 @@ void
ServoRestyleManager::RebuildAllStyleData(nsChangeHint aExtraHint,
nsRestyleHint aRestyleHint)
{
StyleSet()->RebuildData();
mHaveNonAnimationRestyles = true;
// NOTE(emilio): GeckoRestlyeManager does a sync style flush, which seems
// not to be needed in my testing.
//
// If it is, we can just do a content flush and call ProcessPendingRestyles.
if (Element* root = mPresContext->Document()->GetRootElement()) {
PostRestyleEvent(root, aRestyleHint, aExtraHint);
}
// TODO(emilio, bz): Extensions can add/remove stylesheets that can affect
// non-inheriting anon boxes. It's not clear if we want to support that, but
// if we do, we need to re-selector-match them here.
// NOTE(emilio): GeckoRestlyeManager does a sync style flush, which seems not
// to be needed in my testing.
PostRebuildAllStyleDataEvent(aExtraHint, aRestyleHint);
}
void
@ -100,6 +88,10 @@ ServoRestyleManager::PostRebuildAllStyleDataEvent(nsChangeHint aExtraHint,
if (Element* root = mPresContext->Document()->GetRootElement()) {
PostRestyleEvent(root, aRestyleHint, aExtraHint);
}
// TODO(emilio, bz): Extensions can add/remove stylesheets that can affect
// non-inheriting anon boxes. It's not clear if we want to support that, but
// if we do, we need to re-selector-match them here.
}
/* static */ void

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

@ -283,12 +283,6 @@ public:
void AssertTreeIsClean() {}
#endif
/**
* Rebuild the style data. This will force a stylesheet flush, and also
* recompute the default computed styles.
*/
void RebuildData();
/**
* Clears the style data, both style sheet data and cached non-inheriting
* style contexts, and marks the stylist as needing an unconditional full
@ -384,6 +378,12 @@ private:
CSSPseudoElementType aPseudoType,
LazyComputeBehavior aMayCompute);
/**
* Rebuild the style data. This will force a stylesheet flush, and also
* recompute the default computed styles.
*/
void RebuildData();
/**
* Gets the pending snapshots to handle from the restyle manager.
*/