Bug 1390694 - Part 1: Add ServoStyleSet function for checking document state dependencies. r=emilio

MozReview-Commit-ID: G8Ju8yHtYx6

--HG--
extra : rebase_source : 11f25c9b9b9a45144170ff9e563e52577ca8cea2
extra : source : 38302acda5cdb8a808ee80430488d83527a415ff
This commit is contained in:
Cameron McCormack 2017-11-01 21:20:39 +11:00
Родитель b88fd1ec3c
Коммит 1e2c9293c6
3 изменённых файлов: 16 добавлений и 0 удалений

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

@ -163,6 +163,9 @@ SERVO_BINDING_FUNC(Servo_StyleSet_HasStateDependency, bool,
RawServoStyleSetBorrowed set,
RawGeckoElementBorrowed element,
uint64_t state)
SERVO_BINDING_FUNC(Servo_StyleSet_HasDocumentStateDependency, bool,
RawServoStyleSetBorrowed set,
uint64_t state)
// CSSRuleList
SERVO_BINDING_FUNC(Servo_CssRules_ListTypes, void,

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

@ -1603,6 +1603,13 @@ ServoStyleSet::HasStateDependency(const Element& aElement,
mRawSet.get(), &aElement, aState.ServoValue());
}
bool
ServoStyleSet::HasDocumentStateDependency(EventStates aState) const
{
return Servo_StyleSet_HasDocumentStateDependency(
mRawSet.get(), aState.ServoValue());
}
already_AddRefed<ServoStyleContext>
ServoStyleSet::ReparentStyleContext(ServoStyleContext* aStyleContext,
ServoStyleContext* aNewParent,

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

@ -486,6 +486,12 @@ public:
bool HasStateDependency(const dom::Element& aElement,
EventStates aState) const;
/**
* Returns true if a change in document state might require us to restyle the
* document.
*/
bool HasDocumentStateDependency(EventStates aState) const;
/**
* Get a new style context that uses the same rules as the given style context
* but has a different parent.