Changeset 121129 in webkit
- Timestamp:
- Jun 24, 2012 7:03:45 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/fast/css/variables/border-width.html
r117791 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 div { -
trunk/LayoutTests/fast/css/variables/colors-test.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 body { -
trunk/LayoutTests/fast/css/variables/complex-cycle.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 body { -
trunk/LayoutTests/fast/css/variables/computed-style.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 body { -
trunk/LayoutTests/fast/css/variables/inherited-values.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 body { -
trunk/LayoutTests/fast/css/variables/inline-styles.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <body style="-webkit-var-a: green;"> 2 5 <div style="color: -webkit-var(a);"> -
trunk/LayoutTests/fast/css/variables/invalid-shorthand.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 div { -
trunk/LayoutTests/fast/css/variables/invalid-variable-value.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 div { -
trunk/LayoutTests/fast/css/variables/multi-level-cycle.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 .a { -
trunk/LayoutTests/fast/css/variables/redefinition.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 body { -
trunk/LayoutTests/fast/css/variables/shorthand.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 div { -
trunk/LayoutTests/fast/css/variables/simple-cycle.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 body { -
trunk/LayoutTests/fast/css/variables/transform-test.html
r117791 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 div { -
trunk/LayoutTests/fast/css/variables/undefined.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 body { -
trunk/LayoutTests/fast/css/variables/use-before-defined.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 div { -
trunk/LayoutTests/fast/css/variables/var-inside-shorthand.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 body { -
trunk/LayoutTests/fast/css/variables/variable-chain.html
r117390 r121129 1 <script> 2 internals.settings.setCSSVariablesEnabled(true); 3 </script> 1 4 <style> 2 5 body { -
trunk/Source/WebCore/ChangeLog
r121128 r121129 1 2012-06-24 Luke Macpherson <macpherson@chromium.org> 2 3 Add runtime flag to enable/disable CSS variables (in addition to existing compile-time flag). 4 https://bugs.webkit.org/show_bug.cgi?id=89542 5 6 Reviewed by Dimitri Glazkov. 7 8 Added fast/css/variables/build-supports-variables.html to test runtime flag in test environment. 9 Updated all other css variables tests to enable the runtime flag from JS. 10 11 * css/CSSParser.cpp: 12 (WebCore::CSSParserContext::CSSParserContext): 13 (WebCore::operator==): 14 (WebCore::CSSParser::cssVariablesEnabled): 15 (WebCore): 16 (WebCore::CSSParser::detectDashToken): 17 (WebCore::CSSParser::lex): 18 * css/CSSParser.h: 19 (CSSParser): 20 * css/CSSParserMode.h: 21 (CSSParserContext): 22 * page/Settings.h: 23 (Settings): 24 (WebCore::Settings::setCSSVariablesEnabled): 25 (WebCore::Settings::cssVariablesEnabled): 26 1 27 2012-06-22 Kent Tamura <tkent@chromium.org> 2 28 -
trunk/Source/WebCore/css/CSSParser.cpp
r121127 r121129 195 195 , isCSSRegionsEnabled(false) 196 196 , isCSSGridLayoutEnabled(false) 197 #if ENABLE(CSS_VARIABLES) 198 , isCSSVariablesEnabled(false) 199 #endif 197 200 , needsSiteSpecificQuirks(false) 198 201 , enforcesCSSMIMETypeInNoQuirksMode(true) … … 208 211 , isCSSRegionsEnabled(document->cssRegionsEnabled()) 209 212 , isCSSGridLayoutEnabled(document->cssGridLayoutEnabled()) 213 #if ENABLE(CSS_VARIABLES) 214 , isCSSVariablesEnabled(document->settings() ? document->settings()->cssVariablesEnabled() : false) 215 #endif 210 216 , needsSiteSpecificQuirks(document->settings() ? document->settings()->needsSiteSpecificQuirks() : false) 211 217 , enforcesCSSMIMETypeInNoQuirksMode(!document->settings() || document->settings()->enforceCSSMIMETypeInNoQuirksMode()) … … 222 228 && a.isCSSRegionsEnabled == b.isCSSRegionsEnabled 223 229 && a.isCSSGridLayoutEnabled == b.isCSSGridLayoutEnabled 230 #if ENABLE(CSS_VARIABLES) 231 && a.isCSSVariablesEnabled == b.isCSSVariablesEnabled 232 #endif 224 233 && a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks 225 234 && a.enforcesCSSMIMETypeInNoQuirksMode == b.enforcesCSSMIMETypeInNoQuirksMode; … … 1015 1024 } 1016 1025 1026 #if ENABLE(CSS_VARIABLES) 1027 bool CSSParser::parseValue(StylePropertySet* declaration, CSSPropertyID propertyID, const String& string, bool important, Document* document) 1028 { 1029 ASSERT(!string.isEmpty()); 1030 1031 CSSParserContext context(document); 1032 1033 if (parseSimpleLengthValue(declaration, propertyID, string, important, context.mode)) 1034 return true; 1035 if (parseColorValue(declaration, propertyID, string, important, context.mode)) 1036 return true; 1037 if (parseKeywordValue(declaration, propertyID, string, important, context)) 1038 return true; 1039 1040 CSSParser parser(context); 1041 return parser.parseValue(declaration, propertyID, string, important, static_cast<StyleSheetContents*>(0)); 1042 } 1043 #endif 1044 1017 1045 bool CSSParser::parseValue(StylePropertySet* declaration, CSSPropertyID propertyID, const String& string, bool important, CSSParserMode cssParserMode, StyleSheetContents* contextStyleSheet) 1018 1046 { … … 2894 2922 2895 2923 #if ENABLE(CSS_VARIABLES) 2924 bool CSSParser::cssVariablesEnabled() const 2925 { 2926 return m_context.isCSSVariablesEnabled; 2927 } 2928 2896 2929 void CSSParser::storeVariableDeclaration(const CSSParserString& name, PassOwnPtr<CSSParserValueList> value, bool important) 2897 2930 { … … 8523 8556 m_token = MAXFUNCTION; 8524 8557 #if ENABLE(CSS_VARIABLES) 8525 else if ( isASCIIAlphaCaselessEqual(name[10], 'r') && isEqualToCSSIdentifier(name + 1, "webkit-va"))8558 else if (cssVariablesEnabled() && isASCIIAlphaCaselessEqual(name[10], 'r') && isEqualToCSSIdentifier(name + 1, "webkit-va")) 8526 8559 m_token = VARFUNCTION; 8527 8560 #endif … … 8865 8898 case CharacterDash: 8866 8899 #if ENABLE(CSS_VARIABLES) 8867 if ( m_currentCharacter[10] == '-' && isEqualToCSSIdentifier(m_currentCharacter, "webkit-var") && isIdentifierStartAfterDash(m_currentCharacter + 11)) {8900 if (cssVariablesEnabled() && m_currentCharacter[10] == '-' && isEqualToCSSIdentifier(m_currentCharacter, "webkit-var") && isIdentifierStartAfterDash(m_currentCharacter + 11)) { 8868 8901 // handle variable declarations 8869 8902 m_currentCharacter += 11; -
trunk/Source/WebCore/css/CSSParser.h
r120469 r121129 93 93 94 94 #if ENABLE(CSS_VARIABLES) 95 static bool parseValue(StylePropertySet*, CSSPropertyID, const String&, bool important, Document*); 96 bool cssVariablesEnabled() const; 95 97 void storeVariableDeclaration(const CSSParserString&, PassOwnPtr<CSSParserValueList>, bool important); 96 98 #endif -
trunk/Source/WebCore/css/CSSParserMode.h
r117613 r121129 66 66 bool isCSSRegionsEnabled; 67 67 bool isCSSGridLayoutEnabled; 68 #if ENABLE(CSS_VARIABLES) 69 bool isCSSVariablesEnabled; 70 #endif 68 71 bool needsSiteSpecificQuirks; 69 72 bool enforcesCSSMIMETypeInNoQuirksMode; -
trunk/Source/WebCore/css/StyleResolver.cpp
r121123 r121129 3324 3324 // FIXME: It would be faster not to re-parse from strings, but for now CSS property validation lives inside the parser so we do it there. 3325 3325 RefPtr<StylePropertySet> resultSet = StylePropertySet::create(); 3326 if (!CSSParser::parseValue(resultSet.get(), id, expression.second, false, CSSStrictMode, 0))3326 if (!CSSParser::parseValue(resultSet.get(), id, expression.second, false, document())) 3327 3327 return; // expression failed to parse. 3328 3328 -
trunk/Source/WebCore/page/Settings.h
r120885 r121129 330 330 void setCSSRegionsEnabled(bool) { } 331 331 bool cssRegionsEnabled() const { return false; } 332 #endif 333 334 #if ENABLE(CSS_VARIABLES) 335 void setCSSVariablesEnabled(bool enabled) { m_cssVariablesEnabled = enabled; } 336 bool cssVariablesEnabled() const { return true; } 337 #else 338 void setCSSVariablesEnabled(bool) { } 339 bool cssVariablesEnabled() const { return false; } 332 340 #endif 333 341 … … 678 686 bool m_cssRegionsEnabled : 1; 679 687 #endif 688 #if ENABLE(CSS_VARIABLES) 689 bool m_cssVariablesEnabled : 1; 690 #endif 680 691 bool m_regionBasedColumnsEnabled : 1; 681 692 bool m_cssGridLayoutEnabled : 1; -
trunk/Source/WebCore/testing/InternalSettings.cpp
r120883 r121129 349 349 } 350 350 351 void InternalSettings::setCSSVariablesEnabled(bool enabled, ExceptionCode& ec) 352 { 353 InternalSettingsGuardForSettings(); 354 settings()->setCSSVariablesEnabled(enabled); 355 } 356 357 bool InternalSettings::cssVariablesEnabled(ExceptionCode& ec) 358 { 359 InternalSettingsGuardForSettingsReturn(false); 360 return settings()->cssVariablesEnabled(); 361 } 362 351 363 void InternalSettings::setMediaPlaybackRequiresUserGesture(bool enabled, ExceptionCode& ec) 352 364 { -
trunk/Source/WebCore/testing/InternalSettings.h
r120883 r121129 76 76 bool scrollAnimatorEnabled(ExceptionCode&); 77 77 void setCSSExclusionsEnabled(bool enabled, ExceptionCode&); 78 void setCSSVariablesEnabled(bool enabled, ExceptionCode&); 79 bool cssVariablesEnabled(ExceptionCode&); 78 80 void setMediaPlaybackRequiresUserGesture(bool, ExceptionCode&); 79 81 void setEditingBehavior(const String&, ExceptionCode&); -
trunk/Source/WebCore/testing/InternalSettings.idl
r120883 r121129 55 55 boolean scrollAnimatorEnabled() raises(DOMException); 56 56 void setCSSExclusionsEnabled(in boolean enabled) raises(DOMException); 57 void setCSSVariablesEnabled(in boolean enabled) raises(DOMException); 58 boolean cssVariablesEnabled() raises(DOMException); 57 59 void setMediaPlaybackRequiresUserGesture(in boolean enabled) raises(DOMException); 58 60 void setEditingBehavior(in DOMString behavior) raises(DOMException); -
trunk/Source/WebKit/chromium/ChangeLog
r121108 r121129 1 2012-06-24 Luke Macpherson <macpherson@chromium.org> 2 3 Add runtime flag to enable/disable CSS variables (in addition to existing compile-time flag). 4 https://bugs.webkit.org/show_bug.cgi?id=89542 5 6 Reviewed by Dimitri Glazkov. 7 8 * features.gypi: 9 * public/WebSettings.h: 10 * src/WebSettingsImpl.cpp: 11 (WebKit::WebSettingsImpl::setExperimentalCSSVariablesEnabled): 12 (WebKit): 13 * src/WebSettingsImpl.h: 14 (WebSettingsImpl): 15 1 16 2012-06-23 Kwang Yul Seo <skyul@company100.net> 2 17 -
trunk/Source/WebKit/chromium/features.gypi
r120972 r121129 47 47 'ENABLE_CSS_REGIONS=1', 48 48 'ENABLE_CSS_SHADERS=1', 49 'ENABLE_CSS_VARIABLES= 0',49 'ENABLE_CSS_VARIABLES=1', 50 50 'ENABLE_CUSTOM_SCHEME_HANDLER=0', 51 51 'ENABLE_DATALIST=1', -
trunk/Source/WebKit/chromium/public/WebSettings.h
r120885 r121129 106 106 virtual void setExperimentalCSSGridLayoutEnabled(bool) = 0; 107 107 virtual void setExperimentalCSSCustomFilterEnabled(bool) = 0; 108 virtual void setExperimentalCSSVariablesEnabled(bool) = 0; 108 109 virtual void setOpenGLMultisamplingEnabled(bool) = 0; 109 110 virtual void setPrivilegedWebGLExtensionsEnabled(bool) = 0; -
trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp
r120885 r121129 339 339 } 340 340 341 void WebSettingsImpl::setExperimentalCSSVariablesEnabled(bool enabled) 342 { 343 m_settings->setCSSVariablesEnabled(enabled); 344 } 345 341 346 void WebSettingsImpl::setOpenGLMultisamplingEnabled(bool enabled) 342 347 { -
trunk/Source/WebKit/chromium/src/WebSettingsImpl.h
r120885 r121129 98 98 virtual void setExperimentalCSSGridLayoutEnabled(bool); 99 99 virtual void setExperimentalCSSCustomFilterEnabled(bool); 100 virtual void setExperimentalCSSVariablesEnabled(bool); 100 101 virtual void setOpenGLMultisamplingEnabled(bool); 101 102 virtual void setPrivilegedWebGLExtensionsEnabled(bool);
Note: See TracChangeset
for help on using the changeset viewer.