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

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

Issue 2287433003: Get rid of remaining uses of AXObject::elementRect (Closed)
Patch Set: Rebase Created 4 years, 3 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 95
96 LayoutRect AbstractInlineTextBox::localBounds() 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 100
101 return m_inlineTextBox->calculateBoundaries(); 101 return m_inlineTextBox->calculateBoundaries();
102 } 102 }
103 103
104 LayoutRect AbstractInlineTextBox::absoluteBounds() const
105 {
106 if (!m_inlineTextBox || !m_lineLayoutItem)
107 return LayoutRect();
108
109 FloatRect boundaries(m_inlineTextBox->calculateBoundaries());
110 return LayoutRect(m_lineLayoutItem.localToAbsoluteQuad(boundaries).enclosing BoundingBox());
111 }
112
113 unsigned AbstractInlineTextBox::len() const 104 unsigned AbstractInlineTextBox::len() const
114 { 105 {
115 if (!m_inlineTextBox) 106 if (!m_inlineTextBox)
116 return 0; 107 return 0;
117 108
118 return m_inlineTextBox->len(); 109 return m_inlineTextBox->len();
119 } 110 }
120 111
121 AbstractInlineTextBox::Direction AbstractInlineTextBox::getDirection() const 112 AbstractInlineTextBox::Direction AbstractInlineTextBox::getDirection() const
122 { 113 {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return nullptr; 200 return nullptr;
210 201
211 InlineBox* previous = m_inlineTextBox->prevOnLine(); 202 InlineBox* previous = m_inlineTextBox->prevOnLine();
212 if (previous && previous->isInlineTextBox()) 203 if (previous && previous->isInlineTextBox())
213 return getOrCreate(toInlineTextBox(previous)->getLineLayoutItem(), toInl ineTextBox(previous)); 204 return getOrCreate(toInlineTextBox(previous)->getLineLayoutItem(), toInl ineTextBox(previous));
214 205
215 return nullptr; 206 return nullptr;
216 } 207 }
217 208
218 } // namespace blink 209 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698