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

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

Issue 2665983004: [css-grid] Fix static position of positioned grid items (Closed)
Patch Set: Created 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-parent.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 2583 matching lines...) Expand 10 before | Expand all | Expand 10 after
2594 if (!gridAreaRect.contains(child->frameRect())) 2594 if (!gridAreaRect.contains(child->frameRect()))
2595 m_gridItemsOverflowingGridArea.push_back(child); 2595 m_gridItemsOverflowingGridArea.push_back(child);
2596 } 2596 }
2597 } 2597 }
2598 2598
2599 void LayoutGrid::prepareChildForPositionedLayout(LayoutBox& child) { 2599 void LayoutGrid::prepareChildForPositionedLayout(LayoutBox& child) {
2600 ASSERT(child.isOutOfFlowPositioned()); 2600 ASSERT(child.isOutOfFlowPositioned());
2601 child.containingBlock()->insertPositionedObject(&child); 2601 child.containingBlock()->insertPositionedObject(&child);
2602 2602
2603 PaintLayer* childLayer = child.layer(); 2603 PaintLayer* childLayer = child.layer();
2604 childLayer->setStaticInlinePosition(borderAndPaddingStart()); 2604 childLayer->setStaticInlinePosition(LayoutUnit(borderStart()));
2605 childLayer->setStaticBlockPosition(borderAndPaddingBefore()); 2605 childLayer->setStaticBlockPosition(LayoutUnit(borderBefore()));
2606 } 2606 }
2607 2607
2608 void LayoutGrid::layoutPositionedObjects(bool relayoutChildren, 2608 void LayoutGrid::layoutPositionedObjects(bool relayoutChildren,
2609 PositionedLayoutBehavior info) { 2609 PositionedLayoutBehavior info) {
2610 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects(); 2610 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects();
2611 if (!positionedDescendants) 2611 if (!positionedDescendants)
2612 return; 2612 return;
2613 2613
2614 for (auto* child : *positionedDescendants) { 2614 for (auto* child : *positionedDescendants) {
2615 if (isOrthogonalChild(*child)) { 2615 if (isOrthogonalChild(*child)) {
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
3628 if (direction == ForRows) 3628 if (direction == ForRows)
3629 return grid.numTracks(ForRows); 3629 return grid.numTracks(ForRows);
3630 3630
3631 return grid.numTracks(ForRows) 3631 return grid.numTracks(ForRows)
3632 ? grid.numTracks(ForColumns) 3632 ? grid.numTracks(ForColumns)
3633 : GridPositionsResolver::explicitGridColumnCount( 3633 : GridPositionsResolver::explicitGridColumnCount(
3634 styleRef(), grid.autoRepeatTracks(ForColumns)); 3634 styleRef(), grid.autoRepeatTracks(ForColumns));
3635 } 3635 }
3636 3636
3637 } // namespace blink 3637 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-parent.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698