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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/AbstractInlineTextBox.cpp

Issue 2169273004: Switch all LayoutTests to use new accessibility relative bounding box API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix absolute bounds in AXInlineTextBox::elementRect Created 4 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
OLDNEW
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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::nextInlineTextBox() con st 87 PassRefPtr<AbstractInlineTextBox> AbstractInlineTextBox::nextInlineTextBox() con st
88 { 88 {
89 ASSERT(!m_inlineTextBox || !m_inlineTextBox->getLineLayoutItem().needsLayout ()); 89 ASSERT(!m_inlineTextBox || !m_inlineTextBox->getLineLayoutItem().needsLayout ());
90 if (!m_inlineTextBox) 90 if (!m_inlineTextBox)
91 return nullptr; 91 return nullptr;
92 92
93 return getOrCreate(m_lineLayoutItem, m_inlineTextBox->nextTextBox()); 93 return getOrCreate(m_lineLayoutItem, m_inlineTextBox->nextTextBox());
94 } 94 }
95 95
96 LayoutRect AbstractInlineTextBox::bounds() const 96 LayoutRect AbstractInlineTextBox::localBounds() const
97 { 97 {
98 if (!m_inlineTextBox || !m_lineLayoutItem) 98 if (!m_inlineTextBox || !m_lineLayoutItem)
99 return LayoutRect(); 99 return LayoutRect();
100
101 return m_inlineTextBox->calculateBoundaries();
102 }
103
104 LayoutRect AbstractInlineTextBox::absoluteBounds() const
105 {
106 if (!m_inlineTextBox || !m_lineLayoutItem)
107 return LayoutRect();
100 108
101 FloatRect boundaries(m_inlineTextBox->calculateBoundaries()); 109 FloatRect boundaries(m_inlineTextBox->calculateBoundaries());
102 return LayoutRect(m_lineLayoutItem.localToAbsoluteQuad(boundaries).enclosing BoundingBox()); 110 return LayoutRect(m_lineLayoutItem.localToAbsoluteQuad(boundaries).enclosing BoundingBox());
103 } 111 }
104 112
105 unsigned AbstractInlineTextBox::len() const 113 unsigned AbstractInlineTextBox::len() const
106 { 114 {
107 if (!m_inlineTextBox) 115 if (!m_inlineTextBox)
108 return 0; 116 return 0;
109 117
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 return nullptr; 209 return nullptr;
202 210
203 InlineBox* previous = m_inlineTextBox->prevOnLine(); 211 InlineBox* previous = m_inlineTextBox->prevOnLine();
204 if (previous && previous->isInlineTextBox()) 212 if (previous && previous->isInlineTextBox())
205 return getOrCreate(toInlineTextBox(previous)->getLineLayoutItem(), toInl ineTextBox(previous)); 213 return getOrCreate(toInlineTextBox(previous)->getLineLayoutItem(), toInl ineTextBox(previous));
206 214
207 return nullptr; 215 return nullptr;
208 } 216 }
209 217
210 } // namespace blink 218 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698