Title: [120984] trunk
Revision
120984
Author
[email protected]
Date
2012-06-21 17:36:07 -0700 (Thu, 21 Jun 2012)

Log Message

Add support for the grid and inline-grid display types.
https://bugs.webkit.org/show_bug.cgi?id=60732

Reviewed by Tony Chang.

Source/WebCore:

Tests: fast/css-grid-layout/containing-block-grids-expected.html
       fast/css-grid-layout/containing-block-grids.html
       fast/css-grid-layout/floating-empty-grids-expected.html
       fast/css-grid-layout/floating-empty-grids.html

Based on an earlier patch by David Hyatt <[email protected]>.

Added the first renderer for grid elements.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
Added RenderGrid files to the build systems.

* rendering/RenderGrid.cpp: Added.
(WebCore::RenderGrid::RenderGrid):
(WebCore::RenderGrid::~RenderGrid):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::renderName):
* rendering/RenderGrid.h: Added.
(RenderGrid):
Skeleton renderer for now.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::createObject):
Return our new RenderGrid for our 2 new |display| values.

* rendering/style/RenderStyle.h:
Added INLINE_GRID to the inline and replaced types.

LayoutTests:

Based on an earlier patch by David Hyatt <[email protected]>.

* fast/css-grid-layout/containing-block-grids-expected.html: Added.
* fast/css-grid-layout/containing-block-grids.html: Added.
* fast/css-grid-layout/floating-empty-grids-expected.html: Added.
* fast/css-grid-layout/floating-empty-grids.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (120983 => 120984)


--- trunk/LayoutTests/ChangeLog	2012-06-21 23:55:56 UTC (rev 120983)
+++ trunk/LayoutTests/ChangeLog	2012-06-22 00:36:07 UTC (rev 120984)
@@ -1,3 +1,17 @@
+2012-06-21  Julien Chaffraix  <[email protected]>
+
+        Add support for the grid and inline-grid display types.
+        https://bugs.webkit.org/show_bug.cgi?id=60732
+
+        Reviewed by Tony Chang.
+
+        Based on an earlier patch by David Hyatt <[email protected]>.
+
+        * fast/css-grid-layout/containing-block-grids-expected.html: Added.
+        * fast/css-grid-layout/containing-block-grids.html: Added.
+        * fast/css-grid-layout/floating-empty-grids-expected.html: Added.
+        * fast/css-grid-layout/floating-empty-grids.html: Added.
+
 2012-06-21  Kenneth Russell  <[email protected]>
 
         [chromium] Layout test failures after fixing GraphicsLayerChromium scale factors

Added: trunk/LayoutTests/fast/css-grid-layout/containing-block-grids-expected.html (0 => 120984)


--- trunk/LayoutTests/fast/css-grid-layout/containing-block-grids-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/containing-block-grids-expected.html	2012-06-22 00:36:07 UTC (rev 120984)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        div { width: 100px; height: 100px; }
+        .relative-positioned-grid { background-color: red; position:relative; }
+        .relative-positioned-inline-grid { display: inline; background-color: red; position: relative; }
+    </style>
+</head>
+<body>
+<p>Grids can act as containing blocks for positioned content.
+<div class="relative-positioned-grid"><div style="background-color: green; left: 0; top: 0"></div>
+<div class="relative-positioned-inline-grid"><div style="background-color:green; left: 0; top: 0"></div>
+</p>

Added: trunk/LayoutTests/fast/css-grid-layout/containing-block-grids.html (0 => 120984)


--- trunk/LayoutTests/fast/css-grid-layout/containing-block-grids.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/containing-block-grids.html	2012-06-22 00:36:07 UTC (rev 120984)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        div { width: 100px; height: 100px; }
+        .relative-positioned-grid { display: -webkit-grid; background-color: red; position:relative; }
+        .relative-positioned-inline-grid { display: -webkit-inline-grid; background-color: red; position: relative; }
+    </style>
+</head>
+<body>
+<p>Grids can act as containing blocks for positioned content.
+<div class="relative-positioned-grid"><div style="background-color: green; left: 0; top: 0"></div>
+<div class="relative-positioned-inline-grid"><div style="background-color:green; left: 0; top: 0"></div>
+</p>

