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

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

Issue 1648333002: [css-grid] Rename GridCoordinate to GridArea (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "core/css/CSSShadowValue.h" 42 #include "core/css/CSSShadowValue.h"
43 #include "core/css/CSSStringValue.h" 43 #include "core/css/CSSStringValue.h"
44 #include "core/css/CSSTimingFunctionValue.h" 44 #include "core/css/CSSTimingFunctionValue.h"
45 #include "core/css/CSSURIValue.h" 45 #include "core/css/CSSURIValue.h"
46 #include "core/css/CSSValuePair.h" 46 #include "core/css/CSSValuePair.h"
47 #include "core/css/CSSValuePool.h" 47 #include "core/css/CSSValuePool.h"
48 #include "core/css/CSSVariableReferenceValue.h" 48 #include "core/css/CSSVariableReferenceValue.h"
49 #include "core/css/parser/CSSParserFastPaths.h" 49 #include "core/css/parser/CSSParserFastPaths.h"
50 #include "core/css/parser/CSSParserValues.h" 50 #include "core/css/parser/CSSParserValues.h"
51 #include "core/frame/UseCounter.h" 51 #include "core/frame/UseCounter.h"
52 #include "core/style/GridCoordinate.h" 52 #include "core/style/GridArea.h"
53 #include "platform/RuntimeEnabledFeatures.h" 53 #include "platform/RuntimeEnabledFeatures.h"
54 54
55 namespace blink { 55 namespace blink {
56 56
57 void CSSPropertyParser::addProperty(CSSPropertyID propId, PassRefPtrWillBeRawPtr <CSSValue> value, bool important, bool implicit) 57 void CSSPropertyParser::addProperty(CSSPropertyID propId, PassRefPtrWillBeRawPtr <CSSValue> value, bool important, bool implicit)
58 { 58 {
59 ASSERT(!isPropertyAlias(propId)); 59 ASSERT(!isPropertyAlias(propId));
60 60
61 int shorthandIndex = 0; 61 int shorthandIndex = 0;
62 bool setFromShorthand = false; 62 bool setFromShorthand = false;
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 2071
2072 // We handle several grid areas with the same name at once to simplify t he validation code. 2072 // We handle several grid areas with the same name at once to simplify t he validation code.
2073 size_t lookAheadCol; 2073 size_t lookAheadCol;
2074 for (lookAheadCol = currentCol + 1; lookAheadCol < columnCount; ++lookAh eadCol) { 2074 for (lookAheadCol = currentCol + 1; lookAheadCol < columnCount; ++lookAh eadCol) {
2075 if (columnNames[lookAheadCol] != gridAreaName) 2075 if (columnNames[lookAheadCol] != gridAreaName)
2076 break; 2076 break;
2077 } 2077 }
2078 2078
2079 NamedGridAreaMap::iterator gridAreaIt = gridAreaMap.find(gridAreaName); 2079 NamedGridAreaMap::iterator gridAreaIt = gridAreaMap.find(gridAreaName);
2080 if (gridAreaIt == gridAreaMap.end()) { 2080 if (gridAreaIt == gridAreaMap.end()) {
2081 gridAreaMap.add(gridAreaName, GridCoordinate(GridSpan::translatedDef initeGridSpan(rowCount, rowCount + 1), GridSpan::translatedDefiniteGridSpan(curr entCol, lookAheadCol))); 2081 gridAreaMap.add(gridAreaName, GridArea(GridSpan::translatedDefiniteG ridSpan(rowCount, rowCount + 1), GridSpan::translatedDefiniteGridSpan(currentCol , lookAheadCol)));
2082 } else { 2082 } else {
2083 GridCoordinate& gridCoordinate = gridAreaIt->value; 2083 GridArea& gridArea = gridAreaIt->value;
2084 2084
2085 // The following checks test that the grid area is a single filled-i n rectangle. 2085 // The following checks test that the grid area is a single filled-i n rectangle.
2086 // 1. The new row is adjacent to the previously parsed row. 2086 // 1. The new row is adjacent to the previously parsed row.
2087 if (rowCount != gridCoordinate.rows.resolvedFinalPosition()) 2087 if (rowCount != gridArea.rows.resolvedFinalPosition())
2088 return false; 2088 return false;
2089 2089
2090 // 2. The new area starts at the same position as the previously par sed area. 2090 // 2. The new area starts at the same position as the previously par sed area.
2091 if (currentCol != gridCoordinate.columns.resolvedInitialPosition()) 2091 if (currentCol != gridArea.columns.resolvedInitialPosition())
2092 return false; 2092 return false;
2093 2093
2094 // 3. The new area ends at the same position as the previously parse d area. 2094 // 3. The new area ends at the same position as the previously parse d area.
2095 if (lookAheadCol != gridCoordinate.columns.resolvedFinalPosition()) 2095 if (lookAheadCol != gridArea.columns.resolvedFinalPosition())
2096 return false; 2096 return false;
2097 2097
2098 gridCoordinate.rows = GridSpan::translatedDefiniteGridSpan(gridCoord inate.rows.resolvedInitialPosition(), gridCoordinate.rows.resolvedFinalPosition( ) + 1); 2098 gridArea.rows = GridSpan::translatedDefiniteGridSpan(gridArea.rows.r esolvedInitialPosition(), gridArea.rows.resolvedFinalPosition() + 1);
2099 } 2099 }
2100 currentCol = lookAheadCol - 1; 2100 currentCol = lookAheadCol - 1;
2101 } 2101 }
2102 2102
2103 m_valueList->next(); 2103 m_valueList->next();
2104 return true; 2104 return true;
2105 } 2105 }
2106 2106
2107 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTemplateAreas() 2107 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseGridTemplateAreas()
2108 { 2108 {
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
3834 ASSERT(!m_parsedCalculation); 3834 ASSERT(!m_parsedCalculation);
3835 m_parsedCalculation = CSSCalcValue::create(args, range); 3835 m_parsedCalculation = CSSCalcValue::create(args, range);
3836 3836
3837 if (!m_parsedCalculation) 3837 if (!m_parsedCalculation)
3838 return false; 3838 return false;
3839 3839
3840 return true; 3840 return true;
3841 } 3841 }
3842 3842
3843 } // namespace blink 3843 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSGridTemplateAreasValue.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutGrid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698