Bug 1625809 - Remove nsFileControlFrame::AttributeChanged. r=smaug

Syncing tabindex in that attribute callback was wrong since bug 505355.

Differential Revision: https://phabricator.services.mozilla.com/D68740

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2020-03-30 16:49:56 +00:00
Родитель 5af09e6675
Коммит bc0214cf17
2 изменённых файлов: 3 добавлений и 21 удалений

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

@ -232,9 +232,7 @@ static already_AddRefed<Element> MakeAnonButton(Document* aDoc,
// Make sure access key and tab order for the element actually redirect to the
// file picking button.
RefPtr<HTMLButtonElement> buttonElement =
HTMLButtonElement::FromNodeOrNull(button);
auto* buttonElement = HTMLButtonElement::FromNode(button);
if (!aAccessKey.IsEmpty()) {
buttonElement->SetAccessKey(aAccessKey, IgnoreErrors());
}
@ -545,22 +543,6 @@ void nsFileControlFrame::SyncDisabledState() {
}
}
nsresult nsFileControlFrame::AttributeChanged(int32_t aNameSpaceID,
nsAtom* aAttribute,
int32_t aModType) {
if (aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::tabindex) {
if (aModType == MutationEvent_Binding::REMOVAL) {
mBrowseFilesOrDirs->UnsetAttr(aNameSpaceID, aAttribute, true);
} else {
nsAutoString value;
mContent->AsElement()->GetAttr(aNameSpaceID, aAttribute, value);
mBrowseFilesOrDirs->SetAttr(aNameSpaceID, aAttribute, value, true);
}
}
return nsBlockFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType);
}
void nsFileControlFrame::ContentStatesChanged(EventStates aStates) {
if (aStates.HasState(NS_EVENT_STATE_DISABLED)) {
nsContentUtils::AddScriptRunner(new SyncDisabledStateEvent(this));

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

@ -25,6 +25,8 @@ class DataTransfer;
class nsFileControlFrame final : public nsBlockFrame,
public nsIFormControlFrame,
public nsIAnonymousContentCreator {
using Element = mozilla::dom::Element;
public:
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS(nsFileControlFrame)
@ -57,8 +59,6 @@ class nsFileControlFrame final : public nsBlockFrame,
virtual nsresult GetFrameName(nsAString& aResult) const override;
#endif
nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
int32_t aModType) override;
virtual void ContentStatesChanged(mozilla::EventStates aStates) override;
// nsIAnonymousContentCreator