Skip to content

Commit

Permalink
Merge inbound to m-c a=merge CLOSED TREE
Browse files Browse the repository at this point in the history
  • Loading branch information
KWierso committed Mar 4, 2015
2 parents 6541acd + ccaa5f9 commit 01e006a
Show file tree
Hide file tree
Showing 644 changed files with 20,887 additions and 4,549 deletions.
24 changes: 11 additions & 13 deletions accessible/base/AccIterator.cpp
Expand Up @@ -141,7 +141,7 @@ HTMLLabelIterator::Next()
// element, or <label> ancestor which implicitly point to it.
Accessible* label = nullptr;
while ((label = mRelIter.Next())) {
if (label->GetContent()->Tag() == nsGkAtoms::label)
if (label->GetContent()->IsHTMLElement(nsGkAtoms::label))
return label;
}

Expand All @@ -155,17 +155,15 @@ HTMLLabelIterator::Next()
Accessible* walkUp = mAcc->Parent();
while (walkUp && !walkUp->IsDoc()) {
nsIContent* walkUpElm = walkUp->GetContent();
if (walkUpElm->IsHTML()) {
if (walkUpElm->Tag() == nsGkAtoms::label &&
!walkUpElm->HasAttr(kNameSpaceID_None, nsGkAtoms::_for)) {
mLabelFilter = eSkipAncestorLabel; // prevent infinite loop
return walkUp;
}

if (walkUpElm->Tag() == nsGkAtoms::form)
break;
if (walkUpElm->IsHTMLElement(nsGkAtoms::label) &&
!walkUpElm->HasAttr(kNameSpaceID_None, nsGkAtoms::_for)) {
mLabelFilter = eSkipAncestorLabel; // prevent infinite loop
return walkUp;
}

if (walkUpElm->IsHTMLElement(nsGkAtoms::form))
break;

walkUp = walkUp->Parent();
}

Expand All @@ -188,7 +186,7 @@ HTMLOutputIterator::Next()
{
Accessible* output = nullptr;
while ((output = mRelIter.Next())) {
if (output->GetContent()->Tag() == nsGkAtoms::output)
if (output->GetContent()->IsHTMLElement(nsGkAtoms::output))
return output;
}

Expand All @@ -211,7 +209,7 @@ XULLabelIterator::Next()
{
Accessible* label = nullptr;
while ((label = mRelIter.Next())) {
if (label->GetContent()->Tag() == nsGkAtoms::label)
if (label->GetContent()->IsXULElement(nsGkAtoms::label))
return label;
}

Expand All @@ -234,7 +232,7 @@ XULDescriptionIterator::Next()
{
Accessible* descr = nullptr;
while ((descr = mRelIter.Next())) {
if (descr->GetContent()->Tag() == nsGkAtoms::description)
if (descr->GetContent()->IsXULElement(nsGkAtoms::description))
return descr;
}

Expand Down
2 changes: 1 addition & 1 deletion accessible/base/Logging.cpp
Expand Up @@ -713,7 +713,7 @@ logging::Node(const char* aDescr, nsINode* aNode)
dom::Element* elm = aNode->AsElement();

nsAutoCString tag;
elm->Tag()->ToUTF8String(tag);
elm->NodeInfo()->NameAtom()->ToUTF8String(tag);

nsIAtom* idAtom = elm->GetID();
nsAutoCString id;
Expand Down
7 changes: 3 additions & 4 deletions accessible/base/TextAttrs.cpp
Expand Up @@ -872,11 +872,10 @@ TextAttrsMgr::TextPosTextAttr::
}

const nsIContent* content = aFrame->GetContent();
if (content && content->IsHTML()) {
const nsIAtom* tagName = content->Tag();
if (tagName == nsGkAtoms::sup)
if (content) {
if (content->IsHTMLElement(nsGkAtoms::sup))
return eTextPosSuper;
if (tagName == nsGkAtoms::sub)
if (content->IsHTMLElement(nsGkAtoms::sub))
return eTextPosSub;
}

Expand Down
103 changes: 52 additions & 51 deletions accessible/base/nsAccessibilityService.cpp
Expand Up @@ -893,15 +893,15 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,

#ifdef DEBUG
nsImageFrame* imageFrame = do_QueryFrame(frame);
NS_ASSERTION(imageFrame && content->IsHTML() && content->Tag() == nsGkAtoms::area,
NS_ASSERTION(imageFrame && content->IsHTMLElement(nsGkAtoms::area),
"Unknown case of not main content for the frame!");
#endif
return nullptr;
}

#ifdef DEBUG
nsImageFrame* imageFrame = do_QueryFrame(frame);
NS_ASSERTION(!imageFrame || !content->IsHTML() || content->Tag() != nsGkAtoms::area,
NS_ASSERTION(!imageFrame || !content->IsHTMLElement(nsGkAtoms::area),
"Image map manages the area accessible creation!");
#endif

Expand Down Expand Up @@ -931,8 +931,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
return newAcc;
}

bool isHTML = content->IsHTML();
if (isHTML && content->Tag() == nsGkAtoms::map) {
if (content->IsHTMLElement(nsGkAtoms::map)) {
// Create hyper text accessible for HTML map if it is used to group links
// (see http://www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass). If the HTML
// map rect is empty then it is used for links grouping. Otherwise it should
Expand Down Expand Up @@ -971,7 +970,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
roleMapEntry = nullptr;
}

if (!newAcc && isHTML) { // HTML accessibles
if (!newAcc && content->IsHTMLElement()) { // HTML accessibles
bool isARIATableOrCell = roleMapEntry &&
(roleMapEntry->accTypes & (eTableCell | eTable));

Expand Down Expand Up @@ -1009,9 +1008,9 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
aContext->ARIARoleMap() == &aria::gEmptyRoleMap) {
roleMapEntry = &aria::gEmptyRoleMap;

} else if (content->Tag() == nsGkAtoms::dt ||
content->Tag() == nsGkAtoms::li ||
content->Tag() == nsGkAtoms::dd ||
} else if (content->IsAnyOfHTMLElements(nsGkAtoms::dt,
nsGkAtoms::li,
nsGkAtoms::dd) ||
frame->AccessibleType() == eHTMLLiType) {
nsRoleMapEntry* contextRoleMap = aContext->ARIARoleMap();
if (!contextRoleMap->IsOfType(eList))
Expand All @@ -1021,7 +1020,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
}

// Accessible XBL types and deck stuff are used in XUL only currently.
if (!newAcc && content->IsXUL()) {
if (!newAcc && content->IsXULElement()) {
// No accessible for not selected deck panel and its children.
if (!aContext->IsXULTabpanels()) {
nsDeckFrame* deckFrame = do_QueryFrame(frame->GetParent());
Expand Down Expand Up @@ -1050,18 +1049,18 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
}

if (!newAcc) {
if (content->IsSVG()) {
if (content->IsSVGElement()) {
nsSVGPathGeometryFrame* pathGeometryFrame = do_QueryFrame(frame);
if (pathGeometryFrame) {
// A graphic elements: rect, circle, ellipse, line, path, polygon,
// polyline and image. A 'use' and 'text' graphic elements require
// special support.
newAcc = new EnumRoleAccessible(content, document, roles::GRAPHIC);
} else if (content->Tag() == nsGkAtoms::svg) {
} else if (content->IsSVGElement(nsGkAtoms::svg)) {
newAcc = new EnumRoleAccessible(content, document, roles::DIAGRAM);
}
} else if (content->IsMathML()){
if (content->Tag() == nsGkAtoms::math)
} else if (content->IsMathMLElement()) {
if (content->IsMathMLElement(nsGkAtoms::math))
newAcc = new EnumRoleAccessible(content, document, roles::EQUATION);
else
newAcc = new HyperTextAccessible(content, document);
Expand All @@ -1072,13 +1071,15 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// of some property that makes this object interesting
// We don't do this for <body>, <html>, <window>, <dialog> etc. which
// correspond to the doc accessible and will be created in any case
if (!newAcc && content->Tag() != nsGkAtoms::body && content->GetParent() &&
if (!newAcc && !content->IsHTMLElement(nsGkAtoms::body) &&
content->GetParent() &&
(roleMapEntry || MustBeAccessible(content, document) ||
(isHTML && nsCoreUtils::HasClickListener(content)))) {
(content->IsHTMLElement() &&
nsCoreUtils::HasClickListener(content)))) {
// This content is focusable or has an interesting dynamic content accessibility property.
// If it's interesting we need it in the accessibility hierarchy so that events or
// other accessibles can point to it, or so that it can hold a state, etc.
if (isHTML) {
if (content->IsHTMLElement()) {
// Interesting HTML container which may have selectable text and/or embedded objects
newAcc = new HyperTextAccessibleWrap(content, document);
} else { // XUL, SVG, MathML etc.
Expand Down Expand Up @@ -1264,7 +1265,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,

for (nsIContent* child = listItem->GetFirstChild(); child;
child = child->GetNextSibling()) {
if (child->IsXUL(nsGkAtoms::listcell) && child != aContent) {
if (child->IsXULElement(nsGkAtoms::listcell) && child != aContent) {
accessible = new XULListCellAccessibleWrap(aContent, aDoc);
break;
}
Expand Down Expand Up @@ -1296,7 +1297,7 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
// implementations on each platform for a consistent scripting environment, but
// then strip out redundant accessibles in the AccessibleWrap class for each platform.
nsIContent *parent = aContent->GetParent();
if (parent && parent->IsXUL() && parent->Tag() == nsGkAtoms::menu)
if (parent && parent->IsXULElement(nsGkAtoms::menu))
return nullptr;
#endif

Expand Down Expand Up @@ -1390,45 +1391,45 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
}

// This method assumes we're in an HTML namespace.
nsIAtom* tag = aContent->Tag();
if (tag == nsGkAtoms::figcaption) {
if (aContent->IsHTMLElement(nsGkAtoms::figcaption)) {
nsRefPtr<Accessible> accessible =
new HTMLFigcaptionAccessible(aContent, document);
return accessible.forget();
}

if (tag == nsGkAtoms::figure) {
if (aContent->IsHTMLElement(nsGkAtoms::figure)) {
nsRefPtr<Accessible> accessible =
new HTMLFigureAccessible(aContent, document);
return accessible.forget();
}

if (tag == nsGkAtoms::legend) {
if (aContent->IsHTMLElement(nsGkAtoms::legend)) {
nsRefPtr<Accessible> accessible =
new HTMLLegendAccessible(aContent, document);
return accessible.forget();
}

if (tag == nsGkAtoms::option) {
if (aContent->IsHTMLElement(nsGkAtoms::option)) {
nsRefPtr<Accessible> accessible =
new HTMLSelectOptionAccessible(aContent, document);
return accessible.forget();
}

if (tag == nsGkAtoms::optgroup) {
if (aContent->IsHTMLElement(nsGkAtoms::optgroup)) {
nsRefPtr<Accessible> accessible =
new HTMLSelectOptGroupAccessible(aContent, document);
return accessible.forget();
}

if (tag == nsGkAtoms::ul || tag == nsGkAtoms::ol ||
tag == nsGkAtoms::dl) {
if (aContent->IsAnyOfHTMLElements(nsGkAtoms::ul,
nsGkAtoms::ol,
nsGkAtoms::dl)) {
nsRefPtr<Accessible> accessible =
new HTMLListAccessible(aContent, document);
return accessible.forget();
}

if (tag == nsGkAtoms::a) {
if (aContent->IsHTMLElement(nsGkAtoms::a)) {
// Only some roles truly enjoy life as HTMLLinkAccessibles, for details
// see closed bug 494807.
nsRoleMapEntry* roleMapEntry = aria::GetRoleMap(aContent);
Expand All @@ -1449,13 +1450,13 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
// it unconditionally by tag name. nsBlockFrame creates the list item
// accessible for other elements styled as list items.
if (aContext->GetContent() == aContent->GetParent()) {
if (tag == nsGkAtoms::dt || tag == nsGkAtoms::li) {
if (aContent->IsAnyOfHTMLElements(nsGkAtoms::dt, nsGkAtoms::li)) {
nsRefPtr<Accessible> accessible =
new HTMLLIAccessible(aContent, document);
return accessible.forget();
}

if (tag == nsGkAtoms::dd) {
if (aContent->IsHTMLElement(nsGkAtoms::dd)) {
nsRefPtr<Accessible> accessible =
new HyperTextAccessibleWrap(aContent, document);
return accessible.forget();
Expand All @@ -1465,42 +1466,42 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
return nullptr;
}

if (tag == nsGkAtoms::abbr ||
tag == nsGkAtoms::acronym ||
tag == nsGkAtoms::article ||
tag == nsGkAtoms::aside ||
tag == nsGkAtoms::blockquote ||
tag == nsGkAtoms::form ||
tag == nsGkAtoms::footer ||
tag == nsGkAtoms::header ||
tag == nsGkAtoms::h1 ||
tag == nsGkAtoms::h2 ||
tag == nsGkAtoms::h3 ||
tag == nsGkAtoms::h4 ||
tag == nsGkAtoms::h5 ||
tag == nsGkAtoms::h6 ||
tag == nsGkAtoms::nav ||
tag == nsGkAtoms::q ||
tag == nsGkAtoms::section ||
tag == nsGkAtoms::time) {
if (aContent->IsAnyOfHTMLElements(nsGkAtoms::abbr,
nsGkAtoms::acronym,
nsGkAtoms::article,
nsGkAtoms::aside,
nsGkAtoms::blockquote,
nsGkAtoms::form,
nsGkAtoms::footer,
nsGkAtoms::header,
nsGkAtoms::h1,
nsGkAtoms::h2,
nsGkAtoms::h3,
nsGkAtoms::h4,
nsGkAtoms::h5,
nsGkAtoms::h6,
nsGkAtoms::nav,
nsGkAtoms::q,
nsGkAtoms::section,
nsGkAtoms::time)) {
nsRefPtr<Accessible> accessible =
new HyperTextAccessibleWrap(aContent, document);
return accessible.forget();
}

if (tag == nsGkAtoms::label) {
if (aContent->IsHTMLElement(nsGkAtoms::label)) {
nsRefPtr<Accessible> accessible =
new HTMLLabelAccessible(aContent, document);
return accessible.forget();
}

if (tag == nsGkAtoms::output) {
if (aContent->IsHTMLElement(nsGkAtoms::output)) {
nsRefPtr<Accessible> accessible =
new HTMLOutputAccessible(aContent, document);
return accessible.forget();
}

if (tag == nsGkAtoms::progress) {
if (aContent->IsHTMLElement(nsGkAtoms::progress)) {
nsRefPtr<Accessible> accessible =
new HTMLProgressMeterAccessible(aContent, document);
return accessible.forget();
Expand Down Expand Up @@ -1618,7 +1619,7 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
newAcc = new HTMLTextFieldAccessible(aContent, document);
break;
case eHyperTextType:
if (aContent->Tag() != nsGkAtoms::dt && aContent->Tag() != nsGkAtoms::dd)
if (!aContent->IsAnyOfHTMLElements(nsGkAtoms::dt, nsGkAtoms::dd))
newAcc = new HyperTextAccessibleWrap(aContent, document);
break;

Expand Down
4 changes: 2 additions & 2 deletions accessible/base/nsTextEquivUtils.cpp
Expand Up @@ -153,7 +153,7 @@ nsTextEquivUtils::AppendTextEquivFromTextContent(nsIContent *aContent,
return NS_OK;
}

if (aContent->IsHTML() &&
if (aContent->IsHTMLElement() &&
aContent->NodeInfo()->Equals(nsGkAtoms::br)) {
aString->AppendLiteral("\r\n");
return NS_OK;
Expand Down Expand Up @@ -301,7 +301,7 @@ nsTextEquivUtils::AppendFromDOMNode(nsIContent *aContent, nsAString *aString)
if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
return NS_OK;

if (aContent->IsXUL()) {
if (aContent->IsXULElement()) {
nsAutoString textEquivalent;
nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl =
do_QueryInterface(aContent);
Expand Down
2 changes: 1 addition & 1 deletion accessible/generic/Accessible-inl.h
Expand Up @@ -48,7 +48,7 @@ inline bool
Accessible::IsSearchbox() const
{
return (mRoleMapEntry && mRoleMapEntry->Is(nsGkAtoms::searchbox)) ||
(mContent->IsHTML(nsGkAtoms::input) &&
(mContent->IsHTMLElement(nsGkAtoms::input) &&
mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
nsGkAtoms::textInputType, eCaseMatters));
}
Expand Down

0 comments on commit 01e006a

Please sign in to comment.