Bug 1390650: stylo: Remove some unused FFI functions. r?xidorn
MozReview-Commit-ID: K9fXGRmgkr4
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -113,28 +113,16 @@ ThreadSafeGetDefaultFontHelper(const nsP
}
void
AssertIsMainThreadOrServoLangFontPrefsCacheLocked()
{
MOZ_ASSERT(NS_IsMainThread() || sServoLangFontPrefsLock->LockedForWritingByCurrentThread());
}
-uint32_t
-Gecko_ChildrenCount(RawGeckoNodeBorrowed aNode)
-{
- return aNode->GetChildCount();
-}
-
-bool
-Gecko_NodeIsElement(RawGeckoNodeBorrowed aNode)
-{
- return aNode->IsElement();
-}
-
bool
Gecko_IsInDocument(RawGeckoNodeBorrowed aNode)
{
return aNode->IsInComposedDoc();
}
#ifdef MOZ_DEBUG_RUST
bool
@@ -295,27 +283,16 @@ void
Gecko_DestroyStyleChildrenIterator(
RawGeckoStyleChildrenIteratorBorrowedMut aIterator)
{
MOZ_ASSERT(aIterator);
aIterator->~StyleChildrenIterator();
}
-nsIContent*
-Gecko_ElementBindingAnonymousContent(RawGeckoElementBorrowed aElement)
-{
- MOZ_ASSERT(aElement->HasFlag(NODE_MAY_BE_IN_BINDING_MNGR));
- nsBindingManager* manager = aElement->OwnerDoc()->BindingManager();
- if (nsXBLBinding* binding = manager->GetBindingWithContent(aElement)) {
- return binding->GetAnonymousContent();
- }
- return nullptr;
-}
-
RawGeckoNodeBorrowed
Gecko_GetNextStyleChild(RawGeckoStyleChildrenIteratorBorrowedMut aIterator)
{
MOZ_ASSERT(aIterator);
return aIterator->GetNextChild();
}
bool
@@ -342,67 +319,36 @@ Gecko_ElementState(RawGeckoElementBorrow
EventStates::ServoType
Gecko_DocumentState(const nsIDocument* aDocument)
{
return aDocument->ThreadSafeGetDocumentState().ServoValue();
}
bool
-Gecko_IsTextNode(RawGeckoNodeBorrowed aNode)
-{
- return aNode->NodeInfo()->NodeType() == nsIDOMNode::TEXT_NODE;
-}
-
-bool
Gecko_IsRootElement(RawGeckoElementBorrowed aElement)
{
return aElement->OwnerDoc()->GetRootElement() == aElement;
}
bool
Gecko_MatchesElement(CSSPseudoClassType aType,
RawGeckoElementBorrowed aElement)
{
return nsCSSPseudoClasses::MatchesElement(aType, aElement).value();
}
nsIAtom*
-Gecko_LocalName(RawGeckoElementBorrowed aElement)
-{
- return aElement->NodeInfo()->NameAtom();
-}
-
-nsIAtom*
Gecko_Namespace(RawGeckoElementBorrowed aElement)
{
int32_t id = aElement->NodeInfo()->NamespaceID();
return nsContentUtils::NameSpaceManager()->NameSpaceURIAtomForServo(id);
}
-nsIAtom*
-Gecko_GetElementId(RawGeckoElementBorrowed aElement)
-{
- const nsAttrValue* attr = aElement->GetParsedAttr(nsGkAtoms::id);
- if (attr && attr->Type() == nsAttrValue::eAtom) {
- return attr->GetAtomValue();
- }
- // The only case in which we should have a non-atom value here is if it's the
- // empty string value.
- MOZ_ASSERT(!attr || attr->IsEmptyString());
- return nullptr;
-}
-
// Dirtiness tracking.
-uint32_t
-Gecko_GetNodeFlags(RawGeckoNodeBorrowed aNode)
-{
- return aNode->GetFlags();
-}
-
void
Gecko_SetNodeFlags(RawGeckoNodeBorrowed aNode, uint32_t aFlags)
{
const_cast<nsINode*>(aNode)->SetFlags(aFlags);
}
void
Gecko_UnsetNodeFlags(RawGeckoNodeBorrowed aNode, uint32_t aFlags)
@@ -472,22 +418,16 @@ Gecko_CalcStyleDifference(ServoStyleCont
const_cast<ServoStyleContext*>(aNewStyle),
&equalStructs,
&samePointerStructs,
relevantStructs);
*aAnyStyleChanged = equalStructs != NS_STYLE_INHERIT_MASK;
return result;
}
-nsChangeHint
-Gecko_HintsHandledForDescendants(nsChangeHint aHint)
-{
- return aHint & ~NS_HintsNotHandledForDescendantsIn(aHint);
-}
-
const ServoElementSnapshot*
Gecko_GetElementSnapshot(const ServoElementSnapshotTable* aTable,
const Element* aElement)
{
MOZ_ASSERT(aTable);
MOZ_ASSERT(aElement);
return aTable->Get(const_cast<Element*>(aElement));
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -131,18 +131,16 @@ struct FontSizePrefs
nscoord mDefaultSerifSize;
nscoord mDefaultSansSerifSize;
nscoord mDefaultMonospaceSize;
nscoord mDefaultCursiveSize;
nscoord mDefaultFantasySize;
};
// DOM Traversal.
-uint32_t Gecko_ChildrenCount(RawGeckoNodeBorrowed node);
-bool Gecko_NodeIsElement(RawGeckoNodeBorrowed node);
bool Gecko_IsInDocument(RawGeckoNodeBorrowed node);
bool Gecko_FlattenedTreeParentIsParent(RawGeckoNodeBorrowed node);
bool Gecko_IsSignificantChild(RawGeckoNodeBorrowed node,
bool text_is_significant,
bool whitespace_is_significant);
RawGeckoNodeBorrowedOrNull Gecko_GetLastChild(RawGeckoNodeBorrowed node);
RawGeckoNodeBorrowedOrNull Gecko_GetFlattenedTreeParentNode(RawGeckoNodeBorrowed node);
RawGeckoElementBorrowedOrNull Gecko_GetBeforeOrAfterPseudo(RawGeckoElementBorrowed element, bool is_before);
@@ -171,22 +169,19 @@ Gecko_LoadStyleSheet(mozilla::css::Loade
RawGeckoURLExtraData* base_url_data,
const uint8_t* url_bytes,
uint32_t url_length,
RawServoMediaListStrong media_list);
// Selector Matching.
uint64_t Gecko_ElementState(RawGeckoElementBorrowed element);
uint64_t Gecko_DocumentState(const nsIDocument* aDocument);
-bool Gecko_IsTextNode(RawGeckoNodeBorrowed node);
bool Gecko_IsRootElement(RawGeckoElementBorrowed element);
bool Gecko_MatchesElement(mozilla::CSSPseudoClassType type, RawGeckoElementBorrowed element);
-nsIAtom* Gecko_LocalName(RawGeckoElementBorrowed element);
nsIAtom* Gecko_Namespace(RawGeckoElementBorrowed element);
-nsIAtom* Gecko_GetElementId(RawGeckoElementBorrowed element);
bool Gecko_MatchLang(RawGeckoElementBorrowed element,
nsIAtom* override_lang, bool has_override_lang,
const char16_t* value);
nsIAtom* Gecko_GetXMLLangValue(RawGeckoElementBorrowed element);
nsIDocument::DocumentTheme Gecko_GetDocumentLWTheme(const nsIDocument* aDocument);
// Attributes.
#define SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(prefix_, implementor_) \
@@ -378,17 +373,16 @@ void Gecko_CopyCursorArrayFrom(nsStyleUs
const nsStyleUserInterface* src);
void Gecko_SetContentDataImageValue(nsStyleContentData* aList,
mozilla::css::ImageValue* aImageValue);
nsStyleContentData::CounterFunction* Gecko_SetCounterFunction(
nsStyleContentData* content_data, nsStyleContentType type);
// Dirtiness tracking.
-uint32_t Gecko_GetNodeFlags(RawGeckoNodeBorrowed node);
void Gecko_SetNodeFlags(RawGeckoNodeBorrowed node, uint32_t flags);
void Gecko_UnsetNodeFlags(RawGeckoNodeBorrowed node, uint32_t flags);
void Gecko_NoteDirtyElement(RawGeckoElementBorrowed element);
void Gecko_NoteAnimationOnlyDirtyElement(RawGeckoElementBorrowed element);
// Incremental restyle.
// Also, we might want a ComputedValues to ComputedValues API for animations?
// Not if we do them in Gecko...
@@ -397,17 +391,16 @@ nsStyleContext* Gecko_GetStyleContext(Ra
mozilla::CSSPseudoElementType Gecko_GetImplementedPseudo(RawGeckoElementBorrowed element);
// We'd like to return `nsChangeHint` here, but bindgen bitfield enums don't
// work as return values with the Linux 32-bit ABI at the moment because
// they wrap the value in a struct.
uint32_t Gecko_CalcStyleDifference(ServoStyleContextBorrowed old_style,
ServoStyleContextBorrowed new_style,
uint64_t old_style_bits,
bool* any_style_changed);
-nsChangeHint Gecko_HintsHandledForDescendants(nsChangeHint aHint);
// Get an element snapshot for a given element from the table.
const ServoElementSnapshot*
Gecko_GetElementSnapshot(const mozilla::ServoElementSnapshotTable* table,
RawGeckoElementBorrowed element);
void Gecko_DropElementSnapshot(ServoElementSnapshotOwned snapshot);