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

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

Issue 1328723002: [Line Layout API] Add border*() to LineLayoutBoxModel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 3 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/api/LineLayoutBoxModel.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, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 616
617 LayoutUnit newLogicalTop = curr->logicalTop(); 617 LayoutUnit newLogicalTop = curr->logicalTop();
618 LayoutUnit newLogicalTopIncludingMargins = newLogicalTop; 618 LayoutUnit newLogicalTopIncludingMargins = newLogicalTop;
619 LayoutUnit boxHeight = curr->logicalHeight(); 619 LayoutUnit boxHeight = curr->logicalHeight();
620 LayoutUnit boxHeightIncludingMargins = boxHeight; 620 LayoutUnit boxHeightIncludingMargins = boxHeight;
621 LayoutUnit borderPaddingHeight = 0; 621 LayoutUnit borderPaddingHeight = 0;
622 if (curr->isText() || curr->isInlineFlowBox()) { 622 if (curr->isText() || curr->isInlineFlowBox()) {
623 const FontMetrics& fontMetrics = curr->layoutObject().style(isFirstL ineStyle())->fontMetrics(); 623 const FontMetrics& fontMetrics = curr->layoutObject().style(isFirstL ineStyle())->fontMetrics();
624 newLogicalTop += curr->baselinePosition(baselineType) - fontMetrics. ascent(baselineType); 624 newLogicalTop += curr->baselinePosition(baselineType) - fontMetrics. ascent(baselineType);
625 if (curr->isInlineFlowBox()) { 625 if (curr->isInlineFlowBox()) {
626 LayoutBoxModelObject& boxObject = toLayoutBoxModelObject(curr->l ayoutObject()); 626 LineLayoutBoxModel boxObject = LineLayoutBoxModel(curr->lineLayo utItem());
627 newLogicalTop -= boxObject.style(isFirstLineStyle())->isHorizont alWritingMode() ? boxObject.borderTop() + boxObject.paddingTop() : 627 newLogicalTop -= boxObject.style(isFirstLineStyle())->isHorizont alWritingMode() ? boxObject.borderTop() + boxObject.paddingTop() :
628 boxObject.borderRight() + boxObject.paddingRight(); 628 boxObject.borderRight() + boxObject.paddingRight();
629 borderPaddingHeight = boxObject.borderAndPaddingLogicalHeight(); 629 borderPaddingHeight = boxObject.borderAndPaddingLogicalHeight();
630 } 630 }
631 newLogicalTopIncludingMargins = newLogicalTop; 631 newLogicalTopIncludingMargins = newLogicalTop;
632 } else if (!curr->layoutObject().isBR()) { 632 } else if (!curr->layoutObject().isBR()) {
633 LineLayoutBox box = LineLayoutBox(curr->lineLayoutItem()); 633 LineLayoutBox box = LineLayoutBox(curr->lineLayoutItem());
634 newLogicalTopIncludingMargins = newLogicalTop; 634 newLogicalTopIncludingMargins = newLogicalTop;
635 LayoutUnit overSideMargin = curr->isHorizontal() ? box.marginTop() : box.marginRight(); 635 LayoutUnit overSideMargin = curr->isHorizontal() ? box.marginTop() : box.marginRight();
636 LayoutUnit underSideMargin = curr->isHorizontal() ? box.marginBottom () : box.marginLeft(); 636 LayoutUnit underSideMargin = curr->isHorizontal() ? box.marginBottom () : box.marginLeft();
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 ASSERT(child->prevOnLine() == prev); 1308 ASSERT(child->prevOnLine() == prev);
1309 prev = child; 1309 prev = child;
1310 } 1310 }
1311 ASSERT(prev == m_lastChild); 1311 ASSERT(prev == m_lastChild);
1312 #endif 1312 #endif
1313 } 1313 }
1314 1314
1315 #endif 1315 #endif
1316 1316
1317 } // namespace blink 1317 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/api/LineLayoutBoxModel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698