Bug 1487313 - stop using nsIDOMXULLabelElement and nsIDOMXULDescriptionElement in a11y, r=jamie

This commit is contained in:
Alexander Surkov 2018-08-31 09:17:38 +08:00
Родитель 796d9f80d3
Коммит ef0cc6d04c
2 изменённых файлов: 5 добавлений и 9 удалений

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

@ -32,7 +32,6 @@
#include "XULDocument.h"
#include "nsIDOMXULButtonElement.h"
#include "nsIDOMXULLabelElement.h"
#include "nsIDOMXULSelectCntrlEl.h"
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsINodeList.h"
@ -823,17 +822,15 @@ Accessible::XULElmName(DocAccessible* aDocument,
// CASES #2 and #3 ------ label as a child or <label control="id" ... > </label>
if (aName.IsEmpty()) {
Accessible* labelAcc = nullptr;
Accessible* label = nullptr;
XULLabelIterator iter(aDocument, aElm);
while ((labelAcc = iter.Next())) {
nsCOMPtr<nsIDOMXULLabelElement> xulLabel =
do_QueryInterface(labelAcc->GetContent());
while ((label = iter.Next())) {
// Check if label's value attribute is used
if (xulLabel && NS_SUCCEEDED(xulLabel->GetValue(aName)) && aName.IsEmpty()) {
label->Elm()->GetAttr(kNameSpaceID_None, nsGkAtoms::value, aName);
if (aName.IsEmpty()) {
// If no value attribute, a non-empty label must contain
// children that define its text -- possibly using HTML
nsTextEquivUtils::
AppendTextEquivFromContent(labelAcc, labelAcc->GetContent(), &aName);
nsTextEquivUtils::AppendTextEquivFromContent(label, label->Elm(), &aName);
}
}
}

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

@ -20,7 +20,6 @@
#include "Logging.h"
#endif
#include "nsIDOMXULDescriptionElement.h"
#include "nsNameSpaceManager.h"
#include "nsNetUtil.h"
#include "nsString.h"