Bug 810572, part2 - remove 'Accessible' postfix from AccTypes constants, r=tbsaunde, sr=roc

This commit is contained in:
Alexander Surkov 2012-12-12 19:04:12 +09:00
parent 34fe69c06b
commit 5801a37df4
26 changed files with 101 additions and 102 deletions

View File

@ -13,31 +13,31 @@ namespace a11y {
* Accessible object types used when creating an accessible based on the frame.
*/
enum AccType {
eNoAccessible,
eHTMLBRAccessible,
eHTMLButtonAccessible,
eHTMLCanvasAccessible,
eHTMLCaptionAccessible,
eHTMLCheckboxAccessible,
eHTMLComboboxAccessible,
eHTMLFileInputAccessible,
eHTMLGroupboxAccessible,
eHTMLHRAccessible,
eHTMLImageMapAccessible,
eHTMLLabelAccessible,
eHTMLLiAccessible,
eHTMLSelectListAccessible,
eHTMLMediaAccessible,
eHTMLObjectFrameAccessible,
eHTMLRadioButtonAccessible,
eHTMLTableAccessible,
eHTMLTableCellAccessible,
eHTMLTableRowAccessible,
eHTMLTextFieldAccessible,
eHyperTextAccessible,
eImageAccessible,
eOuterDocAccessible,
eTextLeafAccessible
eNoType,
eHTMLBR,
eHTMLButton,
eHTMLCanvas,
eHTMLCaption,
eHTMLCheckbox,
eHTMLCombobox,
eHTMLFileInput,
eHTMLGroupbox,
eHTMLHR,
eHTMLImageMap,
eHTMLLabel,
eHTMLLi,
eHTMLSelectList,
eHTMLMedia,
eHTMLRadioButton,
eHTMLTable,
eHTMLTableCell,
eHTMLTableRow,
eHTMLTextField,
eHyperText,
eImage,
eOuterDoc,
ePlugin,
eTextLeaf
};
}
}

View File

