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

Side by Side Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2057113002: [css-grid] Allow percentage values for column and row gutters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch rebased. New positioned test cases and related bug fixes. Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * Copyright (C) 2015 Google Inc. All rights reserved. 7 * Copyright (C) 2015 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 CSSValueList* list = CSSValueList::createSpaceSeparated(); 835 CSSValueList* list = CSSValueList::createSpaceSeparated();
836 size_t insertionIndex; 836 size_t insertionIndex;
837 if (isLayoutGrid) { 837 if (isLayoutGrid) {
838 const auto* grid = toLayoutGrid(layoutObject); 838 const auto* grid = toLayoutGrid(layoutObject);
839 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? gri d->columnPositions() : grid->rowPositions(); 839 const Vector<LayoutUnit>& trackPositions = direction == ForColumns ? gri d->columnPositions() : grid->rowPositions();
840 // There are at least #tracks + 1 grid lines (trackPositions). Apart fro m that, the grid container can generate implicit grid tracks, 840 // There are at least #tracks + 1 grid lines (trackPositions). Apart fro m that, the grid container can generate implicit grid tracks,
841 // so we'll have more trackPositions than trackSizes as the latter only contain the explicit grid. 841 // so we'll have more trackPositions than trackSizes as the latter only contain the explicit grid.
842 ASSERT(trackPositions.size() - 1 >= trackSizes.size()); 842 ASSERT(trackPositions.size() - 1 >= trackSizes.size());
843 843
844 size_t i; 844 size_t i;
845 LayoutUnit gutterSize = grid->guttersSize(direction, 2); 845 LayoutUnit gutterSize = grid->guttersSize(direction, 2, isRowAxis ? grid ->logicalWidth() : grid->logicalHeight());
cbiesinger 2016/06/22 18:46:13 The spec says they refer to the content area, so s
jfernandez 2016/06/27 23:56:47 Done.
846 LayoutUnit offsetBetweenTracks = grid->offsetBetweenTracks(direction); 846 LayoutUnit offsetBetweenTracks = grid->offsetBetweenTracks(direction);
847 for (i = 0; i < trackPositions.size() - 2; ++i) { 847 for (i = 0; i < trackPositions.size() - 2; ++i) {
848 addValuesForNamedGridLinesAtIndex(collector, i, *list); 848 addValuesForNamedGridLinesAtIndex(collector, i, *list);
849 list->append(*zoomAdjustedPixelValue(trackPositions[i + 1] - trackPo sitions[i] - gutterSize - offsetBetweenTracks, style)); 849 list->append(*zoomAdjustedPixelValue(trackPositions[i + 1] - trackPo sitions[i] - gutterSize - offsetBetweenTracks, style));
850 } 850 }
851 // Last track line does not have any gutter or distribution offset. 851 // Last track line does not have any gutter or distribution offset.
852 addValuesForNamedGridLinesAtIndex(collector, i, *list); 852 addValuesForNamedGridLinesAtIndex(collector, i, *list);
853 list->append(*zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositi ons[i], style)); 853 list->append(*zoomAdjustedPixelValue(trackPositions[i + 1] - trackPositi ons[i], style));
854 insertionIndex = trackPositions.size() - 1; 854 insertionIndex = trackPositions.size() - 1;
855 } else { 855 } else {
(...skipping 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after
3003 case CSSPropertyAll: 3003 case CSSPropertyAll:
3004 return nullptr; 3004 return nullptr;
3005 default: 3005 default:
3006 break; 3006 break;
3007 } 3007 }
3008 ASSERT_NOT_REACHED(); 3008 ASSERT_NOT_REACHED();
3009 return nullptr; 3009 return nullptr;
3010 } 3010 }
3011 3011
3012 } // namespace blink 3012 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698