WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch to fix computedRoleString test
bug-146011-20150710121617.patch (text/plain), 21.77 KB, created by
Nan Wang
on 2015-07-10 12:17:19 PDT
(
hide
)
Description:
patch to fix computedRoleString test
Filename:
MIME Type:
Creator:
Nan Wang
Created:
2015-07-10 12:17:19 PDT
Size:
21.77 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 186682) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,41 @@ >+2015-07-10 Nan Wang <n_wang@apple.com> >+ >+ Added ARIA 1.1 "cell" and "table" roles. >+ https://bugs.webkit.org/show_bug.cgi?id=146011 >+ <rdar://problem/21398946> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Created a new role called GridCellRole to match the gridcell role, >+ so the previous CellRole and TableRole will match to cell and table role. >+ Made the changes to make sure that both GridRole and TableRole have same >+ behavior, as well as the circumstance for GridCellRole and CellRole. >+ >+ Test: accessibility/roles-table-and-cell.html >+ >+ * accessibility/AXObjectCache.cpp: >+ (WebCore::createFromRenderer): >+ * accessibility/AccessibilityNodeObject.cpp: >+ (WebCore::AccessibilityNodeObject::supportsRequiredAttribute): >+ (WebCore::AccessibilityNodeObject::canSetSelectedAttribute): >+ * accessibility/AccessibilityObject.cpp: >+ (WebCore::initializeRoleMap): >+ * accessibility/AccessibilityObject.h: >+ * accessibility/AccessibilityRenderObject.cpp: >+ (WebCore::AccessibilityRenderObject::setSelectedRows): >+ (WebCore::AccessibilityRenderObject::inheritsPresentationalRole): >+ (WebCore::AccessibilityRenderObject::selectedChildren): >+ * accessibility/AccessibilityTable.cpp: >+ (WebCore::AccessibilityTable::roleValue): >+ * accessibility/AccessibilityTableCell.cpp: >+ (WebCore::AccessibilityTableCell::determineAccessibilityRole): >+ * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: >+ (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]): >+ (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]): >+ (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): >+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: >+ (createAccessibilityRoleMap): >+ > 2015-07-10 Javier Fernandez <jfernandez@igalia.com> > > [CSS Grid Layout] Grid item's auto-margins are not applied correctly >Index: Source/WebCore/accessibility/AXObjectCache.cpp >=================================================================== >--- Source/WebCore/accessibility/AXObjectCache.cpp (revision 186682) >+++ Source/WebCore/accessibility/AXObjectCache.cpp (working copy) >@@ -281,11 +281,11 @@ static Ref<AccessibilityObject> createFr > return AccessibilityList::create(renderer); > > // aria tables >- if (nodeHasRole(node, "grid") || nodeHasRole(node, "treegrid")) >+ if (nodeHasRole(node, "grid") || nodeHasRole(node, "treegrid") || nodeHasRole(node, "table")) > return AccessibilityARIAGrid::create(renderer); > if (nodeHasRole(node, "row")) > return AccessibilityARIAGridRow::create(renderer); >- if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "columnheader") || nodeHasRole(node, "rowheader")) >+ if (nodeHasRole(node, "gridcell") || nodeHasRole(node, "cell") || nodeHasRole(node, "columnheader") || nodeHasRole(node, "rowheader")) > return AccessibilityARIAGridCell::create(renderer); > > #if ENABLE(VIDEO) >Index: Source/WebCore/accessibility/AccessibilityNodeObject.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityNodeObject.cpp (revision 186682) >+++ Source/WebCore/accessibility/AccessibilityNodeObject.cpp (working copy) >@@ -799,6 +799,7 @@ bool AccessibilityNodeObject::supportsRe > case CheckBoxRole: > case ComboBoxRole: > case GridRole: >+ case GridCellRole: > case IncrementorRole: > case ListBoxRole: > case PopUpButtonRole: >@@ -2061,6 +2062,7 @@ bool AccessibilityNodeObject::canSetSele > // Elements that can be selected > switch (roleValue()) { > case CellRole: >+ case GridCellRole: > case RadioButtonRole: > case RowHeaderRole: > case RowRole: >Index: Source/WebCore/accessibility/AccessibilityObject.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityObject.cpp (revision 186682) >+++ Source/WebCore/accessibility/AccessibilityObject.cpp (working copy) >@@ -1914,8 +1914,10 @@ static void initializeRoleMap() > { "contentinfo", LandmarkContentInfoRole }, > { "dialog", ApplicationDialogRole }, > { "directory", DirectoryRole }, >- { "grid", TableRole }, >- { "gridcell", CellRole }, >+ { "grid", GridRole }, >+ { "gridcell", GridCellRole }, >+ { "table", TableRole }, >+ { "cell", CellRole }, > { "columnheader", ColumnHeaderRole }, > { "combobox", ComboBoxRole }, > { "definition", DefinitionRole }, >Index: Source/WebCore/accessibility/AccessibilityObject.h >=================================================================== >--- Source/WebCore/accessibility/AccessibilityObject.h (revision 186682) >+++ Source/WebCore/accessibility/AccessibilityObject.h (working copy) >@@ -132,6 +132,7 @@ enum AccessibilityRole { > FooterRole, > FormRole, > GridRole, >+ GridCellRole, > GroupRole, > GrowAreaRole, > HeadingRole, >Index: Source/WebCore/accessibility/AccessibilityRenderObject.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityRenderObject.cpp (revision 186682) >+++ Source/WebCore/accessibility/AccessibilityRenderObject.cpp (working copy) >@@ -1692,7 +1692,7 @@ void AccessibilityRenderObject::setSelec > { > // Setting selected only makes sense in trees and tables (and tree-tables). > AccessibilityRole role = roleValue(); >- if (role != TreeRole && role != TreeGridRole && role != TableRole) >+ if (role != TreeRole && role != TreeGridRole && role != TableRole && role != GridRole) > return; > > bool isMulti = isMultiSelectable(); >@@ -2743,6 +2743,7 @@ bool AccessibilityRenderObject::inherits > } > possibleParentTagNames = &listItemParents.get(); > break; >+ case GridCellRole: > case CellRole: > if (tableCellParents.get().isEmpty()) > tableCellParents.get().add(tableTag); >@@ -3238,7 +3239,7 @@ void AccessibilityRenderObject::selected > AccessibilityRole role = roleValue(); > if (role == ListBoxRole) // native list boxes would be AccessibilityListBoxes, so only check for aria list boxes > ariaListboxSelectedChildren(result); >- else if (role == TreeRole || role == TreeGridRole || role == TableRole) >+ else if (role == TreeRole || role == TreeGridRole || role == TableRole || role == GridRole) > ariaSelectedRows(result); > } > >Index: Source/WebCore/accessibility/AccessibilityTable.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityTable.cpp (revision 186682) >+++ Source/WebCore/accessibility/AccessibilityTable.cpp (working copy) >@@ -585,6 +585,10 @@ AccessibilityRole AccessibilityTable::ro > { > if (!isExposableThroughAccessibility()) > return AccessibilityRenderObject::roleValue(); >+ >+ AccessibilityRole ariaRole = ariaRoleAttribute(); >+ if (ariaRole == GridRole || ariaRole == TreeGridRole) >+ return GridRole; > > return TableRole; > } >Index: Source/WebCore/accessibility/AccessibilityTableCell.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityTableCell.cpp (revision 186682) >+++ Source/WebCore/accessibility/AccessibilityTableCell.cpp (working copy) >@@ -111,7 +111,7 @@ AccessibilityRole AccessibilityTableCell > // role, falling back on the role to be used if we determine here that the element > // should not be exposed as a cell. Thus if we already know it's a cell, return that. > AccessibilityRole defaultRole = AccessibilityRenderObject::determineAccessibilityRole(); >- if (defaultRole == ColumnHeaderRole || defaultRole == RowHeaderRole || defaultRole == CellRole) >+ if (defaultRole == ColumnHeaderRole || defaultRole == RowHeaderRole || defaultRole == CellRole || defaultRole == GridCellRole) > return defaultRole; > > if (!isTableCell()) >Index: Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm >=================================================================== >--- Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (revision 186682) >+++ Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (working copy) >@@ -479,7 +479,7 @@ - (AccessibilityObjectWrapper*)_accessib > - (AccessibilityObjectWrapper*)_accessibilityTableAncestor > { > for (AccessibilityObject* parent = m_object->parentObject(); parent != nil; parent = parent->parentObject()) { >- if (parent->roleValue() == TableRole) >+ if (parent->roleValue() == TableRole || parent->roleValue() == GridRole) > return parent->wrapper(); > } > >@@ -521,6 +521,7 @@ - (uint64_t)_accessibilityTraitsFromAnce > case ListRole: > traits |= [self _axContainedByListTrait]; > break; >+ case GridRole: > case TableRole: > traits |= [self _axContainedByTableTrait]; > break; >@@ -731,6 +732,7 @@ - (BOOL)determineIsAccessibilityElement > case FooterRole: > case FormRole: > case GridRole: >+ case GridCellRole: > case GrowAreaRole: > case HelpTagRole: > case IgnoredRole: >Index: Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm >=================================================================== >--- Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (revision 186682) >+++ Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (working copy) >@@ -1928,6 +1928,7 @@ static const AccessibilityRoleMap& creat > { ListBoxRole, NSAccessibilityListRole }, > { ListBoxOptionRole, NSAccessibilityStaticTextRole }, > { CellRole, NSAccessibilityCellRole }, >+ { GridCellRole, NSAccessibilityCellRole }, > { TableHeaderContainerRole, NSAccessibilityGroupRole }, > { ColumnHeaderRole, NSAccessibilityCellRole }, > { RowHeaderRole, NSAccessibilityCellRole }, >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 186682) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,20 @@ >+2015-07-10 Nan Wang <n_wang@apple.com> >+ >+ Added tests for new role: table and cell. >+ https://bugs.webkit.org/show_bug.cgi?id=146011. >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added tests for table and cell role. Also modified other tests to fit the changes. >+ >+ * accessibility/roles-computedRoleString-expected.txt: >+ * accessibility/roles-computedRoleString.html: >+ * accessibilit/roles-table-and-cell-expected.txt: Added. >+ * accessibility/roles-table-and-cell.html: Added. >+ * platform/mac/accessibility/aria-table-hierarchy-expected.txt: >+ * platform/mac/accessibility/aria-tables-expected.txt: >+ * platform/mac/accessibility/roles-exposed-expected.txt: >+ > 2015-07-10 Javier Fernandez <jfernandez@igalia.com> > > [CSS Grid Layout] Grid item's auto-margins are not applied correctly >Index: LayoutTests/accessibility/aria-table-with-presentational-elements-expected.txt >=================================================================== >--- LayoutTests/accessibility/aria-table-with-presentational-elements-expected.txt (revision 186682) >+++ LayoutTests/accessibility/aria-table-with-presentational-elements-expected.txt (working copy) >@@ -4,7 +4,7 @@ On success, you will see a series of "PA > > > PASS row.role is 'AXRole: AXRow' >-PASS row.parentElement().role is 'AXRole: AXTable' >+PASS row.parentElement().role is 'AXRole: AXGrid' > PASS successfullyParsed is true > > TEST COMPLETE >Index: LayoutTests/accessibility/roles-computedRoleString-expected.txt >=================================================================== >--- LayoutTests/accessibility/roles-computedRoleString-expected.txt (revision 186682) >+++ LayoutTests/accessibility/roles-computedRoleString-expected.txt (working copy) >@@ -57,13 +57,20 @@ PASS: option -> option. > PASS: optgroup -> option. > PASS: option -> option. > PASS: option -> option. >-PASS: table -> grid. >+PASS: table -> table. > PASS: tr -> row. > PASS: th -> columnheader. > PASS: tr -> row. >-PASS: td -> gridcell. >+PASS: td -> cell. > PASS: tr -> row. >-PASS: td -> gridcell. >+PASS: td -> cell. >+PASS: table[role="grid"] -> grid. >+PASS: tr -> row. >+PASS: th -> columnheader. >+PASS: tr -> row. >+PASS: td[role="gridcell"] -> gridcell. >+PASS: tr -> row. >+PASS: td[role="gridcell"] -> gridcell. > PASS: textarea -> textbox. > PASS: ul -> list. > PASS: li -> listitem. >Index: LayoutTests/accessibility/roles-computedRoleString.html >=================================================================== >--- LayoutTests/accessibility/roles-computedRoleString.html (revision 186682) >+++ LayoutTests/accessibility/roles-computedRoleString.html (working copy) >@@ -97,7 +97,7 @@ > <sup data-role="" class="ex">X</sup> > <svg data-role="" class="ex">X</svg> > >-<table data-role="grid" class="ex"> >+<table data-role="table" class="ex"> > <caption data-role="" class="ex">X</caption> > <thead data-role="rowgroup" class="ex"> > <tr data-role="row" class="ex"> >@@ -106,15 +106,35 @@ > </thead> > <tbody data-role="rowgroup" class="ex"> > <tr data-role="row" class="ex"> >- <td data-role="gridcell" class="ex">X</td> >+ <td data-role="cell" class="ex">X</td> > </tr> > </tbody> > <tfoot data-role="rowgroup" class="ex"> > <tr data-role="row" class="ex"> >- <td data-role="gridcell" class="ex">X</td> >+ <td data-role="cell" class="ex">X</td> > </tr> > </tfoot> > </table> >+ >+<table role="grid" data-role="grid" class="ex"> >+ <caption data-role="" class="ex">X</caption> >+ <thead data-role="rowgroup" class="ex"> >+ <tr data-role="row" class="ex"> >+ <th data-role="columnheader" class="ex">X</th> >+ </tr> >+ </thead> >+ <tbody data-role="rowgroup" class="ex"> >+ <tr data-role="row" class="ex"> >+ <td role="gridcell" data-role="gridcell" class="ex">X</td> >+ </tr> >+ </tbody> >+ <tfoot data-role="rowgroup" class="ex"> >+ <tr data-role="row" class="ex"> >+ <td role="gridcell" data-role="gridcell" class="ex">X</td> >+ </tr> >+ </tfoot> >+</table> >+ > <textarea data-role="textbox" class="ex">X</textarea> > <time data-role="" class="ex">X</time> > <ul data-role="list" class="ex"> >Index: LayoutTests/accessibility/roles-table-and-cell-expected.txt >=================================================================== >--- LayoutTests/accessibility/roles-table-and-cell-expected.txt (revision 0) >+++ LayoutTests/accessibility/roles-table-and-cell-expected.txt (working copy) >@@ -0,0 +1,14 @@ >+This tests that table and cell have the correct ARIA roles >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS: div[role="grid"] -> grid. >+PASS: table[role="table"] -> table. >+PASS: td[role="gridcell"] -> gridcell. >+PASS: td -> cell. >+PASS: td[role="cell"] -> cell. >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >Index: LayoutTests/accessibility/roles-table-and-cell.html >=================================================================== >--- LayoutTests/accessibility/roles-table-and-cell.html (revision 0) >+++ LayoutTests/accessibility/roles-table-and-cell.html (working copy) >@@ -0,0 +1,71 @@ >+<!DOCTYPE HTML> >+<html> >+<body> >+<script src="../resources/js-test-pre.js"></script> >+ >+<!-- ==================================================================================================== --> >+<!-- This tests ARIA table role and cell role work as intended --> >+<!-- ==================================================================================================== --> >+ >+<div role="grid" data-role="grid" class="ex"> >+ <div role="gridcell" data-role="gridcell" class="ex">data</div> >+ <div role="cell" data-role="cell" class="ex">data2</div> >+ <div role="cell" data-role="cell" class="ex">data3</div> >+</div> >+ >+<table role="table" data-role="table" class="ex"> >+ <td role="gridcell" data-role="gridcell" class="ex">data</td> >+ <td data-role="cell" class="ex">data2</td> >+ <td role="cell" data-role="cell" class="ex">data3</td> >+</table> >+ >+<div id="console"></div> >+<script> >+if (window.testRunner && window.accessibilityController) { >+ description("This tests that table and cell have the correct ARIA roles") >+ var examples = document.querySelectorAll(".ex"); >+ var el, contentAttrRoleString, axElement, computedAriaRole, output, expectedRole, expectation, result, note; >+ for (var i = 0, c = examples.length; i < c; i++) { >+ el = examples[i]; >+ el.id = "ex" + i >+ >+ axElement = accessibilityController.accessibleElementById(el.id); >+ if (!axElement) >+ continue; >+ >+ computedAriaRole = axElement.computedRoleString; >+ >+ contentAttrRoleString = el.getAttribute("role"); >+ note = el.getAttribute("data-note") >+ output = el.tagName.toLowerCase() + (contentAttrRoleString ? ("[role=\""+contentAttrRoleString+"\"]") : "") + (note ? note : ""); >+ output += " -> "; >+ output += computedAriaRole; >+ output += ". "; >+ >+ expectedRole = ""; >+ if (el.hasAttribute("data-role")) { >+ expectedRole = el.getAttribute("data-role"); >+ } >+ >+ expectation = expectedRole; >+ matchedResults = (computedAriaRole == expectedRole) >+ >+ result = document.getElementById('console'); >+ if (matchedResults) { >+ result.innerText += "PASS: " + output + "\n"; >+ } else { >+ result.innerText += "FAIL: " + output + "Expected: " + expectation + ".\n"; >+ } >+ } >+ >+ // Once tests are complete, hide all the example markup. >+ examples = document.querySelectorAll(".ex"); >+ for (var i = 0, c = examples.length; i < c; i++) { >+ el = examples[i]; >+ el.style.display = "none"; >+ } >+} >+</script> >+<script src="../resources/js-test-post.js"></script> >+</body> >+</html> >Index: LayoutTests/platform/mac-mavericks/accessibility/roles-exposed-expected.txt >=================================================================== >--- LayoutTests/platform/mac-mavericks/accessibility/roles-exposed-expected.txt (revision 186682) >+++ LayoutTests/platform/mac-mavericks/accessibility/roles-exposed-expected.txt (working copy) >@@ -875,9 +875,9 @@ div[role=form] > AXRoleDescription: group > > div[role=grid] >- AXRole: AXTable >+ AXRole: AXGrid > AXSubrole: >- AXRoleDescription: table >+ AXRoleDescription: grid > > div[role=rowgroup] > AXRole: >@@ -1135,9 +1135,9 @@ div[role=treeitem] > AXRoleDescription: outline row > > div[role=treegrid] >- AXRole: AXTable >+ AXRole: AXGrid > AXSubrole: >- AXRoleDescription: table >+ AXRoleDescription: grid > > div[role=rowgroup] > AXRole: >Index: LayoutTests/platform/mac/accessibility/aria-table-hierarchy-expected.txt >=================================================================== >--- LayoutTests/platform/mac/accessibility/aria-table-hierarchy-expected.txt (revision 186682) >+++ LayoutTests/platform/mac/accessibility/aria-table-hierarchy-expected.txt (working copy) >@@ -25,7 +25,7 @@ On success, you will see a series of "PA > > > AXRole: AXWebArea AXValue: >- AXRole: AXTable AXValue: >+ AXRole: AXGrid AXValue: > AXRole: AXRow AXValue: > AXRole: AXCell AXValue: > AXRole: AXStaticText AXValue: foo >@@ -38,7 +38,7 @@ AXRole: AXWebArea AXValue: > AXRole: AXCell AXValue: > AXRole: AXStaticText AXValue: bar > AXRole: AXGroup AXValue: >- AXRole: AXTable AXValue: >+ AXRole: AXGrid AXValue: > AXRole: AXRow AXValue: > AXRole: AXCell AXValue: > AXRole: AXStaticText AXValue: Odd >@@ -73,7 +73,7 @@ AXRole: AXWebArea AXValue: > AXRole: AXStaticText AXValue: Odd > AXRole: AXCell AXValue: > AXRole: AXStaticText AXValue: Even >- AXRole: AXTable AXValue: >+ AXRole: AXGrid AXValue: > AXRole: AXRow AXValue: > AXRole: AXCell AXValue: > AXRole: AXStaticText AXValue: hello >@@ -86,7 +86,7 @@ AXRole: AXWebArea AXValue: > AXRole: AXCell AXValue: > AXRole: AXStaticText AXValue: world > AXRole: AXGroup AXValue: >- AXRole: AXTable AXValue: >+ AXRole: AXGrid AXValue: > AXRole: AXRow AXValue: > AXRole: AXCell AXValue: > AXRole: AXStaticText AXValue: Odd >Index: LayoutTests/platform/mac/accessibility/aria-tables-expected.txt >=================================================================== >--- LayoutTests/platform/mac/accessibility/aria-tables-expected.txt (revision 186682) >+++ LayoutTests/platform/mac/accessibility/aria-tables-expected.txt (working copy) >@@ -10,8 +10,8 @@ cell > header 1 header 2 header 2 > cell cell cell > cell >-AXRole: AXTable >-AXRole: AXTable >+AXRole: AXGrid >+AXRole: AXGrid > AXRole: AXCell > AXRole: AXCell > AXRole: AXCell >Index: LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt >=================================================================== >--- LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt (revision 186682) >+++ LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt (working copy) >@@ -875,9 +875,9 @@ div[role=form] > AXRoleDescription: group > > div[role=grid] >- AXRole: AXTable >+ AXRole: AXGrid > AXSubrole: >- AXRoleDescription: table >+ AXRoleDescription: grid > > div[role=rowgroup] > AXRole: >@@ -1135,9 +1135,9 @@ div[role=treeitem] > AXRoleDescription: outline row > > div[role=treegrid] >- AXRole: AXTable >+ AXRole: AXGrid > AXSubrole: >- AXRoleDescription: table >+ AXRoleDescription: grid > > div[role=rowgroup] > AXRole:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 146011
:
256581
|
256583
|
256586
|
256598
|
256600
|
256602
|
256603
|
256606
|
256740