Bug 778654 - Implement and move tabIndex functions to Element class to avoid duplicate work.r=peterv,heycam

MozReview-Commit-ID: uetkJztNcn
This commit is contained in:
Daosheng Mu
2016-05-24 12:22:17 +08:00
parent a14a729d99
commit 81d88710d1
10 changed files with 107 additions and 74 deletions

View File

@@ -2582,34 +2582,6 @@ nsGenericHTMLFormElement::IsLabelable() const
//----------------------------------------------------------------------
void
nsGenericHTMLElement::Blur(mozilla::ErrorResult& aError)
{
if (!ShouldBlur(this)) {
return;
}
nsIDocument* doc = GetComposedDoc();
if (!doc) {
return;
}
nsPIDOMWindowOuter* win = doc->GetWindow();
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (win && fm) {
aError = fm->ClearFocus(win);
}
}
void
nsGenericHTMLElement::Focus(ErrorResult& aError)
{
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm) {
aError = fm->SetFocus(this, 0);
}
}
void
nsGenericHTMLElement::Click()
{