Changeset 101288 in webkit
- Timestamp:
- Nov 28, 2011 2:59:22 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r101287 r101288 1 2011-11-28 Julien Chaffraix <jchaffraix@webkit.org> 2 3 Add limited parsing support for grid-columns and grid-rows 4 https://bugs.webkit.org/show_bug.cgi?id=72531 5 6 Reviewed by Tony Chang. 7 8 Test our currently supported grammar. 9 10 * fast/css-grid-layout/grid-columns-rows-get-set.html: Added. 11 * fast/css-grid-layout/resources/grid-columns-rows-get-set.js: Added. 12 * fast/css-grid-layout/grid-columns-rows-get-set-expected.txt: Added. 13 1 14 2011-11-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 15 -
trunk/Source/WebCore/CMakeLists.txt
r101257 r101288 1328 1328 rendering/style/StyleFlexibleBoxData.cpp 1329 1329 rendering/style/StyleGeneratedImage.cpp 1330 rendering/style/StyleGridData.cpp 1330 1331 rendering/style/StyleInheritedData.cpp 1331 1332 rendering/style/StyleMarqueeData.cpp -
trunk/Source/WebCore/ChangeLog
r101286 r101288 1 2011-11-28 Julien Chaffraix <jchaffraix@webkit.org> 2 3 Add limited parsing support for grid-columns and grid-rows 4 https://bugs.webkit.org/show_bug.cgi?id=72531 5 6 Reviewed by Tony Chang. 7 8 Test: fast/css-grid-layout/grid-columns-rows-get-set.html 9 10 Added support for: 11 <track-list> := <length> | <percentage> | 'none' | 'auto' 12 13 * CMakeLists.txt: 14 * GNUmakefile.list.am: 15 * Target.pri: 16 * WebCore.gypi: 17 * WebCore.vcproj/WebCore.vcproj: 18 * WebCore.xcodeproj/project.pbxproj: 19 * rendering/style/StyleAllInOne.cpp: 20 Updated our build systems. 21 22 * css/CSSComputedStyleDeclaration.cpp: 23 (WebCore::valueForGridTrackList): 24 Helper function to convert our RenderStyle information to a proper CSSValue. 25 It doesn't do much now but it will be expanded as we add more support. 26 27 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Call the previous 28 function. 29 30 * css/CSSParser.h: 31 * css/CSSParser.cpp: 32 (WebCore::CSSParser::parseValue): 33 (WebCore::CSSParser::parseGridTrackList): 34 CSS parsing part of this change. Pretty simple for now. 35 36 * css/CSSPropertyNames.in: 37 Added -webkit-grid-columns and -webkit-grid-rows. 38 39 * css/CSSProperty.cpp: 40 (WebCore::CSSProperty::isInheritedProperty): 41 * css/CSSStyleApplyProperty.cpp: 42 (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): 43 * css/CSSStyleSelector.cpp: 44 (WebCore::CSSStyleSelector::applyProperty): 45 Style application plumbing. 46 47 * rendering/style/RenderStyle.cpp: 48 (WebCore::RenderStyle::RenderStyle): 49 (WebCore::RenderStyle::diff): 50 This change is required for later when we add layout for our grid. 51 52 * rendering/style/RenderStyle.h: 53 (WebCore::InheritedFlags::gridColumns): 54 (WebCore::InheritedFlags::gridRows): 55 (WebCore::InheritedFlags::setGridColumns): 56 (WebCore::InheritedFlags::setGridRows): 57 (WebCore::InheritedFlags::initialGridColumns): 58 (WebCore::InheritedFlags::initialGridRows): 59 Getters / Setters and initial values. 60 61 * rendering/style/StyleGridData.cpp: Added. 62 (WebCore::StyleGridData::StyleGridData): 63 * rendering/style/StyleGridData.h: Added. 64 (WebCore::StyleGridData::create): 65 (WebCore::StyleGridData::copy): 66 (WebCore::StyleGridData::operator==): 67 (WebCore::StyleGridData::operator!=): 68 This class holds the grid element information. For now pretty simple 69 shell that will be used for the rest of the support. 70 71 * rendering/style/StyleRareNonInheritedData.cpp: 72 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 73 (WebCore::StyleRareNonInheritedData::operator==): 74 * rendering/style/StyleRareNonInheritedData.h: 75 Added StyleGridElementData to StyleRareNonInheritedData. 76 1 77 2011-11-28 Noel Gordon <noel.gordon@gmail.com> 2 78 -
trunk/Source/WebCore/GNUmakefile.list.am
r101270 r101288 3301 3301 Source/WebCore/rendering/style/StyleGeneratedImage.cpp \ 3302 3302 Source/WebCore/rendering/style/StyleGeneratedImage.h \ 3303 Source/WebCore/rendering/style/StyleGridData.cpp \ 3304 Source/WebCore/rendering/style/StyleGridData.h \ 3303 3305 Source/WebCore/rendering/style/StyleImage.h \ 3304 3306 Source/WebCore/rendering/style/StyleInheritedData.cpp \ -
trunk/Source/WebCore/Target.pri
r101262 r101288 1264 1264 rendering/style/StyleFlexibleBoxData.cpp \ 1265 1265 rendering/style/StyleGeneratedImage.cpp \ 1266 rendering/style/StyleGridData.cpp \ 1266 1267 rendering/style/StyleInheritedData.cpp \ 1267 1268 rendering/style/StyleMarqueeData.cpp \ -
trunk/Source/WebCore/WebCore.gypi
r101257 r101288 954 954 'rendering/style/StyleFlexibleBoxData.h', 955 955 'rendering/style/StyleGeneratedImage.h', 956 'rendering/style/StyleGridData.h', 956 957 'rendering/style/StyleImage.h', 957 958 'rendering/style/StyleInheritedData.h', … … 4773 4774 'rendering/style/StyleFlexibleBoxData.cpp', 4774 4775 'rendering/style/StyleGeneratedImage.cpp', 4776 'rendering/style/StyleGridData.cpp', 4775 4777 'rendering/style/StyleInheritedData.cpp', 4776 4778 'rendering/style/StyleMarqueeData.cpp', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r101257 r101288 40772 40772 </File> 40773 40773 <File 40774 RelativePath="..\rendering\style\StyleGridData.cpp" 40775 > 40776 <FileConfiguration 40777 Name="Debug|Win32" 40778 ExcludedFromBuild="true" 40779 > 40780 <Tool 40781 Name="VCCLCompilerTool" 40782 /> 40783 </FileConfiguration> 40784 <FileConfiguration 40785 Name="Release|Win32" 40786 ExcludedFromBuild="true" 40787 > 40788 <Tool 40789 Name="VCCLCompilerTool" 40790 /> 40791 </FileConfiguration> 40792 <FileConfiguration 40793 Name="Debug_Cairo_CFLite|Win32" 40794 ExcludedFromBuild="true" 40795 > 40796 <Tool 40797 Name="VCCLCompilerTool" 40798 /> 40799 </FileConfiguration> 40800 <FileConfiguration 40801 Name="Release_Cairo_CFLite|Win32" 40802 ExcludedFromBuild="true" 40803 > 40804 <Tool 40805 Name="VCCLCompilerTool" 40806 /> 40807 </FileConfiguration> 40808 <FileConfiguration 40809 Name="Debug_All|Win32" 40810 ExcludedFromBuild="true" 40811 > 40812 <Tool 40813 Name="VCCLCompilerTool" 40814 /> 40815 </FileConfiguration> 40816 <FileConfiguration 40817 Name="Production|Win32" 40818 ExcludedFromBuild="true" 40819 > 40820 <Tool 40821 Name="VCCLCompilerTool" 40822 /> 40823 </FileConfiguration> 40824 </File> 40825 <File 40826 RelativePath="..\rendering\style\StyleGridData.h" 40827 > 40828 </File> 40829 <File 40774 40830 RelativePath="..\rendering\style\StyleImage.h" 40775 40831 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r101257 r101288 3399 3399 A0EE0DF7144F825500F80B0D /* WebGLDebugShaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0EE0DF3144F825500F80B0D /* WebGLDebugShaders.cpp */; }; 3400 3400 A0EE0DF8144F825500F80B0D /* WebGLDebugShaders.h in Headers */ = {isa = PBXBuildFile; fileRef = A0EE0DF4144F825500F80B0D /* WebGLDebugShaders.h */; }; 3401 A10DC76A14747BAB005E2471 /* StyleGridData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A10DC76814747BAB005E2471 /* StyleGridData.cpp */; }; 3402 A10DC76B14747BAB005E2471 /* StyleGridData.h in Headers */ = {isa = PBXBuildFile; fileRef = A10DC76914747BAB005E2471 /* StyleGridData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3401 3403 A120ACA413F998CA00FE4AC7 /* LayoutRepainter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A120ACA113F9984600FE4AC7 /* LayoutRepainter.cpp */; }; 3402 3404 A12538D413F9B60A00024754 /* LayoutRepainter.h in Headers */ = {isa = PBXBuildFile; fileRef = A120ACA013F9983700FE4AC7 /* LayoutRepainter.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 10621 10623 A0EE0DF3144F825500F80B0D /* WebGLDebugShaders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLDebugShaders.cpp; path = canvas/WebGLDebugShaders.cpp; sourceTree = "<group>"; }; 10622 10624 A0EE0DF4144F825500F80B0D /* WebGLDebugShaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLDebugShaders.h; path = canvas/WebGLDebugShaders.h; sourceTree = "<group>"; }; 10625 A10DC76814747BAB005E2471 /* StyleGridData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StyleGridData.cpp; path = style/StyleGridData.cpp; sourceTree = "<group>"; }; 10626 A10DC76914747BAB005E2471 /* StyleGridData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleGridData.h; path = style/StyleGridData.h; sourceTree = "<group>"; }; 10623 10627 A120ACA013F9983700FE4AC7 /* LayoutRepainter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutRepainter.h; sourceTree = "<group>"; }; 10624 10628 A120ACA113F9984600FE4AC7 /* LayoutRepainter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutRepainter.cpp; sourceTree = "<group>"; }; … … 19831 19835 isa = PBXGroup; 19832 19836 children = ( 19837 A10DC76814747BAB005E2471 /* StyleGridData.cpp */, 19838 A10DC76914747BAB005E2471 /* StyleGridData.h */, 19833 19839 5038BE2D1472AD230095E0D1 /* StyleCachedShader.cpp */, 19834 19840 5038BE2E1472AD230095E0D1 /* StyleCachedShader.h */, … … 24795 24801 033A6A83147E08A600509B36 /* JSHTMLPropertiesCollection.h in Headers */, 24796 24802 7AA51B6E1483B61600AD2752 /* InspectorBaseAgent.h in Headers */, 24803 A10DC76B14747BAB005E2471 /* StyleGridData.h in Headers */, 24797 24804 ); 24798 24805 runOnlyForDeploymentPostprocessing = 0; … … 27677 27684 033A6A81147E088600509B36 /* JSHTMLPropertiesCollection.cpp in Sources */, 27678 27685 7AA51B6F1483B61600AD2752 /* InspectorBaseAgent.cpp in Sources */, 27686 A10DC76A14747BAB005E2471 /* StyleGridData.cpp in Sources */, 27679 27687 ); 27680 27688 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r101275 r101288 221 221 CSSPropertyWebkitFlexFlow, 222 222 CSSPropertyWebkitFontSmoothing, 223 #if ENABLE(CSS_GRID_LAYOUT) 224 CSSPropertyWebkitGridColumns, 225 CSSPropertyWebkitGridRows, 226 #endif 223 227 CSSPropertyWebkitHighlight, 224 228 CSSPropertyWebkitHyphenateCharacter, … … 790 794 #endif 791 795 796 #if ENABLE(CSS_GRID_LAYOUT) 797 static PassRefPtr<CSSValue> valueForGridTrackList(const Length& trackLength, const RenderStyle* style, CSSPrimitiveValueCache* primitiveValueCache) 798 { 799 if (trackLength.isPercent()) 800 return primitiveValueCache->createValue(trackLength); 801 if (trackLength.isAuto()) 802 return primitiveValueCache->createIdentifierValue(CSSValueAuto); 803 if (trackLength.isUndefined()) 804 return primitiveValueCache->createIdentifierValue(CSSValueNone); 805 return zoomAdjustedPixelValue(trackLength.value(), style, primitiveValueCache); 806 } 807 #endif 808 792 809 static PassRefPtr<CSSValue> getDelayValue(const AnimationList* animList, CSSPrimitiveValueCache* primitiveValueCache) 793 810 { … … 1497 1514 return list.release(); 1498 1515 } 1516 #if ENABLE(CSS_GRID_LAYOUT) 1517 case CSSPropertyWebkitGridColumns: { 1518 Length gridColumns = style->gridColumns(); 1519 return valueForGridTrackList(gridColumns, style.get(), primitiveValueCache); 1520 } 1521 case CSSPropertyWebkitGridRows: { 1522 Length gridRows = style->gridRows(); 1523 return valueForGridTrackList(gridRows, style.get(), primitiveValueCache); 1524 } 1525 #endif 1499 1526 case CSSPropertyHeight: 1500 1527 if (renderer) -
trunk/Source/WebCore/css/CSSParser.cpp
r101078 r101288 1773 1773 return false; 1774 1774 } 1775 #if ENABLE(CSS_GRID_LAYOUT) 1776 case CSSPropertyWebkitGridColumns: 1777 case CSSPropertyWebkitGridRows: 1778 return parseGridTrackList(propId, important); 1779 #endif 1775 1780 case CSSPropertyWebkitMarginCollapse: { 1776 1781 const int properties[2] = { CSSPropertyWebkitMarginBeforeCollapse, … … 3517 3522 } 3518 3523 3524 #if ENABLE(CSS_GRID_LAYOUT) 3525 bool CSSParser::parseGridTrackList(int propId, bool important) 3526 { 3527 CSSParserValue* value = m_valueList->current(); 3528 if (value->id == CSSValueNone || value->id == CSSValueAuto) { 3529 addProperty(propId, primitiveValueCache()->createIdentifierValue(value->id), important); 3530 return true; 3531 } 3532 3533 if (validUnit(value, FLength | FPercent, m_strict)) { 3534 addProperty(propId, createPrimitiveNumericValue(value), important); 3535 return true; 3536 } 3537 return false; 3538 } 3539 #endif 3540 3519 3541 3520 3542 -
trunk/Source/WebCore/css/CSSParser.h
r101048 r101288 126 126 bool parseAnimationShorthand(bool important); 127 127 128 #if ENABLE(CSS_GRID_LAYOUT) 129 bool parseGridTrackList(int propId, bool important); 130 #endif 131 128 132 bool parseDashboardRegions(int propId, bool important); 129 133 -
trunk/Source/WebCore/css/CSSProperty.cpp
r101078 r101288 562 562 case CSSPropertyWebkitFlexFlow: 563 563 case CSSPropertyWebkitFontSizeDelta: 564 #if ENABLE(CSS_GRID_LAYOUT) 565 case CSSPropertyWebkitGridColumns: 566 case CSSPropertyWebkitGridRows: 567 #endif 564 568 case CSSPropertyWebkitLineClamp: 565 569 case CSSPropertyWebkitLogicalWidth: -
trunk/Source/WebCore/css/CSSPropertyNames.in
r101078 r101288 368 368 -webkit-tap-highlight-color 369 369 #endif 370 370 #if defined(ENABLE_CSS_GRID_LAYOUT) && ENABLE_CSS_GRID_LAYOUT 371 -webkit-grid-columns 372 -webkit-grid-rows 373 #endif -
trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp
r101275 r101288 1137 1137 setPropertyHandler(CSSPropertyLeft, ApplyPropertyLength<&RenderStyle::left, &RenderStyle::setLeft, &RenderStyle::initialOffset, AutoEnabled>::createHandler()); 1138 1138 1139 #if ENABLE(CSS_GRID_LAYOUT) 1140 setPropertyHandler(CSSPropertyWebkitGridColumns, ApplyPropertyLength<&RenderStyle::gridColumns, &RenderStyle::setGridColumns, &RenderStyle::initialGridColumns, AutoEnabled, IntrinsicDisabled, MinIntrinsicDisabled, NoneEnabled, UndefinedEnabled>::createHandler()); 1141 setPropertyHandler(CSSPropertyWebkitGridRows, ApplyPropertyLength<&RenderStyle::gridRows, &RenderStyle::setGridRows, &RenderStyle::initialGridRows, AutoEnabled, IntrinsicDisabled, MinIntrinsicDisabled, NoneEnabled, UndefinedEnabled>::createHandler()); 1142 #endif 1143 1139 1144 setPropertyHandler(CSSPropertyWidth, ApplyPropertyLength<&RenderStyle::width, &RenderStyle::setWidth, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexWidth>::createHandler()); 1140 1145 setPropertyHandler(CSSPropertyHeight, ApplyPropertyLength<&RenderStyle::height, &RenderStyle::setHeight, &RenderStyle::initialSize, AutoEnabled, IntrinsicEnabled, MinIntrinsicEnabled, NoneDisabled, UndefinedDisabled, FlexHeight>::createHandler()); -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r101238 r101288 3847 3847 case CSSPropertyFontStyle: 3848 3848 case CSSPropertyFontVariant: 3849 #if ENABLE(CSS_GRID_LAYOUT) 3850 case CSSPropertyWebkitGridColumns: 3851 case CSSPropertyWebkitGridRows: 3852 #endif 3849 3853 case CSSPropertyTextRendering: 3850 3854 case CSSPropertyWebkitTextOrientation: -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r101048 r101288 133 133 #if ENABLE(CSS_FILTERS) 134 134 rareNonInheritedData.access()->m_filter.init(); 135 #endif 136 #if ENABLE(CSS_GRID_LAYOUT) 137 rareNonInheritedData.access()->m_grid.init(); 135 138 #endif 136 139 rareInheritedData.init(); … … 426 429 return StyleDifferenceLayout; 427 430 } 431 #endif 432 #if ENABLE(CSS_GRID_LAYOUT) 433 if (rareNonInheritedData->m_grid.get() != other->rareNonInheritedData->m_grid.get()) 434 return StyleDifferenceLayout; 428 435 #endif 429 436 -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r101225 r101288 57 57 #endif 58 58 #include "StyleFlexibleBoxData.h" 59 #if ENABLE(CSS_GRID_LAYOUT) 60 #include "StyleGridData.h" 61 #endif 59 62 #include "StyleInheritedData.h" 60 63 #include "StyleMarqueeData.h" … … 724 727 EFlexAlign flexAlign() const { return static_cast<EFlexAlign>(rareNonInheritedData->m_flexibleBox->m_flexAlign); } 725 728 EFlexFlow flexFlow() const { return static_cast<EFlexFlow>(rareNonInheritedData->m_flexibleBox->m_flexFlow); } 729 730 #if ENABLE(CSS_GRID_LAYOUT) 731 Length gridColumns() const { return rareNonInheritedData->m_grid->m_gridColumns; } 732 Length gridRows() const { return rareNonInheritedData->m_grid->m_gridRows; } 733 #endif 726 734 727 735 const ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); } … … 1137 1145 void setFlexAlign(EFlexAlign a) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexAlign, a); } 1138 1146 void setFlexFlow(EFlexFlow flow) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexFlow, flow); } 1147 #if ENABLE(CSS_GRID_LAYOUT) 1148 void setGridColumns(Length length) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridColumns, length); } 1149 void setGridRows(Length length) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridRows, length); } 1150 #endif 1151 1139 1152 void setMarqueeIncrement(const Length& f) { SET_VAR(rareNonInheritedData.access()->m_marquee, increment, f); } 1140 1153 void setMarqueeSpeed(int f) { SET_VAR(rareNonInheritedData.access()->m_marquee, speed, f); } … … 1510 1523 static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; } 1511 1524 1525 #if ENABLE(CSS_GRID_LAYOUT) 1526 static Length initialGridColumns() { return Length(Undefined); } 1527 static Length initialGridRows() { return Length(Undefined); } 1528 #endif 1529 1512 1530 static const AtomicString& initialLineGrid() { return nullAtom; } 1513 1531 static LineGridSnap initialLineGridSnap() { return LineGridSnapNone; } -
trunk/Source/WebCore/rendering/style/StyleAllInOne.cpp
r96142 r101288 43 43 #include "StyleFlexibleBoxData.cpp" 44 44 #include "StyleGeneratedImage.cpp" 45 #include "StyleGridData.cpp" 45 46 #include "StyleInheritedData.cpp" 46 47 #include "StyleMarqueeData.cpp" -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r101048 r101288 96 96 #if ENABLE(CSS_FILTERS) 97 97 , m_filter(o.m_filter) 98 #endif 99 #if ENABLE(CSS_GRID_LAYOUT) 100 , m_grid(o.m_grid) 98 101 #endif 99 102 , m_content(o.m_content ? o.m_content->clone() : nullptr) … … 161 164 && m_filter == o.m_filter 162 165 #endif 166 #if ENABLE(CSS_GRID_LAYOUT) 167 && m_grid == o.m_grid 168 #endif 163 169 && contentDataEquivalent(o) 164 170 && counterDataEquivalent(o) -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r101048 r101288 47 47 #endif 48 48 class StyleFlexibleBoxData; 49 #if ENABLE(CSS_GRID_LAYOUT) 50 class StyleGridData; 51 #endif 49 52 class StyleMarqueeData; 50 53 class StyleMultiColData; … … 115 118 #endif 116 119 120 #if ENABLE(CSS_GRID_LAYOUT) 121 DataRef<StyleGridData> m_grid; 122 #endif 123 117 124 OwnPtr<ContentData> m_content; 118 125 OwnPtr<CounterDirectiveMap> m_counterDirectives;
Note: See TracChangeset
for help on using the changeset viewer.