| 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 13 matching lines...) Expand all Loading... |
| 24 #include "config.h" | 24 #include "config.h" |
| 25 #include "core/layout/line/BreakingContextInlineHeaders.h" | 25 #include "core/layout/line/BreakingContextInlineHeaders.h" |
| 26 | 26 |
| 27 namespace blink { | 27 namespace blink { |
| 28 | 28 |
| 29 InlineIterator BreakingContext::handleEndOfLine() | 29 InlineIterator BreakingContext::handleEndOfLine() |
| 30 { | 30 { |
| 31 if (m_lineBreak == m_resolver.position() && (!m_lineBreak.object() || !m_lin
eBreak.object()->isBR())) { | 31 if (m_lineBreak == m_resolver.position() && (!m_lineBreak.object() || !m_lin
eBreak.object()->isBR())) { |
| 32 // we just add as much as possible | 32 // we just add as much as possible |
| 33 if (m_blockStyle->whiteSpace() == PRE && !m_current.offset()) { | 33 if (m_blockStyle->whiteSpace() == PRE && !m_current.offset()) { |
| 34 m_lineBreak.moveTo(m_lastObject, m_lastObject->isText() ? m_lastObje
ct->length() : 0); | 34 m_lineBreak.moveTo(LineLayoutItem(m_lastObject), m_lastObject->isTex
t() ? m_lastObject->length() : 0); |
| 35 } else if (m_lineBreak.object()) { | 35 } else if (m_lineBreak.object()) { |
| 36 // Don't ever break in the middle of a word if we can help it. | 36 // Don't ever break in the middle of a word if we can help it. |
| 37 // There's no room at all. We just have to be on this line, | 37 // There's no room at all. We just have to be on this line, |
| 38 // even though we'll spill out. | 38 // even though we'll spill out. |
| 39 m_lineBreak.moveTo(m_current.object(), m_current.offset()); | 39 m_lineBreak.moveTo(m_current.object(), m_current.offset()); |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 | 42 |
| 43 // FIXME Bug 100049: We do not need to consume input in a multi-segment line | 43 // FIXME Bug 100049: We do not need to consume input in a multi-segment line |
| 44 // unless no segment will. | 44 // unless no segment will. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 60 do { | 60 do { |
| 61 m_lineBreak.setOffset(m_lineBreak.offset() - 1); | 61 m_lineBreak.setOffset(m_lineBreak.offset() - 1); |
| 62 m_lineBreak.increment(); | 62 m_lineBreak.increment(); |
| 63 } while (!m_lineBreak.atEnd() && isEmptyInline(m_lineBreak.object())); | 63 } while (!m_lineBreak.atEnd() && isEmptyInline(m_lineBreak.object())); |
| 64 } | 64 } |
| 65 | 65 |
| 66 return m_lineBreak; | 66 return m_lineBreak; |
| 67 } | 67 } |
| 68 | 68 |
| 69 } | 69 } |
| OLD | NEW |