| 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. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 | 78 |
| 79 RenderObject* currentObject() { return m_current.object(); } | 79 RenderObject* currentObject() { return m_current.object(); } |
| 80 InlineIterator lineBreak() { return m_lineBreak; } | 80 InlineIterator lineBreak() { return m_lineBreak; } |
| 81 bool atEnd() { return m_atEnd; } | 81 bool atEnd() { return m_atEnd; } |
| 82 | 82 |
| 83 void initializeForCurrentObject(); | 83 void initializeForCurrentObject(); |
| 84 | 84 |
| 85 void increment(); | 85 void increment(); |
| 86 | 86 |
| 87 void handleBR(EClear&); | 87 void handleBR(); |
| 88 void handleOutOfFlowPositioned(Vector<RenderBox*>& positionedObjects); | 88 void handleOutOfFlowPositioned(Vector<RenderBox*>& positionedObjects); |
| 89 void handleEmptyInline(); | 89 void handleEmptyInline(); |
| 90 void handleReplaced(); | 90 void handleReplaced(); |
| 91 bool handleText(WordMeasurements&, bool& hyphenated); | 91 bool handleText(WordMeasurements&, bool& hyphenated); |
| 92 void commitAndUpdateLineBreakIfNeeded(); | 92 void commitAndUpdateLineBreakIfNeeded(); |
| 93 InlineIterator handleEndOfLine(); | 93 InlineIterator handleEndOfLine(); |
| 94 | 94 |
| 95 void clearLineBreakIfFitsOnLine() | 95 void clearLineBreakIfFitsOnLine() |
| 96 { | 96 { |
| 97 if (m_width.fitsOnLine() || m_lastWS == NOWRAP) | 97 if (m_width.fitsOnLine() || m_lastWS == NOWRAP) |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 { | 244 { |
| 245 // Clear out our character space bool, since inline <pre>s don't collapse wh
itespace | 245 // Clear out our character space bool, since inline <pre>s don't collapse wh
itespace |
| 246 // with adjacent inline normal/nowrap spans. | 246 // with adjacent inline normal/nowrap spans. |
| 247 if (!m_collapseWhiteSpace) | 247 if (!m_collapseWhiteSpace) |
| 248 m_currentCharacterIsSpace = false; | 248 m_currentCharacterIsSpace = false; |
| 249 | 249 |
| 250 m_current.moveToStartOf(m_nextObject); | 250 m_current.moveToStartOf(m_nextObject); |
| 251 m_atStart = false; | 251 m_atStart = false; |
| 252 } | 252 } |
| 253 | 253 |
| 254 inline void BreakingContext::handleBR(EClear& clear) | 254 inline void BreakingContext::handleBR() |
| 255 { | 255 { |
| 256 if (m_width.fitsOnLine()) { | 256 if (m_width.fitsOnLine()) { |
| 257 RenderObject* br = m_current.object(); | 257 RenderObject* br = m_current.object(); |
| 258 m_lineBreak.moveToStartOf(br); | 258 m_lineBreak.moveToStartOf(br); |
| 259 m_lineBreak.increment(); | 259 m_lineBreak.increment(); |
| 260 | 260 |
| 261 // A <br> always breaks a line, so don't let the line be collapsed | 261 // A <br> always breaks a line, so don't let the line be collapsed |
| 262 // away. Also, the space at the end of a line with a <br> does not | 262 // away. Also, the space at the end of a line with a <br> does not |
| 263 // get collapsed away. It only does this if the previous line broke | 263 // get collapsed away. It only does this if the previous line broke |
| 264 // cleanly. Otherwise the <br> has no effect on whether the line is | 264 // cleanly. Otherwise the <br> has no effect on whether the line is |
| 265 // empty or not. | 265 // empty or not. |
| 266 if (m_startingNewParagraph) | 266 if (m_startingNewParagraph) |
| 267 m_lineInfo.setEmpty(false, m_block, &m_width); | 267 m_lineInfo.setEmpty(false, m_block, &m_width); |
| 268 m_trailingObjects.clear(); | 268 m_trailingObjects.clear(); |
| 269 m_lineInfo.setPreviousLineBrokeCleanly(true); | 269 m_lineInfo.setPreviousLineBrokeCleanly(true); |
| 270 | |
| 271 // A <br> with clearance always needs a linebox in case the lines below
it get dirtied later and | |
| 272 // need to check for floats to clear - so if we're ignoring spaces, stop
ignoring them and add a | |
| 273 // run for this object. | |
| 274 if (m_ignoringSpaces && m_currentStyle->clear() != CNONE) | |
| 275 m_lineMidpointState.ensureLineBoxInsideIgnoredSpaces(br); | |
| 276 | |
| 277 if (!m_lineInfo.isEmpty()) | |
| 278 clear = m_currentStyle->clear(); | |
| 279 } | 270 } |
| 280 m_atEnd = true; | 271 m_atEnd = true; |
| 281 } | 272 } |
| 282 | 273 |
| 283 inline LayoutUnit borderPaddingMarginStart(RenderInline* child) | 274 inline LayoutUnit borderPaddingMarginStart(RenderInline* child) |
| 284 { | 275 { |
| 285 return child->marginStart() + child->paddingStart() + child->borderStart(); | 276 return child->marginStart() + child->paddingStart() + child->borderStart(); |
| 286 } | 277 } |
| 287 | 278 |
| 288 inline LayoutUnit borderPaddingMarginEnd(RenderInline* child) | 279 inline LayoutUnit borderPaddingMarginEnd(RenderInline* child) |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 | 811 |
| 821 if (style->textIndentType() == TextIndentHanging) | 812 if (style->textIndentType() == TextIndentHanging) |
| 822 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; | 813 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In
dentText; |
| 823 | 814 |
| 824 return shouldIndentText; | 815 return shouldIndentText; |
| 825 } | 816 } |
| 826 | 817 |
| 827 } | 818 } |
| 828 | 819 |
| 829 #endif // BreakingContextInlineHeaders_h | 820 #endif // BreakingContextInlineHeaders_h |
| OLD | NEW |