Chromium Code Reviews| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 inline bool alwaysRequiresLineBox(LineLayoutItem flow) | 199 inline bool alwaysRequiresLineBox(LineLayoutItem flow) |
| 200 { | 200 { |
| 201 // FIXME: Right now, we only allow line boxes for inlines that are truly emp ty. | 201 // FIXME: Right now, we only allow line boxes for inlines that are truly emp ty. |
| 202 // We need to fix this, though, because at the very least, inlines containin g only | 202 // We need to fix this, though, because at the very least, inlines containin g only |
| 203 // ignorable whitespace should should also have line boxes. | 203 // ignorable whitespace should should also have line boxes. |
| 204 return isEmptyInline(flow) && LineLayoutInline(flow).hasInlineDirectionBorde rsPaddingOrMargin(); | 204 return isEmptyInline(flow) && LineLayoutInline(flow).hasInlineDirectionBorde rsPaddingOrMargin(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 inline bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo = LineInfo(), WhitespacePosition whitespacePosition = LeadingWhitespace) | 207 inline bool requiresLineBox(const InlineIterator& it, const LineInfo& lineInfo = LineInfo(), WhitespacePosition whitespacePosition = LeadingWhitespace) |
| 208 { | 208 { |
| 209 if (it.getLineLayoutItem().isEmptyText()) { | |
|
eae
2016/08/02 20:52:04
NIT: No curly brackets around one-line control-flo
Gleb Lanbin
2016/08/02 23:17:55
Done.
| |
| 210 return false; | |
| 211 } | |
| 212 | |
| 209 if (it.getLineLayoutItem().isFloatingOrOutOfFlowPositioned()) | 213 if (it.getLineLayoutItem().isFloatingOrOutOfFlowPositioned()) |
| 210 return false; | 214 return false; |
| 211 | 215 |
| 212 if (it.getLineLayoutItem().isLayoutInline() && !alwaysRequiresLineBox(it.get LineLayoutItem()) && !requiresLineBoxForContent(LineLayoutInline(it.getLineLayou tItem()), lineInfo)) | 216 if (it.getLineLayoutItem().isLayoutInline() && !alwaysRequiresLineBox(it.get LineLayoutItem()) && !requiresLineBoxForContent(LineLayoutInline(it.getLineLayou tItem()), lineInfo)) |
| 213 return false; | 217 return false; |
| 214 | 218 |
| 215 if (!shouldCollapseWhiteSpace(it.getLineLayoutItem().styleRef(), lineInfo, w hitespacePosition) || it.getLineLayoutItem().isBR()) | 219 if (!shouldCollapseWhiteSpace(it.getLineLayoutItem().styleRef(), lineInfo, w hitespacePosition) || it.getLineLayoutItem().isBR()) |
| 216 return true; | 220 return true; |
| 217 | 221 |
| 218 UChar current = it.current(); | 222 UChar current = it.current(); |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1190 | 1194 |
| 1191 if (style.getTextIndentType() == TextIndentHanging) | 1195 if (style.getTextIndentType() == TextIndentHanging) |
| 1192 indentText = indentText == IndentText ? DoNotIndentText : IndentText; | 1196 indentText = indentText == IndentText ? DoNotIndentText : IndentText; |
| 1193 | 1197 |
| 1194 return indentText; | 1198 return indentText; |
| 1195 } | 1199 } |
| 1196 | 1200 |
| 1197 } // namespace blink | 1201 } // namespace blink |
| 1198 | 1202 |
| 1199 #endif // BreakingContextInlineHeaders_h | 1203 #endif // BreakingContextInlineHeaders_h |
| OLD | NEW |