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

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

Issue 1375803002: Snap inline box boundaries to layout units during line breaking. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Add comment about currentWidth Created 5 years, 2 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 | « no previous file | third_party/WebKit/Source/core/layout/line/LineWidth.h » ('j') | 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 } 271 }
272 272
273 inline void BreakingContext::increment() 273 inline void BreakingContext::increment()
274 { 274 {
275 // Clear out our character space bool, since inline <pre>s don't collapse wh itespace 275 // Clear out our character space bool, since inline <pre>s don't collapse wh itespace
276 // with adjacent inline normal/nowrap spans. 276 // with adjacent inline normal/nowrap spans.
277 if (!m_collapseWhiteSpace) 277 if (!m_collapseWhiteSpace)
278 m_currentCharacterIsSpace = false; 278 m_currentCharacterIsSpace = false;
279 279
280 m_current.moveToStartOf(m_nextObject); 280 m_current.moveToStartOf(m_nextObject);
281
282 // When the line box tree is created, this position in the line will be snap ped to
283 // LayoutUnit's, and those measurements will be used by the paint code. Do the
284 // equivalent snapping here, to get consistent line measurements.
285 m_width.snapUncommittedWidth();
286
281 m_atStart = false; 287 m_atStart = false;
282 } 288 }
283 289
284 inline void BreakingContext::handleBR(EClear& clear) 290 inline void BreakingContext::handleBR(EClear& clear)
285 { 291 {
286 if (m_width.fitsOnLine()) { 292 if (m_width.fitsOnLine()) {
287 LineLayoutItem br = m_current.object(); 293 LineLayoutItem br = m_current.object();
288 m_lineBreak.moveToStartOf(br); 294 m_lineBreak.moveToStartOf(br);
289 m_lineBreak.increment(); 295 m_lineBreak.increment();
290 296
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 918
913 if (style.textIndentType() == TextIndentHanging) 919 if (style.textIndentType() == TextIndentHanging)
914 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText; 920 shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : In dentText;
915 921
916 return shouldIndentText; 922 return shouldIndentText;
917 } 923 }
918 924
919 } 925 }
920 926
921 #endif // BreakingContextInlineHeaders_h 927 #endif // BreakingContextInlineHeaders_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/line/LineWidth.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698