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

MozReview-Commit-ID: G8Ju8yHtYx6

--HG--
extra : rebase_source : fc55dfaa52acf490b65650a7101188115a6e4f18
This commit is contained in:
Cameron McCormack 2017-10-18 17:26:08 +08:00
Родитель be0c3c9792
Коммит 2559396ff5
3 изменённых файлов: 16 добавлений и 0 удалений

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

@ -158,6 +158,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,

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

@ -1582,6 +1582,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,

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

@ -477,6 +477,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.