| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 32 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 33 #include "core/CSSPropertyNames.h" | 33 #include "core/CSSPropertyNames.h" |
| 34 #include "core/InputTypeNames.h" | 34 #include "core/InputTypeNames.h" |
| 35 #include "core/dom/ElementTraversal.h" | 35 #include "core/dom/ElementTraversal.h" |
| 36 #include "core/dom/Range.h" | 36 #include "core/dom/Range.h" |
| 37 #include "core/dom/shadow/ShadowRoot.h" | 37 #include "core/dom/shadow/ShadowRoot.h" |
| 38 #include "core/editing/EditingUtilities.h" | 38 #include "core/editing/EditingUtilities.h" |
| 39 #include "core/editing/FrameSelection.h" | 39 #include "core/editing/FrameSelection.h" |
| 40 #include "core/editing/RenderedPosition.h" | 40 #include "core/editing/RenderedPosition.h" |
| 41 #include "core/editing/TextAffinity.h" |
| 41 #include "core/editing/VisibleUnits.h" | 42 #include "core/editing/VisibleUnits.h" |
| 42 #include "core/editing/iterators/CharacterIterator.h" | 43 #include "core/editing/iterators/CharacterIterator.h" |
| 43 #include "core/editing/iterators/TextIterator.h" | 44 #include "core/editing/iterators/TextIterator.h" |
| 44 #include "core/frame/LocalFrame.h" | 45 #include "core/frame/LocalFrame.h" |
| 45 #include "core/frame/Settings.h" | 46 #include "core/frame/Settings.h" |
| 46 #include "core/html/HTMLImageElement.h" | 47 #include "core/html/HTMLImageElement.h" |
| 47 #include "core/html/HTMLLabelElement.h" | 48 #include "core/html/HTMLLabelElement.h" |
| 48 #include "core/html/HTMLOptionElement.h" | 49 #include "core/html/HTMLOptionElement.h" |
| 49 #include "core/html/HTMLSelectElement.h" | 50 #include "core/html/HTMLSelectElement.h" |
| 50 #include "core/html/HTMLTextAreaElement.h" | 51 #include "core/html/HTMLTextAreaElement.h" |
| (...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2178 if (index <= 0) | 2179 if (index <= 0) |
| 2179 return VisiblePosition(firstPositionInOrBeforeNode(node)); | 2180 return VisiblePosition(firstPositionInOrBeforeNode(node)); |
| 2180 | 2181 |
| 2181 Position start, end; | 2182 Position start, end; |
| 2182 bool selected = Range::selectNodeContents(node, start, end); | 2183 bool selected = Range::selectNodeContents(node, start, end); |
| 2183 if (!selected) | 2184 if (!selected) |
| 2184 return VisiblePosition(); | 2185 return VisiblePosition(); |
| 2185 | 2186 |
| 2186 CharacterIterator it(start, end); | 2187 CharacterIterator it(start, end); |
| 2187 it.advance(index - 1); | 2188 it.advance(index - 1); |
| 2188 return VisiblePosition(Position(it.currentContainer(), it.endOffset()), UPST
REAM); | 2189 return VisiblePosition(Position(it.currentContainer(), it.endOffset()), Text
Affinity::Upstream); |
| 2189 } | 2190 } |
| 2190 | 2191 |
| 2191 void AXLayoutObject::addInlineTextBoxChildren(bool force) | 2192 void AXLayoutObject::addInlineTextBoxChildren(bool force) |
| 2192 { | 2193 { |
| 2193 Settings* settings = document()->settings(); | 2194 Settings* settings = document()->settings(); |
| 2194 if (!force && (!settings || !settings->inlineTextBoxAccessibilityEnabled())) | 2195 if (!force && (!settings || !settings->inlineTextBoxAccessibilityEnabled())) |
| 2195 return; | 2196 return; |
| 2196 | 2197 |
| 2197 if (!layoutObject() || !layoutObject()->isText()) | 2198 if (!layoutObject() || !layoutObject()->isText()) |
| 2198 return; | 2199 return; |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2644 if (label && label->layoutObject()) { | 2645 if (label && label->layoutObject()) { |
| 2645 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); | 2646 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); |
| 2646 result.unite(labelRect); | 2647 result.unite(labelRect); |
| 2647 } | 2648 } |
| 2648 } | 2649 } |
| 2649 | 2650 |
| 2650 return result; | 2651 return result; |
| 2651 } | 2652 } |
| 2652 | 2653 |
| 2653 } // namespace blink | 2654 } // namespace blink |
| OLD | NEW |