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

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

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs Created 3 years, 10 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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 DCHECK(fontData); 622 DCHECK(fontData);
623 glyphOverflow.setFromBounds( 623 glyphOverflow.setFromBounds(
624 glyphBounds, fontData ? fontData->getFontMetrics().floatAscent() : 0, 624 glyphBounds, fontData ? fontData->getFontMetrics().floatAscent() : 0,
625 fontData ? fontData->getFontMetrics().floatDescent() : 0, measuredWidth); 625 fontData ? fontData->getFontMetrics().floatDescent() : 0, measuredWidth);
626 626
627 run->m_box->setLogicalWidth(LayoutUnit(measuredWidth) + hyphenWidth); 627 run->m_box->setLogicalWidth(LayoutUnit(measuredWidth) + hyphenWidth);
628 if (!fallbackFonts.isEmpty()) { 628 if (!fallbackFonts.isEmpty()) {
629 ASSERT(run->m_box->isText()); 629 ASSERT(run->m_box->isText());
630 GlyphOverflowAndFallbackFontsMap::ValueType* it = 630 GlyphOverflowAndFallbackFontsMap::ValueType* it =
631 textBoxDataMap 631 textBoxDataMap
632 .add(toInlineTextBox(run->m_box), 632 .insert(toInlineTextBox(run->m_box),
633 std::make_pair(Vector<const SimpleFontData*>(), 633 std::make_pair(Vector<const SimpleFontData*>(),
634 GlyphOverflow())) 634 GlyphOverflow()))
635 .storedValue; 635 .storedValue;
636 ASSERT(it->value.first.isEmpty()); 636 ASSERT(it->value.first.isEmpty());
637 copyToVector(fallbackFonts, it->value.first); 637 copyToVector(fallbackFonts, it->value.first);
638 run->m_box->parent()->clearDescendantsHaveSameLineHeightAndBaseline(); 638 run->m_box->parent()->clearDescendantsHaveSameLineHeightAndBaseline();
639 } 639 }
640 if (!glyphOverflow.isApproximatelyZero()) { 640 if (!glyphOverflow.isApproximatelyZero()) {
641 ASSERT(run->m_box->isText()); 641 ASSERT(run->m_box->isText());
642 GlyphOverflowAndFallbackFontsMap::ValueType* it = 642 GlyphOverflowAndFallbackFontsMap::ValueType* it =
643 textBoxDataMap 643 textBoxDataMap
644 .add(toInlineTextBox(run->m_box), 644 .insert(toInlineTextBox(run->m_box),
645 std::make_pair(Vector<const SimpleFontData*>(), 645 std::make_pair(Vector<const SimpleFontData*>(),
646 GlyphOverflow())) 646 GlyphOverflow()))
647 .storedValue; 647 .storedValue;
648 it->value.second = glyphOverflow; 648 it->value.second = glyphOverflow;
649 run->m_box->clearKnownToHaveNoOverflow(); 649 run->m_box->clearKnownToHaveNoOverflow();
650 } 650 }
651 } 651 }
652 652
653 void LayoutBlockFlow::updateLogicalWidthForAlignment( 653 void LayoutBlockFlow::updateLogicalWidthForAlignment(
654 const ETextAlign& textAlign, 654 const ETextAlign& textAlign,
655 const RootInlineBox* rootInlineBox, 655 const RootInlineBox* rootInlineBox,
656 BidiRun* trailingSpaceRun, 656 BidiRun* trailingSpaceRun,
(...skipping 1858 matching lines...) Expand 10 before | Expand all | Expand 10 after
2515 2515
2516 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { 2516 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const {
2517 // LayoutBlockFlow is in charge of paint invalidation of the first line. 2517 // LayoutBlockFlow is in charge of paint invalidation of the first line.
2518 if (firstLineBox()) 2518 if (firstLineBox())
2519 return false; 2519 return false;
2520 2520
2521 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); 2521 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize();
2522 } 2522 }
2523 2523
2524 } // namespace blink 2524 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/FloatingObjects.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698