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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/RootInlineBox.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) 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 LayoutUnit blockRightEdge, 113 LayoutUnit blockRightEdge,
114 LayoutUnit ellipsisWidth) { 114 LayoutUnit ellipsisWidth) {
115 // Create an ellipsis box. 115 // Create an ellipsis box.
116 EllipsisBox* ellipsisBox = 116 EllipsisBox* ellipsisBox =
117 new EllipsisBox(getLineLayoutItem(), ellipsisStr, this, ellipsisWidth, 117 new EllipsisBox(getLineLayoutItem(), ellipsisStr, this, ellipsisWidth,
118 logicalHeight().toFloat(), x().toInt(), y().toInt(), 118 logicalHeight().toFloat(), x().toInt(), y().toInt(),
119 !prevRootBox(), isHorizontal()); 119 !prevRootBox(), isHorizontal());
120 120
121 if (!gEllipsisBoxMap) 121 if (!gEllipsisBoxMap)
122 gEllipsisBoxMap = new EllipsisBoxMap(); 122 gEllipsisBoxMap = new EllipsisBoxMap();
123 gEllipsisBoxMap->add(this, ellipsisBox); 123 gEllipsisBoxMap->insert(this, ellipsisBox);
124 setHasEllipsisBox(true); 124 setHasEllipsisBox(true);
125 125
126 // FIXME: Do we need an RTL version of this? 126 // FIXME: Do we need an RTL version of this?
127 if (ltr && 127 if (ltr &&
128 (logicalLeft() + logicalWidth() + ellipsisWidth) <= blockRightEdge) { 128 (logicalLeft() + logicalWidth() + ellipsisWidth) <= blockRightEdge) {
129 ellipsisBox->setLogicalLeft(logicalLeft() + logicalWidth()); 129 ellipsisBox->setLogicalLeft(logicalLeft() + logicalWidth());
130 return logicalWidth() + ellipsisWidth; 130 return logicalWidth() + ellipsisWidth;
131 } 131 }
132 132
133 // Now attempt to find the nearest glyph horizontally and place just to the 133 // Now attempt to find the nearest glyph horizontally and place just to the
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 } 776 }
777 endBox = nullptr; 777 endBox = nullptr;
778 return nullptr; 778 return nullptr;
779 } 779 }
780 780
781 const char* RootInlineBox::boxName() const { 781 const char* RootInlineBox::boxName() const {
782 return "RootInlineBox"; 782 return "RootInlineBox";
783 } 783 }
784 784
785 } // namespace blink 785 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698