mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-28 01:57:30 +09:00
Issue #2488 - Part 1b: Move PseudoElementType getter/setter implementation of Element away from header
This commit is contained in:
parent
d922a18efb
commit
63076e4211
2 changed files with 23 additions and 17 deletions
|
|
@ -1485,6 +1485,27 @@ Element::GetElementsByClassName(const nsAString& aClassNames,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CSSPseudoElementType
|
||||||
|
Element::GetPseudoElementType() const {
|
||||||
|
if (!HasProperties()) {
|
||||||
|
return CSSPseudoElementType::NotPseudo;
|
||||||
|
}
|
||||||
|
nsresult rv = NS_OK;
|
||||||
|
auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv);
|
||||||
|
if (rv == NS_PROPTABLE_PROP_NOT_THERE) {
|
||||||
|
return CSSPseudoElementType::NotPseudo;
|
||||||
|
}
|
||||||
|
return CSSPseudoElementType(reinterpret_cast<uintptr_t>(raw));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Element::SetPseudoElementType(CSSPseudoElementType aPseudo) {
|
||||||
|
static_assert(sizeof(CSSPseudoElementType) <= sizeof(uintptr_t),
|
||||||
|
"Need to be able to store this in a void*");
|
||||||
|
MOZ_ASSERT(aPseudo != CSSPseudoElementType::NotPseudo);
|
||||||
|
SetProperty(nsGkAtoms::pseudoProperty, reinterpret_cast<void*>(aPseudo));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the count of descendants (inclusive of aContent) in
|
* Returns the count of descendants (inclusive of aContent) in
|
||||||
* the uncomposed document that are explicitly set as editable.
|
* the uncomposed document that are explicitly set as editable.
|
||||||
|
|
|
||||||
|
|
@ -814,24 +814,9 @@ public:
|
||||||
already_AddRefed<nsIHTMLCollection>
|
already_AddRefed<nsIHTMLCollection>
|
||||||
GetElementsByClassName(const nsAString& aClassNames);
|
GetElementsByClassName(const nsAString& aClassNames);
|
||||||
|
|
||||||
CSSPseudoElementType GetPseudoElementType() const {
|
CSSPseudoElementType GetPseudoElementType() const;
|
||||||
if (!HasProperties()) {
|
|
||||||
return CSSPseudoElementType::NotPseudo;
|
|
||||||
}
|
|
||||||
nsresult rv = NS_OK;
|
|
||||||
auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv);
|
|
||||||
if (rv == NS_PROPTABLE_PROP_NOT_THERE) {
|
|
||||||
return CSSPseudoElementType::NotPseudo;
|
|
||||||
}
|
|
||||||
return CSSPseudoElementType(reinterpret_cast<uintptr_t>(raw));
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetPseudoElementType(CSSPseudoElementType aPseudo) {
|
void SetPseudoElementType(CSSPseudoElementType aPseudo);
|
||||||
static_assert(sizeof(CSSPseudoElementType) <= sizeof(uintptr_t),
|
|
||||||
"Need to be able to store this in a void*");
|
|
||||||
MOZ_ASSERT(aPseudo != CSSPseudoElementType::NotPseudo);
|
|
||||||
SetProperty(nsGkAtoms::pseudoProperty, reinterpret_cast<void*>(aPseudo));
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue