mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
Bug 1390694
- Part 3: Add nsBindingManager function to check for document state dependencies. r=emilio
MozReview-Commit-ID: Aw04MrVHyIz --HG-- extra : rebase_source : dd1e15f0589ec532111711e14348c6d2ee590314
This commit is contained in:
parent
2ceac13254
commit
0a31e73ee0
@ -1169,3 +1169,20 @@ nsBindingManager::FindNestedSingleInsertionPoint(nsIContent* aContainer,
|
||||
|
||||
return parent;
|
||||
}
|
||||
|
||||
bool
|
||||
nsBindingManager::AnyBindingHasDocumentStateDependency(EventStates aStateMask)
|
||||
{
|
||||
MOZ_ASSERT(mDocument->IsStyledByServo());
|
||||
|
||||
bool result = false;
|
||||
EnumerateBoundContentBindings([&](nsXBLBinding* aBinding) {
|
||||
ServoStyleSet* styleSet = aBinding->PrototypeBinding()->GetServoStyleSet();
|
||||
if (styleSet && styleSet->HasDocumentStateDependency(aStateMask)) {
|
||||
result = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/StyleSheet.h"
|
||||
#include "mozilla/EventStates.h"
|
||||
|
||||
struct ElementDependentRuleProcessorData;
|
||||
class nsIXPConnectWrappedJS;
|
||||
@ -175,6 +176,8 @@ public:
|
||||
|
||||
nsIContent* FindNestedSingleInsertionPoint(nsIContent* aContainer, bool* aMulti);
|
||||
|
||||
bool AnyBindingHasDocumentStateDependency(mozilla::EventStates aStateMask);
|
||||
|
||||
protected:
|
||||
nsIXPConnectWrappedJS* GetWrappedJS(nsIContent* aContent);
|
||||
nsresult SetWrappedJS(nsIContent* aContent, nsIXPConnectWrappedJS* aResult);
|
||||
|
Loading…
Reference in New Issue
Block a user