Changeset 189642 in webkit


Ignore:
Timestamp:
Sep 11, 2015 5:47:20 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

AX: ARIA 1.1 @aria-current
https://bugs.webkit.org/show_bug.cgi?id=146012

Patch by Nan Wang <n_wang@apple.com> on 2015-09-11
Reviewed by Chris Fleizach.

Source/JavaScriptCore:

Updated inspector to support aria-current.

  • inspector/protocol/DOM.json:

Source/WebCore:

Tests: accessibility/aria-current.html

inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent.html

Added support for ARIA 1.1 aria-current.

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::invalidStatus):
(WebCore::AccessibilityObject::ariaCurrentState):
(WebCore::AccessibilityObject::hasTagName):

  • accessibility/AccessibilityObject.h:
  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

  • html/HTMLAttributeNames.in:
  • inspector/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

Source/WebInspectorUI:

Added support for ARIA 1.1 aria-current.

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Models/DOMNode.js:
  • UserInterface/Views/DOMNodeDetailsSidebarPanel.js:

LayoutTests:

  • accessibility/aria-current-expected.txt: Added.
  • accessibility/aria-current.html: Added.
  • inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent-expected.txt: Added.
  • inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent.html: Added.
  • platform/gtk/TestExpectations:
  • platform/win/TestExpectations:
