| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013, Google Inc. All rights reserved. | 2 * Copyright (C) 2013, 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 13 matching lines...) Expand all Loading... |
| 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #include "config.h" | 29 #include "config.h" |
| 30 #include "modules/accessibility/AXInlineTextBox.h" | 30 #include "modules/accessibility/AXInlineTextBox.h" |
| 31 | 31 |
| 32 #include "core/dom/Range.h" | 32 #include "core/dom/Range.h" |
| 33 #include "core/layout/LayoutText.h" | 33 #include "core/layout/LayoutText.h" |
| 34 #include "core/paint/LineLayoutPaintShim.h" |
| 34 #include "modules/accessibility/AXObjectCacheImpl.h" | 35 #include "modules/accessibility/AXObjectCacheImpl.h" |
| 35 #include "platform/LayoutUnit.h" | 36 #include "platform/LayoutUnit.h" |
| 36 | 37 |
| 37 | 38 |
| 38 namespace blink { | 39 namespace blink { |
| 39 | 40 |
| 40 using namespace HTMLNames; | 41 using namespace HTMLNames; |
| 41 | 42 |
| 42 AXInlineTextBox::AXInlineTextBox(PassRefPtr<AbstractInlineTextBox> inlineTextBox
, AXObjectCacheImpl& axObjectCache) | 43 AXInlineTextBox::AXInlineTextBox(PassRefPtr<AbstractInlineTextBox> inlineTextBox
, AXObjectCacheImpl& axObjectCache) |
| 43 : AXObject(axObjectCache) | 44 : AXObject(axObjectCache) |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 nameFrom = AXNameFromContents; | 122 nameFrom = AXNameFromContents; |
| 122 return m_inlineTextBox->text(); | 123 return m_inlineTextBox->text(); |
| 123 } | 124 } |
| 124 | 125 |
| 125 AXObject* AXInlineTextBox::computeParent() const | 126 AXObject* AXInlineTextBox::computeParent() const |
| 126 { | 127 { |
| 127 ASSERT(!isDetached()); | 128 ASSERT(!isDetached()); |
| 128 if (!m_inlineTextBox || !m_axObjectCache) | 129 if (!m_inlineTextBox || !m_axObjectCache) |
| 129 return 0; | 130 return 0; |
| 130 | 131 |
| 131 LayoutText* layoutText = m_inlineTextBox->layoutText(); | 132 LayoutText* layoutText = toLayoutText(LineLayoutPaintShim::layoutObjectFrom(
m_inlineTextBox->lineLayoutItem())); |
| 132 return m_axObjectCache->getOrCreate(layoutText); | 133 return m_axObjectCache->getOrCreate(layoutText); |
| 133 } | 134 } |
| 134 | 135 |
| 135 // In addition to LTR and RTL direction, edit fields also support | 136 // In addition to LTR and RTL direction, edit fields also support |
| 136 // top to bottom and bottom to top via the CSS writing-mode property. | 137 // top to bottom and bottom to top via the CSS writing-mode property. |
| 137 AccessibilityTextDirection AXInlineTextBox::textDirection() const | 138 AccessibilityTextDirection AXInlineTextBox::textDirection() const |
| 138 { | 139 { |
| 139 if (!m_inlineTextBox) | 140 if (!m_inlineTextBox) |
| 140 return AXObject::textDirection(); | 141 return AXObject::textDirection(); |
| 141 | 142 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 171 if (previousOnLine) | 172 if (previousOnLine) |
| 172 return m_axObjectCache->getOrCreate(previousOnLine.get()); | 173 return m_axObjectCache->getOrCreate(previousOnLine.get()); |
| 173 | 174 |
| 174 if (!m_inlineTextBox->isFirst()) | 175 if (!m_inlineTextBox->isFirst()) |
| 175 return 0; | 176 return 0; |
| 176 | 177 |
| 177 return parentObject()->previousOnLine(); | 178 return parentObject()->previousOnLine(); |
| 178 } | 179 } |
| 179 | 180 |
| 180 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |