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

Side by Side Diff: Source/WebCore/rendering/RenderBlockLineLayout.cpp

Issue 7693022: Merge 92132 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 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 | « LayoutTests/fast/block/update-midpoints-for-trailing-boxes-crash-expected.txt ('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 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 void TrailingObjects::updateMidpointsForTrailingBoxes(LineMidpointState& lineMid pointState, const InlineIterator& lBreak, CollapseFirstSpaceOrNot collapseFirstS pace) 1831 void TrailingObjects::updateMidpointsForTrailingBoxes(LineMidpointState& lineMid pointState, const InlineIterator& lBreak, CollapseFirstSpaceOrNot collapseFirstS pace)
1832 { 1832 {
1833 if (!m_whitespace) 1833 if (!m_whitespace)
1834 return; 1834 return;
1835 1835
1836 // This object is either going to be part of the last midpoint, or it is goi ng to be the actual endpoint. 1836 // This object is either going to be part of the last midpoint, or it is goi ng to be the actual endpoint.
1837 // In both cases we just decrease our pos by 1 level to exclude the space, a llowing it to - in effect - collapse into the newline. 1837 // In both cases we just decrease our pos by 1 level to exclude the space, a llowing it to - in effect - collapse into the newline.
1838 if (lineMidpointState.numMidpoints % 2) { 1838 if (lineMidpointState.numMidpoints % 2) {
1839 // Find the trailing space object's midpoint. 1839 // Find the trailing space object's midpoint.
1840 int trailingSpaceMidpoint = lineMidpointState.numMidpoints - 1; 1840 int trailingSpaceMidpoint = lineMidpointState.numMidpoints - 1;
1841 for ( ; trailingSpaceMidpoint >= 0 && lineMidpointState.midpoints[traili ngSpaceMidpoint].m_obj != m_whitespace; --trailingSpaceMidpoint) { } 1841 for ( ; trailingSpaceMidpoint > 0 && lineMidpointState.midpoints[trailin gSpaceMidpoint].m_obj != m_whitespace; --trailingSpaceMidpoint) { }
1842 ASSERT(trailingSpaceMidpoint >= 0); 1842 ASSERT(trailingSpaceMidpoint >= 0);
1843 if (collapseFirstSpace == CollapseFirstSpace) 1843 if (collapseFirstSpace == CollapseFirstSpace)
1844 lineMidpointState.midpoints[trailingSpaceMidpoint].m_pos--; 1844 lineMidpointState.midpoints[trailingSpaceMidpoint].m_pos--;
1845 1845
1846 // Now make sure every single trailingPositionedBox following the traili ngSpaceMidpoint properly stops and starts 1846 // Now make sure every single trailingPositionedBox following the traili ngSpaceMidpoint properly stops and starts
1847 // ignoring spaces. 1847 // ignoring spaces.
1848 size_t currentMidpoint = trailingSpaceMidpoint + 1; 1848 size_t currentMidpoint = trailingSpaceMidpoint + 1;
1849 for (size_t i = 0; i < m_boxes.size(); ++i) { 1849 for (size_t i = 0; i < m_boxes.size(); ++i) {
1850 if (currentMidpoint >= lineMidpointState.numMidpoints) { 1850 if (currentMidpoint >= lineMidpointState.numMidpoints) {
1851 // We don't have a midpoint for this box yet. 1851 // We don't have a midpoint for this box yet.
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
2529 } 2529 }
2530 } 2530 }
2531 2531
2532 setLogicalHeight(logicalHeight() + paginationStrut); 2532 setLogicalHeight(logicalHeight() + paginationStrut);
2533 width.updateAvailableWidth(); 2533 width.updateAvailableWidth();
2534 2534
2535 return true; 2535 return true;
2536 } 2536 }
2537 2537
2538 } 2538 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/block/update-midpoints-for-trailing-boxes-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698