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

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

Issue 2268383002: [css-grid] Avoid negative values as override containing block sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 end = m_rowPositions[endLine] - borderBefore(); 1976 end = m_rowPositions[endLine] - borderBefore();
1977 } 1977 }
1978 1978
1979 // These vectors store line positions including gaps, but we shouldn't c onsider them for the edges of the grid. 1979 // These vectors store line positions including gaps, but we shouldn't c onsider them for the edges of the grid.
1980 if (endLine > 0 && endLine < lastLine) { 1980 if (endLine > 0 && endLine < lastLine) {
1981 end -= guttersSize(direction, endLine - 1, 2); 1981 end -= guttersSize(direction, endLine - 1, 2);
1982 end -= isForColumns ? m_offsetBetweenColumns : m_offsetBetweenRows; 1982 end -= isForColumns ? m_offsetBetweenColumns : m_offsetBetweenRows;
1983 } 1983 }
1984 } 1984 }
1985 1985
1986 breadth = end - start; 1986 breadth = std::max(end - start, LayoutUnit());
1987 offset = start; 1987 offset = start;
1988 1988
1989 if (isForColumns && !styleRef().isLeftToRightDirection() && !child.styleRef( ).hasStaticInlinePosition(child.isHorizontalWritingMode())) { 1989 if (isForColumns && !styleRef().isLeftToRightDirection() && !child.styleRef( ).hasStaticInlinePosition(child.isHorizontalWritingMode())) {
1990 // If the child doesn't have a static inline position (i.e. "left" and/o r "right" aren't "auto", 1990 // If the child doesn't have a static inline position (i.e. "left" and/o r "right" aren't "auto",
1991 // we need to calculate the offset from the left (even if we're in RTL). 1991 // we need to calculate the offset from the left (even if we're in RTL).
1992 if (endIsAuto) { 1992 if (endIsAuto) {
1993 offset = LayoutUnit(); 1993 offset = LayoutUnit();
1994 } else { 1994 } else {
1995 offset = translateRTLCoordinate(m_columnPositions[endLine]) - border LogicalLeft(); 1995 offset = translateRTLCoordinate(m_columnPositions[endLine]) - border LogicalLeft();
1996 1996
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
2599 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation; 2599 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation;
2600 } 2600 }
2601 2601
2602 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2602 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2603 { 2603 {
2604 if (!m_gridItemArea.isEmpty()) 2604 if (!m_gridItemArea.isEmpty())
2605 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2605 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2606 } 2606 }
2607 2607
2608 } // namespace blink 2608 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698