AX: <details> element should allow expand/close through AX API
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jul 2015 16:34:32 +0000 (16:34 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jul 2015 16:34:32 +0000 (16:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146549

Apply review comments from Daniel Bates.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::setIsExpanded):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186679 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp

index 091ca95..b1910b7 100644 (file)
@@ -1,3 +1,13 @@
+2015-07-10  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: <details> element should allow expand/close through AX API
+        https://bugs.webkit.org/show_bug.cgi?id=146549
+
+        Apply review comments from Daniel Bates.
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::setIsExpanded):
+
 2015-07-10  Brady Eidson  <beidson@apple.com>
 
         ASSERT restoring from page cache as DocumentLoader reattaches to its Frame.
index ec5ae0c..9b6f445 100644 (file)
@@ -1612,9 +1612,9 @@ unsigned AccessibilityNodeObject::hierarchicalLevel() const
 void AccessibilityNodeObject::setIsExpanded(bool expand)
 {
     if (is<HTMLDetailsElement>(node())) {
-        HTMLDetailsElement* details = downcast<HTMLDetailsElement>(node());
-        if ((expand && !details->isOpen()) || (!expand && details->isOpen()))
-            details->toggleOpen();
+        auto& details = downcast<HTMLDetailsElement>(*node());
+        if (expand != details.isOpen())
+            details.toggleOpen();
     }
 }