Added: trunk/LayoutTests/fast/css-grid-layout/floating-empty-grids-expected.html (0 => 120984)


--- trunk/LayoutTests/fast/css-grid-layout/floating-empty-grids-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/floating-empty-grids-expected.html	2012-06-22 00:36:07 UTC (rev 120984)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        span { width: 100px; height: 100px;
+        /* A grid is a block by default. */
+        .grid { display: block; background-color: green; }
+        .inline-grid { display: inline; background-color: green; }
+    </style>
+</head>
+<body>
+<p>In this paragraph <span class="grid" style="float:left"></span> there should be <span class="grid" style="float:right"></span>
+two empty grids.  One will float to the left and one will float to the right.  They should both be empty.</p>
+<br clear=all>
+<p>This grid should be positioned to the right. <div class="grid" style="position:absolute;right:8px"></div></p>
+
+<p style="margin-top:115px">
+<span style="float:left;background-color:orange"></span><span class="inline-grid"></span> The green grid
+should be to the right of the floating orange box.
+</p>

Added: trunk/LayoutTests/fast/css-grid-layout/floating-empty-grids.html (0 => 120984)


--- trunk/LayoutTests/fast/css-grid-layout/floating-empty-grids.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/floating-empty-grids.html	2012-06-22 00:36:07 UTC (rev 120984)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        span { width: 100px; height: 100px;
+        .grid { display: -webkit-grid; background-color: green; }
+        .inline-grid { display: -webkit-inline-grid; background-color: green; }
+    </style>
+</head>
+<body>
+<p>In this paragraph <span class="grid" style="float:left"></span> there should be <span class="grid" style="float:right"></span>
+two empty grids.  One will float to the left and one will float to the right.  They should both be empty.</p>
+<br clear=all>
+<p>This grid should be positioned to the right. <div class="grid" style="position:absolute;right:8px"></div></p>
+
+<p style="margin-top:115px">
+<span style="float:left;background-color:orange"></span><span class="inline-grid"></span> The green grid
+should be to the right of the floating orange box.
+</p>

Modified: trunk/Source/WebCore/CMakeLists.txt (120983 => 120984)


--- trunk/Source/WebCore/CMakeLists.txt	2012-06-21 23:55:56 UTC (rev 120983)
+++ trunk/Source/WebCore/CMakeLists.txt	2012-06-22 00:36:07 UTC (rev 120984)
@@ -1353,6 +1353,7 @@
     rendering/RenderFieldset.cpp
     rendering/RenderFileUploadControl.cpp
     rendering/RenderFlexibleBox.cpp
+    rendering/RenderGrid.cpp
     rendering/RenderFlowThread.cpp
     rendering/RenderFrame.cpp
     rendering/RenderFrameBase.cpp

Modified: trunk/Source/WebCore/ChangeLog (120983 => 120984)


--- trunk/Source/WebCore/ChangeLog	2012-06-21 23:55:56 UTC (rev 120983)
+++ trunk/Source/WebCore/ChangeLog	2012-06-22 00:36:07 UTC (rev 120984)
@@ -1,3 +1,43 @@
+2012-06-21  Julien Chaffraix  <[email protected]>
+
+        Add support for the grid and inline-grid display types.
+        https://bugs.webkit.org/show_bug.cgi?id=60732
+
+        Reviewed by Tony Chang.
+
+        Tests: fast/css-grid-layout/containing-block-grids-expected.html
+               fast/css-grid-layout/containing-block-grids.html
+               fast/css-grid-layout/floating-empty-grids-expected.html
+               fast/css-grid-layout/floating-empty-grids.html
+
+        Based on an earlier patch by David Hyatt <[email protected]>.
+
+        Added the first renderer for grid elements.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        Added RenderGrid files to the build systems.
+
+        * rendering/RenderGrid.cpp: Added.
+        (WebCore::RenderGrid::RenderGrid):
+        (WebCore::RenderGrid::~RenderGrid):
+        (WebCore::RenderGrid::layoutBlock):
+        (WebCore::RenderGrid::renderName):
+        * rendering/RenderGrid.h: Added.
+        (RenderGrid):
+        Skeleton renderer for now.
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::createObject):
+        Return our new RenderGrid for our 2 new |display| values.
+
+        * rendering/style/RenderStyle.h:
+        Added INLINE_GRID to the inline and replaced types.
+
 2012-06-21  Ryosuke Niwa  <[email protected]>
 
         Clang build fix.

Modified: trunk/Source/WebCore/GNUmakefile.list.am (120983 => 120984)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-06-21 23:55:56 UTC (rev 120983)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-06-22 00:36:07 UTC (rev 120984)
@@ -3842,6 +3842,8 @@
 	Source/WebCore/rendering/RenderFrameSet.h \
 	Source/WebCore/rendering/RenderFullScreen.cpp \
 	Source/WebCore/rendering/RenderFullScreen.h \
+	Source/WebCore/rendering/RenderGrid.cpp \
+	Source/WebCore/rendering/RenderGrid.h \
 	Source/WebCore/rendering/RenderGeometryMap.cpp \
 	Source/WebCore/rendering/RenderGeometryMap.h \
 	Source/WebCore/rendering/RenderHTMLCanvas.cpp \

Modified: trunk/Source/WebCore/Target.pri (120983 => 120984)


--- trunk/Source/WebCore/Target.pri	2012-06-21 23:55:56 UTC (rev 120983)
+++ trunk/Source/WebCore/Target.pri	2012-06-22 00:36:07 UTC (rev 120984)
@@ -1275,6 +1275,7 @@
     rendering/RenderFrameBase.cpp \
     rendering/RenderFrameSet.cpp \
     rendering/RenderGeometryMap.cpp \
+    rendering/RenderGrid.cpp \
     rendering/RenderHTMLCanvas.cpp \
     rendering/RenderIFrame.cpp \
     rendering/RenderImage.cpp \
@@ -2490,6 +2491,7 @@
     rendering/RenderFrameBase.h \
     rendering/RenderFrameSet.h \
     rendering/RenderGeometryMap.h \
+    rendering/RenderGrid.h \
     rendering/RenderHTMLCanvas.h \
     rendering/RenderIFrame.h \
     rendering/RenderImageResource.h \

Modified: trunk/Source/WebCore/WebCore.gypi (120983 => 120984)


--- trunk/Source/WebCore/WebCore.gypi	2012-06-21 23:55:56 UTC (rev 120983)
+++ trunk/Source/WebCore/WebCore.gypi	2012-06-22 00:36:07 UTC (rev 120984)
@@ -4844,6 +4844,8 @@
             'rendering/RenderFrameSet.h',
             'rendering/RenderFullScreen.cpp',
             'rendering/RenderFullScreen.h',
+            'rendering/RenderGrid.cpp',
+            'rendering/RenderGrid.h',
             'rendering/RenderGeometryMap.cpp',
             'rendering/RenderGeometryMap.h',
             'rendering/RenderHTMLCanvas.cpp',

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (120983 => 120984)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-06-21 23:55:56 UTC (rev 120983)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-06-22 00:36:07 UTC (rev 120984)
@@ -39554,7 +39554,15 @@
 				RelativePath="..\rendering\RenderGeometryMap.h"
 				>
 			</File>
+                        <File
+				RelativePath="..\rendering\RenderGrid.cpp"
+				>
+			</File>
 			<File
+				RelativePath="..\rendering\RenderGrid.h"
+				>
+			</File>
+			<File
 				RelativePath="..\rendering\RenderHTMLCanvas.cpp"
 				>
 				<FileConfiguration

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (120983 => 120984)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-06-21 23:55:56 UTC (rev 120983)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-06-22 00:36:07 UTC (rev 120984)
@@ -5229,6 +5229,8 @@
 		BC124EE80C2641CD009E2349 /* BarInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BC124EE50C2641CD009E2349 /* BarInfo.h */; };
 		BC124EFF0C26447A009E2349 /* JSBarInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC124EFD0C26447A009E2349 /* JSBarInfo.cpp */; };
 		BC124F000C26447A009E2349 /* JSBarInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BC124EFE0C26447A009E2349 /* JSBarInfo.h */; };