@ -207,9 +207,9 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
}
already_AddRefed<Accessible>
nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
nsIContent* aContent,
Accessible* aContext)
nsAccessibilityService::CreatePluginAccessible(nsObjectFrame* aFrame,
nsIContent* aContent,
Accessible* aContext)
{
// nsObjectFrame means a plugin, so we need to use the accessibility support
// of the plugin.
@ -799,13 +799,13 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// on accessible HTML table elements.
if ((roleMapEntry->accTypes & Accessible::eTableCellAccessible)) {
if (aContext->IsOfType(Accessible::eTableRowAccessible) &&
(frame->AccessibleType() != eHTMLTableCellAccessible ||
(frame->AccessibleType() != eHTMLTableCell ||
aContext->GetContent() != content->GetParent())) {
newAcc = new ARIAGridCellAccessibleWrap(content, document);
}
} else if ((roleMapEntry->accTypes & Accessible::eTableAccessible) &&
frame->AccessibleType() != eHTMLTableAccessible) {
frame->AccessibleType() != eHTMLTable) {
newAcc = new ARIAGridAccessibleWrap(content, document);
}
}
@ -822,20 +822,20 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// If table has strong ARIA role then all table descendants shouldn't
// expose their native roles.
if (!roleMapEntry && newAcc) {
if (frame->AccessibleType() == eHTMLTableRowAccessible) {
if (frame->AccessibleType() == eHTMLTableRow) {
nsRoleMapEntry* contextRoleMap = aContext->ARIARoleMap();
if (contextRoleMap &&
!(contextRoleMap->accTypes & Accessible::eTableAccessible))
roleMapEntry = &nsARIAMap::gEmptyRoleMap;
} else if (frame->AccessibleType() == eHTMLTableCellAccessible &&
} else if (frame->AccessibleType() == eHTMLTableCell &&
aContext->ARIARoleMap() == &nsARIAMap::gEmptyRoleMap) {
roleMapEntry = &nsARIAMap::gEmptyRoleMap;
} else if (content->Tag() == nsGkAtoms::dt ||
content->Tag() == nsGkAtoms::li ||
content->Tag() == nsGkAtoms::dd ||
frame->AccessibleType() == eHTMLLiAccessible) {
frame->AccessibleType() == eHTMLLi) {
nsRoleMapEntry* contextRoleMap = aContext->ARIARoleMap();
if (contextRoleMap &&
!(contextRoleMap->accTypes & Accessible::eListAccessible))
@ -1306,75 +1306,69 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
nsRefPtr<Accessible> newAcc;
switch (aFrame->AccessibleType()) {
case eNoAccessible:
case eNoType:
return nullptr;
case eHTMLBRAccessible:
case eHTMLBR:
newAcc = new HTMLBRAccessible(aContent, document);
break;
case eHTMLButtonAccessible:
case eHTMLButton:
newAcc = new HTMLButtonAccessible(aContent, document);
break;
case eHTMLCanvasAccessible:
case eHTMLCanvas:
newAcc = new HTMLCanvasAccessible(aContent, document);
break;
case eHTMLCaptionAccessible:
case eHTMLCaption:
if (aContext->IsOfType(Accessible::eTableAccessible) &&
aContext->GetContent() == aContent->GetParent()) {
newAcc = new HTMLCaptionAccessible(aContent, document);
}
break;
case eHTMLCheckboxAccessible:
case eHTMLCheckbox:
newAcc = new HTMLCheckboxAccessible(aContent, document);
break;
case eHTMLComboboxAccessible:
case eHTMLCombobox:
newAcc = new HTMLComboboxAccessible(aContent, document);
break;
case eHTMLFileInputAccessible:
case eHTMLFileInput:
newAcc = new HTMLFileInputAccessible(aContent, document);
break;
case eHTMLGroupboxAccessible:
case eHTMLGroupbox:
newAcc = new HTMLGroupboxAccessible(aContent, document);
break;
case eHTMLHRAccessible:
case eHTMLHR:
newAcc = new HTMLHRAccessible(aContent, document);
break;
case eHTMLImageMapAccessible:
case eHTMLImageMap:
newAcc = new HTMLImageMapAccessible(aContent, document);
break;
case eHTMLLabelAccessible:
case eHTMLLabel:
newAcc = new HTMLLabelAccessible(aContent, document);
break;
case eHTMLLiAccessible:
case eHTMLLi:
if (aContext->IsOfType(Accessible::eListAccessible) &&
aContext->GetContent() == aContent->GetParent()) {
newAcc = new HTMLLIAccessible(aContent, document);
}
break;
case eHTMLSelectListAccessible:
case eHTMLSelectList:
newAcc = new HTMLSelectListAccessible(aContent, document);
break;
case eHTMLMediaAccessible:
case eHTMLMedia:
newAcc = new EnumRoleAccessible(aContent, document, roles::GROUPING);
break;
case eHTMLObjectFrameAccessible: {
nsObjectFrame* objectFrame = do_QueryFrame(aFrame);
newAcc = CreateHTMLObjectFrameAccessible(objectFrame, aContent, aContext);
break;
}
case eHTMLRadioButtonAccessible:
case eHTMLRadioButton:
newAcc = new HTMLRadioButtonAccessible(aContent, document);
break;
case eHTMLTableAccessible:
case eHTMLTable:
newAcc = new HTMLTableAccessibleWrap(aContent, document);
break;
case eHTMLTableCellAccessible:
case eHTMLTableCell:
// Accessible HTML table cell must be a child of accessible HTML table row.
if (aContext->IsOfType(Accessible::eHTMLTableRowAccessible))
newAcc = new HTMLTableCellAccessibleWrap(aContent, document);
break;
case eHTMLTableRowAccessible: {
case eHTMLTableRow: {
// Accessible HTML table row must be a child of tbody/tfoot/thead of
// accessible HTML table or must be a child of accessible of HTML table.
if (aContext->IsOfType(Accessible::eTableAccessible)) {
@ -1392,21 +1386,26 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
}
break;
}
case eHTMLTextFieldAccessible:
case eHTMLTextField:
newAcc = new HTMLTextFieldAccessible(aContent, document);
break;
case eHyperTextAccessible:
case eHyperText:
if (aContent->Tag() != nsGkAtoms::dt && aContent->Tag() != nsGkAtoms::dd)
newAcc = new HyperTextAccessibleWrap(aContent, document);
break;
case eImageAccessible:
case eImage:
newAcc = new ImageAccessibleWrap(aContent, document);
break;
case eOuterDocAccessible:
case eOuterDoc:
newAcc = new OuterDocAccessible(aContent, document);
break;
case eTextLeafAccessible:
case ePlugin: {
nsObjectFrame* objectFrame = do_QueryFrame(aFrame);
newAcc = CreatePluginAccessible(objectFrame, aContent, aContext);
break;
}
case eTextLeaf:
newAcc = new TextLeafAccessibleWrap(aContent, document);
break;
}

View File

@ -54,8 +54,8 @@ public:
virtual Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
bool aCanCreate);
already_AddRefed<Accessible>
CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame, nsIContent* aContent,
Accessible* aContext);
CreatePluginAccessible(nsObjectFrame* aFrame, nsIContent* aContent,
Accessible* aContext);
/**
* Adds/remove ATK root accessible for gtk+ native window to/from children

View File

@ -312,7 +312,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
a11y::AccType
nsComboboxControlFrame::AccessibleType()
{
return a11y::eHTMLComboboxAccessible;
return a11y::eHTMLCombobox;
}
#endif

View File

@ -625,7 +625,7 @@ nsFieldSetFrame::RemoveFrame(ChildListID aListID,
a11y::AccType
nsFieldSetFrame::AccessibleType()
{
return a11y::eHTMLGroupboxAccessible;
return a11y::eHTMLGroupbox;
}
#endif

View File

@ -631,7 +631,7 @@ nsFileControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
a11y::AccType
nsFileControlFrame::AccessibleType()
{
return a11y::eHTMLFileInputAccessible;
return a11y::eHTMLFileInput;
}
#endif

View File

@ -90,7 +90,7 @@ nsGfxCheckboxControlFrame::~nsGfxCheckboxControlFrame()
a11y::AccType
nsGfxCheckboxControlFrame::AccessibleType()
{
return a11y::eHTMLCheckboxAccessible;
return a11y::eHTMLCheckbox;
}
#endif

View File

@ -36,7 +36,7 @@ nsGfxRadioControlFrame::~nsGfxRadioControlFrame()
a11y::AccType
nsGfxRadioControlFrame::AccessibleType()
{
return a11y::eHTMLRadioButtonAccessible;
return a11y::eHTMLRadioButton;
}
#endif

View File

@ -78,7 +78,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
a11y::AccType
nsHTMLButtonControlFrame::AccessibleType()
{
return a11y::eHTMLButtonAccessible;
return a11y::eHTMLButton;
}
#endif

View File

@ -133,10 +133,10 @@ nsImageControlFrame::AccessibleType()
{
if (mContent->Tag() == nsGkAtoms::button ||
mContent->Tag() == nsGkAtoms::input) {
return a11y::eHTMLButtonAccessible;
return a11y::eHTMLButton;
}
return a11y::eNoAccessible;
return a11y::eNoType;
}
#endif

View File

@ -267,7 +267,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsHTMLScrollFrame)
a11y::AccType
nsListControlFrame::AccessibleType()
{
return a11y::eHTMLSelectListAccessible;
return a11y::eHTMLSelectList;
}
#endif

View File

@ -95,7 +95,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
a11y::AccType
nsTextControlFrame::AccessibleType()
{
return a11y::eHTMLTextFieldAccessible;
return a11y::eHTMLTextField;
}
#endif

View File

@ -254,10 +254,10 @@ BRFrame::AccessibleType()
parent->GetChildCount() == 1) {
// This <br> is the only node in a text control, therefore it is the hacky
// "bogus node" used when there is no text in the control
return a11y::eNoAccessible;
return a11y::eNoType;
}
return a11y::eHTMLBRAccessible;
return a11y::eHTMLBR;
}
#endif

View File

@ -6250,14 +6250,14 @@ nsBlockFrame::AccessibleType()
{
// block frame may be for <hr>
if (mContent->Tag() == nsGkAtoms::hr) {
return a11y::eHTMLHRAccessible;
return a11y::eHTMLHR;
}
if (!HasBullet() || !PresContext()) {
if (!mContent->GetParent()) {
// Don't create accessible objects for the root content node, they are redundant with
// the nsDocAccessible object created with the document node
return a11y::eNoAccessible;
return a11y::eNoType;
}
nsCOMPtr<nsIDOMHTMLDocument> htmlDoc =
@ -6268,16 +6268,16 @@ nsBlockFrame::AccessibleType()
if (SameCOMIdentity(body, mContent)) {
// Don't create accessible objects for the body, they are redundant with
// the nsDocAccessible object created with the document node
return a11y::eNoAccessible;
return a11y::eNoType;
}
}
// Not a bullet, treat as normal HTML container
return a11y::eHyperTextAccessible;
return a11y::eHyperText;
}
// Create special list bullet accessible
return a11y::eHTMLLiAccessible;
return a11y::eHTMLLi;
}
#endif

View File

@ -6783,7 +6783,7 @@ nsFrame::ChildIsDirty(nsIFrame* aChild)
a11y::AccType
nsFrame::AccessibleType()
{
return a11y::eNoAccessible;
return a11y::eNoType;
}
#endif

View File

@ -861,10 +861,10 @@ nsHTMLScrollFrame::AccessibleType()
if (mContent->IsRootOfNativeAnonymousSubtree() ||
GetScrollbarStyles() == nsIScrollableFrame::
ScrollbarStyles(NS_STYLE_OVERFLOW_HIDDEN, NS_STYLE_OVERFLOW_HIDDEN) ) {
return a11y::eNoAccessible;
return a11y::eNoType;
}
return a11y::eHyperTextAccessible;
return a11y::eHyperText;
}
#endif

View File

@ -336,7 +336,7 @@ nsHTMLCanvasFrame::GetContinuationOffset(nscoord* aWidth) const
a11y::AccType
nsHTMLCanvasFrame::AccessibleType()
{
return a11y::eHTMLCanvasAccessible;
return a11y::eHTMLCanvas;
}
#endif

View File

@ -163,10 +163,10 @@ nsImageFrame::AccessibleType()
{
// Don't use GetImageMap() to avoid reentrancy into accessibility.
if (HasImageMap()) {
return a11y::eHTMLImageMapAccessible;
return a11y::eHTMLImageMap;
}
return a11y::eImageAccessible;
return a11y::eImage;
}
#endif

View File

@ -895,13 +895,13 @@ nsInlineFrame::AccessibleType()
// replaces the image or image control frame with an inline frame
nsIAtom *tagAtom = mContent->Tag();
if (tagAtom == nsGkAtoms::input) // Broken <input type=image ... />
return a11y::eHTMLButtonAccessible;
return a11y::eHTMLButton;
if (tagAtom == nsGkAtoms::img) // Create accessible for broken <img>
return a11y::eImageAccessible;
return a11y::eImage;
if (tagAtom == nsGkAtoms::label) // Creat accessible for <label>
return a11y::eHTMLLabelAccessible;
return a11y::eHTMLLabel;
return a11y::eNoAccessible;
return a11y::eNoType;
}
#endif

View File

@ -275,7 +275,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsObjectFrameSuper)
a11y::AccType
nsObjectFrame::AccessibleType()
{
return a11y::eHTMLObjectFrameAccessible;
return a11y::ePlugin;
}
#ifdef XP_WIN

View File

@ -85,7 +85,7 @@ nsSubDocumentFrame::nsSubDocumentFrame(nsStyleContext* aContext)
a11y::AccType
nsSubDocumentFrame::AccessibleType()
{
return a11y::eOuterDocAccessible;
return a11y::eOuterDoc;
}
#endif

View File

@ -3898,11 +3898,11 @@ nsTextFrame::AccessibleType()
nsAutoString renderedWhitespace;
GetRenderedText(&renderedWhitespace, nullptr, nullptr, 0, 1);
if (renderedWhitespace.IsEmpty()) {
return a11y::eNoAccessible;
return a11y::eNoType;
}
}
return a11y::eTextLeafAccessible;
return a11y::eTextLeaf;
}
#endif

View File

@ -418,7 +418,7 @@ nsVideoFrame::GetType() const
a11y::AccType
nsVideoFrame::AccessibleType()
{
return a11y::eHTMLMediaAccessible;
return a11y::eHTMLMedia;
}
#endif

View File

@ -985,7 +985,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
a11y::AccType
nsTableCellFrame::AccessibleType()
{
return a11y::eHTMLTableCellAccessible;
return a11y::eHTMLTableCell;
}
#endif

View File

@ -115,10 +115,10 @@ a11y::AccType
nsTableCaptionFrame::AccessibleType()
{
if (!GetRect().IsEmpty()) {
return a11y::eHTMLCaptionAccessible;
return a11y::eHTMLCaption;
}
return a11y::eNoAccessible;
return a11y::eNoType;
}
#endif
@ -157,7 +157,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
a11y::AccType
nsTableOuterFrame::AccessibleType()
{
return a11y::eHTMLTableAccessible;
return a11y::eHTMLTable;
}
#endif

View File

@ -1357,7 +1357,7 @@ void nsTableRowFrame::SetContinuousBCBorderWidth(uint8_t aForSide,
a11y::AccType
nsTableRowFrame::AccessibleType()
{
return a11y::eHTMLTableRowAccessible;
return a11y::eHTMLTableRow;
}
#endif
/**