Location:
trunk
Files:
4 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r189638 r189642  
     12015-09-11  Nan Wang  <n_wang@apple.com>
     2
     3        AX: ARIA 1.1 @aria-current
     4        https://bugs.webkit.org/show_bug.cgi?id=146012
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * accessibility/aria-current-expected.txt: Added.
     9        * accessibility/aria-current.html: Added.
     10        * inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent-expected.txt: Added.
     11        * inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent.html: Added.
     12        * platform/gtk/TestExpectations:
     13        * platform/win/TestExpectations:
     14
    1152015-09-11  Alexey Proskuryakov  <ap@apple.com>
    216
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r189566 r189642  
    613613webkit.org/b/146731 fast/hidpi/filters-multiple.html [ ImageOnlyFailure ]
    614614webkit.org/b/146731 fast/hidpi/filters-reference.html [ ImageOnlyFailure ]
     615
     616webkit.org/b/149016 accessibility/aria-current.html [ Skip ]
    615617
    616618#////////////////////////////////////////////////////////////////////////////////////////
  • trunk/LayoutTests/platform/win/TestExpectations

    r189631 r189642  
    618618animations/trigger-container-scroll-simple.html [ Skip ]
    619619animations/trigger-container-scroll-boundaries.html [ Skip ]
     620
     621# TODO aria-current is not supported
     622webkit.org/b/149018 accessibility/aria-current.html [ Skip ]
    620623
    621624################################################################################
  • trunk/Source/JavaScriptCore/ChangeLog

    r189624 r189642  
     12015-09-11  Nan Wang  <n_wang@apple.com>
     2
     3        AX: ARIA 1.1 @aria-current
     4        https://bugs.webkit.org/show_bug.cgi?id=146012
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Updated inspector to support aria-current.
     9
     10        * inspector/protocol/DOM.json:
     11
    1122015-09-11  Sukolsak Sakshuwong  <sukolsak@gmail.com>
    213
  • trunk/Source/JavaScriptCore/inspector/protocol/DOM.json

    r187496 r189642  
    8181                { "name": "childNodeIds", "type": "array", "items": { "$ref": "NodeId" }, "optional": true, "description": "Array of <code>DOMNode</code> ids of the accessibility tree children if available." },
    8282                { "name": "controlledNodeIds", "type": "array", "items": { "$ref": "NodeId" }, "optional": true, "description": "Array of <code>DOMNode</code> ids of any nodes referenced via @aria-controls." },
     83                { "name": "current", "type": "string", "optional": true, "enum": ["true", "false", "page", "step", "location", "date", "time"], "description": "Current item within a container or set of related elements." },
    8384                { "name": "disabled", "type": "boolean", "optional": true, "description": "Disabled state of form controls." },
    8485                { "name": "exists", "type": "boolean", "description": "Indicates whether there is an existing AX object for the DOM node. If this is false, all the other properties will be default values." },
  • trunk/Source/WebCore/ChangeLog

    r189632 r189642  
     12015-09-11  Nan Wang  <n_wang@apple.com>
     2
     3        AX: ARIA 1.1 @aria-current
     4        https://bugs.webkit.org/show_bug.cgi?id=146012
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Tests: accessibility/aria-current.html
     9               inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent.html
     10
     11        Added support for ARIA 1.1 aria-current.
     12
     13        * accessibility/AccessibilityObject.cpp:
     14        (WebCore::AccessibilityObject::invalidStatus):
     15        (WebCore::AccessibilityObject::ariaCurrentState):
     16        (WebCore::AccessibilityObject::hasTagName):
     17        * accessibility/AccessibilityObject.h:
     18        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
     19        (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
     20        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
     21        * html/HTMLAttributeNames.in:
     22        * inspector/InspectorDOMAgent.cpp:
     23        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
     24
    1252015-09-11  Chris Dumez  <cdumez@apple.com>
    226
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r189182 r189642  
    18211821}
    18221822 
     1823AccessibilityARIACurrentState AccessibilityObject::ariaCurrentState() const
     1824{
     1825    // aria-current can return false (default), true, page, step, location, date or time.
     1826    String currentStateValue = stripLeadingAndTrailingHTMLSpaces(getAttribute(aria_currentAttr));
     1827   
     1828    // If "false", empty, or missing, return false state.
     1829    if (currentStateValue.isEmpty() || currentStateValue == "false")
     1830        return ARIACurrentFalse;
     1831   
     1832    if (currentStateValue == "page")
     1833        return ARIACurrentPage;
     1834    if (currentStateValue == "step")
     1835        return ARIACurrentStep;
     1836    if (currentStateValue == "location")
     1837        return ARIACurrentLocation;
     1838    if (currentStateValue == "date")
     1839        return ARIACurrentDate;
     1840    if (currentStateValue == "time")
     1841        return ARIACurrentTime;
     1842   
     1843    // Any value not included in the list of allowed values should be treated as "true".
     1844    return ARIACurrentTrue;
     1845}
     1846
    18231847bool AccessibilityObject::hasTagName(const QualifiedName& tagName) const
    18241848{
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r187582 r189642  
    437437enum AccessibilityMathMultiscriptObjectType { PreSubscript, PreSuperscript, PostSubscript, PostSuperscript };
    438438
     439enum AccessibilityARIACurrentState { ARIACurrentFalse, ARIACurrentTrue, ARIACurrentPage, ARIACurrentStep, ARIACurrentLocation, ARIACurrentDate, ARIACurrentTime };
     440
    439441class AccessibilityObject : public RefCounted<AccessibilityObject> {
    440442protected:
     
    624626    void classList(Vector<String>&) const;
    625627    const AtomicString& roleDescription() const;
     628    AccessibilityARIACurrentState ariaCurrentState() const;
    626629   
    627630    bool supportsARIASetSize() const;
  • trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm

    r189598 r189642  
    248248#define NSAccessibilityDOMIdentifierAttribute @"AXDOMIdentifier"
    249249#define NSAccessibilityDOMClassListAttribute @"AXDOMClassList"
     250
     251#ifndef NSAccessibilityARIACurrentAttribute
     252#define NSAccessibilityARIACurrentAttribute @"AXARIACurrent"
     253#endif
    250254
    251255// Search
     
    16961700    if ([additionalAttributes count])
    16971701        objectAttributes = [objectAttributes arrayByAddingObjectsFromArray:additionalAttributes];
     1702   
     1703    // Only expose AXARIACurrent attribute when the element is set to be current item.
     1704    if (m_object->ariaCurrentState() != ARIACurrentFalse)
     1705        [objectAttributes arrayByAddingObjectsFromArray:@[ NSAccessibilityARIACurrentAttribute ]];
    16981706   
    16991707    return objectAttributes;
     
    28712879        return [NSNumber numberWithBool:m_object->isSelected()];
    28722880   
     2881    if ([attributeName isEqualToString: NSAccessibilityARIACurrentAttribute]) {
     2882        switch (m_object->ariaCurrentState()) {
     2883        case ARIACurrentFalse:
     2884            return @"false";
     2885        case ARIACurrentPage:
     2886            return @"page";
     2887        case ARIACurrentStep:
     2888            return @"step";
     2889        case ARIACurrentLocation:
     2890            return @"location";
     2891        case ARIACurrentTime:
     2892            return @"time";
     2893        case ARIACurrentDate:
     2894            return @"date";
     2895        default:
     2896        case ARIACurrentTrue:
     2897            return @"true";
     2898        }
     2899    }
     2900   
    28732901    if ([attributeName isEqualToString: NSAccessibilityServesAsTitleForUIElementsAttribute] && m_object->isMenuButton()) {
    28742902        AccessibilityObject* uiElement = downcast<AccessibilityRenderObject>(*m_object).menuForMenuButton();
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r186038 r189642  
    1919aria-checked
    2020aria-controls
     21aria-current
    2122aria-describedby
    2223aria-disabled
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r189438 r189642  
    15241524    RefPtr<Inspector::Protocol::Array<int>> childNodeIds;
    15251525    RefPtr<Inspector::Protocol::Array<int>> controlledNodeIds;
     1526    auto currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::False;
    15261527    bool exists = false;
    15271528    bool expanded = false;
     
    15881589                }
    15891590            }
     1591           
     1592            switch (axObject->ariaCurrentState()) {
     1593            case ARIACurrentFalse:
     1594                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::False;
     1595                break;
     1596            case ARIACurrentPage:
     1597                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::Page;
     1598                break;
     1599            case ARIACurrentStep:
     1600                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::Step;
     1601                break;
     1602            case ARIACurrentLocation:
     1603                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::Location;
     1604                break;
     1605            case ARIACurrentDate:
     1606                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::Date;
     1607                break;
     1608            case ARIACurrentTime:
     1609                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::Time;
     1610                break;
     1611            default:
     1612            case ARIACurrentTrue:
     1613                currentState = Inspector::Protocol::DOM::AccessibilityProperties::Current::True;
     1614                break;
     1615            }
    15901616
    15911617            disabled = !axObject->isEnabled();
     
    17251751        if (controlledNodeIds)
    17261752            value->setControlledNodeIds(controlledNodeIds);
     1753        if (currentState != Inspector::Protocol::DOM::AccessibilityProperties::Current::False)
     1754            value->setCurrent(currentState);
    17271755        if (disabled)
    17281756            value->setDisabled(disabled);
  • trunk/Source/WebInspectorUI/ChangeLog

    r189593 r189642  
     12015-09-11  Nan Wang  <n_wang@apple.com>
     2
     3        AX: ARIA 1.1 @aria-current
     4        https://bugs.webkit.org/show_bug.cgi?id=146012
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Added support for ARIA 1.1 aria-current.
     9
     10        * Localizations/en.lproj/localizedStrings.js:
     11        * UserInterface/Models/DOMNode.js:
     12        * UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
     13
    1142015-09-10  Devin Rousso  <dcrousso+webkit@gmail.com>
    215
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r189236 r189642  
    163163localizedStrings["Could not fetch properties. Object may no longer exist."] = "Could not fetch properties. Object may no longer exist.";
    164164localizedStrings["Create a new tab"] = "Create a new tab";
     165localizedStrings["Current"] = "Current";
    165166localizedStrings["Cursor"] = "Cursor";
    166167localizedStrings["Custom"] = "Custom";
     
    169170localizedStrings["Database no longer has expected version."] = "Database no longer has expected version.";
    170171localizedStrings["Databases"] = "Databases";
     172localizedStrings["Date"] = "Date";
    171173localizedStrings["Debug: "] = "Debug: ";
    172174localizedStrings["Debugger"] = "Debugger";
     
    427429localizedStrings["Owns"] = "Owns";
    428430localizedStrings["Padding"] = "Padding";
     431localizedStrings["Page"] = "Page";
    429432localizedStrings["Page Issue"] = "Page Issue";
    430433localizedStrings["Paint"] = "Paint";
     
    550553localizedStrings["Start Time"] = "Start Time";
    551554localizedStrings["Status"] = "Status";
     555localizedStrings["Step"] = "Step";
    552556localizedStrings["Step into (%s or %s)"] = "Step into (%s or %s)";
    553557localizedStrings["Step out (%s or %s)"] = "Step out (%s or %s)";
     
    578582localizedStrings["This Element"] = "This Element";
    579583localizedStrings["This property needs a value.\nClick to open autocomplete."] = "This property needs a value.\nClick to open autocomplete.";
     584localizedStrings["Time"] = "Time";
    580585localizedStrings["Time until the load event fired, click to show the Network Requests timeline"] = "Time until the load event fired, click to show the Network Requests timeline";
    581586localizedStrings["Timeline Events"] = "Timeline Events";
     
    597602localizedStrings["Transition"] = "Transition";
    598603localizedStrings["Triggered Breakpoint"] = "Triggered Breakpoint";
     604localizedStrings["True"] = "True";
    599605localizedStrings["Type"] = "Type";
    600606localizedStrings["Type Issue"] = "Type Issue";
  • trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js

    r189104 r189642  
    427427                    childNodeIds: accessibilityProperties.childNodeIds,
    428428                    controlledNodeIds: accessibilityProperties.controlledNodeIds,
     429                    current: accessibilityProperties.current,
    429430                    disabled: accessibilityProperties.disabled,
    430431                    exists: accessibilityProperties.exists,
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeDetailsSidebarPanel.js

    r187402 r189642  
    6868            this._accessibilityNodeChildrenRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Children"));
    6969            this._accessibilityNodeControlsRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Controls"));
     70            this._accessibilityNodeCurrentRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Current"));
    7071            this._accessibilityNodeDisabledRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Disabled"));
    7172            this._accessibilityNodeExpandedRow = new WebInspector.DetailsSectionSimpleRow(WebInspector.UIString("Expanded"));
     
    347348               
    348349                var controlledNodeLinkList = linkListForNodeIds(accessibilityProperties.controlledNodeIds);
     350               
     351                var current = "";
     352                switch (accessibilityProperties.current) {
     353                case DOMAgent.AccessibilityPropertiesCurrent.True:
     354                    current = WebInspector.UIString("True");
     355                    break;
     356                case DOMAgent.AccessibilityPropertiesCurrent.Page:
     357                    current = WebInspector.UIString("Page");
     358                    break;
     359                case DOMAgent.AccessibilityPropertiesCurrent.Location:
     360                    current = WebInspector.UIString("Location");
     361                    break;
     362                case DOMAgent.AccessibilityPropertiesCurrent.Step:
     363                    current = WebInspector.UIString("Step");
     364                    break;
     365                case DOMAgent.AccessibilityPropertiesCurrent.Date:
     366                    current = WebInspector.UIString("Date");
     367                    break;
     368                case DOMAgent.AccessibilityPropertiesCurrent.Time:
     369                    current = WebInspector.UIString("Time");
     370                    break;
     371                default:
     372                    current = "";
     373                }
     374               
    349375                var disabled = booleanValueToLocalizedStringIfTrue("disabled");
    350376                var expanded = booleanValueToLocalizedStringIfPropertyDefined("expanded");
     
    463489                this._accessibilityNodeChildrenRow.value = childNodeLinkList || "";
    464490                this._accessibilityNodeControlsRow.value = controlledNodeLinkList || "";
     491                this._accessibilityNodeCurrentRow.value = current;
    465492                this._accessibilityNodeDisabledRow.value = disabled;
    466493                this._accessibilityNodeExpandedRow.value = expanded;
     
    506533                    this._accessibilityNodeBusyRow,
    507534                    this._accessibilityNodeLiveRegionStatusRow,
     535                    this._accessibilityNodeCurrentRow,
    508536
    509537                    // Properties exposed for all input-type elements.
Note: See TracChangeset for help on using the changeset viewer.