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

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

Issue 1043643002: Switch line layout to LayoutUnit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More TestExpectations tweaks Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/line/AbstractInlineTextBox.h ('k') | Source/core/layout/line/EllipsisBox.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 return nullptr; 80 return nullptr;
81 81
82 return getOrCreate(m_layoutText, m_inlineTextBox->nextTextBox()); 82 return getOrCreate(m_layoutText, m_inlineTextBox->nextTextBox());
83 } 83 }
84 84
85 LayoutRect AbstractInlineTextBox::bounds() const 85 LayoutRect AbstractInlineTextBox::bounds() const
86 { 86 {
87 if (!m_inlineTextBox || !m_layoutText) 87 if (!m_inlineTextBox || !m_layoutText)
88 return LayoutRect(); 88 return LayoutRect();
89 89
90 FloatRect boundaries = m_inlineTextBox->calculateBoundaries().toFloatRect(); 90 FloatRect boundaries = m_inlineTextBox->calculateBoundaries();
91 return LayoutRect(m_layoutText->localToAbsoluteQuad(boundaries).enclosingBou ndingBox()); 91 return LayoutRect(m_layoutText->localToAbsoluteQuad(boundaries).enclosingBou ndingBox());
92 } 92 }
93 93
94 unsigned AbstractInlineTextBox::len() const 94 unsigned AbstractInlineTextBox::len() const
95 { 95 {
96 if (!m_inlineTextBox) 96 if (!m_inlineTextBox)
97 return 0; 97 return 0;
98 98
99 return m_inlineTextBox->len(); 99 return m_inlineTextBox->len();
100 } 100 }
101 101
102 AbstractInlineTextBox::Direction AbstractInlineTextBox::direction() const 102 AbstractInlineTextBox::Direction AbstractInlineTextBox::direction() const
103 { 103 {
104 if (!m_inlineTextBox || !m_layoutText) 104 if (!m_inlineTextBox || !m_layoutText)
105 return LeftToRight; 105 return LeftToRight;
106 106
107 if (m_layoutText->style()->isHorizontalWritingMode()) 107 if (m_layoutText->style()->isHorizontalWritingMode())
108 return (m_inlineTextBox->direction() == RTL ? RightToLeft : LeftToRight) ; 108 return (m_inlineTextBox->direction() == RTL ? RightToLeft : LeftToRight) ;
109 return (m_inlineTextBox->direction() == RTL ? BottomToTop : TopToBottom); 109 return (m_inlineTextBox->direction() == RTL ? BottomToTop : TopToBottom);
110 } 110 }
111 111
112 void AbstractInlineTextBox::characterWidths(Vector<FloatWillBeLayoutUnit>& width s) const 112 void AbstractInlineTextBox::characterWidths(Vector<float>& widths) const
113 { 113 {
114 if (!m_inlineTextBox) 114 if (!m_inlineTextBox)
115 return; 115 return;
116 116
117 m_inlineTextBox->characterWidths(widths); 117 m_inlineTextBox->characterWidths(widths);
118 } 118 }
119 119
120 void AbstractInlineTextBox::wordBoundaries(Vector<WordBoundaries>& words) const 120 void AbstractInlineTextBox::wordBoundaries(Vector<WordBoundaries>& words) const
121 { 121 {
122 if (!m_inlineTextBox) 122 if (!m_inlineTextBox)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return nullptr; 191 return nullptr;
192 192
193 InlineBox* previous = m_inlineTextBox->prevOnLine(); 193 InlineBox* previous = m_inlineTextBox->prevOnLine();
194 if (previous && previous->isInlineTextBox()) 194 if (previous && previous->isInlineTextBox())
195 return getOrCreate(&toInlineTextBox(previous)->layoutObject(), toInlineT extBox(previous)); 195 return getOrCreate(&toInlineTextBox(previous)->layoutObject(), toInlineT extBox(previous));
196 196
197 return nullptr; 197 return nullptr;
198 } 198 }
199 199
200 } // namespace blink 200 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/line/AbstractInlineTextBox.h ('k') | Source/core/layout/line/EllipsisBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698