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

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

Issue 2543193002: [css-grid] Use child's marginLogicalWidth to compute content-sized track (Closed)
Patch Set: Created 4 years 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) 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 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 // intrinsic width, which is what we are interested in here. Thus we need to 1374 // intrinsic width, which is what we are interested in here. Thus we need to
1375 // set the inline-axis override size to -1 (no possible resolution). 1375 // set the inline-axis override size to -1 (no possible resolution).
1376 if (shouldClearOverrideContainingBlockContentSizeForChild(child, 1376 if (shouldClearOverrideContainingBlockContentSizeForChild(child,
1377 ForColumns)) 1377 ForColumns))
1378 setOverrideContainingBlockContentSizeForChild(child, childInlineDirection, 1378 setOverrideContainingBlockContentSizeForChild(child, childInlineDirection,
1379 LayoutUnit(-1)); 1379 LayoutUnit(-1));
1380 1380
1381 // FIXME: It's unclear if we should return the intrinsic width or the 1381 // FIXME: It's unclear if we should return the intrinsic width or the
1382 // preferred width. 1382 // preferred width.
1383 // See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html 1383 // See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html
1384 return child.minPreferredLogicalWidth() + 1384 return child.minPreferredLogicalWidth() + child.marginLogicalWidth();
1385 marginIntrinsicLogicalWidthForChild(child);
1386 } 1385 }
1387 1386
1388 // All orthogonal flow boxes were already laid out during an early layout 1387 // All orthogonal flow boxes were already laid out during an early layout
1389 // phase performed in FrameView::performLayout. 1388 // phase performed in FrameView::performLayout.
1390 // It's true that grid track sizing was not completed at that time and it may 1389 // It's true that grid track sizing was not completed at that time and it may
1391 // afffect the final height of a grid item, but since it's forbidden to 1390 // afffect the final height of a grid item, but since it's forbidden to
1392 // perform a layout during intrinsic width computation, we have to use that 1391 // perform a layout during intrinsic width computation, we have to use that
1393 // computed height for now. 1392 // computed height for now.
1394 if (direction == ForColumns && 1393 if (direction == ForColumns &&
1395 sizingData.sizingOperation == IntrinsicSizeComputation) { 1394 sizingData.sizingOperation == IntrinsicSizeComputation) {
(...skipping 18 matching lines...) Expand all
1414 // intrinsic width, which is what we are interested in here. Thus we need to 1413 // intrinsic width, which is what we are interested in here. Thus we need to
1415 // set the inline-axis override size to -1 (no possible resolution). 1414 // set the inline-axis override size to -1 (no possible resolution).
1416 if (shouldClearOverrideContainingBlockContentSizeForChild(child, 1415 if (shouldClearOverrideContainingBlockContentSizeForChild(child,
1417 ForColumns)) 1416 ForColumns))
1418 setOverrideContainingBlockContentSizeForChild(child, childInlineDirection, 1417 setOverrideContainingBlockContentSizeForChild(child, childInlineDirection,
1419 LayoutUnit(-1)); 1418 LayoutUnit(-1));
1420 1419
1421 // FIXME: It's unclear if we should return the intrinsic width or the 1420 // FIXME: It's unclear if we should return the intrinsic width or the
1422 // preferred width. 1421 // preferred width.
1423 // See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html 1422 // See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html
1424 return child.maxPreferredLogicalWidth() + 1423 return child.maxPreferredLogicalWidth() + child.marginLogicalWidth();
1425 marginIntrinsicLogicalWidthForChild(child);
1426 } 1424 }
1427 1425
1428 // All orthogonal flow boxes were already laid out during an early layout 1426 // All orthogonal flow boxes were already laid out during an early layout
1429 // phase performed in FrameView::performLayout. 1427 // phase performed in FrameView::performLayout.
1430 // It's true that grid track sizing was not completed at that time and it may 1428 // It's true that grid track sizing was not completed at that time and it may
1431 // afffect the final height of a grid item, but since it's forbidden to 1429 // afffect the final height of a grid item, but since it's forbidden to
1432 // perform a layout during intrinsic width computation, we have to use that 1430 // perform a layout during intrinsic width computation, we have to use that
1433 // computed height for now. 1431 // computed height for now.
1434 if (direction == ForColumns && 1432 if (direction == ForColumns &&
1435 sizingData.sizingOperation == IntrinsicSizeComputation) { 1433 sizingData.sizingOperation == IntrinsicSizeComputation) {
(...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after
3572 if (direction == ForRows) 3570 if (direction == ForRows)
3573 return m_grid.numTracks(ForRows); 3571 return m_grid.numTracks(ForRows);
3574 3572
3575 return m_grid.numTracks(ForRows) 3573 return m_grid.numTracks(ForRows)
3576 ? m_grid.numTracks(ForColumns) 3574 ? m_grid.numTracks(ForColumns)
3577 : GridPositionsResolver::explicitGridColumnCount( 3575 : GridPositionsResolver::explicitGridColumnCount(
3578 styleRef(), m_grid.autoRepeatTracks(ForColumns)); 3576 styleRef(), m_grid.autoRepeatTracks(ForColumns));
3579 } 3577 }
3580 3578
3581 } // namespace blink 3579 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698