Issue #2112 - Part 2: Stub out Servo functions

This commit is contained in:
FranklinDM 2024-03-24 20:28:40 +08:00 • committed by roytam1
commit 88ac168f96
8 changed files with 77 additions and 1228 deletions

View file

@ -16,30 +16,11 @@ ServoElementSnapshot::ServoElementSnapshot(Element* aElement)
, mExplicitRestyleHint(nsRestyleHint(0))
, mExplicitChangeHint(nsChangeHint(0))
{
mIsHTMLElementInHTMLDocument =
aElement->IsHTMLElement() && aElement->IsInHTMLDocument();
mIsInChromeDocument =
nsContentUtils::IsChromeDoc(aElement->OwnerDoc());
}
void
ServoElementSnapshot::AddAttrs(Element* aElement)
{
MOZ_ASSERT(aElement);
if (HasAny(Flags::Attributes)) {
return;
}
uint32_t attrCount = aElement->GetAttrCount();
const nsAttrName* attrName;
for (uint32_t i = 0; i < attrCount; ++i) {
attrName = aElement->GetAttrNameAt(i);
const nsAttrValue* attrValue =
aElement->GetParsedAttr(attrName->LocalName(), attrName->NamespaceID());
mAttrs.AppendElement(ServoAttrSnapshot(*attrName, *attrValue));
}
mContains |= Flags::Attributes;
}
} // namespace mozilla