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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 #include "core/html/HTMLTableCaptionElement.h" | 47 #include "core/html/HTMLTableCaptionElement.h" |
48 #include "core/html/HTMLTableCellElement.h" | 48 #include "core/html/HTMLTableCellElement.h" |
49 #include "core/html/HTMLTableElement.h" | 49 #include "core/html/HTMLTableElement.h" |
50 #include "core/html/HTMLTableRowElement.h" | 50 #include "core/html/HTMLTableRowElement.h" |
51 #include "core/html/HTMLTableSectionElement.h" | 51 #include "core/html/HTMLTableSectionElement.h" |
52 #include "core/html/HTMLTextAreaElement.h" | 52 #include "core/html/HTMLTextAreaElement.h" |
53 #include "core/html/parser/HTMLParserIdioms.h" | 53 #include "core/html/parser/HTMLParserIdioms.h" |
54 #include "core/html/shadow/MediaControlElements.h" | 54 #include "core/html/shadow/MediaControlElements.h" |
55 #include "core/layout/LayoutBlockFlow.h" | 55 #include "core/layout/LayoutBlockFlow.h" |
56 #include "core/layout/LayoutObject.h" | 56 #include "core/layout/LayoutObject.h" |
57 #include "core/svg/SVGElement.h" | |
57 #include "modules/accessibility/AXObjectCacheImpl.h" | 58 #include "modules/accessibility/AXObjectCacheImpl.h" |
58 #include "platform/UserGestureIndicator.h" | 59 #include "platform/UserGestureIndicator.h" |
59 #include "platform/text/PlatformLocale.h" | 60 #include "platform/text/PlatformLocale.h" |
60 #include "wtf/text/StringBuilder.h" | 61 #include "wtf/text/StringBuilder.h" |
61 | 62 |
62 | 63 |
63 namespace blink { | 64 namespace blink { |
64 | 65 |
65 using namespace HTMLNames; | 66 using namespace HTMLNames; |
66 | 67 |
(...skipping 2303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2370 source.text = textAlternative; | 2371 source.text = textAlternative; |
2371 *foundTextAlternative = true; | 2372 *foundTextAlternative = true; |
2372 } else { | 2373 } else { |
2373 return textAlternative; | 2374 return textAlternative; |
2374 } | 2375 } |
2375 } | 2376 } |
2376 | 2377 |
2377 return textAlternative; | 2378 return textAlternative; |
2378 } | 2379 } |
2379 | 2380 |
2381 // Per SVG AAM 1.0's modifications to 2D of this algorithm. | |
2382 if (node()->isSVGElement()) { | |
2383 nameFrom = AXNameFromRelatedElement; | |
2384 if (nameSources) { | |
2385 nameSources->append(NameSource(*foundTextAlternative)); | |
2386 nameSources->last().type = nameFrom; | |
2387 nameSources->last().nativeSource = AXTextFromNativeHTMLTitleElement; | |
2388 } | |
2389 DCHECK(node()->isContainerNode()); | |
2390 Element* title = ElementTraversal::firstChild( | |
aboxhall
2016/01/07 18:55:26
I just now thought to look at how SVGElement does
Elly Fong-Jones
2016/01/08 14:13:16
To do this I have to turn the Node into an SVGElem
| |
2391 toContainerNode(*(node())), | |
2392 HasTagName(SVGNames::titleTag)); | |
2393 | |
2394 if (title) { | |
2395 AXObject* titleAXObject = axObjectCache().getOrCreate(title); | |
2396 if (titleAXObject && !visited.contains(titleAXObject)) { | |
2397 textAlternative = recursiveTextAlternative(*titleAXObject, false , visited); | |
2398 if (relatedObjects) { | |
2399 localRelatedObjects.append(new NameSourceRelatedObject( | |
2400 titleAXObject, textAlternative)); | |
2401 *relatedObjects = localRelatedObjects; | |
2402 localRelatedObjects.clear(); | |
2403 } | |
2404 } | |
2405 if (nameSources) { | |
2406 NameSource& source = nameSources->last(); | |
2407 source.text = textAlternative; | |
aboxhall
2016/01/07 18:55:26
need to set source.relatedObjects here.
...yeah,
Elly Fong-Jones
2016/01/08 14:13:16
Done!
| |
2408 *foundTextAlternative = true; | |
2409 } else { | |
2410 return textAlternative; | |
2411 } | |
2412 } | |
2413 } | |
2414 | |
2380 // Fieldset / legend. | 2415 // Fieldset / legend. |
2381 if (isHTMLFieldSetElement(node())) { | 2416 if (isHTMLFieldSetElement(node())) { |
2382 nameFrom = AXNameFromRelatedElement; | 2417 nameFrom = AXNameFromRelatedElement; |
2383 if (nameSources) { | 2418 if (nameSources) { |
2384 nameSources->append(NameSource(*foundTextAlternative)); | 2419 nameSources->append(NameSource(*foundTextAlternative)); |
2385 nameSources->last().type = nameFrom; | 2420 nameSources->last().type = nameFrom; |
2386 nameSources->last().nativeSource = AXTextFromNativeHTMLLegend; | 2421 nameSources->last().nativeSource = AXTextFromNativeHTMLLegend; |
2387 } | 2422 } |
2388 HTMLElement* legend = toHTMLFieldSetElement(node())->legend(); | 2423 HTMLElement* legend = toHTMLFieldSetElement(node())->legend(); |
2389 if (legend) { | 2424 if (legend) { |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2702 return placeholder; | 2737 return placeholder; |
2703 } | 2738 } |
2704 | 2739 |
2705 DEFINE_TRACE(AXNodeObject) | 2740 DEFINE_TRACE(AXNodeObject) |
2706 { | 2741 { |
2707 visitor->trace(m_node); | 2742 visitor->trace(m_node); |
2708 AXObject::trace(visitor); | 2743 AXObject::trace(visitor); |
2709 } | 2744 } |
2710 | 2745 |
2711 } // namespace blin | 2746 } // namespace blin |
OLD | NEW |