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

Side by Side Diff: sky/engine/core/rendering/InlineFlowBox.h

Issue 688213002: First pass at removing dead vertical writing mode code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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.cpp ('k') | sky/engine/core/rendering/InlineFlowBox.cpp » ('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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 // Line visual and layout overflow are in the coordinate space of the block. This means that they aren't purely physical directions. 217 // Line visual and layout overflow are in the coordinate space of the block. This means that they aren't purely physical directions.
218 // For horizontal-tb and vertical-lr they will match physical directions, bu t for horizontal-bt and vertical-rl, the top/bottom and left/right 218 // For horizontal-tb and vertical-lr they will match physical directions, bu t for horizontal-bt and vertical-rl, the top/bottom and left/right
219 // respectively are flipped when compared to their physical counterparts. F or example minX is on the left in vertical-lr, but it is on the right in vertica l-rl. 219 // respectively are flipped when compared to their physical counterparts. F or example minX is on the left in vertical-lr, but it is on the right in vertica l-rl.
220 LayoutRect layoutOverflowRect(LayoutUnit lineTop, LayoutUnit lineBottom) con st 220 LayoutRect layoutOverflowRect(LayoutUnit lineTop, LayoutUnit lineBottom) con st
221 { 221 {
222 return m_overflow ? m_overflow->layoutOverflowRect() : enclosingLayoutRe ct(frameRectIncludingLineHeight(lineTop, lineBottom)); 222 return m_overflow ? m_overflow->layoutOverflowRect() : enclosingLayoutRe ct(frameRectIncludingLineHeight(lineTop, lineBottom));
223 } 223 }
224 LayoutUnit logicalLeftLayoutOverflow() const 224 LayoutUnit logicalLeftLayoutOverflow() const
225 { 225 {
226 return m_overflow ? (isHorizontal() ? m_overflow->layoutOverflowRect().x () : m_overflow->layoutOverflowRect().y()) : 226 return m_overflow ? m_overflow->layoutOverflowRect().x() : static_cast<L ayoutUnit>(logicalLeft());
227 static_cast<LayoutUnit>(logicalLeft());
228 } 227 }
229 LayoutUnit logicalRightLayoutOverflow() const 228 LayoutUnit logicalRightLayoutOverflow() const
230 { 229 {
231 return m_overflow ? (isHorizontal() ? m_overflow->layoutOverflowRect().m axX() : m_overflow->layoutOverflowRect().maxY()) : 230 return m_overflow ? m_overflow->layoutOverflowRect().maxX() : static_cas t<LayoutUnit>(ceilf(logicalRight()));
232 static_cast<LayoutUnit>(ceilf(logicalRight()));
233 } 231 }
234 LayoutUnit logicalTopLayoutOverflow(LayoutUnit lineTop) const 232 LayoutUnit logicalTopLayoutOverflow(LayoutUnit lineTop) const
235 { 233 {
236 if (m_overflow) 234 if (m_overflow)
237 return isHorizontal() ? m_overflow->layoutOverflowRect().y() : m_ove rflow->layoutOverflowRect().x(); 235 return m_overflow->layoutOverflowRect().y();
238 return lineTop; 236 return lineTop;
239 } 237 }
240 LayoutUnit logicalBottomLayoutOverflow(LayoutUnit lineBottom) const 238 LayoutUnit logicalBottomLayoutOverflow(LayoutUnit lineBottom) const
241 { 239 {
242 if (m_overflow) 240 if (m_overflow)
243 return isHorizontal() ? m_overflow->layoutOverflowRect().maxY() : m_ overflow->layoutOverflowRect().maxX(); 241 return m_overflow->layoutOverflowRect().maxY();
244 return lineBottom; 242 return lineBottom;
245 } 243 }
246 LayoutRect logicalLayoutOverflowRect(LayoutUnit lineTop, LayoutUnit lineBott om) const 244 LayoutRect logicalLayoutOverflowRect(LayoutUnit lineTop, LayoutUnit lineBott om) const
247 { 245 {
248 LayoutRect result = layoutOverflowRect(lineTop, lineBottom); 246 // FIXME(sky): Remove
249 if (!renderer().isHorizontalWritingMode()) 247 return layoutOverflowRect(lineTop, lineBottom);
250 result = result.transposedRect();
251 return result;
252 } 248 }
253 249
254 LayoutRect visualOverflowRect(LayoutUnit lineTop, LayoutUnit lineBottom) con st 250 LayoutRect visualOverflowRect(LayoutUnit lineTop, LayoutUnit lineBottom) con st
255 { 251 {
256 return m_overflow ? m_overflow->visualOverflowRect() : enclosingLayoutRe ct(frameRectIncludingLineHeight(lineTop, lineBottom)); 252 return m_overflow ? m_overflow->visualOverflowRect() : enclosingLayoutRe ct(frameRectIncludingLineHeight(lineTop, lineBottom));
257 } 253 }
258 LayoutUnit logicalLeftVisualOverflow() const { return m_overflow ? (isHorizo ntal() ? m_overflow->visualOverflowRect().x() : m_overflow->visualOverflowRect() .y()) : static_cast<LayoutUnit>(logicalLeft()); } 254 LayoutUnit logicalLeftVisualOverflow() const { return m_overflow ? (isHorizo ntal() ? m_overflow->visualOverflowRect().x() : m_overflow->visualOverflowRect() .y()) : static_cast<LayoutUnit>(logicalLeft()); }
259 LayoutUnit logicalRightVisualOverflow() const { return m_overflow ? (isHoriz ontal() ? m_overflow->visualOverflowRect().maxX() : m_overflow->visualOverflowRe ct().maxY()) : static_cast<LayoutUnit>(ceilf(logicalRight())); } 255 LayoutUnit logicalRightVisualOverflow() const { return m_overflow ? (isHoriz ontal() ? m_overflow->visualOverflowRect().maxX() : m_overflow->visualOverflowRe ct().maxY()) : static_cast<LayoutUnit>(ceilf(logicalRight())); }
260 LayoutUnit logicalTopVisualOverflow(LayoutUnit lineTop) const 256 LayoutUnit logicalTopVisualOverflow(LayoutUnit lineTop) const
261 { 257 {
262 if (m_overflow) 258 if (m_overflow)
263 return isHorizontal() ? m_overflow->visualOverflowRect().y() : m_ove rflow->visualOverflowRect().x(); 259 return isHorizontal() ? m_overflow->visualOverflowRect().y() : m_ove rflow->visualOverflowRect().x();
264 return lineTop; 260 return lineTop;
265 } 261 }
266 LayoutUnit logicalBottomVisualOverflow(LayoutUnit lineBottom) const 262 LayoutUnit logicalBottomVisualOverflow(LayoutUnit lineBottom) const
267 { 263 {
268 if (m_overflow) 264 if (m_overflow)
269 return isHorizontal() ? m_overflow->visualOverflowRect().maxY() : m_ overflow->visualOverflowRect().maxX(); 265 return isHorizontal() ? m_overflow->visualOverflowRect().maxY() : m_ overflow->visualOverflowRect().maxX();
270 return lineBottom; 266 return lineBottom;
271 } 267 }
272 LayoutRect logicalVisualOverflowRect(LayoutUnit lineTop, LayoutUnit lineBott om) const 268 LayoutRect logicalVisualOverflowRect(LayoutUnit lineTop, LayoutUnit lineBott om) const
273 { 269 {
274 LayoutRect result = visualOverflowRect(lineTop, lineBottom); 270 return visualOverflowRect(lineTop, lineBottom);
275 if (!renderer().isHorizontalWritingMode())
276 result = result.transposedRect();
277 return result;
278 } 271 }
279 272
280 void setOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflow, co nst LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineBottom ); 273 void setOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflow, co nst LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineBottom );
281 274
282 FloatRect frameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineBo ttom) const 275 FloatRect frameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineBo ttom) const
283 { 276 {
284 if (isHorizontal()) 277 return FloatRect(m_topLeft.x(), lineTop.toFloat(), width(), (lineBottom - lineTop).toFloat());
285 return FloatRect(m_topLeft.x(), lineTop.toFloat(), width(), (lineBot tom - lineTop).toFloat());
286 return FloatRect(lineTop.toFloat(), m_topLeft.y(), (lineBottom - lineTop ).toFloat(), height());
287 } 278 }
288 279
289 FloatRect logicalFrameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineBottom) const 280 FloatRect logicalFrameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineBottom) const
290 { 281 {
291 return FloatRect(logicalLeft(), lineTop.toFloat(), logicalWidth(), (line Bottom - lineTop).toFloat()); 282 return FloatRect(logicalLeft(), lineTop.toFloat(), logicalWidth(), (line Bottom - lineTop).toFloat());
292 } 283 }
293 284
294 bool descendantsHaveSameLineHeightAndBaseline() const { return m_descendants HaveSameLineHeightAndBaseline; } 285 bool descendantsHaveSameLineHeightAndBaseline() const { return m_descendants HaveSameLineHeightAndBaseline; }
295 void clearDescendantsHaveSameLineHeightAndBaseline() 286 void clearDescendantsHaveSameLineHeightAndBaseline()
296 { 287 {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 } 366 }
376 367
377 } // namespace blink 368 } // namespace blink
378 369
379 #ifndef NDEBUG 370 #ifndef NDEBUG
380 // Outside the WebCore namespace for ease of invocation from gdb. 371 // Outside the WebCore namespace for ease of invocation from gdb.
381 void showTree(const blink::InlineFlowBox*); 372 void showTree(const blink::InlineFlowBox*);
382 #endif 373 #endif
383 374
384 #endif // InlineFlowBox_h 375 #endif // InlineFlowBox_h
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/InlineBox.cpp ('k') | sky/engine/core/rendering/InlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698