Bug 1596506 - Remove special-case for <xul:label> accesskey. r=smaug

We don't have any NAC which is a <xul:label>. We could keep it for shadow dom but it
doesn't seem to me like this code is working correctly.

nsXULLabelFrame::RegUnregAccessKey doesn't have similar code, and uses the
<label> node to register / unregister.

Finally, we do have non-anon labels, and those would be broken... So just
remove the special-case.

Depends on D53058

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-11-14 22:03:00 +00:00
Родитель 7b02559d06
Коммит 31001a6ef8
1 изменённых файлов: 3 добавлений и 18 удалений

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

@ -707,24 +707,9 @@ void nsXULElement::UnregisterAccessKey(const nsAString& aOldValue) {
//
Document* doc = GetComposedDoc();
if (doc && !aOldValue.IsEmpty()) {
PresShell* presShell = doc->GetPresShell();
if (presShell) {
Element* element = this;
// find out what type of content node this is
if (mNodeInfo->Equals(nsGkAtoms::label)) {
// For anonymous labels the unregistering must
// occur on the binding parent control.
// XXXldb: And what if the binding parent is null?
nsIContent* bindingParent = GetBindingParent();
element = bindingParent ? bindingParent->AsElement() : nullptr;
}
if (element) {
presShell->GetPresContext()->EventStateManager()->UnregisterAccessKey(
element, aOldValue.First());
}
if (PresShell* presShell = doc->GetPresShell()) {
presShell->GetPresContext()->EventStateManager()->UnregisterAccessKey(
this, aOldValue.First());
}
}
}