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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "core/layout/HitTestResult.h" | 50 #include "core/layout/HitTestResult.h" |
51 #include "core/layout/Layer.h" | 51 #include "core/layout/Layer.h" |
52 #include "core/layout/LayoutFieldset.h" | 52 #include "core/layout/LayoutFieldset.h" |
53 #include "core/layout/LayoutFileUploadControl.h" | 53 #include "core/layout/LayoutFileUploadControl.h" |
54 #include "core/layout/LayoutHTMLCanvas.h" | 54 #include "core/layout/LayoutHTMLCanvas.h" |
55 #include "core/layout/LayoutImage.h" | 55 #include "core/layout/LayoutImage.h" |
56 #include "core/layout/LayoutInline.h" | 56 #include "core/layout/LayoutInline.h" |
57 #include "core/layout/LayoutListMarker.h" | 57 #include "core/layout/LayoutListMarker.h" |
58 #include "core/layout/LayoutPart.h" | 58 #include "core/layout/LayoutPart.h" |
59 #include "core/layout/LayoutTextControlSingleLine.h" | 59 #include "core/layout/LayoutTextControlSingleLine.h" |
| 60 #include "core/layout/LayoutTextFragment.h" |
60 #include "core/layout/LayoutView.h" | 61 #include "core/layout/LayoutView.h" |
61 #include "core/loader/ProgressTracker.h" | 62 #include "core/loader/ProgressTracker.h" |
62 #include "core/page/Page.h" | 63 #include "core/page/Page.h" |
63 #include "core/rendering/RenderMenuList.h" | 64 #include "core/rendering/RenderMenuList.h" |
64 #include "core/rendering/RenderTextFragment.h" | |
65 #include "core/svg/SVGDocumentExtensions.h" | 65 #include "core/svg/SVGDocumentExtensions.h" |
66 #include "core/svg/SVGSVGElement.h" | 66 #include "core/svg/SVGSVGElement.h" |
67 #include "core/svg/graphics/SVGImage.h" | 67 #include "core/svg/graphics/SVGImage.h" |
68 #include "modules/accessibility/AXImageMapLink.h" | 68 #include "modules/accessibility/AXImageMapLink.h" |
69 #include "modules/accessibility/AXInlineTextBox.h" | 69 #include "modules/accessibility/AXInlineTextBox.h" |
70 #include "modules/accessibility/AXObjectCacheImpl.h" | 70 #include "modules/accessibility/AXObjectCacheImpl.h" |
71 #include "modules/accessibility/AXSVGRoot.h" | 71 #include "modules/accessibility/AXSVGRoot.h" |
72 #include "modules/accessibility/AXSpinButton.h" | 72 #include "modules/accessibility/AXSpinButton.h" |
73 #include "modules/accessibility/AXTable.h" | 73 #include "modules/accessibility/AXTable.h" |
74 #include "platform/text/PlatformLocale.h" | 74 #include "platform/text/PlatformLocale.h" |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 | 589 |
590 if (m_renderer->isBR()) | 590 if (m_renderer->isBR()) |
591 return false; | 591 return false; |
592 | 592 |
593 // NOTE: BRs always have text boxes now, so the text box check here can be r
emoved | 593 // NOTE: BRs always have text boxes now, so the text box check here can be r
emoved |
594 if (m_renderer->isText()) { | 594 if (m_renderer->isText()) { |
595 // static text beneath MenuItems and MenuButtons are just reported along
with the menu item, so it's ignored on an individual level | 595 // static text beneath MenuItems and MenuButtons are just reported along
with the menu item, so it's ignored on an individual level |
596 AXObject* parent = parentObjectUnignored(); | 596 AXObject* parent = parentObjectUnignored(); |
597 if (parent && (parent->ariaRoleAttribute() == MenuItemRole || parent->ar
iaRoleAttribute() == MenuButtonRole)) | 597 if (parent && (parent->ariaRoleAttribute() == MenuItemRole || parent->ar
iaRoleAttribute() == MenuButtonRole)) |
598 return true; | 598 return true; |
599 RenderText* renderText = toRenderText(m_renderer); | 599 LayoutText* renderText = toLayoutText(m_renderer); |
600 if (m_renderer->isBR() || !renderText->firstTextBox()) | 600 if (m_renderer->isBR() || !renderText->firstTextBox()) |
601 return true; | 601 return true; |
602 | 602 |
603 // Don't ignore static text in editable text controls. | 603 // Don't ignore static text in editable text controls. |
604 for (AXObject* parent = parentObject(); parent; parent = parent->parentO
bject()) { | 604 for (AXObject* parent = parentObject(); parent; parent = parent->parentO
bject()) { |
605 if (parent->roleValue() == TextFieldRole || parent->roleValue() == T
extAreaRole) | 605 if (parent->roleValue() == TextFieldRole || parent->roleValue() == T
extAreaRole) |
606 return false; | 606 return false; |
607 } | 607 } |
608 | 608 |
609 // text elements that are just empty whitespace should not be returned | 609 // text elements that are just empty whitespace should not be returned |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 | 1196 |
1197 String AXLayoutObject::textUnderElement(TextUnderElementMode mode) const | 1197 String AXLayoutObject::textUnderElement(TextUnderElementMode mode) const |
1198 { | 1198 { |
1199 if (!m_renderer) | 1199 if (!m_renderer) |
1200 return String(); | 1200 return String(); |
1201 | 1201 |
1202 if (m_renderer->isFileUploadControl()) | 1202 if (m_renderer->isFileUploadControl()) |
1203 return toLayoutFileUploadControl(m_renderer)->buttonValue(); | 1203 return toLayoutFileUploadControl(m_renderer)->buttonValue(); |
1204 | 1204 |
1205 if (m_renderer->isText()) | 1205 if (m_renderer->isText()) |
1206 return toRenderText(m_renderer)->plainText(); | 1206 return toLayoutText(m_renderer)->plainText(); |
1207 | 1207 |
1208 return AXNodeObject::textUnderElement(mode); | 1208 return AXNodeObject::textUnderElement(mode); |
1209 } | 1209 } |
1210 | 1210 |
1211 // | 1211 // |
1212 // Accessibility Text - (To be deprecated). | 1212 // Accessibility Text - (To be deprecated). |
1213 // | 1213 // |
1214 | 1214 |
1215 String AXLayoutObject::helpText() const | 1215 String AXLayoutObject::helpText() const |
1216 { | 1216 { |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1874 void AXLayoutObject::addInlineTextBoxChildren(bool force) | 1874 void AXLayoutObject::addInlineTextBoxChildren(bool force) |
1875 { | 1875 { |
1876 Settings* settings = document()->settings(); | 1876 Settings* settings = document()->settings(); |
1877 if (!force && (!settings || !settings->inlineTextBoxAccessibilityEnabled())) | 1877 if (!force && (!settings || !settings->inlineTextBoxAccessibilityEnabled())) |
1878 return; | 1878 return; |
1879 | 1879 |
1880 if (!renderer() || !renderer()->isText()) | 1880 if (!renderer() || !renderer()->isText()) |
1881 return; | 1881 return; |
1882 | 1882 |
1883 if (renderer()->needsLayout()) { | 1883 if (renderer()->needsLayout()) { |
1884 // If a RenderText needs layout, its inline text boxes are either | 1884 // If a LayoutText needs layout, its inline text boxes are either |
1885 // nonexistent or invalid, so defer until the layout happens and | 1885 // nonexistent or invalid, so defer until the layout happens and |
1886 // the renderer calls AXObjectCacheImpl::inlineTextBoxesUpdated. | 1886 // the renderer calls AXObjectCacheImpl::inlineTextBoxesUpdated. |
1887 return; | 1887 return; |
1888 } | 1888 } |
1889 | 1889 |
1890 RenderText* renderText = toRenderText(renderer()); | 1890 LayoutText* renderText = toLayoutText(renderer()); |
1891 for (RefPtr<AbstractInlineTextBox> box = renderText->firstAbstractInlineText
Box(); box.get(); box = box->nextInlineTextBox()) { | 1891 for (RefPtr<AbstractInlineTextBox> box = renderText->firstAbstractInlineText
Box(); box.get(); box = box->nextInlineTextBox()) { |
1892 AXObject* axObject = axObjectCache()->getOrCreate(box.get()); | 1892 AXObject* axObject = axObjectCache()->getOrCreate(box.get()); |
1893 if (!axObject->accessibilityIsIgnored()) | 1893 if (!axObject->accessibilityIsIgnored()) |
1894 m_children.append(axObject); | 1894 m_children.append(axObject); |
1895 } | 1895 } |
1896 } | 1896 } |
1897 | 1897 |
1898 void AXLayoutObject::lineBreaks(Vector<int>& lineBreaks) const | 1898 void AXLayoutObject::lineBreaks(Vector<int>& lineBreaks) const |
1899 { | 1899 { |
1900 if (!isTextControl()) | 1900 if (!isTextControl()) |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2377 if (obj->node()) // If we are a continuation, we want to make sure to use th
e primary renderer. | 2377 if (obj->node()) // If we are a continuation, we want to make sure to use th
e primary renderer. |
2378 obj = obj->node()->renderer(); | 2378 obj = obj->node()->renderer(); |
2379 | 2379 |
2380 // absoluteFocusRingBoundingBox will query the hierarchy below this element,
which for large webpages can be very slow. | 2380 // absoluteFocusRingBoundingBox will query the hierarchy below this element,
which for large webpages can be very slow. |
2381 // For a web area, which will have the most elements of any element, absolut
eQuads should be used. | 2381 // For a web area, which will have the most elements of any element, absolut
eQuads should be used. |
2382 // We should also use absoluteQuads for SVG elements, otherwise transforms w
on't be applied. | 2382 // We should also use absoluteQuads for SVG elements, otherwise transforms w
on't be applied. |
2383 | 2383 |
2384 LayoutRect result; | 2384 LayoutRect result; |
2385 if (obj->isText()) { | 2385 if (obj->isText()) { |
2386 Vector<FloatQuad> quads; | 2386 Vector<FloatQuad> quads; |
2387 toRenderText(obj)->absoluteQuads(quads, 0, RenderText::ClipToEllipsis); | 2387 toLayoutText(obj)->absoluteQuads(quads, 0, LayoutText::ClipToEllipsis); |
2388 result = LayoutRect(boundingBoxForQuads(obj, quads)); | 2388 result = LayoutRect(boundingBoxForQuads(obj, quads)); |
2389 } else if (isWebArea() || obj->isSVGRoot()) { | 2389 } else if (isWebArea() || obj->isSVGRoot()) { |
2390 result = LayoutRect(obj->absoluteBoundingBoxRect()); | 2390 result = LayoutRect(obj->absoluteBoundingBoxRect()); |
2391 } else { | 2391 } else { |
2392 result = LayoutRect(obj->absoluteFocusRingBoundingBoxRect()); | 2392 result = LayoutRect(obj->absoluteFocusRingBoundingBoxRect()); |
2393 } | 2393 } |
2394 | 2394 |
2395 Document* document = this->document(); | 2395 Document* document = this->document(); |
2396 if (document && document->isSVGDocument()) | 2396 if (document && document->isSVGDocument()) |
2397 offsetBoundingBoxForRemoteSVGElement(result); | 2397 offsetBoundingBoxForRemoteSVGElement(result); |
(...skipping 13 matching lines...) Expand all Loading... |
2411 if (label && label->renderer()) { | 2411 if (label && label->renderer()) { |
2412 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); | 2412 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); |
2413 result.unite(labelRect); | 2413 result.unite(labelRect); |
2414 } | 2414 } |
2415 } | 2415 } |
2416 | 2416 |
2417 return result; | 2417 return result; |
2418 } | 2418 } |
2419 | 2419 |
2420 } // namespace blink | 2420 } // namespace blink |
OLD | NEW |