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

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

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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.cpp ('k') | Source/core/layout/line/LineBreaker.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, 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (shouldClearDescendantsHaveSameLineHeightAndBaseline) 155 if (shouldClearDescendantsHaveSameLineHeightAndBaseline)
156 clearDescendantsHaveSameLineHeightAndBaseline(); 156 clearDescendantsHaveSameLineHeightAndBaseline();
157 } 157 }
158 158
159 if (!child->renderer().isOutOfFlowPositioned()) { 159 if (!child->renderer().isOutOfFlowPositioned()) {
160 if (child->isText()) { 160 if (child->isText()) {
161 const LayoutStyle& childStyle = child->renderer().styleRef(isFirstLi neStyle()); 161 const LayoutStyle& childStyle = child->renderer().styleRef(isFirstLi neStyle());
162 if (childStyle.letterSpacing() < 0 || childStyle.textShadow() || chi ldStyle.textEmphasisMark() != TextEmphasisMarkNone || childStyle.textStrokeWidth ()) 162 if (childStyle.letterSpacing() < 0 || childStyle.textShadow() || chi ldStyle.textEmphasisMark() != TextEmphasisMarkNone || childStyle.textStrokeWidth ())
163 child->clearKnownToHaveNoOverflow(); 163 child->clearKnownToHaveNoOverflow();
164 } else if (child->renderer().isReplaced()) { 164 } else if (child->renderer().isReplaced()) {
165 RenderBox& box = toRenderBox(child->renderer()); 165 LayoutBox& box = toLayoutBox(child->renderer());
166 if (box.hasRenderOverflow() || box.hasSelfPaintingLayer()) 166 if (box.hasRenderOverflow() || box.hasSelfPaintingLayer())
167 child->clearKnownToHaveNoOverflow(); 167 child->clearKnownToHaveNoOverflow();
168 } else if (!child->renderer().isBR() && (child->renderer().style(isFirst LineStyle())->boxShadow() || child->boxModelObject()->hasSelfPaintingLayer() 168 } else if (!child->renderer().isBR() && (child->renderer().style(isFirst LineStyle())->boxShadow() || child->boxModelObject()->hasSelfPaintingLayer()
169 || (child->renderer().isListMarker() && !toLayoutListMarker(child->r enderer()).isInside()) 169 || (child->renderer().isListMarker() && !toLayoutListMarker(child->r enderer()).isInside())
170 || child->renderer().style(isFirstLineStyle())->hasBorderImageOutset s() 170 || child->renderer().style(isFirstLineStyle())->hasBorderImageOutset s()
171 || child->renderer().style(isFirstLineStyle())->hasOutline())) { 171 || child->renderer().style(isFirstLineStyle())->hasOutline())) {
172 child->clearKnownToHaveNoOverflow(); 172 child->clearKnownToHaveNoOverflow();
173 } 173 }
174 174
175 if (knownToHaveNoOverflow() && child->isInlineFlowBox() && !toInlineFlow Box(child)->knownToHaveNoOverflow()) 175 if (knownToHaveNoOverflow() && child->isInlineFlowBox() && !toInlineFlow Box(child)->knownToHaveNoOverflow())
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 const FontMetrics& fontMetrics = curr->renderer().style(isFirstLineS tyle())->fontMetrics(); 654 const FontMetrics& fontMetrics = curr->renderer().style(isFirstLineS tyle())->fontMetrics();
655 newLogicalTop += curr->baselinePosition(baselineType) - fontMetrics. ascent(baselineType); 655 newLogicalTop += curr->baselinePosition(baselineType) - fontMetrics. ascent(baselineType);
656 if (curr->isInlineFlowBox()) { 656 if (curr->isInlineFlowBox()) {
657 LayoutBoxModelObject& boxObject = toLayoutBoxModelObject(curr->r enderer()); 657 LayoutBoxModelObject& boxObject = toLayoutBoxModelObject(curr->r enderer());
658 newLogicalTop -= boxObject.style(isFirstLineStyle())->isHorizont alWritingMode() ? boxObject.borderTop() + boxObject.paddingTop() : 658 newLogicalTop -= boxObject.style(isFirstLineStyle())->isHorizont alWritingMode() ? boxObject.borderTop() + boxObject.paddingTop() :
659 boxObject.borderRight() + boxObject.paddingRight(); 659 boxObject.borderRight() + boxObject.paddingRight();
660 borderPaddingHeight = boxObject.borderAndPaddingLogicalHeight(); 660 borderPaddingHeight = boxObject.borderAndPaddingLogicalHeight();
661 } 661 }
662 newLogicalTopIncludingMargins = newLogicalTop; 662 newLogicalTopIncludingMargins = newLogicalTop;
663 } else if (!curr->renderer().isBR()) { 663 } else if (!curr->renderer().isBR()) {
664 RenderBox& box = toRenderBox(curr->renderer()); 664 LayoutBox& box = toLayoutBox(curr->renderer());
665 newLogicalTopIncludingMargins = newLogicalTop; 665 newLogicalTopIncludingMargins = newLogicalTop;
666 LayoutUnit overSideMargin = curr->isHorizontal() ? box.marginTop() : box.marginRight(); 666 LayoutUnit overSideMargin = curr->isHorizontal() ? box.marginTop() : box.marginRight();
667 LayoutUnit underSideMargin = curr->isHorizontal() ? box.marginBottom () : box.marginLeft(); 667 LayoutUnit underSideMargin = curr->isHorizontal() ? box.marginBottom () : box.marginLeft();
668 newLogicalTop += overSideMargin; 668 newLogicalTop += overSideMargin;
669 boxHeightIncludingMargins += overSideMargin + underSideMargin; 669 boxHeightIncludingMargins += overSideMargin + underSideMargin;
670 } 670 }
671 671
672 curr->setLogicalTop(newLogicalTop.toFloat()); 672 curr->setLogicalTop(newLogicalTop.toFloat());
673 673
674 if (childAffectsTopBottomPos) { 674 if (childAffectsTopBottomPos) {
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 LayoutUnit logicalLeftVisualOverflow = std::min(textBox->pixelSnappedLogical Left() + childOverflowLogicalLeft, logicalVisualOverflow.x()); 887 LayoutUnit logicalLeftVisualOverflow = std::min(textBox->pixelSnappedLogical Left() + childOverflowLogicalLeft, logicalVisualOverflow.x());
888 LayoutUnit logicalRightVisualOverflow = std::max(textBox->pixelSnappedLogica lRight() + childOverflowLogicalRight, logicalVisualOverflow.maxX()); 888 LayoutUnit logicalRightVisualOverflow = std::max(textBox->pixelSnappedLogica lRight() + childOverflowLogicalRight, logicalVisualOverflow.maxX());
889 889
890 logicalVisualOverflow = LayoutRect(logicalLeftVisualOverflow, logicalTopVisu alOverflow, logicalRightVisualOverflow - logicalLeftVisualOverflow, logicalBotto mVisualOverflow - logicalTopVisualOverflow); 890 logicalVisualOverflow = LayoutRect(logicalLeftVisualOverflow, logicalTopVisu alOverflow, logicalRightVisualOverflow - logicalLeftVisualOverflow, logicalBotto mVisualOverflow - logicalTopVisualOverflow);
891 891
892 textBox->setLogicalOverflowRect(logicalVisualOverflow); 892 textBox->setLogicalOverflowRect(logicalVisualOverflow);
893 } 893 }
894 894
895 inline void InlineFlowBox::addReplacedChildOverflow(const InlineBox* inlineBox, LayoutRect& logicalLayoutOverflow, LayoutRect& logicalVisualOverflow) 895 inline void InlineFlowBox::addReplacedChildOverflow(const InlineBox* inlineBox, LayoutRect& logicalLayoutOverflow, LayoutRect& logicalVisualOverflow)
896 { 896 {
897 RenderBox& box = toRenderBox(inlineBox->renderer()); 897 LayoutBox& box = toLayoutBox(inlineBox->renderer());
898 898
899 // Visual overflow only propagates if the box doesn't have a self-painting l ayer. This rectangle does not include 899 // Visual overflow only propagates if the box doesn't have a self-painting l ayer. This rectangle does not include
900 // transforms or relative positioning (since those objects always have self- painting layers), but it does need to be adjusted 900 // transforms or relative positioning (since those objects always have self- painting layers), but it does need to be adjusted
901 // for writing-mode differences. 901 // for writing-mode differences.
902 if (!box.hasSelfPaintingLayer()) { 902 if (!box.hasSelfPaintingLayer()) {
903 LayoutRect childLogicalVisualOverflow = box.logicalVisualOverflowRectFor Propagation(renderer().styleRef()); 903 LayoutRect childLogicalVisualOverflow = box.logicalVisualOverflowRectFor Propagation(renderer().styleRef());
904 childLogicalVisualOverflow.move(inlineBox->logicalLeft(), inlineBox->log icalTop()); 904 childLogicalVisualOverflow.move(inlineBox->logicalLeft(), inlineBox->log icalTop());
905 logicalVisualOverflow.unite(childLogicalVisualOverflow); 905 logicalVisualOverflow.unite(childLogicalVisualOverflow);
906 } 906 }
907 907
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 ASSERT(child->prevOnLine() == prev); 1333 ASSERT(child->prevOnLine() == prev);
1334 prev = child; 1334 prev = child;
1335 } 1335 }
1336 ASSERT(prev == m_lastChild); 1336 ASSERT(prev == m_lastChild);
1337 #endif 1337 #endif
1338 } 1338 }
1339 1339
1340 #endif 1340 #endif
1341 1341
1342 } // namespace blink 1342 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/line/InlineBox.cpp ('k') | Source/core/layout/line/LineBreaker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698