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

Side by Side Diff: Source/core/rendering/line/BreakingContext.cpp

Issue 300853007: Empty inline elements always get a line box. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 6 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 | Annotate | Revision Log
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 30 matching lines...) Expand all
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.
45 if (m_lineBreak == m_resolver.position()) 45 if (m_lineBreak == m_resolver.position())
46 m_lineBreak.increment(); 46 m_lineBreak.increment();
47 47
48 // Sanity check our midpoints. 48 // Sanity check our midpoints.
49 m_lineMidpointState.checkMidpoints(m_lineBreak); 49 m_lineMidpointState.checkMidpoints(m_lineBreak);
50 50
51 m_trailingObjects.updateMidpointsForTrailingBoxes(m_lineMidpointState, m_lin eBreak, TrailingObjects::CollapseFirstSpace); 51 m_trailingObjects.updateMidpointsForTrailingObjects(m_lineMidpointState, m_l ineBreak, TrailingObjects::CollapseFirstSpace);
52 52
53 // We might have made lineBreak an iterator that points past the end 53 // We might have made lineBreak an iterator that points past the end
54 // of the object. Do this adjustment to make it point to the start 54 // of the object. Do this adjustment to make it point to the start
55 // of the next object instead to avoid confusing the rest of the 55 // of the next object instead to avoid confusing the rest of the
56 // code. 56 // code.
57 if (m_lineBreak.offset()) { 57 if (m_lineBreak.offset()) {
58 // This loop enforces the invariant that line breaks should never point 58 // This loop enforces the invariant that line breaks should never point
59 // at an empty inline. See http://crbug.com/305904. 59 // at an empty inline. See http://crbug.com/305904.
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698