Diff
Modified: trunk/LayoutTests/ChangeLog (108854 => 108855)
--- trunk/LayoutTests/ChangeLog 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/LayoutTests/ChangeLog 2012-02-24 23:24:46 UTC (rev 108855)
@@ -1,3 +1,13 @@
+2012-02-24 Julien Chaffraix <[email protected]>
+
+ Implement limited parsing of -webkit-grid-column and -webkit-grid-row
+ https://bugs.webkit.org/show_bug.cgi?id=79151
+
+ Reviewed by Ojan Vafai.
+
+ * fast/css-grid-layout/grid-item-column-row-get-set-expected.txt: Added.
+ * fast/css-grid-layout/grid-item-column-row-get-set.html: Added.
+
2012-02-24 Adrienne Walker <[email protected]>
[chromium] Unreviewed gardening. Remove expectations for nonexistent tests.
Added: trunk/LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set-expected.txt (0 => 108855)
--- trunk/LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set-expected.txt 2012-02-24 23:24:46 UTC (rev 108855)
@@ -0,0 +1,36 @@
+Test that setting and getting grid-column and grid-row works as expected
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test getting -webkit-grid-column and -webkit-grid-row set through CSS
+PASS getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-column') is 'auto'
+PASS getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-row') is 'auto'
+PASS getComputedStyle(gridItemWithPositiveInteger, '').getPropertyValue('-webkit-grid-column') is '10'
+PASS getComputedStyle(gridItemWithPositiveInteger, '').getPropertyValue('-webkit-grid-row') is '15'
+PASS getComputedStyle(gridItemWithNegativeInteger, '').getPropertyValue('-webkit-grid-column') is '-10'
+PASS getComputedStyle(gridItemWithNegativeInteger, '').getPropertyValue('-webkit-grid-row') is '-15'
+PASS getComputedStyle(gridItemWithAutoElement, '').getPropertyValue('-webkit-grid-column') is 'auto'
+PASS getComputedStyle(gridItemWithAutoElement, '').getPropertyValue('-webkit-grid-row') is 'auto'
+
+Test the initial value
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-column') is 'auto'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-row') is 'auto'
+
+Test getting and setting grid-column and grid-row through JS
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-column') is '18'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-row') is '66'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-column') is '-55'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-row') is '-40'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-column') is 'auto'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-row') is 'auto'
+
+Test setting grid-column and grid-row back to 'auto' through JS
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-column') is '18'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-row') is '66'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-column') is 'auto'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-row') is 'auto'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Property changes on: trunk/LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set-expected.txt
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set.html (0 => 108855)
--- trunk/LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set.html (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set.html 2012-02-24 23:24:46 UTC (rev 108855)
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.gridItemWithPositiveInteger {
+ -webkit-grid-column: 10;
+ -webkit-grid-row: 15;
+}
+.gridItemWithNegativeInteger {
+ -webkit-grid-column: -10;
+ -webkit-grid-row: -15;
+}
+.gridItemWithAuto {
+ -webkit-grid-column: auto;
+ -webkit-grid-row: auto;
+}
+</style>
+<script src=""
+</head>
+<body>
+<!-- The first has no properties set on it. -->
+<div id="gridElement"></div>
+<div class="gridItemWithPositiveInteger" id="gridItemWithPositiveInteger"></div>
+<div class="gridItemWithNegativeInteger" id="gridItemWithNegativeInteger"></div>
+<div class="gridItemWithAuto" id="gridItemWithAutoElement"></div>
+<script>
+ description('Test that setting and getting grid-column and grid-row works as expected');
+
+ debug("Test getting -webkit-grid-column and -webkit-grid-row set through CSS");
+ var gridElement = document.getElementById("gridElement");
+ shouldBe("getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-column')", "'auto'");
+ shouldBe("getComputedStyle(gridElement, '').getPropertyValue('-webkit-grid-row')", "'auto'");
+
+ var gridItemWithPositiveInteger = document.getElementById("gridItemWithPositiveInteger");
+ shouldBe("getComputedStyle(gridItemWithPositiveInteger, '').getPropertyValue('-webkit-grid-column')", "'10'");
+ shouldBe("getComputedStyle(gridItemWithPositiveInteger, '').getPropertyValue('-webkit-grid-row')", "'15'");
+
+ var gridItemWithNegativeInteger = document.getElementById("gridItemWithNegativeInteger");
+ shouldBe("getComputedStyle(gridItemWithNegativeInteger, '').getPropertyValue('-webkit-grid-column')", "'-10'");
+ shouldBe("getComputedStyle(gridItemWithNegativeInteger, '').getPropertyValue('-webkit-grid-row')", "'-15'");
+
+ var gridItemWithAutoElement = document.getElementById("gridItemWithAutoElement");
+ shouldBe("getComputedStyle(gridItemWithAutoElement, '').getPropertyValue('-webkit-grid-column')", "'auto'");
+ shouldBe("getComputedStyle(gridItemWithAutoElement, '').getPropertyValue('-webkit-grid-row')", "'auto'");
+
+ debug("");
+ debug("Test the initial value");
+ var element = document.createElement("div");
+ document.body.appendChild(element);
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-column')", "'auto'");
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-row')", "'auto'");
+
+ debug("");
+ debug("Test getting and setting grid-column and grid-row through JS");
+ element.style.webkitGridColumn = "18";
+ element.style.webkitGridRow = "66";
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-column')", "'18'");
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-row')", "'66'");
+
+ element = document.createElement("div");
+ document.body.appendChild(element);
+ element.style.webkitGridColumn = "-55";
+ element.style.webkitGridRow = "-40";
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-column')", "'-55'");
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-row')", "'-40'");
+
+ element = document.createElement("div");
+ document.body.appendChild(element);
+ element.style.webkitGridColumn = "auto";
+ element.style.webkitGridRow = "auto";
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-column')", "'auto'");
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-row')", "'auto'");
+
+ debug("");
+ debug("Test setting grid-column and grid-row back to 'auto' through JS");
+ element.style.webkitGridColumn = "18";
+ element.style.webkitGridRow = "66";
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-column')", "'18'");
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-row')", "'66'");
+ element.style.webkitGridColumn = "auto";
+ element.style.webkitGridRow = "auto";
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-column')", "'auto'");
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-row')", "'auto'");
+</script>
+<script src=""
+</body>
+</html>
Property changes on: trunk/LayoutTests/fast/css-grid-layout/grid-item-column-row-get-set.html
___________________________________________________________________
Added: svn:executable
Added: svn:eol-style
Modified: trunk/Source/WebCore/CMakeLists.txt (108854 => 108855)
--- trunk/Source/WebCore/CMakeLists.txt 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/CMakeLists.txt 2012-02-24 23:24:46 UTC (rev 108855)
@@ -1369,6 +1369,7 @@
rendering/style/StyleFlexibleBoxData.cpp
rendering/style/StyleGeneratedImage.cpp
rendering/style/StyleGridData.cpp
+ rendering/style/StyleGridItemData.cpp
rendering/style/StyleInheritedData.cpp
rendering/style/StyleMarqueeData.cpp
rendering/style/StyleMultiColData.cpp
Modified: trunk/Source/WebCore/ChangeLog (108854 => 108855)
--- trunk/Source/WebCore/ChangeLog 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/ChangeLog 2012-02-24 23:24:46 UTC (rev 108855)
@@ -1,3 +1,64 @@
+2012-02-24 Julien Chaffraix <[email protected]>
+
+ Implement limited parsing of -webkit-grid-column and -webkit-grid-row
+ https://bugs.webkit.org/show_bug.cgi?id=79151
+
+ Reviewed by Ojan Vafai.
+
+ Test: fast/css-grid-layout/grid-item-column-row-get-set.html
+
+ This change implements a subset of the grammar:
+
+ -webkit-grid-{row|column} := <integer> | 'auto'
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ Added the new files to our build systems.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::valueForGridPosition): Check that we have the right translated grammar
+ (this function will be more useful once we implement more of the grammar).
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ Added handling for the new properties.
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ Allow only 'auto' or <integer>.
+
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ grid-colum and grid-row are not inherited.
+
+ * css/CSSPropertyNames.in:
+ Added the 2 new properties.
+
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::RenderStyle):
+ (WebCore::RenderStyle::diff):
+ * rendering/style/RenderStyle.h:
+ * rendering/style/StyleGridItemData.cpp: Added.
+ (WebCore::StyleGridItemData::StyleGridItemData):
+ * rendering/style/StyleGridItemData.h: Added.
+ (StyleGridItemData):
+ (WebCore::StyleGridItemData::create):
+ (WebCore::StyleGridItemData::copy):
+ (WebCore::StyleGridItemData::operator==):
+ (WebCore::StyleGridItemData::operator!=):
+ Implemented the minimum working class.
+
+ * rendering/style/StyleRareNonInheritedData.cpp:
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+ (WebCore::StyleRareNonInheritedData::operator==):
+ * rendering/style/StyleRareNonInheritedData.h:
+ (StyleRareNonInheritedData):
+ Added StyleGridItemData to the class StyleRareNonInheritedData.
+
2012-02-24 Joshua Bell <[email protected]>
IndexedDB: IDBObjectStore.count() and IDBIndex.count() should accept key argument
Modified: trunk/Source/WebCore/GNUmakefile.list.am (108854 => 108855)
--- trunk/Source/WebCore/GNUmakefile.list.am 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2012-02-24 23:24:46 UTC (rev 108855)
@@ -3688,6 +3688,8 @@
Source/WebCore/rendering/style/StyleGeneratedImage.h \
Source/WebCore/rendering/style/StyleGridData.cpp \
Source/WebCore/rendering/style/StyleGridData.h \
+ Source/WebCore/rendering/style/StyleGridItemData.cpp \
+ Source/WebCore/rendering/style/StyleGridItemData.h \
Source/WebCore/rendering/style/StyleImage.h \
Source/WebCore/rendering/style/StyleInheritedData.cpp \
Source/WebCore/rendering/style/StyleInheritedData.h \
Modified: trunk/Source/WebCore/Target.pri (108854 => 108855)
--- trunk/Source/WebCore/Target.pri 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/Target.pri 2012-02-24 23:24:46 UTC (rev 108855)
@@ -1290,6 +1290,7 @@
rendering/style/StyleFlexibleBoxData.cpp \
rendering/style/StyleGeneratedImage.cpp \
rendering/style/StyleGridData.cpp \
+ rendering/style/StyleGridItemData.cpp \
rendering/style/StyleInheritedData.cpp \
rendering/style/StyleMarqueeData.cpp \
rendering/style/StyleMultiColData.cpp \
Modified: trunk/Source/WebCore/WebCore.gypi (108854 => 108855)
--- trunk/Source/WebCore/WebCore.gypi 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/WebCore.gypi 2012-02-24 23:24:46 UTC (rev 108855)
@@ -538,6 +538,7 @@
'rendering/style/StyleFlexibleBoxData.h',
'rendering/style/StyleGeneratedImage.h',
'rendering/style/StyleGridData.h',
+ 'rendering/style/StyleGridItemData.h',
'rendering/style/StyleImage.h',
'rendering/style/StyleInheritedData.h',
'rendering/style/StyleMarqueeData.h',
@@ -4546,6 +4547,7 @@
'rendering/style/StyleFlexibleBoxData.cpp',
'rendering/style/StyleGeneratedImage.cpp',
'rendering/style/StyleGridData.cpp',
+ 'rendering/style/StyleGridItemData.cpp',
'rendering/style/StyleInheritedData.cpp',
'rendering/style/StyleMarqueeData.cpp',
'rendering/style/StyleMultiColData.cpp',
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (108854 => 108855)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-02-24 23:24:46 UTC (rev 108855)
@@ -43507,6 +43507,62 @@
>
</File>
<File
+ RelativePath="..\rendering\style\StyleGridItemData.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Production|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\rendering\style\StyleGridItemData.h"
+ >
+ </File>
+ <File
RelativePath="..\rendering\style\StyleImage.h"
>
</File>
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (108854 => 108855)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-02-24 23:24:46 UTC (rev 108855)
@@ -3527,6 +3527,8 @@
A10BB58B1484E3B300B2E87A /* RenderSVGShape.h in Headers */ = {isa = PBXBuildFile; fileRef = A10BB5891484E3B300B2E87A /* RenderSVGShape.h */; };
A10DC76A14747BAB005E2471 /* StyleGridData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A10DC76814747BAB005E2471 /* StyleGridData.cpp */; };
A10DC76B14747BAB005E2471 /* StyleGridData.h in Headers */ = {isa = PBXBuildFile; fileRef = A10DC76914747BAB005E2471 /* StyleGridData.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ A110DB9D14F5DF8700A03B93 /* StyleGridItemData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A110DB9C14F5DF8700A03B93 /* StyleGridItemData.cpp */; };
+ A110DB9B14F5DF7700A03B93 /* StyleGridItemData.h in Headers */ = {isa = PBXBuildFile; fileRef = A110DB9A14F5DF7700A03B93 /* StyleGridItemData.h */; settings = {ATTRIBUTES = (Private, ); }; };
A120ACA413F998CA00FE4AC7 /* LayoutRepainter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A120ACA113F9984600FE4AC7 /* LayoutRepainter.cpp */; };
A12538D413F9B60A00024754 /* LayoutRepainter.h in Headers */ = {isa = PBXBuildFile; fileRef = A120ACA013F9983700FE4AC7 /* LayoutRepainter.h */; settings = {ATTRIBUTES = (Private, ); }; };
A136A00C1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A136A00A1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp */; };
@@ -10416,6 +10418,8 @@
A10BB5891484E3B300B2E87A /* RenderSVGShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGShape.h; sourceTree = "<group>"; };
A10DC76814747BAB005E2471 /* StyleGridData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StyleGridData.cpp; path = style/StyleGridData.cpp; sourceTree = "<group>"; };
A10DC76914747BAB005E2471 /* StyleGridData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleGridData.h; path = style/StyleGridData.h; sourceTree = "<group>"; };
+ A110DB9A14F5DF7700A03B93 /* StyleGridItemData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleGridItemData.h; path = style/StyleGridItemData.h; sourceTree = "<group>"; };
+ A110DB9C14F5DF8700A03B93 /* StyleGridItemData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StyleGridItemData.cpp; path = style/StyleGridItemData.cpp; sourceTree = "<group>"; };
A120ACA013F9983700FE4AC7 /* LayoutRepainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutRepainter.h; sourceTree = "<group>"; };
A120ACA113F9984600FE4AC7 /* LayoutRepainter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutRepainter.cpp; sourceTree = "<group>"; };
A136A00A1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLHttpRequestProgressEventThrottle.cpp; sourceTree = "<group>"; };
@@ -19590,6 +19594,8 @@
BCEF44490E6745E0001C1287 /* StyleGeneratedImage.h */,
A10DC76814747BAB005E2471 /* StyleGridData.cpp */,
A10DC76914747BAB005E2471 /* StyleGridData.h */,
+ A110DB9C14F5DF8700A03B93 /* StyleGridItemData.cpp */,
+ A110DB9A14F5DF7700A03B93 /* StyleGridItemData.h */,
BCEF43CE0E673DA1001C1287 /* StyleImage.h */,
BC2273010E82F1E600E7F975 /* StyleInheritedData.cpp */,
BC2273020E82F1E600E7F975 /* StyleInheritedData.h */,
@@ -23840,6 +23846,7 @@
5317612313C516690026E454 /* StyleFlexibleBoxData.h in Headers */,
BCEF444A0E6745E0001C1287 /* StyleGeneratedImage.h in Headers */,
A10DC76B14747BAB005E2471 /* StyleGridData.h in Headers */,
+ A110DB9B14F5DF7700A03B93 /* StyleGridItemData.h in Headers */,
BCEF43CF0E673DA1001C1287 /* StyleImage.h in Headers */,
BC2273040E82F1E600E7F975 /* StyleInheritedData.h in Headers */,
BC5EB72A0E81DE8100B25965 /* StyleMarqueeData.h in Headers */,
@@ -26905,6 +26912,7 @@
5317612213C516690026E454 /* StyleFlexibleBoxData.cpp in Sources */,
BCEF447D0E674806001C1287 /* StyleGeneratedImage.cpp in Sources */,
A10DC76A14747BAB005E2471 /* StyleGridData.cpp in Sources */,
+ A110DB9D14F5DF8700A03B93 /* StyleGridItemData.cpp in Sources */,
BC2273030E82F1E600E7F975 /* StyleInheritedData.cpp in Sources */,
BC5EB7290E81DE8100B25965 /* StyleMarqueeData.cpp in Sources */,
0FF50271102BA96A0066F39A /* StyleMedia.cpp in Sources */,
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (108854 => 108855)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2012-02-24 23:24:46 UTC (rev 108855)
@@ -232,6 +232,9 @@
#if ENABLE(CSS_GRID_LAYOUT)
CSSPropertyWebkitGridColumns,
CSSPropertyWebkitGridRows,
+
+ CSSPropertyWebkitGridColumn,
+ CSSPropertyWebkitGridRow,
#endif
CSSPropertyWebkitHighlight,
CSSPropertyWebkitHyphenateCharacter,
@@ -913,6 +916,15 @@
list->append(valueForGridTrackBreadth(trackLengths[i], style, cssValuePool));
return list.release();
}
+
+static PassRefPtr<CSSValue> valueForGridPosition(const Length& position, CSSValuePool* cssValuePool)
+{
+ if (position.isAuto())
+ return cssValuePool->createIdentifierValue(CSSValueAuto);
+
+ ASSERT(position.isFixed());
+ return cssValuePool->createValue(position.value(), CSSPrimitiveValue::CSS_NUMBER);
+}
#endif
static PassRefPtr<CSSValue> getDelayValue(const AnimationList* animList, CSSValuePool* cssValuePool)
@@ -1648,6 +1660,11 @@
case CSSPropertyWebkitGridRows: {
return valueForGridTrackList(style->gridRows(), style.get(), cssValuePool);
}
+
+ case CSSPropertyWebkitGridColumn:
+ return valueForGridPosition(style->gridItemColumn(), cssValuePool);
+ case CSSPropertyWebkitGridRow:
+ return valueForGridPosition(style->gridItemRow(), cssValuePool);
#endif
case CSSPropertyHeight:
if (renderer) {
Modified: trunk/Source/WebCore/css/CSSParser.cpp (108854 => 108855)
--- trunk/Source/WebCore/css/CSSParser.cpp 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/css/CSSParser.cpp 2012-02-24 23:24:46 UTC (rev 108855)
@@ -1882,6 +1882,11 @@
case CSSPropertyWebkitGridColumns:
case CSSPropertyWebkitGridRows:
return parseGridTrackList(propId, important);
+
+ case CSSPropertyWebkitGridColumn:
+ case CSSPropertyWebkitGridRow:
+ validPrimitive = id == CSSValueAuto || validUnit(value, FInteger, m_strict);
+ break;
#endif
case CSSPropertyWebkitMarginCollapse: {
const int properties[2] = { CSSPropertyWebkitMarginBeforeCollapse,
Modified: trunk/Source/WebCore/css/CSSProperty.cpp (108854 => 108855)
--- trunk/Source/WebCore/css/CSSProperty.cpp 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/css/CSSProperty.cpp 2012-02-24 23:24:46 UTC (rev 108855)
@@ -573,6 +573,9 @@
#if ENABLE(CSS_GRID_LAYOUT)
case CSSPropertyWebkitGridColumns:
case CSSPropertyWebkitGridRows:
+
+ case CSSPropertyWebkitGridColumn:
+ case CSSPropertyWebkitGridRow:
#endif
case CSSPropertyWebkitLineClamp:
case CSSPropertyWebkitLogicalWidth:
Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (108854 => 108855)
--- trunk/Source/WebCore/css/CSSPropertyNames.in 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in 2012-02-24 23:24:46 UTC (rev 108855)
@@ -376,6 +376,8 @@
#if defined(ENABLE_CSS_GRID_LAYOUT) && ENABLE_CSS_GRID_LAYOUT
-webkit-grid-columns
-webkit-grid-rows
+-webkit-grid-column
+-webkit-grid-row
#endif
#if defined(ENABLE_DASHBOARD_SUPPORT) && ENABLE_DASHBOARD_SUPPORT
-webkit-dashboard-region
Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (108854 => 108855)
--- trunk/Source/WebCore/css/CSSStyleSelector.cpp 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp 2012-02-24 23:24:46 UTC (rev 108855)
@@ -2952,6 +2952,22 @@
return false;
}
+
+
+static bool createGridPosition(CSSValue* value, Length& position)
+{
+ // For now, we only accept: <integer> | 'auto'
+ if (!value->isPrimitiveValue())
+ return false;
+
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
+ if (primitiveValue->getIdent() == CSSValueAuto)
+ return true;
+
+ ASSERT(primitiveValue->isNumber());
+ position.setValue(primitiveValue->getIntValue());
+ return true;
+}
#endif
void CSSStyleSelector::applyProperty(int id, CSSValue *value)
@@ -3804,6 +3820,21 @@
m_style->setGridRows(lengths);
return;
}
+
+ case CSSPropertyWebkitGridColumn: {
+ Length column;
+ if (!createGridPosition(value, column))
+ return;
+ m_style->setGridItemColumn(column);
+ return;
+ }
+ case CSSPropertyWebkitGridRow: {
+ Length row;
+ if (!createGridPosition(value, row))
+ return;
+ m_style->setGridItemRow(row);
+ return;
+ }
#endif
// These properties are implemented in the CSSStyleApplyProperty lookup table.
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (108854 => 108855)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2012-02-24 23:24:46 UTC (rev 108855)
@@ -135,6 +135,7 @@
#endif
#if ENABLE(CSS_GRID_LAYOUT)
rareNonInheritedData.access()->m_grid.init();
+ rareNonInheritedData.access()->m_gridItem.init();
#endif
rareInheritedData.init();
inherited.init();
@@ -424,7 +425,8 @@
}
#endif
#if ENABLE(CSS_GRID_LAYOUT)
- if (rareNonInheritedData->m_grid.get() != other->rareNonInheritedData->m_grid.get())
+ if (rareNonInheritedData->m_grid.get() != other->rareNonInheritedData->m_grid.get()
+ && rareNonInheritedData->m_gridItem.get() != other->rareNonInheritedData->m_gridItem.get())
return StyleDifferenceLayout;
#endif
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (108854 => 108855)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2012-02-24 23:24:46 UTC (rev 108855)
@@ -77,6 +77,7 @@
#if ENABLE(CSS_GRID_LAYOUT)
#include "StyleGridData.h"
+#include "StyleGridItemData.h"
#endif
#if ENABLE(DASHBOARD_SUPPORT)
@@ -814,6 +815,9 @@
#if ENABLE(CSS_GRID_LAYOUT)
const Vector<Length>& gridColumns() const { return rareNonInheritedData->m_grid->m_gridColumns; }
const Vector<Length>& gridRows() const { return rareNonInheritedData->m_grid->m_gridRows; }
+
+ const Length& gridItemColumn() const { return rareNonInheritedData->m_gridItem->m_gridColumn; }
+ const Length& gridItemRow() const { return rareNonInheritedData->m_gridItem->m_gridRow; }
#endif
const ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
@@ -1240,6 +1244,9 @@
#if ENABLE(CSS_GRID_LAYOUT)
void setGridColumns(const Vector<Length>& lengths) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridColumns, lengths); }
void setGridRows(const Vector<Length>& lengths) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridRows, lengths); }
+
+ void setGridItemColumn(const Length& columnPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridColumn, columnPosition); }
+ void setGridItemRow(const Length& rowPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridRow, rowPosition); }
#endif
void setMarqueeIncrement(const Length& f) { SET_VAR(rareNonInheritedData.access()->m_marquee, increment, f); }
@@ -1636,6 +1643,10 @@
}
static Vector<Length> initialGridColumns() { return initialGridTrackValue(); }
static Vector<Length> initialGridRows() { return initialGridTrackValue(); }
+
+ // 'auto' is the default.
+ static Length initialGridItemColumn() { return Length(); }
+ static Length initialGridItemRow() { return Length(); }
#endif
static const AtomicString& initialLineGrid() { return nullAtom; }
Added: trunk/Source/WebCore/rendering/style/StyleGridItemData.cpp (0 => 108855)
--- trunk/Source/WebCore/rendering/style/StyleGridItemData.cpp (rev 0)
+++ trunk/Source/WebCore/rendering/style/StyleGridItemData.cpp 2012-02-24 23:24:46 UTC (rev 108855)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "StyleGridItemData.h"
+
+#if ENABLE(CSS_GRID_LAYOUT)
+
+#include "RenderStyle.h"
+
+namespace WebCore {
+
+StyleGridItemData::StyleGridItemData()
+ : m_gridColumn(RenderStyle::initialGridItemColumn())
+ , m_gridRow(RenderStyle::initialGridItemRow())
+{
+}
+
+StyleGridItemData::StyleGridItemData(const StyleGridItemData& o)
+ : RefCounted<StyleGridItemData>()
+ , m_gridColumn(o.m_gridColumn)
+ , m_gridRow(o.m_gridRow)
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(CSS_GRID_LAYOUT)
+
Property changes on: trunk/Source/WebCore/rendering/style/StyleGridItemData.cpp
___________________________________________________________________
Added: svn:eol-style
Added: trunk/Source/WebCore/rendering/style/StyleGridItemData.h (0 => 108855)
--- trunk/Source/WebCore/rendering/style/StyleGridItemData.h (rev 0)
+++ trunk/Source/WebCore/rendering/style/StyleGridItemData.h 2012-02-24 23:24:46 UTC (rev 108855)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StyleGridItemData_h
+#define StyleGridItemData_h
+
+#if ENABLE(CSS_GRID_LAYOUT)
+
+#include "Length.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class StyleGridItemData : public RefCounted<StyleGridItemData> {
+public:
+ static PassRefPtr<StyleGridItemData> create() { return adoptRef(new StyleGridItemData); }
+ PassRefPtr<StyleGridItemData> copy() const { return adoptRef(new StyleGridItemData(*this)); }
+
+ bool operator==(const StyleGridItemData& o) const
+ {
+ return m_gridColumn == o.m_gridColumn && m_gridRow == o.m_gridRow;
+ }
+
+ bool operator!=(const StyleGridItemData& o) const
+ {
+ return !(*this == o);
+ }
+
+ // FIXME: For the moment, we only support a subset of the grammar which correspond to:
+ // 'auto' | <length>
+ // When we add more of the syntax, we will need a dedicated GridPosition class.
+ Length m_gridColumn;
+ Length m_gridRow;
+
+private:
+ StyleGridItemData();
+ StyleGridItemData(const StyleGridItemData&);
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(CSS_LAYOUT_GRID)
+
+#endif // StyleGridItemData_h
Property changes on: trunk/Source/WebCore/rendering/style/StyleGridItemData.h
___________________________________________________________________
Added: svn:eol-style
Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (108854 => 108855)
--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp 2012-02-24 23:24:46 UTC (rev 108855)
@@ -98,6 +98,7 @@
#endif
#if ENABLE(CSS_GRID_LAYOUT)
, m_grid(o.m_grid)
+ , m_gridItem(o.m_gridItem)
#endif
, m_content(o.m_content ? o.m_content->clone() : nullptr)
, m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) : nullptr)
@@ -165,6 +166,7 @@
#endif
#if ENABLE(CSS_GRID_LAYOUT)
&& m_grid == o.m_grid
+ && m_gridItem == o.m_gridItem
#endif
&& contentDataEquivalent(o)
&& counterDataEquivalent(o)
Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (108854 => 108855)
--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h 2012-02-24 23:18:55 UTC (rev 108854)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h 2012-02-24 23:24:46 UTC (rev 108855)
@@ -48,6 +48,7 @@
class StyleFlexibleBoxData;
#if ENABLE(CSS_GRID_LAYOUT)
class StyleGridData;
+class StyleGridItemData;
#endif
class StyleMarqueeData;
class StyleMultiColData;
@@ -119,6 +120,7 @@
#if ENABLE(CSS_GRID_LAYOUT)
DataRef<StyleGridData> m_grid;
+ DataRef<StyleGridItemData> m_gridItem;
#endif
OwnPtr<ContentData> m_content;