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

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

Issue 754493002: Start splitting RenderParagraph logic out of RenderBlock (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: preland Created 6 years 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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 ASSERT(inlineObj->parent() == this); 1480 ASSERT(inlineObj->parent() == this);
1481 1481
1482 InlineIterator it(this, inlineObj, 0); 1482 InlineIterator it(this, inlineObj, 0);
1483 // FIXME: We should pass correct value for WhitespacePosition. 1483 // FIXME: We should pass correct value for WhitespacePosition.
1484 while (!it.atEnd() && !requiresLineBox(it)) 1484 while (!it.atEnd() && !requiresLineBox(it))
1485 it.increment(); 1485 it.increment();
1486 1486
1487 return !it.atEnd(); 1487 return !it.atEnd();
1488 } 1488 }
1489 1489
1490
1491 void RenderBlockFlow::addOverflowFromInlineChildren()
1492 {
1493 LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : LayoutUnit();
1494 // FIXME: Need to find another way to do this, since scrollbars could show w hen we don't want them to.
1495 if (hasOverflowClip() && !endPadding && node() && node()->isRootEditableElem ent() && style()->isLeftToRightDirection())
1496 endPadding = 1;
1497 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
1498 addLayoutOverflow(curr->paddedLayoutOverflowRect(endPadding));
1499 LayoutRect visualOverflow = curr->visualOverflowRect(curr->lineTop(), cu rr->lineBottom());
1500 addContentsVisualOverflow(visualOverflow);
1501 }
1502 }
1503
1504 void RenderBlockFlow::deleteEllipsisLineBoxes() 1490 void RenderBlockFlow::deleteEllipsisLineBoxes()
1505 { 1491 {
1506 ETextAlign textAlign = style()->textAlign(); 1492 ETextAlign textAlign = style()->textAlign();
1507 bool ltr = style()->isLeftToRightDirection(); 1493 bool ltr = style()->isLeftToRightDirection();
1508 bool firstLine = true; 1494 bool firstLine = true;
1509 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) { 1495 for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
1510 if (curr->hasEllipsisBox()) { 1496 if (curr->hasEllipsisBox()) {
1511 curr->clearTruncation(); 1497 curr->clearTruncation();
1512 1498
1513 // Shift the line back where it belongs if we cannot accomodate an e llipsis. 1499 // Shift the line back where it belongs if we cannot accomodate an e llipsis.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 float logicalLeft = logicalLeftOffsetForLine(false).toFloat(); 1571 float logicalLeft = logicalLeftOffsetForLine(false).toFloat();
1586 float availableLogicalWidth = logicalRightOffsetForLine(false) - logicalLeft ; 1572 float availableLogicalWidth = logicalRightOffsetForLine(false) - logicalLeft ;
1587 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0); 1573 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0);
1588 1574
1589 if (!style()->isLeftToRightDirection()) 1575 if (!style()->isLeftToRightDirection())
1590 return logicalWidth() - logicalLeft; 1576 return logicalWidth() - logicalLeft;
1591 return logicalLeft; 1577 return logicalLeft;
1592 } 1578 }
1593 1579
1594 } 1580 }
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBlockFlow.h ('k') | sky/engine/core/rendering/RenderParagraph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698