Bug 1331213: Bootstrap a Gecko-side Device, and track it's dirtiness manually in the per-doc data. r=heycam

The setup is quite different to Servo-land, so add a comment about the different
setup.

Also, check viewport rules when flushing stylesheets. I believe that the
previous behavior is plain wrong, though I haven't taken the time to come up
with a test case.

In any case, it doesn't hurt any of both back-ends.

MozReview-Commit-ID: 46gtTkesOsr
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-01-14 23:34:49 +01:00
Родитель 367ac14b53
Коммит 1aed15b692
5 изменённых файлов: 12 добавлений и 22 удалений

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

@ -88,19 +88,9 @@ void
ServoRestyleManager::RebuildAllStyleData(nsChangeHint aExtraHint,
nsRestyleHint aRestyleHint)
{
NS_WARNING("stylo: ServoRestyleManager::RebuildAllStyleData not implemented");
// That said, we do know that rebuilding all style data in Gecko would get rid
// of the old ruletree, and hence of the cached-on-the-root default computed
// styles. So we know we need to clear them here. I think this is the only
// way they could get cleared, in fact, though not _all_ calls that come
// through here may need to clear them in practice.
//
// We probably need to do some actual restyling here too, though. And figure
// out whether it actually matters that we may be recomputing the default
// styles in too many cases. For one thing, we do a bunch of eager work here,
// whereas we should really just set a bit that says to recompute the default
// computed styles before the next time we restyle anything!
StyleSet()->RecomputeDefaultComputedStyles();
// TODO(emilio, bz): We probably need to do some actual restyling here too.
NS_WARNING("stylo: ServoRestyleManager::RebuildAllStyleData is incomplete");
StyleSet()->RebuildData();
}
void

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

@ -50,10 +50,9 @@ SERVO_BINDING_FUNC(Servo_StyleSheet_HasRules, bool,
RawServoStyleSheetBorrowed sheet)
SERVO_BINDING_FUNC(Servo_StyleSheet_GetRules, ServoCssRulesStrong,
RawServoStyleSheetBorrowed sheet)
SERVO_BINDING_FUNC(Servo_StyleSet_Init, RawServoStyleSetOwned, RawGeckoPresContextBorrowed pres_context)
SERVO_BINDING_FUNC(Servo_StyleSet_RecomputeDefaultStyles, void,
RawServoStyleSetBorrowed set,
RawGeckoPresContextBorrowed pres_context)
SERVO_BINDING_FUNC(Servo_StyleSet_Init, RawServoStyleSetOwned, RawGeckoPresContextOwned pres_context)
SERVO_BINDING_FUNC(Servo_StyleSet_RebuildData, void,
RawServoStyleSetBorrowed set)
SERVO_BINDING_FUNC(Servo_StyleSet_Drop, void, RawServoStyleSetOwned set)
SERVO_BINDING_FUNC(Servo_StyleSet_AppendStyleSheet, void,
RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet, bool flush)

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

@ -107,6 +107,7 @@ DECL_BORROWED_MUT_REF_TYPE_FOR(StyleChildrenIterator)
DECL_BORROWED_MUT_REF_TYPE_FOR(ServoElementSnapshot)
DECL_BORROWED_REF_TYPE_FOR(nsCSSValue)
DECL_BORROWED_MUT_REF_TYPE_FOR(nsCSSValue)
DECL_OWNED_REF_TYPE_FOR(RawGeckoPresContext)
DECL_BORROWED_REF_TYPE_FOR(RawGeckoPresContext)
DECL_BORROWED_MUT_REF_TYPE_FOR(RawGeckoAnimationValueList)

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

@ -549,9 +549,9 @@ ServoStyleSet::AssertTreeIsClean()
#endif
void
ServoStyleSet::RecomputeDefaultComputedStyles()
ServoStyleSet::RebuildData()
{
Servo_StyleSet_RecomputeDefaultStyles(mRawSet.get(), mPresContext);
Servo_StyleSet_RebuildData(mRawSet.get());
}
ServoComputedValuesStrong

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

@ -161,10 +161,10 @@ public:
#endif
/**
* Recompute our default computed styles. This will eagerly create a new set
* of default computed style structs.
* Rebuild the style data. This will force a stylesheet flush, and also
* recompute the default computed styles.
*/
void RecomputeDefaultComputedStyles();
void RebuildData();
/**
* Resolve style for the given element, and return it as a