| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1630 if (!document) | 1630 if (!document) |
| 1631 return String(); | 1631 return String(); |
| 1632 | 1632 |
| 1633 // Check if the HTML element has an aria-label for the webpage. | 1633 // Check if the HTML element has an aria-label for the webpage. |
| 1634 if (Element* documentElement = document->documentElement()) { | 1634 if (Element* documentElement = document->documentElement()) { |
| 1635 const AtomicString& ariaLabel = documentElement->getAttribute(aria_label
Attr); | 1635 const AtomicString& ariaLabel = documentElement->getAttribute(aria_label
Attr); |
| 1636 if (!ariaLabel.isEmpty()) | 1636 if (!ariaLabel.isEmpty()) |
| 1637 return ariaLabel; | 1637 return ariaLabel; |
| 1638 } | 1638 } |
| 1639 | 1639 |
| 1640 Node* owner = document->ownerElement(); | 1640 if (HTMLFrameOwnerElement* owner = document->ownerElement()) { |
| 1641 if (owner) { | |
| 1642 if (isHTMLFrameElementBase(*owner)) { | 1641 if (isHTMLFrameElementBase(*owner)) { |
| 1643 const AtomicString& title = toElement(owner)->getAttribute(titleAttr
); | 1642 const AtomicString& title = owner->getAttribute(titleAttr); |
| 1644 if (!title.isEmpty()) | 1643 if (!title.isEmpty()) |
| 1645 return title; | 1644 return title; |
| 1646 return toElement(owner)->getNameAttribute(); | |
| 1647 } | 1645 } |
| 1648 if (owner->isHTMLElement()) | 1646 return owner->getNameAttribute(); |
| 1649 return toHTMLElement(owner)->getNameAttribute(); | |
| 1650 } | 1647 } |
| 1651 | 1648 |
| 1652 String documentTitle = document->title(); | 1649 String documentTitle = document->title(); |
| 1653 if (!documentTitle.isEmpty()) | 1650 if (!documentTitle.isEmpty()) |
| 1654 return documentTitle; | 1651 return documentTitle; |
| 1655 | 1652 |
| 1656 owner = document->body(); | 1653 if (HTMLElement* body = document->body()) |
| 1657 if (owner && owner->isHTMLElement()) | 1654 return body->getNameAttribute(); |
| 1658 return toHTMLElement(owner)->getNameAttribute(); | |
| 1659 | 1655 |
| 1660 return String(); | 1656 return String(); |
| 1661 } | 1657 } |
| 1662 | 1658 |
| 1663 void AXNodeObject::alternativeText(Vector<AccessibilityText>& textOrder) const | 1659 void AXNodeObject::alternativeText(Vector<AccessibilityText>& textOrder) const |
| 1664 { | 1660 { |
| 1665 if (isWebArea()) { | 1661 if (isWebArea()) { |
| 1666 String webAreaText = alternativeTextForWebArea(); | 1662 String webAreaText = alternativeTextForWebArea(); |
| 1667 if (!webAreaText.isEmpty()) | 1663 if (!webAreaText.isEmpty()) |
| 1668 textOrder.append(AccessibilityText(webAreaText, AlternativeText)); | 1664 textOrder.append(AccessibilityText(webAreaText, AlternativeText)); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1704 float range = maxValueForRange() - minValueForRange(); | 1700 float range = maxValueForRange() - minValueForRange(); |
| 1705 float value = valueForRange(); | 1701 float value = valueForRange(); |
| 1706 | 1702 |
| 1707 value += range * (percentChange / 100); | 1703 value += range * (percentChange / 100); |
| 1708 setValue(String::number(value)); | 1704 setValue(String::number(value)); |
| 1709 | 1705 |
| 1710 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru
e); | 1706 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru
e); |
| 1711 } | 1707 } |
| 1712 | 1708 |
| 1713 } // namespace blink | 1709 } // namespace blink |
| OLD | NEW |