From 4817516f622850b20921077614420353fa5b1e87 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 13 Jul 2017 23:45:49 -0400 Subject: [PATCH] Bug 1380393 part 2. Remove nsIDOMHTMLElement.tabIndex. r=mccr8 --- dom/html/HTMLObjectElement.cpp | 4 ++-- dom/html/HTMLSharedObjectElement.cpp | 2 +- dom/html/nsGenericHTMLElement.h | 9 --------- dom/interfaces/html/nsIDOMHTMLElement.idl | 1 - layout/forms/nsFileControlFrame.cpp | 5 ++--- layout/forms/nsNumberControlFrame.cpp | 5 ++--- 6 files changed, 7 insertions(+), 19 deletions(-) diff --git a/dom/html/HTMLObjectElement.cpp b/dom/html/HTMLObjectElement.cpp index 100f022ce9ce..91791c0c795b 100644 --- a/dom/html/HTMLObjectElement.cpp +++ b/dom/html/HTMLObjectElement.cpp @@ -361,7 +361,7 @@ HTMLObjectElement::IsHTMLFocusable(bool aWithMouse, nsIDocument *doc = GetComposedDoc(); if (!doc || doc->HasFlag(NODE_IS_EDITABLE)) { if (aTabIndex) { - GetTabIndex(aTabIndex); + *aTabIndex = TabIndex(); } *aIsFocusable = false; @@ -377,7 +377,7 @@ HTMLObjectElement::IsHTMLFocusable(bool aWithMouse, // Has plugin content: let the plugin decide what to do in terms of // internal focus from mouse clicks if (aTabIndex) { - GetTabIndex(aTabIndex); + *aTabIndex = TabIndex(); } *aIsFocusable = true; diff --git a/dom/html/HTMLSharedObjectElement.cpp b/dom/html/HTMLSharedObjectElement.cpp index 132cc598fb85..a310aaa9770b 100644 --- a/dom/html/HTMLSharedObjectElement.cpp +++ b/dom/html/HTMLSharedObjectElement.cpp @@ -224,7 +224,7 @@ HTMLSharedObjectElement::IsHTMLFocusable(bool aWithMouse, // Has plugin content: let the plugin decide what to do in terms of // internal focus from mouse clicks if (aTabIndex) { - GetTabIndex(aTabIndex); + *aTabIndex = TabIndex(); } *aIsFocusable = true; diff --git a/dom/html/nsGenericHTMLElement.h b/dom/html/nsGenericHTMLElement.h index a5c334b2486d..3d8a6c36c916 100644 --- a/dom/html/nsGenericHTMLElement.h +++ b/dom/html/nsGenericHTMLElement.h @@ -306,15 +306,6 @@ public: *aOffsetHeight = OffsetHeight(); return NS_OK; } - NS_IMETHOD GetTabIndex(int32_t* aTabIndex) final override { - *aTabIndex = TabIndex(); - return NS_OK; - } - NS_IMETHOD SetTabIndex(int32_t aTabIndex) final override { - mozilla::ErrorResult rv; - SetTabIndex(aTabIndex, rv); - return rv.StealNSResult(); - } NS_IMETHOD Focus() final override { mozilla::ErrorResult rv; Focus(rv); diff --git a/dom/interfaces/html/nsIDOMHTMLElement.idl b/dom/interfaces/html/nsIDOMHTMLElement.idl index 2a0ac119871d..e36308233cb2 100644 --- a/dom/interfaces/html/nsIDOMHTMLElement.idl +++ b/dom/interfaces/html/nsIDOMHTMLElement.idl @@ -22,7 +22,6 @@ interface nsIDOMHTMLMenuElement; [uuid(b0c42392-d0e7-4f6a-beb5-a698ce648945)] interface nsIDOMHTMLElement : nsIDOMElement { - attribute long tabIndex; void focus(); attribute DOMString accessKey; readonly attribute boolean draggable; diff --git a/layout/forms/nsFileControlFrame.cpp b/layout/forms/nsFileControlFrame.cpp index 228aac1e8ce9..9c076f5db209 100644 --- a/layout/forms/nsFileControlFrame.cpp +++ b/layout/forms/nsFileControlFrame.cpp @@ -116,9 +116,8 @@ MakeAnonButton(nsIDocument* aDoc, const char* labelKey, // Both elements are given the same tab index so that the user can tab // to the file control at the correct index, and then between the two // buttons. - int32_t tabIndex; - aInputElement->GetTabIndex(&tabIndex); - buttonElement->SetTabIndex(tabIndex); + IgnoredErrorResult ignored; + buttonElement->SetTabIndex(aInputElement->TabIndex(), ignored); return button.forget(); } diff --git a/layout/forms/nsNumberControlFrame.cpp b/layout/forms/nsNumberControlFrame.cpp index c2c31ef40998..e0a89207528b 100644 --- a/layout/forms/nsNumberControlFrame.cpp +++ b/layout/forms/nsNumberControlFrame.cpp @@ -401,9 +401,8 @@ nsNumberControlFrame::CreateAnonymousContent(nsTArray& aElements) } // Propogate our tabindex: - int32_t tabIndex; - content->GetTabIndex(&tabIndex); - textField->SetTabIndex(tabIndex); + IgnoredErrorResult ignored; + textField->SetTabIndex(content->TabIndex(), ignored); // Initialize the text field's placeholder, if ours is set: nsAutoString placeholder;