1. 25 Jun, 2012 2 commits
    • macpherson@chromium.org's avatar
      Add runtime flag to enable/disable CSS variables (in addition to existing compile-time flag). · 73eb1e5f
      macpherson@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=89542
      
      Reviewed by Dimitri Glazkov.
      
      Source/WebCore:
      
      Added fast/css/variables/build-supports-variables.html to test runtime flag in test environment.
      Updated all other css variables tests to enable the runtime flag from JS.
      
      * css/CSSParser.cpp:
      (WebCore::CSSParserContext::CSSParserContext):
      (WebCore::operator==):
      (WebCore::CSSParser::cssVariablesEnabled):
      (WebCore):
      (WebCore::CSSParser::detectDashToken):
      (WebCore::CSSParser::lex):
      * css/CSSParser.h:
      (CSSParser):
      * css/CSSParserMode.h:
      (CSSParserContext):
      * page/Settings.h:
      (Settings):
      (WebCore::Settings::setCSSVariablesEnabled):
      (WebCore::Settings::cssVariablesEnabled):
      
      Source/WebKit/chromium:
      
      * features.gypi:
      * public/WebSettings.h:
      * src/WebSettingsImpl.cpp:
      (WebKit::WebSettingsImpl::setExperimentalCSSVariablesEnabled):
      (WebKit):
      * src/WebSettingsImpl.h:
      (WebSettingsImpl):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      73eb1e5f
    • hclam@chromium.org's avatar
      Unreviewed, rolling out r121129. · 320d95e4
      hclam@chromium.org authored
      http://trac.webkit.org/changeset/121129
      https://bugs.webkit.org/show_bug.cgi?id=89542
      
      Chromium ASan failure: crbug.com/134402
      
      Source/WebCore:
      
      * css/CSSParser.cpp:
      (WebCore::CSSParserContext::CSSParserContext):
      (WebCore::operator==):
      (WebCore):
      (WebCore::CSSParser::detectDashToken):
      (WebCore::CSSParser::lex):
      * css/CSSParser.h:
      (CSSParser):
      * css/CSSParserMode.h:
      (CSSParserContext):
      * css/StyleResolver.cpp:
      (WebCore::StyleResolver::collectMatchingRulesForList):
      * page/Settings.h:
      (Settings):
      * testing/InternalSettings.cpp:
      * testing/InternalSettings.h:
      (InternalSettings):
      * testing/InternalSettings.idl:
      
      Source/WebKit/chromium:
      
      * features.gypi:
      * public/WebSettings.h:
      * src/WebSettingsImpl.cpp:
      * src/WebSettingsImpl.h:
      (WebSettingsImpl):
      
      LayoutTests:
      
      * fast/css/variables/border-width.html:
      * fast/css/variables/build-supports-variables-expected.txt: Removed.
      * fast/css/variables/build-supports-variables.html: Removed.
      * fast/css/variables/colors-test.html:
      * fast/css/variables/complex-cycle.html:
      * fast/css/variables/computed-style.html:
      * fast/css/variables/inherited-values.html:
      * fast/css/variables/inline-styles.html:
      * fast/css/variables/invalid-shorthand.html:
      * fast/css/variables/invalid-variable-value.html:
      * fast/css/variables/multi-level-cycle.html:
      * fast/css/variables/redefinition.html:
      * fast/css/variables/shorthand.html:
      * fast/css/variables/simple-cycle.html:
      * fast/css/variables/transform-test.html:
      * fast/css/variables/undefined.html:
      * fast/css/variables/use-before-defined.html:
      * fast/css/variables/var-inside-shorthand.html:
      * fast/css/variables/variable-chain.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      320d95e4
  2. 24 Jun, 2012 1 commit
    • macpherson@chromium.org's avatar
      Add runtime flag to enable/disable CSS variables (in addition to existing compile-time flag). · d7f98d4e
      macpherson@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=89542
      
      Reviewed by Dimitri Glazkov.
      
      Source/WebCore:
      
      Added fast/css/variables/build-supports-variables.html to test runtime flag in test environment.
      Updated all other css variables tests to enable the runtime flag from JS.
      
      * css/CSSParser.cpp:
      (WebCore::CSSParserContext::CSSParserContext):
      (WebCore::operator==):
      (WebCore::CSSParser::cssVariablesEnabled):
      (WebCore):
      (WebCore::CSSParser::detectDashToken):
      (WebCore::CSSParser::lex):
      * css/CSSParser.h:
      (CSSParser):
      * css/CSSParserMode.h:
      (CSSParserContext):
      * page/Settings.h:
      (Settings):
      (WebCore::Settings::setCSSVariablesEnabled):
      (WebCore::Settings::cssVariablesEnabled):
      
      Source/WebKit/chromium:
      
      * features.gypi:
      * public/WebSettings.h:
      * src/WebSettingsImpl.cpp:
      (WebKit::WebSettingsImpl::setExperimentalCSSVariablesEnabled):
      (WebKit):
      * src/WebSettingsImpl.h:
      (WebSettingsImpl):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121129 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d7f98d4e
  3. 16 May, 2012 1 commit
    • macpherson@chromium.org's avatar
      Add tests for CSS Variables. · 6177786a
      macpherson@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=86575
      
      Reviewed by Dimitri Glazkov.
      
      * fast/css/variables/colors-test-expected.html: Added.
      * fast/css/variables/colors-test.html: Added.
      * fast/css/variables/complex-cycle-expected.html: Added.
      * fast/css/variables/complex-cycle.html: Added.
      * fast/css/variables/computed-style-expected.html: Added.
      * fast/css/variables/computed-style.html: Added.
      * fast/css/variables/inherited-values-expected.html: Added.
      * fast/css/variables/inherited-values.html: Added.
      * fast/css/variables/inline-styles-expected.html: Added.
      * fast/css/variables/inline-styles.html: Added.
      * fast/css/variables/invalid-shorthand-expected.html: Added.
      * fast/css/variables/invalid-shorthand.html: Added.
      * fast/css/variables/invalid-variable-value-expected.html: Added.
      * fast/css/variables/invalid-variable-value.html: Added.
      * fast/css/variables/multi-level-cycle-expected.html: Added.
      * fast/css/variables/multi-level-cycle.html: Added.
      * fast/css/variables/redefinition-expected.html: Added.
      * fast/css/variables/redefinition.html: Added.
      * fast/css/variables/shorthand-expected.html: Added.
      * fast/css/variables/shorthand.html: Added.
      * fast/css/variables/simple-cycle-expected.html: Added.
      * fast/css/variables/simple-cycle.html: Added.
      * fast/css/variables/undefined-expected.html: Added.
      * fast/css/variables/undefined.html: Added.
      * fast/css/variables/use-before-defined-expected.html: Added.
      * fast/css/variables/use-before-defined.html: Added.
      * fast/css/variables/var-inside-shorthand-expected.html: Added.
      * fast/css/variables/var-inside-shorthand.html: Added.
      * fast/css/variables/variable-chain-expected.html: Added.
      * fast/css/variables/variable-chain.html: Added.
      * platform/chromium/test_expectations.txt: Skip tests until variables implementation lands.
      * platform/efl/test_expectations.txt: Skip tests until variables implementation lands.
      * platform/gtk/test_expectations.txt: Skip tests until variables implementation lands.
      * platform/mac/test_expectations.txt: Skip tests until variables implementation lands.
      * platform/qt/test_expectations.txt: Skip tests until variables implementation lands.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6177786a
  4. 16 Nov, 2010 1 commit
  5. 19 Jun, 2008 1 commit
    • hyatt@apple.com's avatar
      WebCore: · 51e2fadf
      hyatt@apple.com authored
      2008-06-19  David Hyatt  <hyatt@apple.com>
      
              Add initial support for CSS variables.  Non-dynamic cases should (hopefully) all work.  Things will get
              confused if you use the CSS OM to remove variables/inject variables, etc.  In addition no DOM APIs are
              exposed yet for the new variable interfaces.
      
              Reviewed by Beth
      
              Added many tests to fast/css/variables/
      
              * WebCore.xcodeproj/project.pbxproj:
              * css/CSSFunctionValue.cpp: Added.
              (WebCore::CSSFunctionValue::CSSFunctionValue):
              (WebCore::CSSFunctionValue::~CSSFunctionValue):
              (WebCore::CSSFunctionValue::cssText):
              (WebCore::CSSFunctionValue::parserValue):
              * css/CSSFunctionValue.h: Added.
              (WebCore::CSSFunctionValue::create):
              * css/CSSGrammar.y:
              * css/CSSMutableStyleDeclaration.cpp:
              (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
              (WebCore::CSSMutableStyleDeclaration::copy):
              * css/CSSMutableStyleDeclaration.h:
              (WebCore::CSSMutableStyleDeclaration::create):
              (WebCore::CSSMutableStyleDeclaration::hasVariableDependentValue):
              * css/CSSParser.cpp:
              (WebCore::equal):
              (WebCore::equalIgnoringCase):
              (WebCore::CSSParser::~CSSParser):
              (WebCore::CSSParserString::lower):
              (WebCore::CSSParser::document):
              (WebCore::CSSParser::validUnit):
              (WebCore::unitFromString):
              (WebCore::CSSParser::checkForOrphanedUnits):
              (WebCore::CSSParser::parseValue):
              (WebCore::CSSParser::parseFillShorthand):
              (WebCore::CSSParser::parseTransitionShorthand):
              (WebCore::CSSParser::parseContent):
              (WebCore::CSSParser::parseFillImage):
              (WebCore::CSSParser::parseFillPosition):
              (WebCore::CSSParser::parseFillSize):
              (WebCore::CSSParser::parseFillProperty):
              (WebCore::CSSParser::parseTransitionDuration):
              (WebCore::CSSParser::parseTransitionRepeatCount):
              (WebCore::CSSParser::parseTimingFunctionValue):
              (WebCore::CSSParser::parseTransitionTimingFunction):
              (WebCore::CSSParser::parseTransitionProperty):
              (WebCore::skipCommaInDashboardRegion):
              (WebCore::CSSParser::parseDashboardRegions):
              (WebCore::CSSParser::parseCounterContent):
              (WebCore::CSSParser::parseShape):
              (WebCore::CSSParser::parseFont):
              (WebCore::CSSParser::parseFontFamily):
              (WebCore::CSSParser::parseFontFaceSrc):
              (WebCore::CSSParser::parseFontFaceUnicodeRange):
              (WebCore::CSSParser::parseColorParameters):
              (WebCore::CSSParser::parseHSLParameters):
              (WebCore::CSSParser::parseColor):
              (WebCore::CSSParser::parseColorFromValue):
              (WebCore::ShadowParseContext::commitLength):
              (WebCore::CSSParser::parseShadow):
              (WebCore::CSSParser::parseReflect):
              (WebCore::BorderImageParseContext::commitNumber):
              (WebCore::BorderImageParseContext::commitWidth):
              (WebCore::BorderImageParseContext::commitBorderImage):
              (WebCore::CSSParser::parseBorderImage):
              (WebCore::CSSParser::parseCounter):
              (WebCore::parseGradientPoint):
              (WebCore::parseGradientColorStop):
              (WebCore::CSSParser::parseGradient):
              (WebCore::CSSParser::parseCanvas):
              (WebCore::TransformOperationInfo::TransformOperationInfo):
              (WebCore::CSSParser::parseTransform):
              (WebCore::CSSParser::lex):
              (WebCore::CSSParser::text):
              (WebCore::CSSParser::createFloatingValueList):
              (WebCore::CSSParser::sinkFloatingValueList):
              (WebCore::CSSParser::createFloatingFunction):
              (WebCore::CSSParser::sinkFloatingFunction):
              (WebCore::CSSParser::sinkFloatingValue):
              (WebCore::CSSParser::createFloatingMediaQueryExp):
              (WebCore::CSSParser::createCharsetRule):
              (WebCore::CSSParser::createImportRule):
              (WebCore::CSSParser::createVariablesRule):
              (WebCore::CSSParser::addVariable):
              (WebCore::CSSParser::clearVariables):
              (WebCore::CSSParser::parseVariable):
              (WebCore::CSSParser::parsePropertyWithResolvedVariables):
              (WebCore::CSSParser::checkForVariables):
              (WebCore::CSSParser::addUnresolvedProperty):
              (WebCore::cssPropertyID):
              (WebCore::cssValueKeywordID):
              * css/CSSParser.h:
              * css/CSSParserValues.cpp: Added.
              (WebCore::CSSParserValueList::~CSSParserValueList):
              (WebCore::CSSParserValueList::addValue):
              (WebCore::CSSParserValueList::deleteValueAt):
              (WebCore::CSSParserValue::createCSSValue):
              * css/CSSParserValues.h: Added.
              (WebCore::CSSParserString::operator String):
              (WebCore::CSSParserString::operator AtomicString):
              (WebCore::CSSParserValue::):
              (WebCore::CSSParserValueList::CSSParserValueList):
              (WebCore::CSSParserValueList::size):
              (WebCore::CSSParserValueList::current):
              (WebCore::CSSParserValueList::next):
              (WebCore::CSSParserValueList::valueAt):
              (WebCore::CSSParserValueList::clear):
              (WebCore::CSSParserValueList::containsVariables):
              (WebCore::CSSParserFunction::~CSSParserFunction):
              * css/CSSPrimitiveValue.cpp:
              (WebCore::CSSPrimitiveValue::getStringValue):
              (WebCore::CSSPrimitiveValue::cssText):
              (WebCore::CSSPrimitiveValue::parserValue):
              * css/CSSPrimitiveValue.h:
              (WebCore::CSSPrimitiveValue::):
              (WebCore::CSSPrimitiveValue::setPrimitiveType):
              * css/CSSRule.h:
              (WebCore::CSSRule::):
              * css/CSSRule.idl:
              * css/CSSStyleDeclaration.cpp:
              (WebCore::CSSStyleDeclaration::copyPropertiesInSet):
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::addMatchedDeclaration):
              (WebCore::CSSStyleSelector::addVariables):
              (WebCore::CSSStyleSelector::resolveVariableDependentValue):
              (WebCore::CSSRuleSet::addRulesFromSheet):
              (WebCore::CSSStyleSelector::applyDeclarations):
              * css/CSSStyleSelector.h:
              * css/CSSValue.h:
              (WebCore::CSSValue::isVariableDependentValue):
              (WebCore::CSSValue::parserValue):
              * css/CSSValueList.cpp:
              (WebCore::CSSValueList::CSSValueList):
              (WebCore::CSSValueList::createParserValueList):
              * css/CSSValueList.h:
              (WebCore::CSSValueList::createFromParserValueList):
              * css/CSSVariableDependentValue.cpp: Added.
              (WebCore::CSSVariableDependentValue::CSSVariableDependentValue):
              (WebCore::CSSVariableDependentValue::~CSSVariableDependentValue):
              (WebCore::CSSVariableDependentValue::cssText):
              * css/CSSVariableDependentValue.h: Added.
              (WebCore::CSSVariableDependentValue::create):
              (WebCore::CSSVariableDependentValue::isVariableDependentValue):
              (WebCore::CSSVariableDependentValue::valueList):
              * css/CSSVariablesDeclaration.cpp: Added.
              (WebCore::CSSVariablesDeclaration::CSSVariablesDeclaration):
              (WebCore::CSSVariablesDeclaration::~CSSVariablesDeclaration):
              (WebCore::CSSVariablesDeclaration::getVariableValue):
              (WebCore::CSSVariablesDeclaration::removeVariable):
              (WebCore::CSSVariablesDeclaration::setVariable):
              (WebCore::CSSVariablesDeclaration::addParsedVariable):
              (WebCore::CSSVariablesDeclaration::getParsedVariable):
              (WebCore::CSSVariablesDeclaration::length):
              (WebCore::CSSVariablesDeclaration::item):
              (WebCore::CSSVariablesDeclaration::parentRule):
              (WebCore::CSSVariablesDeclaration::cssText):
              * css/CSSVariablesDeclaration.h: Added.
              (WebCore::CSSVariablesDeclaration::create):
              * css/CSSVariablesRule.cpp: Added.
              (WebCore::CSSVariablesRule::CSSVariablesRule):
              (WebCore::CSSVariablesRule::~CSSVariablesRule):
              (WebCore::CSSVariablesRule::cssText):
              * css/CSSVariablesRule.h: Added.
              (WebCore::CSSVariablesRule::media):
              (WebCore::CSSVariablesRule::variables):
              (WebCore::CSSVariablesRule::type):
              (WebCore::CSSVariablesRule::isVariablesRule):
              (WebCore::CSSVariablesRule::setDeclaration):
              * css/MediaQueryExp.cpp:
              (WebCore::MediaQueryExp::MediaQueryExp):
              * css/MediaQueryExp.h:
              * css/SVGCSSParser.cpp:
              (WebCore::CSSParser::parseSVGValue):
              (WebCore::CSSParser::parseSVGStrokeDasharray):
              * css/StyleBase.h:
              (WebCore::StyleBase::isVariablesRule):
              * css/tokenizer.flex:
      
      LayoutTests:
      
      2008-06-19  David Hyatt  <hyatt@apple.com>
      
              Add layout tests for CSS variables.
      
              Reviewed by Beth
      
              * fast/css/variables: Added.
              * fast/css/variables/colors-test.html: Added.
              * fast/css/variables/font-test.html: Added.
              * fast/css/variables/image-test.html: Added.
              * fast/css/variables/import-test.html: Added.
              * fast/css/variables/invalid-variable-test.html: Added.
              * fast/css/variables/margin-test.html: Added.
              * fast/css/variables/misplaced-import-test.html: Added.
              * fast/css/variables/misplaced-variables-test.html: Added.
              * fast/css/variables/override-test.html: Added.
              * fast/css/variables/print-test.html: Added.
              * fast/css/variables/resources: Added.
              * fast/css/variables/resources/bad.css: Added.
              * fast/css/variables/resources/good.css: Added.
              * fast/css/variables/resources/listmark.gif: Added.
              * fast/css/variables/shorthand-test.html: Added.
              * fast/css/variables/single-term-test.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34666 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      51e2fadf