Bug 810572, part 2.5 - rename AccType constants again, r=tbsaunde, sr=roc

This commit is contained in:
Alexander Surkov 2012-12-18 10:25:52 +09:00
parent 6900e0c183
commit db23e3552b
23 changed files with 78 additions and 78 deletions

View File

@ -14,30 +14,30 @@ namespace a11y {
*/
enum AccType {
eNoType,
eHTMLBR,
eHTMLButton,
eHTMLCanvas,
eHTMLCaption,
eHTMLCheckbox,
eHTMLCombobox,
eHTMLFileInput,
eHTMLGroupbox,
eHTMLHR,
eHTMLImageMap,
eHTMLLabel,
eHTMLLi,
eHTMLSelectList,
eHTMLMedia,
eHTMLRadioButton,
eHTMLTable,
eHTMLTableCell,
eHTMLTableRow,
eHTMLTextField,
eHyperText,
eImage,
eOuterDoc,
eHTMLBRType,
eHTMLButtonType,
eHTMLCanvasType,
eHTMLCaptionType,
eHTMLCheckboxType,
eHTMLComboboxType,
eHTMLFileInputType,
eHTMLGroupboxType,
eHTMLHRType,
eHTMLImageMapType,
eHTMLLabelType,
eHTMLLiType,
eHTMLSelectListType,
eHTMLMediaType,
eHTMLRadioButtonType,
eHTMLTableType,
eHTMLTableCellType,
eHTMLTableRowType,
eHTMLTextFieldType,
eHyperTextType,
eImageType,
eOuterDocType,
ePlugin,
eTextLeaf
eTextLeafType
};
}
}

View File

