Bug 1825825 - Remove ShadowRoot::mIsUAWidget. r=smaug

We can just use the node flag.

Differential Revision: https://phabricator.services.mozilla.com/D174316
This commit is contained in:
Emilio Cobos Álvarez 2023-04-03 09:21:34 +00:00
Родитель 15d8aed661
Коммит 3864011350
2 изменённых файлов: 15 добавлений и 22 удалений

Просмотреть файл

@ -58,7 +58,6 @@ ShadowRoot::ShadowRoot(Element* aElement, ShadowRootMode aMode,
mMode(aMode),
mDelegatesFocus(aDelegatesFocus),
mSlotAssignment(aSlotAssignment),
mIsUAWidget(false),
mIsDetailsShadowTree(aElement->IsHTMLElement(nsGkAtoms::details)),
mIsAvailableToElementInternals(false) {
SetHost(aElement);
@ -746,7 +745,7 @@ Element* ShadowRoot::GetActiveElement() {
nsINode* ShadowRoot::ImportNodeAndAppendChildAt(nsINode& aParentNode,
nsINode& aNode, bool aDeep,
mozilla::ErrorResult& rv) {
MOZ_ASSERT(mIsUAWidget);
MOZ_ASSERT(IsUAWidget());
if (!aParentNode.IsInUAWidget()) {
rv.Throw(NS_ERROR_INVALID_ARG);
@ -764,7 +763,7 @@ nsINode* ShadowRoot::ImportNodeAndAppendChildAt(nsINode& aParentNode,
nsINode* ShadowRoot::CreateElementAndAppendChildAt(nsINode& aParentNode,
const nsAString& aTagName,
mozilla::ErrorResult& rv) {
MOZ_ASSERT(mIsUAWidget);
MOZ_ASSERT(IsUAWidget());
if (!aParentNode.IsInUAWidget()) {
rv.Throw(NS_ERROR_INVALID_ARG);

Просмотреть файл

@ -218,12 +218,11 @@ class ShadowRoot final : public DocumentFragment,
const nsAString& aTagName,
mozilla::ErrorResult& rv);
bool IsUAWidget() const { return mIsUAWidget; }
bool IsUAWidget() const { return HasBeenInUAWidget(); }
void SetIsUAWidget() {
MOZ_ASSERT(!HasChildren());
SetFlags(NODE_HAS_BEEN_IN_UA_WIDGET);
mIsUAWidget = true;
}
bool IsAvailableToElementInternals() const {
@ -241,12 +240,11 @@ class ShadowRoot final : public DocumentFragment,
nsIRadioVisitor* aVisitor) override {
return DocumentOrShadowRoot::WalkRadioGroup(aName, aVisitor);
}
virtual void SetCurrentRadioButton(const nsAString& aName,
HTMLInputElement* aRadio) override {
void SetCurrentRadioButton(const nsAString& aName,
HTMLInputElement* aRadio) override {
DocumentOrShadowRoot::SetCurrentRadioButton(aName, aRadio);
}
virtual HTMLInputElement* GetCurrentRadioButton(
const nsAString& aName) override {
HTMLInputElement* GetCurrentRadioButton(const nsAString& aName) override {
return DocumentOrShadowRoot::GetCurrentRadioButton(aName);
}
NS_IMETHOD
@ -256,27 +254,25 @@ class ShadowRoot final : public DocumentFragment,
return DocumentOrShadowRoot::GetNextRadioButton(aName, aPrevious,
aFocusedRadio, aRadioOut);
}
virtual void AddToRadioGroup(const nsAString& aName,
HTMLInputElement* aRadio) override {
void AddToRadioGroup(const nsAString& aName,
HTMLInputElement* aRadio) override {
DocumentOrShadowRoot::AddToRadioGroup(aName, aRadio);
}
virtual void RemoveFromRadioGroup(const nsAString& aName,
HTMLInputElement* aRadio) override {
void RemoveFromRadioGroup(const nsAString& aName,
HTMLInputElement* aRadio) override {
DocumentOrShadowRoot::RemoveFromRadioGroup(aName, aRadio);
}
virtual uint32_t GetRequiredRadioCount(
const nsAString& aName) const override {
uint32_t GetRequiredRadioCount(const nsAString& aName) const override {
return DocumentOrShadowRoot::GetRequiredRadioCount(aName);
}
virtual void RadioRequiredWillChange(const nsAString& aName,
bool aRequiredAdded) override {
void RadioRequiredWillChange(const nsAString& aName,
bool aRequiredAdded) override {
DocumentOrShadowRoot::RadioRequiredWillChange(aName, aRequiredAdded);
}
virtual bool GetValueMissingState(const nsAString& aName) const override {
bool GetValueMissingState(const nsAString& aName) const override {
return DocumentOrShadowRoot::GetValueMissingState(aName);
}
virtual void SetValueMissingState(const nsAString& aName,
bool aValue) override {
void SetValueMissingState(const nsAString& aName, bool aValue) override {
return DocumentOrShadowRoot::SetValueMissingState(aName, aValue);
}
@ -306,8 +302,6 @@ class ShadowRoot final : public DocumentFragment,
// tree.
nsTArray<const Element*> mParts;
bool mIsUAWidget : 1;
// Whether this is the <details> internal shadow tree.
bool mIsDetailsShadowTree : 1;