Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1058)

Side by Side Diff: Source/core/accessibility/AXRenderObject.cpp

Issue 495763005: Switch to using accessibilityEnabled and inlineTextBoxAccessibilityEnabled from settings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make WebAXObject methods noops Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 if (document()->settings() && document()->settings()->inlineTextBoxAccessibi lityEnabled() && roleValue() == StaticTextRole)
1690 childrenChanged(); 1691 childrenChanged();
1691 1692
1692 // Do this last - AXNodeObject::textChanged posts live region announcements, 1693 // Do this last - AXNodeObject::textChanged posts live region announcements,
1693 // and we should update the inline text boxes first. 1694 // and we should update the inline text boxes first.
1694 AXNodeObject::textChanged(); 1695 AXNodeObject::textChanged();
1695 } 1696 }
1696 1697
1697 // 1698 //
1698 // Text metrics. Most of these should be deprecated, needs major cleanup. 1699 // Text metrics. Most of these should be deprecated, needs major cleanup.
1699 // 1700 //
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 1757
1757 RefPtrWillBeRawPtr<Range> range = Range::create(m_renderer->document()); 1758 RefPtrWillBeRawPtr<Range> range = Range::create(m_renderer->document());
1758 range->setStart(node, 0, IGNORE_EXCEPTION); 1759 range->setStart(node, 0, IGNORE_EXCEPTION);
1759 range->setEnd(indexPosition, IGNORE_EXCEPTION); 1760 range->setEnd(indexPosition, IGNORE_EXCEPTION);
1760 1761
1761 return TextIterator::rangeLength(range.get()); 1762 return TextIterator::rangeLength(range.get());
1762 } 1763 }
1763 1764
1764 void AXRenderObject::addInlineTextBoxChildren() 1765 void AXRenderObject::addInlineTextBoxChildren()
1765 { 1766 {
1766 if (!axObjectCache()->inlineTextBoxAccessibility()) 1767 if (!document()->settings() || !document()->settings()->inlineTextBoxAccessi bilityEnabled())
1767 return; 1768 return;
1768 1769
1769 if (!renderer() || !renderer()->isText()) 1770 if (!renderer() || !renderer()->isText())
1770 return; 1771 return;
1771 1772
1772 if (renderer()->needsLayout()) { 1773 if (renderer()->needsLayout()) {
1773 // If a RenderText needs layout, its inline text boxes are either 1774 // If a RenderText needs layout, its inline text boxes are either
1774 // nonexistent or invalid, so defer until the layout happens and 1775 // nonexistent or invalid, so defer until the layout happens and
1775 // the renderer calls AXObjectCache::inlineTextBoxesUpdated. 1776 // the renderer calls AXObjectCache::inlineTextBoxesUpdated.
1776 return; 1777 return;
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2024 if (!image || !image->isSVGImage()) 2025 if (!image || !image->isSVGImage())
2025 return 0; 2026 return 0;
2026 2027
2027 FrameView* frameView = toSVGImage(image)->frameView(); 2028 FrameView* frameView = toSVGImage(image)->frameView();
2028 if (!frameView) 2029 if (!frameView)
2029 return 0; 2030 return 0;
2030 Document* doc = frameView->frame().document(); 2031 Document* doc = frameView->frame().document();
2031 if (!doc || !doc->isSVGDocument()) 2032 if (!doc || !doc->isSVGDocument())
2032 return 0; 2033 return 0;
2033 2034
2035 if (doc->settings() && !doc->settings()->accessibilityEnabled())
2036 doc->settings()->setAccessibilityEnabled(true);
2037
2034 SVGSVGElement* rootElement = doc->accessSVGExtensions().rootElement(); 2038 SVGSVGElement* rootElement = doc->accessSVGExtensions().rootElement();
2035 if (!rootElement) 2039 if (!rootElement)
2036 return 0; 2040 return 0;
2037 RenderObject* rendererRoot = rootElement->renderer(); 2041 RenderObject* rendererRoot = rootElement->renderer();
2038 if (!rendererRoot) 2042 if (!rendererRoot)
2039 return 0; 2043 return 0;
2040 2044
2041 AXObject* rootSVGObject = doc->axObjectCache()->getOrCreate(rendererRoot); 2045 AXObject* rootSVGObject = doc->axObjectCache()->getOrCreate(rendererRoot);
2042 2046
2043 // In order to connect the AX hierarchy from the SVG root element from the l oaded resource 2047 // 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
2314 if (label && label->renderer()) { 2318 if (label && label->renderer()) {
2315 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2319 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2316 result.unite(labelRect); 2320 result.unite(labelRect);
2317 } 2321 }
2318 } 2322 }
2319 2323
2320 return result; 2324 return result;
2321 } 2325 }
2322 2326
2323 } // namespace blink 2327 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698