Bug 1914321 - Clean-up a tiny bit nsXMLElement. r=smaug

I didn't end up using it (for now at least), but worth landing.

Differential Revision: https://phabricator.services.mozilla.com/D228254
This commit is contained in:
Emilio Cobos Álvarez 2024-11-06 23:38:13 +00:00
parent c00f45c2e5
commit 5e5938bc73
4 changed files with 8 additions and 13 deletions

View File

@ -616,6 +616,10 @@ void Element::ClearStyleStateLocks() {
/* virtual */
nsINode* Element::GetScopeChainParent() const { return OwnerDoc(); }
JSObject* Element::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
return Element_Binding::Wrap(aCx, this, aGivenProto);
}
nsDOMTokenList* Element::ClassList() {
nsDOMSlots* slots = DOMSlots();
if (!slots->mClassList) {

View File

@ -1738,6 +1738,8 @@ class Element : public FragmentOrElement {
nsINode* GetScopeChainParent() const override;
JSObject* WrapNode(JSContext*, JS::Handle<JSObject*> aGivenProto) override;
/**
* Locate a TextEditor rooted at this content node, if there is one.
*/

View File

@ -23,11 +23,6 @@ nsresult NS_NewXMLElement(
return NS_OK;
}
JSObject* nsXMLElement::WrapNode(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) {
return Element_Binding::Wrap(aCx, this, aGivenProto);
}
void nsXMLElement::UnbindFromTree(UnbindContext& aContext) {
nsAtom* property;
switch (GetPseudoElementType()) {

View File

@ -7,9 +7,7 @@
#ifndef nsXMLElement_h___
#define nsXMLElement_h___
#include "mozilla/Attributes.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/DOMRect.h"
class nsXMLElement : public mozilla::dom::Element {
public:
@ -20,16 +18,12 @@ class nsXMLElement : public mozilla::dom::Element {
NS_INLINE_DECL_REFCOUNTING_INHERITED(nsXMLElement, mozilla::dom::Element)
// nsINode interface methods
virtual nsresult Clone(mozilla::dom::NodeInfo*,
nsINode** aResult) const override;
nsresult Clone(mozilla::dom::NodeInfo*, nsINode** aResult) const override;
virtual void UnbindFromTree(UnbindContext&) override;
void UnbindFromTree(UnbindContext&) override;
protected:
virtual ~nsXMLElement() = default;
virtual JSObject* WrapNode(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
};
#endif // nsXMLElement_h___