+		BC128A73137C867C00CAC845 /* RenderGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = BC128A72137C867C00CAC845 /* RenderGrid.h */; };
+		BC128B01137C8D4600CAC845 /* RenderGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC128B00137C8D4600CAC845 /* RenderGrid.cpp */; };
 		BC14028A0E83680800319717 /* ScrollbarThemeComposite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */; };
 		BC14028B0E83680800319717 /* ScrollbarThemeComposite.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1402890E83680800319717 /* ScrollbarThemeComposite.h */; };
 		BC17F9660B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */; };
@@ -12398,6 +12400,8 @@
 		BC124EE60C2641CD009E2349 /* BarInfo.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = BarInfo.idl; sourceTree = "<group>"; };
 		BC124EFD0C26447A009E2349 /* JSBarInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSBarInfo.cpp; sourceTree = "<group>"; };
 		BC124EFE0C26447A009E2349 /* JSBarInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSBarInfo.h; sourceTree = "<group>"; };
+		BC128A72137C867C00CAC845 /* RenderGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderGrid.h; sourceTree = "<group>"; };
+		BC128B00137C8D4600CAC845 /* RenderGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderGrid.cpp; sourceTree = "<group>"; };
 		BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollbarThemeComposite.cpp; sourceTree = "<group>"; };
 		BC1402890E83680800319717 /* ScrollbarThemeComposite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeComposite.h; sourceTree = "<group>"; };
 		BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSelectElementCustom.cpp; sourceTree = "<group>"; };
@@ -21083,6 +21087,8 @@
 				A871DEC90A1530C700B12A68 /* RenderFrameSet.h */,
 				CDEA7C831276230400B846DD /* RenderFullScreen.cpp */,
 				CDEA7C821276230400B846DD /* RenderFullScreen.h */,
