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

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

Issue 2610253004: Migrate WTF::Vector::append() to ::push_back() [part 9 of N] (Closed)
Patch Set: rebase Created 3 years, 11 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) 2003, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 } 606 }
607 607
608 bool includeLeading = includeLeadingForBox(box); 608 bool includeLeading = includeLeadingForBox(box);
609 bool setUsedFontWithLeading = false; 609 bool setUsedFontWithLeading = false;
610 610
611 if (usedFonts && !usedFonts->isEmpty() && (box->getLineLayoutItem() 611 if (usedFonts && !usedFonts->isEmpty() && (box->getLineLayoutItem()
612 .style(isFirstLineStyle()) 612 .style(isFirstLineStyle())
613 ->lineHeight() 613 ->lineHeight()
614 .isNegative() && 614 .isNegative() &&
615 includeLeading)) { 615 includeLeading)) {
616 usedFonts->append(box->getLineLayoutItem() 616 usedFonts->push_back(box->getLineLayoutItem()
617 .style(isFirstLineStyle()) 617 .style(isFirstLineStyle())
618 ->font() 618 ->font()
619 .primaryFont()); 619 .primaryFont());
620 for (size_t i = 0; i < usedFonts->size(); ++i) { 620 for (size_t i = 0; i < usedFonts->size(); ++i) {
621 const FontMetrics& fontMetrics = usedFonts->at(i)->getFontMetrics(); 621 const FontMetrics& fontMetrics = usedFonts->at(i)->getFontMetrics();
622 int usedFontAscent = fontMetrics.ascent(baselineType()); 622 int usedFontAscent = fontMetrics.ascent(baselineType());
623 int usedFontDescent = fontMetrics.descent(baselineType()); 623 int usedFontDescent = fontMetrics.descent(baselineType());
624 int halfLeading = (fontMetrics.lineSpacing() - fontMetrics.height()) / 2; 624 int halfLeading = (fontMetrics.lineSpacing() - fontMetrics.height()) / 2;
625 int usedFontAscentAndLeading = usedFontAscent + halfLeading; 625 int usedFontAscentAndLeading = usedFontAscent + halfLeading;
626 int usedFontDescentAndLeading = 626 int usedFontDescentAndLeading =
627 fontMetrics.lineSpacing() - usedFontAscentAndLeading; 627 fontMetrics.lineSpacing() - usedFontAscentAndLeading;
628 if (includeLeading) { 628 if (includeLeading) {
629 setAscentAndDescent(ascent, descent, usedFontAscentAndLeading, 629 setAscentAndDescent(ascent, descent, usedFontAscentAndLeading,
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 } 782 }
783 endBox = nullptr; 783 endBox = nullptr;
784 return nullptr; 784 return nullptr;
785 } 785 }
786 786
787 const char* RootInlineBox::boxName() const { 787 const char* RootInlineBox::boxName() const {
788 return "RootInlineBox"; 788 return "RootInlineBox";
789 } 789 }
790 790
791 } // namespace blink 791 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698