OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
5 * Copyright (C) 2013 Adobe Systems Incorporated. | 5 * Copyright (C) 2013 Adobe Systems Incorporated. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 * | 21 * |
22 */ | 22 */ |
23 | 23 |
24 #ifndef BreakingContextInlineHeaders_h | 24 #ifndef BreakingContextInlineHeaders_h |
25 #define BreakingContextInlineHeaders_h | 25 #define BreakingContextInlineHeaders_h |
26 | 26 |
27 #include "core/layout/Layer.h" | 27 #include "core/layout/Layer.h" |
| 28 #include "core/layout/LayoutObject.h" |
28 #include "core/layout/LayoutRubyRun.h" | 29 #include "core/layout/LayoutRubyRun.h" |
29 #include "core/layout/line/InlineIterator.h" | 30 #include "core/layout/line/InlineIterator.h" |
30 #include "core/layout/line/InlineTextBox.h" | 31 #include "core/layout/line/InlineTextBox.h" |
31 #include "core/layout/line/LayoutTextInfo.h" | 32 #include "core/layout/line/LayoutTextInfo.h" |
32 #include "core/layout/line/LineBreaker.h" | 33 #include "core/layout/line/LineBreaker.h" |
33 #include "core/layout/line/LineInfo.h" | 34 #include "core/layout/line/LineInfo.h" |
34 #include "core/layout/line/LineWidth.h" | 35 #include "core/layout/line/LineWidth.h" |
35 #include "core/layout/line/TrailingObjects.h" | 36 #include "core/layout/line/TrailingObjects.h" |
36 #include "core/layout/line/WordMeasurement.h" | 37 #include "core/layout/line/WordMeasurement.h" |
37 #include "core/rendering/RenderCombineText.h" | 38 #include "core/rendering/RenderCombineText.h" |
38 #include "core/rendering/RenderInline.h" | 39 #include "core/rendering/RenderInline.h" |
39 #include "core/rendering/RenderListMarker.h" | 40 #include "core/rendering/RenderListMarker.h" |
40 #include "core/rendering/RenderObjectInlines.h" | |
41 #include "core/rendering/TextRunConstructor.h" | 41 #include "core/rendering/TextRunConstructor.h" |
42 #include "core/rendering/svg/RenderSVGInlineText.h" | 42 #include "core/rendering/svg/RenderSVGInlineText.h" |
43 #include "platform/text/TextBreakIterator.h" | 43 #include "platform/text/TextBreakIterator.h" |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
47 // We don't let our line box tree for a single line get any deeper than this. | 47 // We don't let our line box tree for a single line get any deeper than this. |
48 const unsigned cMaxLineDepth = 200; | 48 const unsigned cMaxLineDepth = 200; |
49 | 49 |
50 class BreakingContext { | 50 class BreakingContext { |
(...skipping 25 matching lines...) Expand all Loading... |
76 , m_floatsFitOnLine(true) | 76 , m_floatsFitOnLine(true) |
77 , m_collapseWhiteSpace(false) | 77 , m_collapseWhiteSpace(false) |
78 , m_startingNewParagraph(m_lineInfo.previousLineBrokeCleanly()) | 78 , m_startingNewParagraph(m_lineInfo.previousLineBrokeCleanly()) |
79 , m_allowImagesToBreak(!block->document().inQuirksMode() || !block->isTa
bleCell() || !m_blockStyle->logicalWidth().isIntrinsicOrAuto()) | 79 , m_allowImagesToBreak(!block->document().inQuirksMode() || !block->isTa
bleCell() || !m_blockStyle->logicalWidth().isIntrinsicOrAuto()) |
80 , m_atEnd(false) | 80 , m_atEnd(false) |
81 , m_lineMidpointState(resolver.midpointState()) | 81 , m_lineMidpointState(resolver.midpointState()) |
82 { | 82 { |
83 m_lineInfo.setPreviousLineBrokeCleanly(false); | 83 m_lineInfo.setPreviousLineBrokeCleanly(false); |
84 } | 84 } |
85 | 85 |
86 RenderObject* currentObject() { return m_current.object(); } | 86 LayoutObject* currentObject() { return m_current.object(); } |
87 InlineIterator lineBreak() { return m_lineBreak; } | 87 InlineIterator lineBreak() { return m_lineBreak; } |
88 bool atEnd() { return m_atEnd; } | 88 bool atEnd() { return m_atEnd; } |
89 | 89 |
90 void initializeForCurrentObject(); | 90 void initializeForCurrentObject(); |
91 | 91 |
92 void increment(); | 92 void increment(); |
93 | 93 |
94 void handleBR(EClear&); | 94 void handleBR(EClear&); |
95 void handleOutOfFlowPositioned(Vector<RenderBox*>& positionedObjects); | 95 void handleOutOfFlowPositioned(Vector<RenderBox*>& positionedObjects); |
96 void handleFloat(); | 96 void handleFloat(); |
(...skipping 12 matching lines...) Expand all Loading... |
109 private: | 109 private: |
110 void skipTrailingWhitespace(InlineIterator&, const LineInfo&); | 110 void skipTrailingWhitespace(InlineIterator&, const LineInfo&); |
111 | 111 |
112 InlineBidiResolver& m_resolver; | 112 InlineBidiResolver& m_resolver; |
113 | 113 |
114 InlineIterator m_current; | 114 InlineIterator m_current; |
115 InlineIterator m_lineBreak; | 115 InlineIterator m_lineBreak; |
116 InlineIterator m_startOfIgnoredSpaces; | 116 InlineIterator m_startOfIgnoredSpaces; |
117 | 117 |
118 RenderBlockFlow* m_block; | 118 RenderBlockFlow* m_block; |
119 RenderObject* m_lastObject; | 119 LayoutObject* m_lastObject; |
120 RenderObject* m_nextObject; | 120 LayoutObject* m_nextObject; |
121 | 121 |
122 RenderStyle* m_currentStyle; | 122 RenderStyle* m_currentStyle; |
123 RenderStyle* m_blockStyle; | 123 RenderStyle* m_blockStyle; |
124 | 124 |
125 LineInfo& m_lineInfo; | 125 LineInfo& m_lineInfo; |
126 | 126 |
127 LayoutTextInfo& m_renderTextInfo; | 127 LayoutTextInfo& m_renderTextInfo; |
128 | 128 |
129 FloatingObject* m_lastFloatFromPreviousLine; | 129 FloatingObject* m_lastFloatFromPreviousLine; |
130 | 130 |
(...skipping 27 matching lines...) Expand all Loading... |
158 // CSS2 16.6.1 | 158 // CSS2 16.6.1 |
159 // If a space (U+0020) at the beginning of a line has 'white-space' set to '
normal', 'nowrap', or 'pre-line', it is removed. | 159 // If a space (U+0020) at the beginning of a line has 'white-space' set to '
normal', 'nowrap', or 'pre-line', it is removed. |
160 // If a space (U+0020) at the end of a line has 'white-space' set to 'normal
', 'nowrap', or 'pre-line', it is also removed. | 160 // If a space (U+0020) at the end of a line has 'white-space' set to 'normal
', 'nowrap', or 'pre-line', it is also removed. |
161 // If spaces (U+0020) or tabs (U+0009) at the end of a line have 'white-spac
e' set to 'pre-wrap', UAs may visually collapse them. | 161 // If spaces (U+0020) or tabs (U+0009) at the end of a line have 'white-spac
e' set to 'pre-wrap', UAs may visually collapse them. |
162 return style->collapseWhiteSpace() | 162 return style->collapseWhiteSpace() |
163 || (whitespacePosition == TrailingWhitespace && style->whiteSpace() == P
RE_WRAP && (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly())); | 163 || (whitespacePosition == TrailingWhitespace && style->whiteSpace() == P
RE_WRAP && (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly())); |
164 } | 164 } |
165 | 165 |
166 inline bool requiresLineBoxForContent(RenderInline* flow, const LineInfo& lineIn
fo) | 166 inline bool requiresLineBoxForContent(RenderInline* flow, const LineInfo& lineIn
fo) |
167 { | 167 { |
168 RenderObject* parent = flow->parent(); | 168 LayoutObject* parent = flow->parent(); |
169 if (flow->document().inNoQuirksMode() | 169 if (flow->document().inNoQuirksMode() |
170 && (flow->style(lineInfo.isFirstLine())->lineHeight() != parent->style(l
ineInfo.isFirstLine())->lineHeight() | 170 && (flow->style(lineInfo.isFirstLine())->lineHeight() != parent->style(l
ineInfo.isFirstLine())->lineHeight() |
171 || flow->style()->verticalAlign() != parent->style()->verticalAlign() | 171 || flow->style()->verticalAlign() != parent->style()->verticalAlign() |
172 || !parent->style()->font().fontMetrics().hasIdenticalAscentDescentAndLi
neGap(flow->style()->font().fontMetrics()))) | 172 || !parent->style()->font().fontMetrics().hasIdenticalAscentDescentAndLi
neGap(flow->style()->font().fontMetrics()))) |
173 return true; | 173 return true; |
174 return false; | 174 return false; |
175 } | 175 } |
176 | 176 |
177 inline bool alwaysRequiresLineBox(RenderObject* flow) | 177 inline bool alwaysRequiresLineBox(LayoutObject* flow) |
178 { | 178 { |
179 // FIXME: Right now, we only allow line boxes for inlines that are truly emp
ty. | 179 // FIXME: Right now, we only allow line boxes for inlines that are truly emp
ty. |
180 // We need to fix this, though, because at the very least, inlines containin
g only | 180 // We need to fix this, though, because at the very least, inlines containin
g only |
181 // ignorable whitespace should should also have line boxes. | 181 // ignorable whitespace should should also have line boxes. |
182 return isEmptyInline(flow) && toRenderInline(flow)->hasInlineDirectionBorder
sPaddingOrMargin(); | 182 return isEmptyInline(flow) && toRenderInline(flow)->hasInlineDirectionBorder
sPaddingOrMargin(); |
183 } | 183 } |
184 | 184 |
185 inline bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo =
LineInfo(), WhitespacePosition whitespacePosition = LeadingWhitespace) | 185 inline bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo =
LineInfo(), WhitespacePosition whitespacePosition = LeadingWhitespace) |
186 { | 186 { |
187 if (it.object()->isFloatingOrOutOfFlowPositioned()) | 187 if (it.object()->isFloatingOrOutOfFlowPositioned()) |
188 return false; | 188 return false; |
189 | 189 |
190 if (it.object()->isRenderInline() && !alwaysRequiresLineBox(it.object()) &&
!requiresLineBoxForContent(toRenderInline(it.object()), lineInfo)) | 190 if (it.object()->isRenderInline() && !alwaysRequiresLineBox(it.object()) &&
!requiresLineBoxForContent(toRenderInline(it.object()), lineInfo)) |
191 return false; | 191 return false; |
192 | 192 |
193 if (!shouldCollapseWhiteSpace(it.object()->style(), lineInfo, whitespacePosi
tion) || it.object()->isBR()) | 193 if (!shouldCollapseWhiteSpace(it.object()->style(), lineInfo, whitespacePosi
tion) || it.object()->isBR()) |
194 return true; | 194 return true; |
195 | 195 |
196 UChar current = it.current(); | 196 UChar current = it.current(); |
197 bool notJustWhitespace = current != ' ' && current != '\t' && current != sof
tHyphen && (current != '\n' || it.object()->preservesNewline()); | 197 bool notJustWhitespace = current != ' ' && current != '\t' && current != sof
tHyphen && (current != '\n' || it.object()->preservesNewline()); |
198 return notJustWhitespace || isEmptyInline(it.object()); | 198 return notJustWhitespace || isEmptyInline(it.object()); |
199 } | 199 } |
200 | 200 |
201 inline void setStaticPositions(RenderBlockFlow* block, RenderBox* child) | 201 inline void setStaticPositions(RenderBlockFlow* block, RenderBox* child) |
202 { | 202 { |
203 ASSERT(child->isOutOfFlowPositioned()); | 203 ASSERT(child->isOutOfFlowPositioned()); |
204 // FIXME: The math here is actually not really right. It's a best-guess appr
oximation that | 204 // FIXME: The math here is actually not really right. It's a best-guess appr
oximation that |
205 // will work for the common cases | 205 // will work for the common cases |
206 RenderObject* containerBlock = child->container(); | 206 LayoutObject* containerBlock = child->container(); |
207 LayoutUnit blockHeight = block->logicalHeight(); | 207 LayoutUnit blockHeight = block->logicalHeight(); |
208 if (containerBlock->isRenderInline()) { | 208 if (containerBlock->isRenderInline()) { |
209 // A relative positioned inline encloses us. In this case, we also have
to determine our | 209 // A relative positioned inline encloses us. In this case, we also have
to determine our |
210 // position as though we were an inline. Set |staticInlinePosition| and
|staticBlockPosition| on the relative positioned | 210 // position as though we were an inline. Set |staticInlinePosition| and
|staticBlockPosition| on the relative positioned |
211 // inline so that we can obtain the value later. | 211 // inline so that we can obtain the value later. |
212 toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->
startAlignedOffsetForLine(blockHeight, false)); | 212 toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->
startAlignedOffsetForLine(blockHeight, false)); |
213 toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHei
ght); | 213 toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHei
ght); |
214 | 214 |
215 // If |child| is a leading or trailing positioned object this is its onl
y opportunity to ensure it moves with an inline | 215 // If |child| is a leading or trailing positioned object this is its onl
y opportunity to ensure it moves with an inline |
216 // container changing width. | 216 // container changing width. |
217 child->moveWithEdgeOfInlineContainerIfNecessary(child->isHorizontalWriti
ngMode()); | 217 child->moveWithEdgeOfInlineContainerIfNecessary(child->isHorizontalWriti
ngMode()); |
218 } | 218 } |
219 block->updateStaticInlinePositionForChild(*child, blockHeight); | 219 block->updateStaticInlinePositionForChild(*child, blockHeight); |
220 child->layer()->setStaticBlockPosition(blockHeight); | 220 child->layer()->setStaticBlockPosition(blockHeight); |
221 } | 221 } |
222 | 222 |
223 // FIXME: The entire concept of the skipTrailingWhitespace function is flawed, s
ince we really need to be building | 223 // FIXME: The entire concept of the skipTrailingWhitespace function is flawed, s
ince we really need to be building |
224 // line boxes even for containers that may ultimately collapse away. Otherwise w
e'll never get positioned | 224 // line boxes even for containers that may ultimately collapse away. Otherwise w
e'll never get positioned |
225 // elements quite right. In other words, we need to build this function's work i
nto the normal line | 225 // elements quite right. In other words, we need to build this function's work i
nto the normal line |
226 // object iteration process. | 226 // object iteration process. |
227 // NB. this function will insert any floating elements that would otherwise | 227 // NB. this function will insert any floating elements that would otherwise |
228 // be skipped but it will not position them. | 228 // be skipped but it will not position them. |
229 inline void BreakingContext::skipTrailingWhitespace(InlineIterator& iterator, co
nst LineInfo& lineInfo) | 229 inline void BreakingContext::skipTrailingWhitespace(InlineIterator& iterator, co
nst LineInfo& lineInfo) |
230 { | 230 { |
231 while (!iterator.atEnd() && !requiresLineBox(iterator, lineInfo, TrailingWhi
tespace)) { | 231 while (!iterator.atEnd() && !requiresLineBox(iterator, lineInfo, TrailingWhi
tespace)) { |
232 RenderObject* object = iterator.object(); | 232 LayoutObject* object = iterator.object(); |
233 if (object->isOutOfFlowPositioned()) | 233 if (object->isOutOfFlowPositioned()) |
234 setStaticPositions(m_block, toRenderBox(object)); | 234 setStaticPositions(m_block, toRenderBox(object)); |
235 else if (object->isFloating()) | 235 else if (object->isFloating()) |
236 m_block->insertFloatingObject(*toRenderBox(object)); | 236 m_block->insertFloatingObject(*toRenderBox(object)); |
237 iterator.increment(); | 237 iterator.increment(); |
238 } | 238 } |
239 } | 239 } |
240 | 240 |
241 inline void BreakingContext::initializeForCurrentObject() | 241 inline void BreakingContext::initializeForCurrentObject() |
242 { | 242 { |
(...skipping 20 matching lines...) Expand all Loading... |
263 if (!m_collapseWhiteSpace) | 263 if (!m_collapseWhiteSpace) |
264 m_currentCharacterIsSpace = false; | 264 m_currentCharacterIsSpace = false; |
265 | 265 |
266 m_current.moveToStartOf(m_nextObject); | 266 m_current.moveToStartOf(m_nextObject); |
267 m_atStart = false; | 267 m_atStart = false; |
268 } | 268 } |
269 | 269 |
270 inline void BreakingContext::handleBR(EClear& clear) | 270 inline void BreakingContext::handleBR(EClear& clear) |
271 { | 271 { |
272 if (m_width.fitsOnLine()) { | 272 if (m_width.fitsOnLine()) { |
273 RenderObject* br = m_current.object(); | 273 LayoutObject* br = m_current.object(); |
274 m_lineBreak.moveToStartOf(br); | 274 m_lineBreak.moveToStartOf(br); |
275 m_lineBreak.increment(); | 275 m_lineBreak.increment(); |
276 | 276 |
277 // A <br> always breaks a line, so don't let the line be collapsed | 277 // A <br> always breaks a line, so don't let the line be collapsed |
278 // away. Also, the space at the end of a line with a <br> does not | 278 // away. Also, the space at the end of a line with a <br> does not |
279 // get collapsed away. It only does this if the previous line broke | 279 // get collapsed away. It only does this if the previous line broke |
280 // cleanly. Otherwise the <br> has no effect on whether the line is | 280 // cleanly. Otherwise the <br> has no effect on whether the line is |
281 // empty or not. | 281 // empty or not. |
282 if (m_startingNewParagraph) | 282 if (m_startingNewParagraph) |
283 m_lineInfo.setEmpty(false, m_block, &m_width); | 283 m_lineInfo.setEmpty(false, m_block, &m_width); |
(...skipping 15 matching lines...) Expand all Loading... |
299 inline LayoutUnit borderPaddingMarginStart(RenderInline* child) | 299 inline LayoutUnit borderPaddingMarginStart(RenderInline* child) |
300 { | 300 { |
301 return child->marginStart() + child->paddingStart() + child->borderStart(); | 301 return child->marginStart() + child->paddingStart() + child->borderStart(); |
302 } | 302 } |
303 | 303 |
304 inline LayoutUnit borderPaddingMarginEnd(RenderInline* child) | 304 inline LayoutUnit borderPaddingMarginEnd(RenderInline* child) |
305 { | 305 { |
306 return child->marginEnd() + child->paddingEnd() + child->borderEnd(); | 306 return child->marginEnd() + child->paddingEnd() + child->borderEnd(); |
307 } | 307 } |
308 | 308 |
309 inline bool shouldAddBorderPaddingMargin(RenderObject* child, bool &checkSide) | 309 inline bool shouldAddBorderPaddingMargin(LayoutObject* child, bool &checkSide) |
310 { | 310 { |
311 if (!child || (child->isText() && !toRenderText(child)->textLength())) | 311 if (!child || (child->isText() && !toRenderText(child)->textLength())) |
312 return true; | 312 return true; |
313 checkSide = false; | 313 checkSide = false; |
314 return checkSide; | 314 return checkSide; |
315 } | 315 } |
316 | 316 |
317 inline LayoutUnit inlineLogicalWidth(RenderObject* child, bool start = true, boo
l end = true) | 317 inline LayoutUnit inlineLogicalWidth(LayoutObject* child, bool start = true, boo
l end = true) |
318 { | 318 { |
319 unsigned lineDepth = 1; | 319 unsigned lineDepth = 1; |
320 LayoutUnit extraWidth = 0; | 320 LayoutUnit extraWidth = 0; |
321 RenderObject* parent = child->parent(); | 321 LayoutObject* parent = child->parent(); |
322 while (parent->isRenderInline() && lineDepth++ < cMaxLineDepth) { | 322 while (parent->isRenderInline() && lineDepth++ < cMaxLineDepth) { |
323 RenderInline* parentAsRenderInline = toRenderInline(parent); | 323 RenderInline* parentAsRenderInline = toRenderInline(parent); |
324 if (!isEmptyInline(parentAsRenderInline)) { | 324 if (!isEmptyInline(parentAsRenderInline)) { |
325 if (start && shouldAddBorderPaddingMargin(child->previousSibling(),
start)) | 325 if (start && shouldAddBorderPaddingMargin(child->previousSibling(),
start)) |
326 extraWidth += borderPaddingMarginStart(parentAsRenderInline); | 326 extraWidth += borderPaddingMarginStart(parentAsRenderInline); |
327 if (end && shouldAddBorderPaddingMargin(child->nextSibling(), end)) | 327 if (end && shouldAddBorderPaddingMargin(child->nextSibling(), end)) |
328 extraWidth += borderPaddingMarginEnd(parentAsRenderInline); | 328 extraWidth += borderPaddingMarginEnd(parentAsRenderInline); |
329 if (!start && !end) | 329 if (!start && !end) |
330 return extraWidth; | 330 return extraWidth; |
331 } | 331 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 } | 379 } |
380 } else { | 380 } else { |
381 m_floatsFitOnLine = false; | 381 m_floatsFitOnLine = false; |
382 } | 382 } |
383 // Update prior line break context characters, using U+FFFD (OBJECT REPLACEM
ENT CHARACTER) for floating element. | 383 // Update prior line break context characters, using U+FFFD (OBJECT REPLACEM
ENT CHARACTER) for floating element. |
384 m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter
); | 384 m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter
); |
385 } | 385 } |
386 | 386 |
387 // This is currently just used for list markers and inline flows that have line
boxes. Neither should | 387 // This is currently just used for list markers and inline flows that have line
boxes. Neither should |
388 // have an effect on whitespace at the start of the line. | 388 // have an effect on whitespace at the start of the line. |
389 inline bool shouldSkipWhitespaceAfterStartObject(RenderBlockFlow* block, RenderO
bject* o, LineMidpointState& lineMidpointState) | 389 inline bool shouldSkipWhitespaceAfterStartObject(RenderBlockFlow* block, LayoutO
bject* o, LineMidpointState& lineMidpointState) |
390 { | 390 { |
391 RenderObject* next = bidiNextSkippingEmptyInlines(block, o); | 391 LayoutObject* next = bidiNextSkippingEmptyInlines(block, o); |
392 while (next && next->isFloatingOrOutOfFlowPositioned()) | 392 while (next && next->isFloatingOrOutOfFlowPositioned()) |
393 next = bidiNextSkippingEmptyInlines(block, next); | 393 next = bidiNextSkippingEmptyInlines(block, next); |
394 | 394 |
395 if (next && !next->isBR() && next->isText() && toRenderText(next)->textLengt
h() > 0) { | 395 if (next && !next->isBR() && next->isText() && toRenderText(next)->textLengt
h() > 0) { |
396 RenderText* nextText = toRenderText(next); | 396 RenderText* nextText = toRenderText(next); |
397 UChar nextChar = nextText->characterAt(0); | 397 UChar nextChar = nextText->characterAt(0); |
398 if (nextText->style()->isCollapsibleWhiteSpace(nextChar)) { | 398 if (nextText->style()->isCollapsibleWhiteSpace(nextChar)) { |
399 lineMidpointState.startIgnoringSpaces(InlineIterator(0, o, 0)); | 399 lineMidpointState.startIgnoringSpaces(InlineIterator(0, o, 0)); |
400 return true; | 400 return true; |
401 } | 401 } |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 | 891 |
892 if (style->textIndentType() == TextIndentHanging) | 892 if (style->textIndentType() == TextIndentHanging) |
893 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; | 893 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; |
894 | 894 |
895 return shouldIndentText; | 895 return shouldIndentText; |
896 } | 896 } |
897 | 897 |
898 } | 898 } |
899 | 899 |
900 #endif // BreakingContextInlineHeaders_h | 900 #endif // BreakingContextInlineHeaders_h |
OLD | NEW |