According to the spec, http://dev.w3.org/csswg/css-grid/#valuedef-percentage, that's what we have to do. This will fix examples like the following one .grid { width: -webkit-min-content; height: auto; -webkit-grid-definition-columns:50%; -webkit-grid-definition-rows:20%; } <div class="grid"></div> If we ask for getComputedStyle() for the <div> element, we'll get a negative value, because the renderer will try to compute a percentage of an undefined size (which is internally represented as -1).
Created attachment 223446 [details] Patch
Comment on attachment 223446 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=223446&action=review > Source/WebCore/rendering/RenderGrid.cpp:413 > + DEFINE_STATIC_LOCAL(GridTrackSize, autoTrackSize, (Auto)); New code should not use DEFINE_STATIC_LOCAL (I think we should rename it DEPRECATED_DEFINE_STATIC_LOCAL). Instead you should just use static NeverDestroyed. There are lots of examples of that all over the code.
(In reply to comment #2) > (From update of attachment 223446 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=223446&action=review > > > Source/WebCore/rendering/RenderGrid.cpp:413 > > + DEFINE_STATIC_LOCAL(GridTrackSize, autoTrackSize, (Auto)); > > New code should not use DEFINE_STATIC_LOCAL (I think we should rename it DEPRECATED_DEFINE_STATIC_LOCAL). Instead you should just use static NeverDestroyed. There are lots of examples of that all over the code. Filed https://bugs.webkit.org/show_bug.cgi?id=129612
Committed r165048: <http://trac.webkit.org/changeset/165048>