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

Side by Side Diff: sky/engine/core/rendering/InlineBox.cpp

Issue 688233002: Remove writing mode code from the linebox tree. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 6 years, 1 month 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 | « sky/engine/core/rendering/InlineBox.h ('k') | sky/engine/core/rendering/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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 #endif 117 #endif
118 118
119 float InlineBox::logicalHeight() const 119 float InlineBox::logicalHeight() const
120 { 120 {
121 if (hasVirtualLogicalHeight()) 121 if (hasVirtualLogicalHeight())
122 return virtualLogicalHeight(); 122 return virtualLogicalHeight();
123 123
124 if (renderer().isText()) 124 if (renderer().isText())
125 return m_bitfields.isText() ? renderer().style(isFirstLineStyle())->font Metrics().height() : 0; 125 return m_bitfields.isText() ? renderer().style(isFirstLineStyle())->font Metrics().height() : 0;
126 if (renderer().isBox() && parent()) 126 if (renderer().isBox() && parent())
127 return isHorizontal() ? toRenderBox(renderer()).height().toFloat() : toR enderBox(renderer()).width().toFloat(); 127 return toRenderBox(renderer()).height().toFloat();
128 128
129 ASSERT(isInlineFlowBox()); 129 ASSERT(isInlineFlowBox());
130 RenderBoxModelObject* flowObject = boxModelObject(); 130 RenderBoxModelObject* flowObject = boxModelObject();
131 const FontMetrics& fontMetrics = renderer().style(isFirstLineStyle())->fontM etrics(); 131 const FontMetrics& fontMetrics = renderer().style(isFirstLineStyle())->fontM etrics();
132 float result = fontMetrics.height(); 132 float result = fontMetrics.height();
133 if (parent()) 133 if (parent())
134 result += flowObject->borderAndPaddingLogicalHeight(); 134 result += flowObject->borderAndPaddingLogicalHeight();
135 return result; 135 return result;
136 } 136 }
137 137
138 int InlineBox::baselinePosition(FontBaseline baselineType) const 138 int InlineBox::baselinePosition(FontBaseline baselineType) const
139 { 139 {
140 return boxModelObject()->baselinePosition(baselineType, m_bitfields.firstLin e(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); 140 return boxModelObject()->baselinePosition(baselineType, m_bitfields.firstLin e(), HorizontalLine, PositionOnContainingLine);
141 } 141 }
142 142
143 LayoutUnit InlineBox::lineHeight() const 143 LayoutUnit InlineBox::lineHeight() const
144 { 144 {
145 return boxModelObject()->lineHeight(m_bitfields.firstLine(), isHorizontal() ? HorizontalLine : VerticalLine, PositionOnContainingLine); 145 return boxModelObject()->lineHeight(m_bitfields.firstLine(), HorizontalLine, PositionOnContainingLine);
146 } 146 }
147 147
148 int InlineBox::caretMinOffset() const 148 int InlineBox::caretMinOffset() const
149 { 149 {
150 return renderer().caretMinOffset(); 150 return renderer().caretMinOffset();
151 } 151 }
152 152
153 int InlineBox::caretMaxOffset() const 153 int InlineBox::caretMaxOffset() const
154 { 154 {
155 return renderer().caretMaxOffset(); 155 return renderer().caretMaxOffset();
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 b->showTreeForThis(); 322 b->showTreeForThis();
323 } 323 }
324 324
325 void showLineTree(const blink::InlineBox* b) 325 void showLineTree(const blink::InlineBox* b)
326 { 326 {
327 if (b) 327 if (b)
328 b->showLineTreeForThis(); 328 b->showLineTreeForThis();
329 } 329 }
330 330
331 #endif 331 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/InlineBox.h ('k') | sky/engine/core/rendering/InlineFlowBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698