<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[200215] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/200215">200215</a></dd>
<dt>Author</dt> <dd>rego@igalia.com</dd>
<dt>Date</dt> <dd>2016-04-28 16:13:59 -0700 (Thu, 28 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css-grid] Add CSS Grid Layout runtime flag
https://bugs.webkit.org/show_bug.cgi?id=157134

Reviewed by Simon Fraser.

Source/WebCore:

Add CSS Grid Layout runtime flag enabled by default.
Disable parsing of CSS Grid Layout properties
if the runtime flag is not enabled.
Expose runtime flag through internals to verify that
it's working as expected.

Test: fast/css-grid-layout/grid-disable.html

* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSGridLayoutEnabled):
(WebCore::RuntimeEnabledFeatures::isCSSGridLayoutEnabled):
* css/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition):
(WebCore::CSSParser::parseGridPosition):
(WebCore::CSSParser::parseGridItemPositionShorthand):
(WebCore::CSSParser::parseGridGapShorthand):
(WebCore::CSSParser::parseGridTemplateColumns):
(WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
(WebCore::CSSParser::parseGridTemplateShorthand):
(WebCore::CSSParser::parseGridShorthand):
(WebCore::CSSParser::parseGridAreaShorthand):
(WebCore::CSSParser::parseSingleGridAreaLonghand):
(WebCore::CSSParser::parseGridLineNames):
(WebCore::CSSParser::parseGridTrackList):
(WebCore::CSSParser::parseGridTrackRepeatFunction):
(WebCore::CSSParser::parseGridTrackSize):
(WebCore::CSSParser::parseGridBreadth):
(WebCore::CSSParser::parseGridAutoFlow):
(WebCore::CSSParser::parseGridTemplateAreasRow):
(WebCore::CSSParser::parseGridTemplateAreas):
(WebCore::CSSParser::iscSSGridLayoutEnabled):
* css/CSSParser.h:
* css/CSSParserMode.h:
* dom/Document.cpp:
(WebCore::Document::isCSSGridLayoutEnabled):
* dom/Document.h:
* testing/Internals.cpp:
(WebCore::Internals::setCSSGridLayoutEnabled):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit/mac:

Add CSS Grid Layout runtime flag based on preferences,
enabled by default.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences isCSSGridLayoutEnabled]):
(-[WebPreferences setCSSGridLayoutEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Add CSS Grid Layout runtime flag based on preferences,
enabled by default.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetCSSGridLayoutEnabled):
(WKPreferencesGetCSSGridLayoutEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests:

Add test to verify that CSS Grid Layout is disabled if the flag is off.

* fast/css-grid-layout/grid-disable-expected.txt: Added.
* fast/css-grid-layout/grid-disable.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturescpp">trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturesh">trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserh">trunk/Source/WebCore/css/CSSParser.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserModeh">trunk/Source/WebCore/css/CSSParserMode.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferenceKeysPrivateh">trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferencesmm">trunk/Source/WebKit/mac/WebView/WebPreferences.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebPreferencesPrivateh">trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPreferencesDefinitionsh">trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencescpp">trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh">trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgriddisableexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-disable-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgriddisablehtml">trunk/LayoutTests/fast/css-grid-layout/grid-disable.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/LayoutTests/ChangeLog        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-04-28  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Add CSS Grid Layout runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=157134
+
+        Reviewed by Simon Fraser.
+
+        Add test to verify that CSS Grid Layout is disabled if the flag is off.
+
+        * fast/css-grid-layout/grid-disable-expected.txt: Added.
+        * fast/css-grid-layout/grid-disable.html: Added.
+
</ins><span class="cx"> 2016-04-28  Chris Fleizach  &lt;cfleizach@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: superscript content exposed as plain text; VoiceOver does not speak or pause to make this understandable     
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgriddisableexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-disable-expected.txt (0 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-disable-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-disable-expected.txt        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Verifies that CSS Grid Layout does not work if runtime feature is disabled.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS document.getElementById('grid').style.display is ''
+PASS document.getElementById('inlinegrid').style.display is ''
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgriddisablehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-disable.html (0 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-disable.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-disable.html        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;script&gt;
+if (window.internals)
+    window.internals.setCSSGridLayoutEnabled(false);
+&lt;/script&gt;
+
+&lt;div id=&quot;grid&quot; style=&quot;display: -webkit-grid&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;inlinegrid&quot; style=&quot;display: -webkit-inline-grid&quot;&gt;&lt;/div&gt;
+
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+description(&quot;Verifies that CSS Grid Layout does not work if runtime feature is disabled.&quot;);
+
+shouldBe(&quot;document.getElementById('grid').style.display&quot;, &quot;''&quot;);
+shouldBe(&quot;document.getElementById('inlinegrid').style.display&quot;, &quot;''&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebCore/ChangeLog        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2016-04-28  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Add CSS Grid Layout runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=157134
+
+        Reviewed by Simon Fraser.
+
+        Add CSS Grid Layout runtime flag enabled by default.
+        Disable parsing of CSS Grid Layout properties
+        if the runtime flag is not enabled.
+        Expose runtime flag through internals to verify that
+        it's working as expected.
+
+        Test: fast/css-grid-layout/grid-disable.html
+
+        * bindings/generic/RuntimeEnabledFeatures.cpp:
+        (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setCSSGridLayoutEnabled):
+        (WebCore::RuntimeEnabledFeatures::isCSSGridLayoutEnabled):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParserContext::CSSParserContext):
+        (WebCore::operator==):
+        (WebCore::isValidKeywordPropertyAndValue):
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseIntegerOrCustomIdentFromGridPosition):
+        (WebCore::CSSParser::parseGridPosition):
+        (WebCore::CSSParser::parseGridItemPositionShorthand):
+        (WebCore::CSSParser::parseGridGapShorthand):
+        (WebCore::CSSParser::parseGridTemplateColumns):
+        (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
+        (WebCore::CSSParser::parseGridTemplateShorthand):
+        (WebCore::CSSParser::parseGridShorthand):
+        (WebCore::CSSParser::parseGridAreaShorthand):
+        (WebCore::CSSParser::parseSingleGridAreaLonghand):
+        (WebCore::CSSParser::parseGridLineNames):
+        (WebCore::CSSParser::parseGridTrackList):
+        (WebCore::CSSParser::parseGridTrackRepeatFunction):
+        (WebCore::CSSParser::parseGridTrackSize):
+        (WebCore::CSSParser::parseGridBreadth):
+        (WebCore::CSSParser::parseGridAutoFlow):
+        (WebCore::CSSParser::parseGridTemplateAreasRow):
+        (WebCore::CSSParser::parseGridTemplateAreas):
+        (WebCore::CSSParser::iscSSGridLayoutEnabled):
+        * css/CSSParser.h:
+        * css/CSSParserMode.h:
+        * dom/Document.cpp:
+        (WebCore::Document::isCSSGridLayoutEnabled):
+        * dom/Document.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::setCSSGridLayoutEnabled):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2016-04-28  Chris Fleizach  &lt;cfleizach@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: superscript content exposed as plain text; VoiceOver does not speak or pause to make this understandable
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -113,6 +113,9 @@
</span><span class="cx"> #if ENABLE(WEB_ANIMATIONS)
</span><span class="cx">     , m_areWebAnimationsEnabled(false)
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    , m_cssGridLayoutEnabled(true)
+#endif
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -241,6 +241,11 @@
</span><span class="cx">     bool downloadAttributeEnabled() const { return m_isDownloadAttributeEnabled; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    void setCSSGridLayoutEnabled(bool isEnabled) { m_cssGridLayoutEnabled = isEnabled; }
+    bool isCSSGridLayoutEnabled() const { return m_cssGridLayoutEnabled; }
+#endif
+
</ins><span class="cx">     WEBCORE_EXPORT static RuntimeEnabledFeatures&amp; sharedFeatures();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -354,6 +359,10 @@
</span><span class="cx">     bool m_isDownloadAttributeEnabled { false };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    bool m_cssGridLayoutEnabled;
+#endif
+
</ins><span class="cx">     friend class WTF::NeverDestroyed&lt;RuntimeEnabledFeatures&gt;;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -248,6 +248,9 @@
</span><span class="cx">     , isHTMLDocument(false)
</span><span class="cx">     , isCSSRegionsEnabled(RuntimeEnabledFeatures::sharedFeatures().cssRegionsEnabled())
</span><span class="cx">     , isCSSCompositingEnabled(RuntimeEnabledFeatures::sharedFeatures().cssCompositingEnabled())
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    , cssGridLayoutEnabled(RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled())
+#endif
</ins><span class="cx">     , needsSiteSpecificQuirks(false)
</span><span class="cx">     , enforcesCSSMIMETypeInNoQuirksMode(true)
</span><span class="cx">     , useLegacyBackgroundSizeShorthandBehavior(false)
</span><span class="lines">@@ -267,6 +270,9 @@
</span><span class="cx">     , isHTMLDocument(document.isHTMLDocument())
</span><span class="cx">     , isCSSRegionsEnabled(document.cssRegionsEnabled())
</span><span class="cx">     , isCSSCompositingEnabled(document.cssCompositingEnabled())
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    , cssGridLayoutEnabled(document.isCSSGridLayoutEnabled())
+#endif
</ins><span class="cx">     , needsSiteSpecificQuirks(document.settings() ? document.settings()-&gt;needsSiteSpecificQuirks() : false)
</span><span class="cx">     , enforcesCSSMIMETypeInNoQuirksMode(!document.settings() || document.settings()-&gt;enforceCSSMIMETypeInNoQuirksMode())
</span><span class="cx">     , useLegacyBackgroundSizeShorthandBehavior(document.settings() ? document.settings()-&gt;useLegacyBackgroundSizeShorthandBehavior() : false)
</span><span class="lines">@@ -287,6 +293,9 @@
</span><span class="cx">         &amp;&amp; a.isHTMLDocument == b.isHTMLDocument
</span><span class="cx">         &amp;&amp; a.isCSSRegionsEnabled == b.isCSSRegionsEnabled
</span><span class="cx">         &amp;&amp; a.isCSSCompositingEnabled == b.isCSSCompositingEnabled
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+        &amp;&amp; a.cssGridLayoutEnabled == b.cssGridLayoutEnabled
+#endif
</ins><span class="cx">         &amp;&amp; a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks
</span><span class="cx">         &amp;&amp; a.enforcesCSSMIMETypeInNoQuirksMode == b.enforcesCSSMIMETypeInNoQuirksMode
</span><span class="cx">         &amp;&amp; a.useLegacyBackgroundSizeShorthandBehavior == b.useLegacyBackgroundSizeShorthandBehavior;
</span><span class="lines">@@ -674,7 +683,7 @@
</span><span class="cx">         if ((valueID &gt;= CSSValueInline &amp;&amp; valueID &lt;= CSSValueContents) || valueID == CSSValueNone)
</span><span class="cx">             return true;
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><del>-        if (valueID == CSSValueWebkitGrid || valueID == CSSValueWebkitInlineGrid)
</del><ins>+        if (parserContext.cssGridLayoutEnabled &amp;&amp; (valueID == CSSValueWebkitGrid || valueID == CSSValueWebkitInlineGrid))
</ins><span class="cx">             return true;
</span><span class="cx"> #endif
</span><span class="cx">         break;
</span><span class="lines">@@ -2789,11 +2798,15 @@
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">     case CSSPropertyWebkitGridAutoColumns:
</span><span class="cx">     case CSSPropertyWebkitGridAutoRows:
</span><ins>+        if (!isCSSGridLayoutEnabled())
+            return false;
</ins><span class="cx">         parsedValue = parseGridTrackSize(*m_valueList);
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case CSSPropertyWebkitGridTemplateColumns:
</span><span class="cx">     case CSSPropertyWebkitGridTemplateRows:
</span><ins>+        if (!isCSSGridLayoutEnabled())
+            return false;
</ins><span class="cx">         parsedValue = parseGridTrackList();
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="lines">@@ -2801,35 +2814,52 @@
</span><span class="cx">     case CSSPropertyWebkitGridColumnEnd:
</span><span class="cx">     case CSSPropertyWebkitGridRowStart:
</span><span class="cx">     case CSSPropertyWebkitGridRowEnd:
</span><ins>+        if (!isCSSGridLayoutEnabled())
+            return false;
</ins><span class="cx">         parsedValue = parseGridPosition();
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case CSSPropertyWebkitGridColumnGap:
</span><span class="cx">     case CSSPropertyWebkitGridRowGap:
</span><ins>+        if (!isCSSGridLayoutEnabled())
+            return false;
</ins><span class="cx">         validPrimitive = validateUnit(valueWithCalculation, FLength | FNonNeg);
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case CSSPropertyWebkitGridGap:
</span><ins>+        if (!isCSSGridLayoutEnabled())
+            return false;
</ins><span class="cx">         return parseGridGapShorthand(important);
</span><span class="cx"> 
</span><span class="cx">     case CSSPropertyWebkitGridColumn:
</span><del>-    case CSSPropertyWebkitGridRow: {
</del><ins>+    case CSSPropertyWebkitGridRow:
+        if (!isCSSGridLayoutEnabled())
+            return false;
</ins><span class="cx">         return parseGridItemPositionShorthand(propId, important);
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     case CSSPropertyWebkitGridTemplate:
</span><ins>+        if (!isCSSGridLayoutEnabled())
+            return false;
</ins><span class="cx">         return parseGridTemplateShorthand(important);
</span><span class="cx"> 
</span><span class="cx">     case CSSPropertyWebkitGrid:
</span><ins>+        if (!isCSSGridLayoutEnabled())
+            return false;
</ins><span class="cx">         return parseGridShorthand(important);
</span><span class="cx"> 
</span><span class="cx">     case CSSPropertyWebkitGridArea:
</span><ins>+        if (!isCSSGridLayoutEnabled())
+            return false;
</ins><span class="cx">         return parseGridAreaShorthand(important);
</span><span class="cx"> 
</span><span class="cx">     case CSSPropertyWebkitGridTemplateAreas:
</span><ins>+        if (!isCSSGridLayoutEnabled())
+            return false;
</ins><span class="cx">         parsedValue = parseGridTemplateAreas();
</span><span class="cx">         break;
</span><span class="cx">     case CSSPropertyWebkitGridAutoFlow:
</span><ins>+        if (!isCSSGridLayoutEnabled())
+            return false;
</ins><span class="cx">         parsedValue = parseGridAutoFlow(*m_valueList);
</span><span class="cx">         break;
</span><span class="cx"> #endif /* ENABLE(CSS_GRID_LAYOUT) */
</span><span class="lines">@@ -5422,6 +5452,8 @@
</span><span class="cx"> // The function parses [ &lt;integer&gt; || &lt;custom-ident&gt; ] in &lt;grid-line&gt; (which can be stand alone or with 'span').
</span><span class="cx"> bool CSSParser::parseIntegerOrCustomIdentFromGridPosition(RefPtr&lt;CSSPrimitiveValue&gt;&amp; numericValue, RefPtr&lt;CSSPrimitiveValue&gt;&amp; gridLineName)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     ValueWithCalculation valueWithCalculation(*m_valueList-&gt;current());
</span><span class="cx">     if (validateUnit(valueWithCalculation, FInteger) &amp;&amp; valueWithCalculation.value().fValue) {
</span><span class="cx">         numericValue = createPrimitiveNumericValue(valueWithCalculation);
</span><span class="lines">@@ -5450,6 +5482,8 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSParser::parseGridPosition()
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     CSSParserValue* value = m_valueList-&gt;current();
</span><span class="cx">     if (value-&gt;id == CSSValueAuto) {
</span><span class="cx">         m_valueList-&gt;next();
</span><span class="lines">@@ -5512,6 +5546,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseGridItemPositionShorthand(CSSPropertyID shorthandId, bool important)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     ShorthandScope scope(this, shorthandId);
</span><span class="cx">     const StylePropertyShorthand&amp; shorthand = shorthandForProperty(shorthandId);
</span><span class="cx">     ASSERT(shorthand.length() == 2);
</span><span class="lines">@@ -5541,6 +5577,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseGridGapShorthand(bool important)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     ShorthandScope scope(this, CSSPropertyWebkitGridGap);
</span><span class="cx">     ASSERT(shorthandForProperty(CSSPropertyWebkitGridGap).length() == 2);
</span><span class="cx"> 
</span><span class="lines">@@ -5578,6 +5616,8 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSParser::parseGridTemplateColumns()
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     if (!(m_valueList-&gt;current() &amp;&amp; isForwardSlashOperator(*m_valueList-&gt;current()) &amp;&amp; m_valueList-&gt;next()))
</span><span class="cx">         return nullptr;
</span><span class="cx">     if (auto columnsValue = parseGridTrackList()) {
</span><span class="lines">@@ -5591,6 +5631,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseGridTemplateRowsAndAreasAndColumns(bool important)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     // At least template-areas strings must be defined.
</span><span class="cx">     if (!m_valueList-&gt;current() || isForwardSlashOperator(*m_valueList-&gt;current()))
</span><span class="cx">         return false;
</span><span class="lines">@@ -5654,6 +5696,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseGridTemplateShorthand(bool important)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     ShorthandScope scope(this, CSSPropertyWebkitGridTemplate);
</span><span class="cx">     ASSERT(shorthandForProperty(CSSPropertyWebkitGridTemplate).length() == 3);
</span><span class="cx"> 
</span><span class="lines">@@ -5698,6 +5742,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseGridShorthand(bool important)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     ShorthandScope scope(this, CSSPropertyWebkitGrid);
</span><span class="cx">     ASSERT(shorthandForProperty(CSSPropertyWebkitGrid).length() == 8);
</span><span class="cx"> 
</span><span class="lines">@@ -5762,6 +5808,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseGridAreaShorthand(bool important)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     ShorthandScope scope(this, CSSPropertyWebkitGridArea);
</span><span class="cx">     ASSERT(shorthandForProperty(CSSPropertyWebkitGridArea).length() == 4);
</span><span class="cx"> 
</span><span class="lines">@@ -5799,6 +5847,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseSingleGridAreaLonghand(RefPtr&lt;CSSValue&gt;&amp; property)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     if (!m_valueList-&gt;current())
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="lines">@@ -5814,6 +5864,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseGridLineNames(CSSParserValueList&amp; inputList, CSSValueList&amp; valueList, CSSGridLineNamesValue* previousNamedAreaTrailingLineNames)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
</ins><span class="cx">     ASSERT(inputList.current() &amp;&amp; inputList.current()-&gt;unit == CSSParserValue::ValueList);
</span><span class="cx"> 
</span><span class="cx">     CSSParserValueList&amp; identList = *inputList.current()-&gt;valueList;
</span><span class="lines">@@ -5865,6 +5916,8 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSParser::parseGridTrackList()
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     CSSParserValue* value = m_valueList-&gt;current();
</span><span class="cx">     if (value-&gt;id == CSSValueNone) {
</span><span class="cx">         m_valueList-&gt;next();
</span><span class="lines">@@ -5916,6 +5969,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseGridTrackRepeatFunction(CSSValueList&amp; list, bool&amp; isAutoRepeat)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     CSSParserValueList* arguments = m_valueList-&gt;current()-&gt;function-&gt;args.get();
</span><span class="cx">     if (!arguments || arguments-&gt;size() &lt; 3 || !isComma(arguments-&gt;valueAt(1)))
</span><span class="cx">         return false;
</span><span class="lines">@@ -5979,6 +6034,8 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSParser::parseGridTrackSize(CSSParserValueList&amp; inputList, TrackSizeRestriction restriction)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     CSSParserValue&amp; currentValue = *inputList.current();
</span><span class="cx">     inputList.next();
</span><span class="cx"> 
</span><span class="lines">@@ -6010,6 +6067,8 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSPrimitiveValue&gt; CSSParser::parseGridBreadth(CSSParserValue&amp; value, TrackSizeRestriction restriction)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     if (value.id == CSSValueWebkitMinContent || value.id == CSSValueWebkitMaxContent || value.id == CSSValueAuto) {
</span><span class="cx">         if (restriction == FixedSizeOnly)
</span><span class="cx">             return nullptr;
</span><span class="lines">@@ -6043,6 +6102,8 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSParser::parseGridAutoFlow(CSSParserValueList&amp; inputList)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     // [ row | column ] || dense
</span><span class="cx">     CSSParserValue* value = inputList.current();
</span><span class="cx">     if (!value)
</span><span class="lines">@@ -6263,6 +6324,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseGridTemplateAreasRow(NamedGridAreaMap&amp; gridAreaMap, const unsigned rowCount, unsigned&amp; columnCount)
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     CSSParserValue* currentValue = m_valueList-&gt;current();
</span><span class="cx">     if (!currentValue || currentValue-&gt;unit != CSSPrimitiveValue::CSS_STRING)
</span><span class="cx">         return false;
</span><span class="lines">@@ -6324,6 +6387,8 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSParser::parseGridTemplateAreas()
</span><span class="cx"> {
</span><ins>+    ASSERT(isCSSGridLayoutEnabled());
+
</ins><span class="cx">     if (m_valueList-&gt;current() &amp;&amp; m_valueList-&gt;current()-&gt;id == CSSValueNone) {
</span><span class="cx">         m_valueList-&gt;next();
</span><span class="cx">         return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
</span><span class="lines">@@ -10212,6 +10277,13 @@
</span><span class="cx">     return m_context.isCSSCompositingEnabled;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+bool CSSParser::isCSSGridLayoutEnabled() const
+{
+    return m_context.cssGridLayoutEnabled;
+}
+#endif
+
</ins><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx"> 
</span><span class="cx"> // none | &lt;ident&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebCore/css/CSSParser.h        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -208,6 +208,7 @@
</span><span class="cx">     bool parseColumnsShorthand(bool important);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><ins>+    bool isCSSGridLayoutEnabled() const;
</ins><span class="cx">     RefPtr&lt;CSSValue&gt; parseGridPosition();
</span><span class="cx">     bool parseGridItemPositionShorthand(CSSPropertyID, bool important);
</span><span class="cx">     RefPtr&lt;CSSValue&gt; parseGridTemplateColumns();
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserModeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserMode.h (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserMode.h        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebCore/css/CSSParserMode.h        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -66,6 +66,9 @@
</span><span class="cx">     bool isHTMLDocument;
</span><span class="cx">     bool isCSSRegionsEnabled;
</span><span class="cx">     bool isCSSCompositingEnabled;
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    bool cssGridLayoutEnabled;
+#endif
</ins><span class="cx">     bool needsSiteSpecificQuirks;
</span><span class="cx">     bool enforcesCSSMIMETypeInNoQuirksMode;
</span><span class="cx">     bool useLegacyBackgroundSizeShorthandBehavior;
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -1138,6 +1138,13 @@
</span><span class="cx">     return RuntimeEnabledFeatures::sharedFeatures().cssCompositingEnabled();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+bool Document::isCSSGridLayoutEnabled() const
+{
+    return RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled();
+}
+#endif
+
</ins><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;DOMNamedFlowCollection&gt; Document::webkitGetNamedFlows()
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebCore/dom/Document.h        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -394,6 +394,9 @@
</span><span class="cx"> 
</span><span class="cx">     bool cssRegionsEnabled() const;
</span><span class="cx">     bool cssCompositingEnabled() const;
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    bool isCSSGridLayoutEnabled() const;
+#endif
</ins><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx">     RefPtr&lt;DOMNamedFlowCollection&gt; webkitGetNamedFlows();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -3318,4 +3318,11 @@
</span><span class="cx">     RuntimeEnabledFeatures::sharedFeatures().setLinkPreloadEnabled(enable);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+void Internals::setCSSGridLayoutEnabled(bool enable)
+{
+    RuntimeEnabledFeatures::sharedFeatures().setCSSGridLayoutEnabled(enable);
</ins><span class="cx"> }
</span><ins>+#endif
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebCore/testing/Internals.h        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -469,6 +469,10 @@
</span><span class="cx">     void setViewportForceAlwaysUserScalable(bool);
</span><span class="cx">     void setLinkPreloadSupport(bool);
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    void setCSSGridLayoutEnabled(bool);
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit Internals(Document&amp;);
</span><span class="cx">     Document* contextDocument() const;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -446,4 +446,9 @@
</span><span class="cx"> 
</span><span class="cx">     void setViewportForceAlwaysUserScalable(boolean scalable);
</span><span class="cx">     void setLinkPreloadSupport(boolean scalable);
</span><ins>+
+#if defined(ENABLE_CSS_GRID_LAYOUT) &amp;&amp; ENABLE_CSS_GRID_LAYOUT
+    void setCSSGridLayoutEnabled(boolean enable);
+#endif
+
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-04-28  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Add CSS Grid Layout runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=157134
+
+        Reviewed by Simon Fraser.
+
+        Add CSS Grid Layout runtime flag based on preferences,
+        enabled by default.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences isCSSGridLayoutEnabled]):
+        (-[WebPreferences setCSSGridLayoutEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
</ins><span class="cx"> 2016-04-28  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Another fix for the Apple Internal OS X build
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebPreferenceKeysPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -164,6 +164,7 @@
</span><span class="cx"> #define WebKitCustomElementsEnabledPreferenceKey @&quot;WebKitCustomElementsEnabled&quot;
</span><span class="cx"> #define WebKitFetchAPIEnabledPreferenceKey @&quot;WebKitFetchAPIEnabled&quot;
</span><span class="cx"> #define WebKitDownloadAttributeEnabledPreferenceKey @&quot;WebKitDownloadAttributeEnabled&quot;
</span><ins>+#define WebKitCSSGridLayoutEnabledPreferenceKey @&quot;WebKitCSSGridLayoutEnabled&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if !TARGET_OS_IPHONE
</span><span class="cx"> // These are private both because callers should be using the cover methods and because the
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebPreferencesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -619,6 +619,9 @@
</span><span class="cx"> #if ENABLE(DOWNLOAD_ATTRIBUTE)
</span><span class="cx">         [NSNumber numberWithBool:NO], WebKitDownloadAttributeEnabledPreferenceKey,
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+        [NSNumber numberWithBool:YES], WebKitCSSGridLayoutEnabledPreferenceKey,
+#endif
</ins><span class="cx">         nil];
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="lines">@@ -2739,6 +2742,16 @@
</span><span class="cx">     [self _setBoolValue:flag forKey:WebKitDownloadAttributeEnabledPreferenceKey];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (BOOL)isCSSGridLayoutEnabled
+{
+    return [self _boolValueForKey:WebKitCSSGridLayoutEnabledPreferenceKey];
+}
+
+- (void)setCSSGridLayoutEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitCSSGridLayoutEnabledPreferenceKey];
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation WebPreferences (WebInternal)
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebPreferencesPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -490,6 +490,9 @@
</span><span class="cx"> - (void)setDownloadAttributeEnabled:(BOOL)flag;
</span><span class="cx"> - (BOOL)downloadAttributeEnabled;
</span><span class="cx"> 
</span><ins>+- (void)setCSSGridLayoutEnabled:(BOOL)flag;
+- (BOOL)isCSSGridLayoutEnabled;
+
</ins><span class="cx"> @property (nonatomic) BOOL javaScriptMarkupEnabled;
</span><span class="cx"> @property (nonatomic) BOOL mediaDataLoadsAutomatically;
</span><span class="cx"> @property (nonatomic) BOOL attachmentElementEnabled;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -2493,6 +2493,10 @@
</span><span class="cx">     RuntimeEnabledFeatures::sharedFeatures().setDownloadAttributeEnabled([preferences downloadAttributeEnabled]);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    RuntimeEnabledFeatures::sharedFeatures().setCSSGridLayoutEnabled([preferences isCSSGridLayoutEnabled]);
+#endif
+
</ins><span class="cx">     NSTimeInterval timeout = [preferences incrementalRenderingSuppressionTimeoutInSeconds];
</span><span class="cx">     if (timeout &gt; 0)
</span><span class="cx">         settings.setIncrementalRenderingSuppressionTimeoutInSeconds(timeout);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebKit2/ChangeLog        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-04-28  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Add CSS Grid Layout runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=157134
+
+        Reviewed by Simon Fraser.
+
+        Add CSS Grid Layout runtime flag based on preferences,
+        enabled by default.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetCSSGridLayoutEnabled):
+        (WKPreferencesGetCSSGridLayoutEnabled):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
</ins><span class="cx"> 2016-04-28  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix the Apple Internal OS X build
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPreferencesDefinitionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -281,6 +281,7 @@
</span><span class="cx"> #define FOR_EACH_WEBKIT_EXPERIMENTAL_FEATURE_PREFERENCE(macro) \
</span><span class="cx">     macro(ExperimentalShadowDOMEnabled, experimentalShadowDOMEnabled, Bool, bool, false, &quot;Shadow DOM&quot;, &quot;Support for the Shadow DOM feature&quot;) \
</span><span class="cx">     macro(ExperimentalWebGL2Enabled, experimentalWebGL2Enabled, Bool, bool, false, &quot;WebGL 2.0&quot;, &quot;Prototype WebGL 2 Support&quot;) \
</span><ins>+    macro(CSSGridLayoutEnabled, cssGridLayoutEnabled, Bool, bool, true, &quot;&quot;, &quot;&quot;) \
</ins><span class="cx">     \
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -1540,3 +1540,13 @@
</span><span class="cx"> {
</span><span class="cx">     return toImpl(preferencesRef)-&gt;downloadAttributeEnabled();
</span><span class="cx"> }
</span><ins>+
+void WKPreferencesSetCSSGridLayoutEnabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)-&gt;setCSSGridLayoutEnabled(flag);
+}
+
+bool WKPreferencesGetCSSGridLayoutEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)-&gt;cssGridLayoutEnabled();
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -431,6 +431,10 @@
</span><span class="cx"> WK_EXPORT void WKPreferencesSetDownloadAttributeEnabled(WKPreferencesRef, bool flag);
</span><span class="cx"> WK_EXPORT bool WKPreferencesGetDownloadAttributeEnabled(WKPreferencesRef);
</span><span class="cx"> 
</span><ins>+// Defaults to true
+WK_EXPORT void WKPreferencesSetCSSGridLayoutEnabled(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetCSSGridLayoutEnabled(WKPreferencesRef);
+
</ins><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -217,7 +217,12 @@
</span><span class="cx">     if (preference == &quot;WebKitDownloadAttributeEnabled&quot;)
</span><span class="cx">         RuntimeEnabledFeatures::sharedFeatures().setDownloadAttributeEnabled(enabled);
</span><span class="cx"> #endif
</span><del>-    
</del><ins>+
+#if ENABLE(CSS_GRID_LAYOUT)
+    if (preference == &quot;WebKitCSSGridLayoutEnabled&quot;)
+        RuntimeEnabledFeatures::sharedFeatures().setCSSGridLayoutEnabled(enabled);
+#endif
+
</ins><span class="cx">     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
</span><span class="cx"> #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
</span><span class="cx">     macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (200214 => 200215)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-04-28 23:12:37 UTC (rev 200214)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-04-28 23:13:59 UTC (rev 200215)
</span><span class="lines">@@ -3118,6 +3118,10 @@
</span><span class="cx">     RuntimeEnabledFeatures::sharedFeatures().setDownloadAttributeEnabled(store.getBoolValueForKey(WebPreferencesKey::downloadAttributeEnabledKey()));
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    RuntimeEnabledFeatures::sharedFeatures().setCSSGridLayoutEnabled(store.getBoolValueForKey(WebPreferencesKey::cssGridLayoutEnabledKey()));
+#endif
+
</ins><span class="cx">     bool processSuppressionEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey());
</span><span class="cx">     if (m_processSuppressionEnabled != processSuppressionEnabled) {
</span><span class="cx">         m_processSuppressionEnabled = processSuppressionEnabled;
</span></span></pre>
</div>
</div>

</body>
</html>