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

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

Issue 1640173005: [Line Layout API] Convert another RootInlineBox use of layoutObject() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2_RootInlineBox1
Patch Set: without dependency patchset Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineBox.h ('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) 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 return false; 109 return false;
110 110
111 // Next iterate over all the line boxes on the line. If we find a replaced element that intersects 111 // Next iterate over all the line boxes on the line. If we find a replaced element that intersects
112 // then we refuse to accommodate the ellipsis. Otherwise we're ok. 112 // then we refuse to accommodate the ellipsis. Otherwise we're ok.
113 return InlineFlowBox::canAccommodateEllipsis(ltr, blockEdge, ellipsisWidth); 113 return InlineFlowBox::canAccommodateEllipsis(ltr, blockEdge, ellipsisWidth);
114 } 114 }
115 115
116 LayoutUnit RootInlineBox::placeEllipsis(const AtomicString& ellipsisStr, bool l tr, LayoutUnit blockLeftEdge, LayoutUnit blockRightEdge, LayoutUnit ellipsisWidt h) 116 LayoutUnit RootInlineBox::placeEllipsis(const AtomicString& ellipsisStr, bool l tr, LayoutUnit blockLeftEdge, LayoutUnit blockRightEdge, LayoutUnit ellipsisWidt h)
117 { 117 {
118 // Create an ellipsis box. 118 // Create an ellipsis box.
119 EllipsisBox* ellipsisBox = new EllipsisBox(layoutObject(), ellipsisStr, this , 119 EllipsisBox* ellipsisBox = new EllipsisBox(this, ellipsisStr, this,
120 ellipsisWidth, logicalHeight().toFloat(), x(), y(), !prevRootBox(), isHo rizontal()); 120 ellipsisWidth, logicalHeight().toFloat(), x(), y(), !prevRootBox(), isHo rizontal());
121 121
122 if (!gEllipsisBoxMap) 122 if (!gEllipsisBoxMap)
123 gEllipsisBoxMap = new EllipsisBoxMap(); 123 gEllipsisBoxMap = new EllipsisBoxMap();
124 gEllipsisBoxMap->add(this, ellipsisBox); 124 gEllipsisBoxMap->add(this, ellipsisBox);
125 setHasEllipsisBox(true); 125 setHasEllipsisBox(true);
126 126
127 // FIXME: Do we need an RTL version of this? 127 // FIXME: Do we need an RTL version of this?
128 if (ltr && (logicalLeft() + logicalWidth() + ellipsisWidth) <= blockRightEdg e) { 128 if (ltr && (logicalLeft() + logicalWidth() + ellipsisWidth) <= blockRightEdg e) {
129 ellipsisBox->setLogicalLeft(logicalLeft() + logicalWidth()); 129 ellipsisBox->setLogicalLeft(logicalLeft() + logicalWidth());
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 endBox = nullptr; 753 endBox = nullptr;
754 return nullptr; 754 return nullptr;
755 } 755 }
756 756
757 const char* RootInlineBox::boxName() const 757 const char* RootInlineBox::boxName() const
758 { 758 {
759 return "RootInlineBox"; 759 return "RootInlineBox";
760 } 760 }
761 761
762 } // namespace blink 762 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/line/InlineBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698