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: third_party/WebKit/Source/core/layout/LayoutGrid.cpp

Issue 1909153002: [css-grid] Fix bug with positioned items in vertical writing mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Increase size of grids in the tests to avoid weird visual results Created 4 years, 8 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/LayoutTests/fast/css-grid-layout/grid-positioned-children-writing-modes-expected.html ('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 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 1625
1626 breadth = end - start; 1626 breadth = end - start;
1627 offset = start; 1627 offset = start;
1628 1628
1629 if (isForColumns && !styleRef().isLeftToRightDirection() && !child.styleRef( ).hasStaticInlinePosition(child.isHorizontalWritingMode())) { 1629 if (isForColumns && !styleRef().isLeftToRightDirection() && !child.styleRef( ).hasStaticInlinePosition(child.isHorizontalWritingMode())) {
1630 // If the child doesn't have a static inline position (i.e. "left" and/o r "right" aren't "auto", 1630 // If the child doesn't have a static inline position (i.e. "left" and/o r "right" aren't "auto",
1631 // we need to calculate the offset from the left (even if we're in RTL). 1631 // we need to calculate the offset from the left (even if we're in RTL).
1632 if (endIsAuto) { 1632 if (endIsAuto) {
1633 offset = LayoutUnit(); 1633 offset = LayoutUnit();
1634 } else { 1634 } else {
1635 offset = translateRTLCoordinate(m_columnPositions[endLine]) - border Left(); 1635 offset = translateRTLCoordinate(m_columnPositions[endLine]) - border LogicalLeft();
1636 1636
1637 if (endLine > firstExplicitLine && endLine < lastExplicitLine) { 1637 if (endLine > firstExplicitLine && endLine < lastExplicitLine) {
1638 offset += guttersSize(direction, 2); 1638 offset += guttersSize(direction, 2);
1639 offset += isForColumns ? m_offsetBetweenColumns : m_offsetBetwee nRows; 1639 offset += isForColumns ? m_offsetBetweenColumns : m_offsetBetwee nRows;
1640 } 1640 }
1641 } 1641 }
1642 } 1642 }
1643 1643
1644 if (child.parent() == this && !startIsAuto) { 1644 if (child.parent() == this && !startIsAuto) {
1645 // If column/row start is "auto" the static position has been already se t in prepareChildForPositionedLayout(). 1645 // If column/row start is "auto" the static position has been already se t in prepareChildForPositionedLayout().
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
2142 2142
2143 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData )); 2143 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData ));
2144 } 2144 }
2145 2145
2146 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2146 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2147 { 2147 {
2148 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2148 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2149 } 2149 }
2150 2150
2151 } // namespace blink 2151 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-positioned-children-writing-modes-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698