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

Side by Side Diff: Source/core/layout/line/InlineBox.cpp

Issue 1294483002: [Line Layout API] Convert InlineBox::boxModelObject to new API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nits Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/line/InlineBox.h ('k') | Source/core/layout/line/InlineFlowBox.h » ('j') | 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, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 { 133 {
134 if (hasVirtualLogicalHeight()) 134 if (hasVirtualLogicalHeight())
135 return virtualLogicalHeight(); 135 return virtualLogicalHeight();
136 136
137 if (lineLayoutItem().isText()) 137 if (lineLayoutItem().isText())
138 return m_bitfields.isText() ? LayoutUnit(lineLayoutItem().style(isFirstL ineStyle())->fontMetrics().height()) : LayoutUnit(); 138 return m_bitfields.isText() ? LayoutUnit(lineLayoutItem().style(isFirstL ineStyle())->fontMetrics().height()) : LayoutUnit();
139 if (lineLayoutItem().isBox() && parent()) 139 if (lineLayoutItem().isBox() && parent())
140 return isHorizontal() ? toLayoutBox(layoutObject()).size().height() : to LayoutBox(layoutObject()).size().width(); 140 return isHorizontal() ? toLayoutBox(layoutObject()).size().height() : to LayoutBox(layoutObject()).size().width();
141 141
142 ASSERT(isInlineFlowBox()); 142 ASSERT(isInlineFlowBox());
143 LayoutBoxModelObject* flowObject = boxModelObject(); 143 LineLayoutBoxModel flowObject = boxModelObject();
144 const FontMetrics& fontMetrics = lineLayoutItem().style(isFirstLineStyle())- >fontMetrics(); 144 const FontMetrics& fontMetrics = lineLayoutItem().style(isFirstLineStyle())- >fontMetrics();
145 LayoutUnit result = fontMetrics.height(); 145 LayoutUnit result = fontMetrics.height();
146 if (parent()) 146 if (parent())
147 result += flowObject->borderAndPaddingLogicalHeight(); 147 result += flowObject.borderAndPaddingLogicalHeight();
148 return result; 148 return result;
149 } 149 }
150 150
151 int InlineBox::baselinePosition(FontBaseline baselineType) const 151 int InlineBox::baselinePosition(FontBaseline baselineType) const
152 { 152 {
153 return boxModelObject()->baselinePosition(baselineType, m_bitfields.firstLin e(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); 153 return boxModelObject().baselinePosition(baselineType, m_bitfields.firstLine (), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine);
154 } 154 }
155 155
156 LayoutUnit InlineBox::lineHeight() const 156 LayoutUnit InlineBox::lineHeight() const
157 { 157 {
158 return boxModelObject()->lineHeight(m_bitfields.firstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); 158 return boxModelObject().lineHeight(m_bitfields.firstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine);
159 } 159 }
160 160
161 int InlineBox::caretMinOffset() const 161 int InlineBox::caretMinOffset() const
162 { 162 {
163 return lineLayoutItem().caretMinOffset(); 163 return lineLayoutItem().caretMinOffset();
164 } 164 }
165 165
166 int InlineBox::caretMaxOffset() const 166 int InlineBox::caretMaxOffset() const
167 { 167 {
168 return lineLayoutItem().caretMaxOffset(); 168 return lineLayoutItem().caretMaxOffset();
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 395
396 void showLineTree(const blink::InlineBox* b) 396 void showLineTree(const blink::InlineBox* b)
397 { 397 {
398 if (b) 398 if (b)
399 b->showLineTreeForThis(); 399 b->showLineTreeForThis();
400 else 400 else
401 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n"); 401 fprintf(stderr, "Cannot showLineTree for (nil) InlineBox.\n");
402 } 402 }
403 403
404 #endif 404 #endif
OLDNEW
« no previous file with comments | « Source/core/layout/line/InlineBox.h ('k') | Source/core/layout/line/InlineFlowBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698