OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple 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 26 matching lines...) Expand all Loading... |
37 #include "core/accessibility/AXSpinButton.h" | 37 #include "core/accessibility/AXSpinButton.h" |
38 #include "core/accessibility/AXTable.h" | 38 #include "core/accessibility/AXTable.h" |
39 #include "core/dom/ElementTraversal.h" | 39 #include "core/dom/ElementTraversal.h" |
40 #include "core/dom/shadow/ShadowRoot.h" | 40 #include "core/dom/shadow/ShadowRoot.h" |
41 #include "core/editing/FrameSelection.h" | 41 #include "core/editing/FrameSelection.h" |
42 #include "core/editing/RenderedPosition.h" | 42 #include "core/editing/RenderedPosition.h" |
43 #include "core/editing/TextIterator.h" | 43 #include "core/editing/TextIterator.h" |
44 #include "core/editing/VisibleUnits.h" | 44 #include "core/editing/VisibleUnits.h" |
45 #include "core/editing/htmlediting.h" | 45 #include "core/editing/htmlediting.h" |
46 #include "core/frame/LocalFrame.h" | 46 #include "core/frame/LocalFrame.h" |
| 47 #include "core/frame/Settings.h" |
47 #include "core/html/HTMLImageElement.h" | 48 #include "core/html/HTMLImageElement.h" |
48 #include "core/html/HTMLLabelElement.h" | 49 #include "core/html/HTMLLabelElement.h" |
49 #include "core/html/HTMLOptionElement.h" | 50 #include "core/html/HTMLOptionElement.h" |
50 #include "core/html/HTMLSelectElement.h" | 51 #include "core/html/HTMLSelectElement.h" |
51 #include "core/html/HTMLTextAreaElement.h" | 52 #include "core/html/HTMLTextAreaElement.h" |
52 #include "core/html/shadow/ShadowElementNames.h" | 53 #include "core/html/shadow/ShadowElementNames.h" |
53 #include "core/loader/ProgressTracker.h" | 54 #include "core/loader/ProgressTracker.h" |
54 #include "core/page/Page.h" | 55 #include "core/page/Page.h" |
55 #include "core/rendering/HitTestResult.h" | 56 #include "core/rendering/HitTestResult.h" |
56 #include "core/rendering/RenderFieldset.h" | 57 #include "core/rendering/RenderFieldset.h" |
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1679 // Post that the specific row either collapsed or expanded. | 1680 // Post that the specific row either collapsed or expanded. |
1680 if (roleValue() == RowRole || roleValue() == TreeItemRole) | 1681 if (roleValue() == RowRole || roleValue() == TreeItemRole) |
1681 axObjectCache()->postNotification(this, document(), isExpanded() ? AXObj
ectCache::AXRowExpanded : AXObjectCache::AXRowCollapsed, true); | 1682 axObjectCache()->postNotification(this, document(), isExpanded() ? AXObj
ectCache::AXRowExpanded : AXObjectCache::AXRowCollapsed, true); |
1682 } | 1683 } |
1683 | 1684 |
1684 void AXRenderObject::textChanged() | 1685 void AXRenderObject::textChanged() |
1685 { | 1686 { |
1686 if (!m_renderer) | 1687 if (!m_renderer) |
1687 return; | 1688 return; |
1688 | 1689 |
1689 if (AXObjectCache::inlineTextBoxAccessibility() && roleValue() == StaticText
Role) | 1690 Settings* settings = document()->settings(); |
| 1691 if (settings && settings->inlineTextBoxAccessibilityEnabled() && roleValue()
== StaticTextRole) |
1690 childrenChanged(); | 1692 childrenChanged(); |
1691 | 1693 |
1692 // Do this last - AXNodeObject::textChanged posts live region announcements, | 1694 // Do this last - AXNodeObject::textChanged posts live region announcements, |
1693 // and we should update the inline text boxes first. | 1695 // and we should update the inline text boxes first. |
1694 AXNodeObject::textChanged(); | 1696 AXNodeObject::textChanged(); |
1695 } | 1697 } |
1696 | 1698 |
1697 // | 1699 // |
1698 // Text metrics. Most of these should be deprecated, needs major cleanup. | 1700 // Text metrics. Most of these should be deprecated, needs major cleanup. |
1699 // | 1701 // |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 | 1758 |
1757 RefPtrWillBeRawPtr<Range> range = Range::create(m_renderer->document()); | 1759 RefPtrWillBeRawPtr<Range> range = Range::create(m_renderer->document()); |
1758 range->setStart(node, 0, IGNORE_EXCEPTION); | 1760 range->setStart(node, 0, IGNORE_EXCEPTION); |
1759 range->setEnd(indexPosition, IGNORE_EXCEPTION); | 1761 range->setEnd(indexPosition, IGNORE_EXCEPTION); |
1760 | 1762 |
1761 return TextIterator::rangeLength(range.get()); | 1763 return TextIterator::rangeLength(range.get()); |
1762 } | 1764 } |
1763 | 1765 |
1764 void AXRenderObject::addInlineTextBoxChildren() | 1766 void AXRenderObject::addInlineTextBoxChildren() |
1765 { | 1767 { |
1766 if (!axObjectCache()->inlineTextBoxAccessibility()) | 1768 Settings* settings = document()->settings(); |
| 1769 if (!settings || !settings->inlineTextBoxAccessibilityEnabled()) |
1767 return; | 1770 return; |
1768 | 1771 |
1769 if (!renderer() || !renderer()->isText()) | 1772 if (!renderer() || !renderer()->isText()) |
1770 return; | 1773 return; |
1771 | 1774 |
1772 if (renderer()->needsLayout()) { | 1775 if (renderer()->needsLayout()) { |
1773 // If a RenderText needs layout, its inline text boxes are either | 1776 // If a RenderText needs layout, its inline text boxes are either |
1774 // nonexistent or invalid, so defer until the layout happens and | 1777 // nonexistent or invalid, so defer until the layout happens and |
1775 // the renderer calls AXObjectCache::inlineTextBoxesUpdated. | 1778 // the renderer calls AXObjectCache::inlineTextBoxesUpdated. |
1776 return; | 1779 return; |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2024 if (!image || !image->isSVGImage()) | 2027 if (!image || !image->isSVGImage()) |
2025 return 0; | 2028 return 0; |
2026 | 2029 |
2027 FrameView* frameView = toSVGImage(image)->frameView(); | 2030 FrameView* frameView = toSVGImage(image)->frameView(); |
2028 if (!frameView) | 2031 if (!frameView) |
2029 return 0; | 2032 return 0; |
2030 Document* doc = frameView->frame().document(); | 2033 Document* doc = frameView->frame().document(); |
2031 if (!doc || !doc->isSVGDocument()) | 2034 if (!doc || !doc->isSVGDocument()) |
2032 return 0; | 2035 return 0; |
2033 | 2036 |
| 2037 Settings* settings = doc->settings(); |
| 2038 if (settings && !settings->accessibilityEnabled()) |
| 2039 settings->setAccessibilityEnabled(true); |
| 2040 |
2034 SVGSVGElement* rootElement = doc->accessSVGExtensions().rootElement(); | 2041 SVGSVGElement* rootElement = doc->accessSVGExtensions().rootElement(); |
2035 if (!rootElement) | 2042 if (!rootElement) |
2036 return 0; | 2043 return 0; |
2037 RenderObject* rendererRoot = rootElement->renderer(); | 2044 RenderObject* rendererRoot = rootElement->renderer(); |
2038 if (!rendererRoot) | 2045 if (!rendererRoot) |
2039 return 0; | 2046 return 0; |
2040 | 2047 |
2041 AXObject* rootSVGObject = doc->axObjectCache()->getOrCreate(rendererRoot); | 2048 AXObject* rootSVGObject = doc->axObjectCache()->getOrCreate(rendererRoot); |
2042 | 2049 |
2043 // In order to connect the AX hierarchy from the SVG root element from the l
oaded resource | 2050 // In order to connect the AX hierarchy from the SVG root element from the l
oaded resource |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2314 if (label && label->renderer()) { | 2321 if (label && label->renderer()) { |
2315 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); | 2322 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); |
2316 result.unite(labelRect); | 2323 result.unite(labelRect); |
2317 } | 2324 } |
2318 } | 2325 } |
2319 | 2326 |
2320 return result; | 2327 return result; |
2321 } | 2328 } |
2322 | 2329 |
2323 } // namespace blink | 2330 } // namespace blink |
OLD | NEW |