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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h

Issue 2204593003: Change requiresLineBox to return false for empty-text inline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove curly brackets around one-line control-flow statements Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/api/LineLayoutItem.h ('k') | no next file » | 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) 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
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())
210 return false;
211
209 if (it.getLineLayoutItem().isFloatingOrOutOfFlowPositioned()) 212 if (it.getLineLayoutItem().isFloatingOrOutOfFlowPositioned())
210 return false; 213 return false;
211 214
212 if (it.getLineLayoutItem().isLayoutInline() && !alwaysRequiresLineBox(it.get LineLayoutItem()) && !requiresLineBoxForContent(LineLayoutInline(it.getLineLayou tItem()), lineInfo)) 215 if (it.getLineLayoutItem().isLayoutInline() && !alwaysRequiresLineBox(it.get LineLayoutItem()) && !requiresLineBoxForContent(LineLayoutInline(it.getLineLayou tItem()), lineInfo))
213 return false; 216 return false;
214 217
215 if (!shouldCollapseWhiteSpace(it.getLineLayoutItem().styleRef(), lineInfo, w hitespacePosition) || it.getLineLayoutItem().isBR()) 218 if (!shouldCollapseWhiteSpace(it.getLineLayoutItem().styleRef(), lineInfo, w hitespacePosition) || it.getLineLayoutItem().isBR())
216 return true; 219 return true;
217 220
218 UChar current = it.current(); 221 UChar current = it.current();
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 1193
1191 if (style.getTextIndentType() == TextIndentHanging) 1194 if (style.getTextIndentType() == TextIndentHanging)
1192 indentText = indentText == IndentText ? DoNotIndentText : IndentText; 1195 indentText = indentText == IndentText ? DoNotIndentText : IndentText;
1193 1196
1194 return indentText; 1197 return indentText;
1195 } 1198 }
1196 1199
1197 } // namespace blink 1200 } // namespace blink
1198 1201
1199 #endif // BreakingContextInlineHeaders_h 1202 #endif // BreakingContextInlineHeaders_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/api/LineLayoutItem.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698