+				BC128B00137C8D4600CAC845 /* RenderGrid.cpp */,
+				BC128A72137C867C00CAC845 /* RenderGrid.h */,
 				0F3F0E57157030C3006DA57F /* RenderGeometryMap.cpp */,
 				0F3F0E58157030C3006DA57F /* RenderGeometryMap.h */,
 				BCEA482A097D93020094C9E4 /* RenderHTMLCanvas.cpp */,
@@ -24233,6 +24239,7 @@
 				7E33CD01127F340D00BE8F17 /* PurgePriority.h in Headers */,
 				550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */,
 				379E371713736A6600B9E919 /* QuotedPrintable.h in Headers */,
+				BC128A73137C867C00CAC845 /* RenderGrid.h in Headers */,
 				5A574F29131DB96D00471B88 /* QuotesData.h in Headers */,
 				B22279720D00BF220071B782 /* RadialGradientAttributes.h in Headers */,
 				F55B3DCC1251F12D003EF269 /* RadioInputType.h in Headers */,
@@ -27444,6 +27451,7 @@
 				E4D687770ED7AE3D006EA978 /* PurgeableBufferMac.cpp in Sources */,
 				550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */,
 				379E371613736A6600B9E919 /* QuotedPrintable.cpp in Sources */,
+				BC128B01137C8D4600CAC845 /* RenderGrid.cpp in Sources */,
 				5A574F28131DB96D00471B88 /* QuotesData.cpp in Sources */,
 				F55B3DCB1251F12D003EF269 /* RadioInputType.cpp in Sources */,
 				B658FFA51522EFAA00DD5595 /* RadioNodeList.cpp in Sources */,

