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

Unified Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 1309513008: [css-grid] Implement grid gutters (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing v3 Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index e4f1a572ecedde1601d5605035ecd8df2dc127bc..4a25c7fbc5cd4c7881142cb85bfdc2521ea85b88 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -619,10 +619,15 @@ static PassRefPtrWillBeRawPtr<CSSValue> valueForGridTrackList(GridTrackSizingDir
// so we'll have more trackPositions than trackSizes as the latter only contain the explicit grid.
ASSERT(trackPositions.size() - 1 >= trackSizes.size());
- for (size_t i = 0; i < trackPositions.size() - 1; ++i) {
+ size_t i;
+ LayoutUnit gutterSize = toLayoutGrid(layoutObject)->guttersSize(direction, 2);
+ for (i = 0; i < trackPositions.size() - 2; ++i) {
addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list);
- list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositions[i], style));
+ list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositions[i] - gutterSize, style));
}
+ // Last track line does not have any gutter.
+ addValuesForNamedGridLinesAtIndex(orderedNamedGridLines, i, *list);
+ list->append(zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositions[i], style));
insertionIndex = trackPositions.size() - 1;
} else {
for (size_t i = 0; i < trackSizes.size(); ++i) {
@@ -1718,6 +1723,12 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
}
return CSSGridTemplateAreasValue::create(style.namedGridArea(), style.namedGridAreaRowCount(), style.namedGridAreaColumnCount());
+ case CSSPropertyGridColumnGap:
+ return zoomAdjustedPixelValueForLength(style.gridColumnGap(), style);
+ case CSSPropertyGridRowGap:
+ return zoomAdjustedPixelValueForLength(style.gridRowGap(), style);
+ case CSSPropertyGridGap:
+ return valuesForShorthandProperty(gridGapShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
case CSSPropertyHeight:
if (layoutObject) {

Powered by Google App Engine
This is Rietveld 408576698