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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Issue 1647313003: Continue converting to explicit LayoutUnit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicitContstructors
Patch Set: Add TODO Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 // Add in the overflow from positioned objects. 948 // Add in the overflow from positioned objects.
949 addOverflowFromPositionedObjects(); 949 addOverflowFromPositionedObjects();
950 950
951 if (hasOverflowClip()) { 951 if (hasOverflowClip()) {
952 // When we have overflow clip, propagate the original spillout since it will include collapsed bottom margins 952 // When we have overflow clip, propagate the original spillout since it will include collapsed bottom margins
953 // and bottom padding. Set the axis we don't care about to be 1, since we want this overflow to always 953 // and bottom padding. Set the axis we don't care about to be 1, since we want this overflow to always
954 // be considered reachable. 954 // be considered reachable.
955 LayoutRect clientRect(noOverflowRect()); 955 LayoutRect clientRect(noOverflowRect());
956 LayoutRect rectToApply; 956 LayoutRect rectToApply;
957 if (isHorizontalWritingMode()) 957 if (isHorizontalWritingMode())
958 rectToApply = LayoutRect(clientRect.x(), clientRect.y(), 1, std::max <LayoutUnit>(0, oldClientAfterEdge - clientRect.y())); 958 rectToApply = LayoutRect(clientRect.x(), clientRect.y(), LayoutUnit( 1), (oldClientAfterEdge - clientRect.y()).clampNegativeToZero());
959 else 959 else
960 rectToApply = LayoutRect(clientRect.x(), clientRect.y(), std::max<La youtUnit>(0, oldClientAfterEdge - clientRect.x()), 1); 960 rectToApply = LayoutRect(clientRect.x(), clientRect.y(), (oldClientA fterEdge - clientRect.x()).clampNegativeToZero(), LayoutUnit(1));
961 addLayoutOverflow(rectToApply); 961 addLayoutOverflow(rectToApply);
962 if (hasOverflowModel()) 962 if (hasOverflowModel())
963 m_overflow->setLayoutClientAfterEdge(oldClientAfterEdge); 963 m_overflow->setLayoutClientAfterEdge(oldClientAfterEdge);
964 } 964 }
965 965
966 addVisualEffectOverflow(); 966 addVisualEffectOverflow();
967 967
968 addVisualOverflowFromTheme(); 968 addVisualOverflowFromTheme();
969 } 969 }
970 970
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 else 2053 else
2054 floatRightWidth += w; 2054 floatRightWidth += w;
2055 } else { 2055 } else {
2056 maxLogicalWidth = std::max(w, maxLogicalWidth); 2056 maxLogicalWidth = std::max(w, maxLogicalWidth);
2057 } 2057 }
2058 2058
2059 child = child->nextSibling(); 2059 child = child->nextSibling();
2060 } 2060 }
2061 2061
2062 // Always make sure these values are non-negative. 2062 // Always make sure these values are non-negative.
2063 minLogicalWidth = std::max<LayoutUnit>(0, minLogicalWidth); 2063 minLogicalWidth = minLogicalWidth.clampNegativeToZero();
2064 maxLogicalWidth = std::max<LayoutUnit>(0, maxLogicalWidth); 2064 maxLogicalWidth = maxLogicalWidth.clampNegativeToZero();
2065 2065
2066 maxLogicalWidth = std::max(floatLeftWidth + floatRightWidth, maxLogicalWidth ); 2066 maxLogicalWidth = std::max(floatLeftWidth + floatRightWidth, maxLogicalWidth );
2067 } 2067 }
2068 2068
2069 void LayoutBlock::computeChildPreferredLogicalWidths(LayoutObject& child, Layout Unit& minPreferredLogicalWidth, LayoutUnit& maxPreferredLogicalWidth) const 2069 void LayoutBlock::computeChildPreferredLogicalWidths(LayoutObject& child, Layout Unit& minPreferredLogicalWidth, LayoutUnit& maxPreferredLogicalWidth) const
2070 { 2070 {
2071 if (child.isBox() && child.isHorizontalWritingMode() != isHorizontalWritingM ode()) { 2071 if (child.isBox() && child.isHorizontalWritingMode() != isHorizontalWritingM ode()) {
2072 // If the child is an orthogonal flow, child's height determines the wid th, but the height is not available until layout. 2072 // If the child is an orthogonal flow, child's height determines the wid th, but the height is not available until layout.
2073 // http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-shrink-to-fit 2073 // http://dev.w3.org/csswg/css-writing-modes-3/#orthogonal-shrink-to-fit
2074 if (!child.needsLayout()) { 2074 if (!child.needsLayout()) {
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2858 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2859 { 2859 {
2860 showLayoutObject(); 2860 showLayoutObject();
2861 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2861 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2862 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2862 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2863 } 2863 }
2864 2864
2865 #endif 2865 #endif
2866 2866
2867 } // namespace blink 2867 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698