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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp

Issue 2725343002: Migrate WTF::LinkedHashSet/ListHashSet::last() to ::back() (Closed)
Patch Set: rebase Created 3 years, 9 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
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. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
4 * All right reserved. 4 * All right reserved.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 boxToDelete = next; 976 boxToDelete = next;
977 } 977 }
978 } 978 }
979 979
980 void LayoutBlockFlow::layoutRunsAndFloats(LineLayoutState& layoutState) { 980 void LayoutBlockFlow::layoutRunsAndFloats(LineLayoutState& layoutState) {
981 // We want to skip ahead to the first dirty line 981 // We want to skip ahead to the first dirty line
982 InlineBidiResolver resolver; 982 InlineBidiResolver resolver;
983 RootInlineBox* startLine = determineStartPosition(layoutState, resolver); 983 RootInlineBox* startLine = determineStartPosition(layoutState, resolver);
984 984
985 if (containsFloats()) 985 if (containsFloats())
986 layoutState.setLastFloat(m_floatingObjects->set().last().get()); 986 layoutState.setLastFloat(m_floatingObjects->set().back().get());
987 987
988 // We also find the first clean line and extract these lines. We will add 988 // We also find the first clean line and extract these lines. We will add
989 // them back if we determine that we're able to synchronize after handling all 989 // them back if we determine that we're able to synchronize after handling all
990 // our dirty lines. 990 // our dirty lines.
991 InlineIterator cleanLineStart; 991 InlineIterator cleanLineStart;
992 BidiStatus cleanLineBidiStatus; 992 BidiStatus cleanLineBidiStatus;
993 if (!layoutState.isFullLayout() && startLine) 993 if (!layoutState.isFullLayout() && startLine)
994 determineEndPosition(layoutState, startLine, cleanLineStart, 994 determineEndPosition(layoutState, startLine, cleanLineStart,
995 cleanLineBidiStatus); 995 cleanLineBidiStatus);
996 996
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 // If a float's geometry has changed, give up on syncing with clean lines. 1054 // If a float's geometry has changed, give up on syncing with clean lines.
1055 if (layoutState.floats()[layoutState.floatIndex()].rect != 1055 if (layoutState.floats()[layoutState.floatIndex()].rect !=
1056 floatingObject.frameRect()) { 1056 floatingObject.frameRect()) {
1057 // Delete all the remaining lines. 1057 // Delete all the remaining lines.
1058 deleteLineRange(layoutState, layoutState.endLine()); 1058 deleteLineRange(layoutState, layoutState.endLine());
1059 layoutState.setEndLine(nullptr); 1059 layoutState.setEndLine(nullptr);
1060 } 1060 }
1061 layoutState.setFloatIndex(layoutState.floatIndex() + 1); 1061 layoutState.setFloatIndex(layoutState.floatIndex() + 1);
1062 } 1062 }
1063 layoutState.setLastFloat( 1063 layoutState.setLastFloat(
1064 !floatingObjectSet.isEmpty() ? floatingObjectSet.last().get() : 0); 1064 !floatingObjectSet.isEmpty() ? floatingObjectSet.back().get() : 0);
1065 } 1065 }
1066 1066
1067 void LayoutBlockFlow::layoutRunsAndFloatsInRange( 1067 void LayoutBlockFlow::layoutRunsAndFloatsInRange(
1068 LineLayoutState& layoutState, 1068 LineLayoutState& layoutState,
1069 InlineBidiResolver& resolver, 1069 InlineBidiResolver& resolver,
1070 const InlineIterator& cleanLineStart, 1070 const InlineIterator& cleanLineStart,
1071 const BidiStatus& cleanLineBidiStatus) { 1071 const BidiStatus& cleanLineBidiStatus) {
1072 const ComputedStyle& styleToUse = styleRef(); 1072 const ComputedStyle& styleToUse = styleRef();
1073 bool paginated = 1073 bool paginated =
1074 view()->layoutState() && view()->layoutState()->isPaginated(); 1074 view()->layoutState() && view()->layoutState()->isPaginated();
(...skipping 29 matching lines...) Expand all
1104 } 1104 }
1105 1105
1106 lineMidpointState.reset(); 1106 lineMidpointState.reset();
1107 1107
1108 layoutState.lineInfo().setEmpty(true); 1108 layoutState.lineInfo().setEmpty(true);
1109 layoutState.lineInfo().resetRunsFromLeadingWhitespace(); 1109 layoutState.lineInfo().resetRunsFromLeadingWhitespace();
1110 1110
1111 const InlineIterator previousEndofLine = endOfLine; 1111 const InlineIterator previousEndofLine = endOfLine;
1112 bool isNewUBAParagraph = layoutState.lineInfo().previousLineBrokeCleanly(); 1112 bool isNewUBAParagraph = layoutState.lineInfo().previousLineBrokeCleanly();
1113 FloatingObject* lastFloatFromPreviousLine = 1113 FloatingObject* lastFloatFromPreviousLine =
1114 (containsFloats()) ? m_floatingObjects->set().last().get() : 0; 1114 (containsFloats()) ? m_floatingObjects->set().back().get() : 0;
1115 1115
1116 WordMeasurements wordMeasurements; 1116 WordMeasurements wordMeasurements;
1117 endOfLine = lineBreaker.nextLineBreak(resolver, layoutState.lineInfo(), 1117 endOfLine = lineBreaker.nextLineBreak(resolver, layoutState.lineInfo(),
1118 layoutTextInfo, wordMeasurements); 1118 layoutTextInfo, wordMeasurements);
1119 layoutTextInfo.m_lineBreakIterator.resetPriorContext(); 1119 layoutTextInfo.m_lineBreakIterator.resetPriorContext();
1120 if (resolver.position().atEnd()) { 1120 if (resolver.position().atEnd()) {
1121 // FIXME: We shouldn't be creating any runs in nextLineBreak to begin 1121 // FIXME: We shouldn't be creating any runs in nextLineBreak to begin
1122 // with! Once BidiRunList is separated from BidiResolver this will not be 1122 // with! Once BidiRunList is separated from BidiResolver this will not be
1123 // needed. 1123 // needed.
1124 resolver.runs().deleteRuns(); 1124 resolver.runs().deleteRuns();
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2585 2585
2586 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { 2586 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const {
2587 // LayoutBlockFlow is in charge of paint invalidation of the first line. 2587 // LayoutBlockFlow is in charge of paint invalidation of the first line.
2588 if (firstLineBox()) 2588 if (firstLineBox())
2589 return false; 2589 return false;
2590 2590
2591 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); 2591 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize();
2592 } 2592 }
2593 2593
2594 } // namespace blink 2594 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698