@ -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() != eHTMLTableCell ||
(frame->AccessibleType() != eHTMLTableCellType ||
aContext->GetContent() != content->GetParent())) {
newAcc = new ARIAGridCellAccessibleWrap(content, document);
}
} else if ((roleMapEntry->accTypes & Accessible::eTableAccessible) &&
frame->AccessibleType() != eHTMLTable) {
frame->AccessibleType() != eHTMLTableType) {
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() == eHTMLTableRow) {
if (frame->AccessibleType() == eHTMLTableRowType) {
nsRoleMapEntry* contextRoleMap = aContext->ARIARoleMap();
if (contextRoleMap &&
!(contextRoleMap->accTypes & Accessible::eTableAccessible))
roleMapEntry = &nsARIAMap::gEmptyRoleMap;
} else if (frame->AccessibleType() == eHTMLTableCell &&
} else if (frame->AccessibleType() == eHTMLTableCellType &&
aContext->ARIARoleMap() == &nsARIAMap::gEmptyRoleMap) {
roleMapEntry = &nsARIAMap::gEmptyRoleMap;
} else if (content->Tag() == nsGkAtoms::dt ||
content->Tag() == nsGkAtoms::li ||
content->Tag() == nsGkAtoms::dd ||
frame->AccessibleType() == eHTMLLi) {
frame->AccessibleType() == eHTMLLiType) {
nsRoleMapEntry* contextRoleMap = aContext->ARIARoleMap();
if (contextRoleMap &&
!(contextRoleMap->accTypes & Accessible::eListAccessible))
@ -1308,67 +1308,67 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
switch (aFrame->AccessibleType()) {
case eNoType:
return nullptr;
case eHTMLBR:
case eHTMLBRType:
newAcc = new HTMLBRAccessible(aContent, document);
break;
case eHTMLButton:
case eHTMLButtonType:
newAcc = new HTMLButtonAccessible(aContent, document);
break;
case eHTMLCanvas:
case eHTMLCanvasType:
newAcc = new HTMLCanvasAccessible(aContent, document);
break;
case eHTMLCaption:
case eHTMLCaptionType:
if (aContext->IsOfType(Accessible::eTableAccessible) &&
aContext->GetContent() == aContent->GetParent()) {
newAcc = new HTMLCaptionAccessible(aContent, document);
}
break;
case eHTMLCheckbox:
case eHTMLCheckboxType:
newAcc = new HTMLCheckboxAccessible(aContent, document);
break;
case eHTMLCombobox:
case eHTMLComboboxType:
newAcc = new HTMLComboboxAccessible(aContent, document);
break;
case eHTMLFileInput:
case eHTMLFileInputType:
newAcc = new HTMLFileInputAccessible(aContent, document);
break;
case eHTMLGroupbox:
case eHTMLGroupboxType:
newAcc = new HTMLGroupboxAccessible(aContent, document);
break;
case eHTMLHR:
case eHTMLHRType:
newAcc = new HTMLHRAccessible(aContent, document);
break;
case eHTMLImageMap:
case eHTMLImageMapType:
newAcc = new HTMLImageMapAccessible(aContent, document);
break;
case eHTMLLabel:
case eHTMLLabelType:
newAcc = new HTMLLabelAccessible(aContent, document);
break;
case eHTMLLi:
case eHTMLLiType:
if (aContext->IsOfType(Accessible::eListAccessible) &&
aContext->GetContent() == aContent->GetParent()) {
newAcc = new HTMLLIAccessible(aContent, document);
}
break;
case eHTMLSelectList:
case eHTMLSelectListType:
newAcc = new HTMLSelectListAccessible(aContent, document);
break;
case eHTMLMedia:
case eHTMLMediaType:
newAcc = new EnumRoleAccessible(aContent, document, roles::GROUPING);
break;
case eHTMLRadioButton:
case eHTMLRadioButtonType:
newAcc = new HTMLRadioButtonAccessible(aContent, document);
break;
case eHTMLTable:
case eHTMLTableType:
newAcc = new HTMLTableAccessibleWrap(aContent, document);
break;
case eHTMLTableCell:
case eHTMLTableCellType:
// 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 eHTMLTableRow: {
case eHTMLTableRowType: {
// 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)) {
@ -1386,18 +1386,18 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
}
break;
}
case eHTMLTextField:
case eHTMLTextFieldType:
newAcc = new HTMLTextFieldAccessible(aContent, document);
break;
case eHyperText:
case eHyperTextType:
if (aContent->Tag() != nsGkAtoms::dt && aContent->Tag() != nsGkAtoms::dd)
newAcc = new HyperTextAccessibleWrap(aContent, document);
break;
case eImage:
case eImageType:
newAcc = new ImageAccessibleWrap(aContent, document);
break;
case eOuterDoc:
case eOuterDocType:
newAcc = new OuterDocAccessible(aContent, document);
break;
case ePlugin: {
@ -1405,7 +1405,7 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
newAcc = CreatePluginAccessible(objectFrame, aContent, aContext);
break;
}
case eTextLeaf:
case eTextLeafType:
newAcc = new TextLeafAccessibleWrap(aContent, document);
break;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -133,7 +133,7 @@ nsImageControlFrame::AccessibleType()
{
if (mContent->Tag() == nsGkAtoms::button ||
mContent->Tag() == nsGkAtoms::input) {
return a11y::eHTMLButton;
return a11y::eHTMLButtonType;
}
return a11y::eNoType;

View File

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

View File

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

View File

@ -257,7 +257,7 @@ BRFrame::AccessibleType()
return a11y::eNoType;
}
return a11y::eHTMLBR;
return a11y::eHTMLBRType;
}
#endif

View File

@ -6252,7 +6252,7 @@ nsBlockFrame::AccessibleType()
{
// block frame may be for <hr>
if (mContent->Tag() == nsGkAtoms::hr) {
return a11y::eHTMLHR;
return a11y::eHTMLHRType;
}
if (!HasBullet() || !PresContext()) {
@ -6275,11 +6275,11 @@ nsBlockFrame::AccessibleType()
}
// Not a bullet, treat as normal HTML container
return a11y::eHyperText;
return a11y::eHyperTextType;
}
// Create special list bullet accessible
return a11y::eHTMLLi;
return a11y::eHTMLLiType;
}
#endif

View File

@ -864,7 +864,7 @@ nsHTMLScrollFrame::AccessibleType()
return a11y::eNoType;
}
return a11y::eHyperText;
return a11y::eHyperTextType;
}
#endif

View File

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

View File

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

View File

@ -895,11 +895,11 @@ 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::eHTMLButton;
return a11y::eHTMLButtonType;
if (tagAtom == nsGkAtoms::img) // Create accessible for broken <img>
return a11y::eImage;
return a11y::eImageType;
if (tagAtom == nsGkAtoms::label) // Creat accessible for <label>
return a11y::eHTMLLabel;
return a11y::eHTMLLabelType;
return a11y::eNoType;
}

View File

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

View File

@ -3902,7 +3902,7 @@ nsTextFrame::AccessibleType()
}
}
return a11y::eTextLeaf;
return a11y::eTextLeafType;
}
#endif

View File

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

View File

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

View File

@ -116,7 +116,7 @@ a11y::AccType
nsTableCaptionFrame::AccessibleType()
{
if (!GetRect().IsEmpty()) {
return a11y::eHTMLCaption;
return a11y::eHTMLCaptionType;
}
return a11y::eNoType;
@ -158,7 +158,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
a11y::AccType
nsTableOuterFrame::AccessibleType()
{
return a11y::eHTMLTable;
return a11y::eHTMLTableType;
}
#endif

View File

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