Bug 1369954 - Part 5: Add FFI function for checking whether an element has XBL-created anonymous content. r=emilio

MozReview-Commit-ID: 2ZXyBzxkfsA
This commit is contained in:
Cameron McCormack 2017-06-09 21:18:11 +08:00
parent 4b10337a50
commit e3babb3936
2 changed files with 13 additions and 0 deletions

View File

@ -240,6 +240,18 @@ Gecko_DropStyleChildrenIterator(StyleChildrenIteratorOwned aIterator)
delete aIterator;
}
bool
Gecko_ElementHasBindingWithAnonymousContent(RawGeckoElementBorrowed aElement)
{
if (!aElement->HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) {
return false;
}
nsBindingManager* manager = aElement->OwnerDoc()->BindingManager();
nsXBLBinding* binding = manager->GetBindingWithContent(aElement);
return binding && binding->GetAnonymousContent();
}
RawGeckoNodeBorrowed
Gecko_GetNextStyleChild(StyleChildrenIteratorBorrowedMut aIterator)
{

View File

@ -155,6 +155,7 @@ void Gecko_LoadStyleSheet(mozilla::css::Loader* loader,
StyleChildrenIteratorOwnedOrNull Gecko_MaybeCreateStyleChildrenIterator(RawGeckoNodeBorrowed node);
void Gecko_DropStyleChildrenIterator(StyleChildrenIteratorOwned it);
RawGeckoNodeBorrowedOrNull Gecko_GetNextStyleChild(StyleChildrenIteratorBorrowedMut it);
bool Gecko_ElementHasBindingWithAnonymousContent(RawGeckoElementBorrowed element);
// Selector Matching.
uint64_t Gecko_ElementState(RawGeckoElementBorrowed element);