Added: trunk/Source/WebCore/rendering/RenderGrid.cpp (0 => 120984)


--- trunk/Source/WebCore/rendering/RenderGrid.cpp	                        (rev 0)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2012-06-22 00:36:07 UTC (rev 120984)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2011 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE COMPUTER, INC. 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 "RenderGrid.h"
+
+namespace WebCore {
+
+RenderGrid::RenderGrid(Node* node)
+    : RenderBlock(node)
+{
+    // All of our children must be block level.
+    setChildrenInline(false);
+}
+
+RenderGrid::~RenderGrid()
+{
+}
+
+void RenderGrid::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight)
+{
+    // For now just call the base class.
+    RenderBlock::layoutBlock(relayoutChildren, pageLogicalHeight);
+}
+
+const char* RenderGrid::renderName() const
+{
+    if (isFloating())
+        return "RenderGrid (floating)";
+    if (isPositioned())
+        return "RenderGrid (positioned)";
+    if (isAnonymous())
+        return "RenderGrid (generated)";
+    if (isRelPositioned())
+        return "RenderGrid (relative positioned)";
+    return "RenderGrid";
+}
+
+} // namespace WebCore

Added: trunk/Source/WebCore/rendering/RenderGrid.h (0 => 120984)


--- trunk/Source/WebCore/rendering/RenderGrid.h	                        (rev 0)
+++ trunk/Source/WebCore/rendering/RenderGrid.h	2012-06-22 00:36:07 UTC (rev 120984)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011 Apple 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:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE COMPUTER, INC. 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 RenderGrid_h
+#define RenderGrid_h
+
+#include "RenderBlock.h"
+
+namespace WebCore {
+
+class RenderGrid : public RenderBlock {
+public:
+    RenderGrid(Node*);
+    virtual ~RenderGrid();
+
+    virtual const char* renderName() const OVERRIDE;
+
+    virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) OVERRIDE;
+
+    virtual bool avoidsFloats() const OVERRIDE { return true; }
+};
+
+} // namespace WebCore
+
+#endif // RenderGrid_h

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (120983 => 120984)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2012-06-21 23:55:56 UTC (rev 120983)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2012-06-22 00:36:07 UTC (rev 120984)
@@ -47,6 +47,7 @@
 #include "RenderDeprecatedFlexibleBox.h"
 #include "RenderFlexibleBox.h"
 #include "RenderGeometryMap.h"
+#include "RenderGrid.h"
 #include "RenderImage.h"
 #include "RenderImageResourceStyleImage.h"
 #include "RenderInline.h"
@@ -151,9 +152,6 @@
         return new (arena) RenderRubyText(node);
 
     switch (style->display()) {
-    // For now, we don't show grid elements.
-    case GRID:
-    case INLINE_GRID:
     case NONE:
         return 0;
     case INLINE:
@@ -194,6 +192,9 @@
     case INLINE_FLEX:
         return new (arena) RenderFlexibleBox(node);
 #endif
+    case GRID:
+    case INLINE_GRID:
+        return new (arena) RenderGrid(node);
     }
 
     return 0;

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (120983 => 120984)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-06-21 23:55:56 UTC (rev 120983)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-06-22 00:36:07 UTC (rev 120984)
@@ -1490,7 +1490,7 @@
 
     bool isDisplayReplacedType() const
     {
-        return display() == INLINE_BLOCK || display() == INLINE_BOX || display() == INLINE_TABLE;
+        return display() == INLINE_BLOCK || display() == INLINE_BOX || display() == INLINE_TABLE || display() == INLINE_GRID;
     }
 
     bool isDisplayInlineType() const
@@ -1501,7 +1501,7 @@
     bool isOriginalDisplayInlineType() const
     {
         return originalDisplay() == INLINE || originalDisplay() == INLINE_BLOCK
-            || originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE;
+            || originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE || originalDisplay() == INLINE_GRID;
     }
 
     void setWritingMode(WritingMode v) { inherited_flags.m_writingMode = v; }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to