haikuwebkit/LayoutTests/css3/supports.html

250 lines
6.0 KiB
HTML
Raw Permalink Normal View History

Implement css3-conditional's @supports rule https://bugs.webkit.org/show_bug.cgi?id=86146 Patch by Pablo Flouret <pablof@motorola.com> on 2012-10-18 Reviewed by Antti Koivisto. .: * Source/cmake/WebKitFeatures.cmake: * Source/cmakeconfig.h.cmake: * configure.ac: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebCore: The "@supports" rule is a conditional group rule whose condition tests whether the user agent supports CSS property:value pairs. http://dev.w3.org/csswg/css3-conditional/#at-supports Test: css3/supports.html * Configurations/FeatureDefines.xcconfig: * GNUmakefile.am: * GNUmakefile.features.am: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. * css/CSSGrammar.y.in: * css/CSSParser.cpp: (WebCore): (WebCore::CSSParser::detectSupportsToken): Tries to find 'and', 'not' and 'or' tokens. (WebCore::CSSParser::detectAtToken): Enter SupportsMode if @supports is detected. (WebCore::CSSParser::realLex): Try to detect supports tokens when in SupportsMode. * css/CSSParser.h: Added new SupportsMode parsing mode. (CSSParser): Source/WebKit/chromium: * features.gypi: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit/mac: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit2: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Tools: * Scripts/webkitperl/FeatureList.pm: * qmake/mkspecs/features/features.pri: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. WebKitLibraries: * win/tools/vsprops/FeatureDefines.vsprops: * win/tools/vsprops/FeatureDefinesCairo.vsprops: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. LayoutTests: * css3/supports-expected.txt: Added. * css3/supports.html: Added. * platform/chromium/TestExpectations: * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/qt/TestExpectations: * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * platform/wk2/TestExpectations: Skip the test until the feature is enabled. Canonical link: https://commits.webkit.org/117727@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-18 18:43:15 +00:00
<!DOCTYPE HTML>
<html>
<head>
Change LayoutTests' c* files to use pre and post js files in LayoutTests/resources. https://bugs.webkit.org/show_bug.cgi?id=120986. Rubber stamped by Filip Pizlo. * canvas/philip/tests/2d.composite.globalComposite.html: * compositing/repaint/shrink-layer.html: * css1/units/rounding.html: * css3/calc/color-hsl.html: * css3/calc/color-rgb.html: * css3/calc/font-size-fractional.html: * css3/calc/font-size.html: * css3/calc/font.html: * css3/calc/getComputedStyle-margin-percentage.html: * css3/calc/line-height.html: * css3/calc/margin.html: * css3/calc/table-border-spacing.html: * css3/calc/table-calcs.html: * css3/calc/zoom-with-em.html: * css3/compositing/background-blend-mode-property-parsing.html: * css3/compositing/background-blend-mode-property.html: * css3/compositing/blend-mode-property-parsing-invalid.html: * css3/compositing/blend-mode-property-parsing.html: * css3/compositing/blend-mode-property.html: * css3/compositing/should-have-compositing-layer.html: * css3/filters/custom-with-at-rule-syntax/parsing-at-rule-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-at-rule-valid.html: * css3/filters/custom-with-at-rule-syntax/parsing-custom-function-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-custom-function-valid.html: * css3/filters/custom-with-at-rule-syntax/parsing-geometry-property-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-geometry-property-valid.html: * css3/filters/custom-with-at-rule-syntax/parsing-mix-property-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-mix-property-valid.html: * css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid.html: * css3/filters/custom-with-at-rule-syntax/parsing-src-property-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-src-property-valid.html: * css3/filters/custom/custom-filter-crash-inline-computed-style.html: * css3/filters/custom/custom-filter-mix-bindings.html: * css3/filters/custom/custom-filter-property-computed-style.html: * css3/filters/custom/custom-filter-property-parsing-invalid.html: * css3/filters/custom/custom-filter-property-parsing.html: * css3/filters/custom/effect-custom-disabled.html: * css3/filters/effect-reference-delete-crash.html: * css3/filters/effect-reference-reset-style-delete-crash.html: * css3/filters/filter-property-computed-style.html: * css3/filters/filter-property-parsing-invalid.html: * css3/filters/filter-property-parsing.html: * css3/filters/filter-property.html: * css3/filters/script-tests/TEMPLATE.html: * css3/filters/should-not-have-compositing-layer.html: * css3/flexbox/align-absolute-child.html: * css3/flexbox/css-properties.html: * css3/flexbox/display-flexbox-set-get.html: * css3/flexbox/flex-align-baseline.html: * css3/flexbox/flex-flow-initial.html: * css3/flexbox/flex-longhand-parsing.html: * css3/flexbox/flex-property-parsing.html: * css3/flexbox/flexitem-no-margin-collapsing.html: * css3/flexbox/overflow-keep-scrollpos.html: * css3/font-feature-settings-parsing.html: * css3/supports-cssom.html: * css3/supports-dom-api.html: * css3/supports.html: * css3/unicode-bidi-insolate-parse.html: * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle.html: * css3/zoom-coords.xhtml: Canonical link: https://commits.webkit.org/138879@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-08 02:07:30 +00:00
<script src="../resources/js-test-pre.js"></script>
Implement css3-conditional's @supports rule https://bugs.webkit.org/show_bug.cgi?id=86146 Patch by Pablo Flouret <pablof@motorola.com> on 2012-10-18 Reviewed by Antti Koivisto. .: * Source/cmake/WebKitFeatures.cmake: * Source/cmakeconfig.h.cmake: * configure.ac: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebCore: The "@supports" rule is a conditional group rule whose condition tests whether the user agent supports CSS property:value pairs. http://dev.w3.org/csswg/css3-conditional/#at-supports Test: css3/supports.html * Configurations/FeatureDefines.xcconfig: * GNUmakefile.am: * GNUmakefile.features.am: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. * css/CSSGrammar.y.in: * css/CSSParser.cpp: (WebCore): (WebCore::CSSParser::detectSupportsToken): Tries to find 'and', 'not' and 'or' tokens. (WebCore::CSSParser::detectAtToken): Enter SupportsMode if @supports is detected. (WebCore::CSSParser::realLex): Try to detect supports tokens when in SupportsMode. * css/CSSParser.h: Added new SupportsMode parsing mode. (CSSParser): Source/WebKit/chromium: * features.gypi: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit/mac: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit2: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Tools: * Scripts/webkitperl/FeatureList.pm: * qmake/mkspecs/features/features.pri: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. WebKitLibraries: * win/tools/vsprops/FeatureDefines.vsprops: * win/tools/vsprops/FeatureDefinesCairo.vsprops: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. LayoutTests: * css3/supports-expected.txt: Added. * css3/supports.html: Added. * platform/chromium/TestExpectations: * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/qt/TestExpectations: * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * platform/wk2/TestExpectations: Skip the test until the feature is enabled. Canonical link: https://commits.webkit.org/117727@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-18 18:43:15 +00:00
<style>
.test {
content: "UNTOUCHED";
}
@supports (display: none) {
#t0 { content: "APPLIED" }
}
@supports (display: deadbeef) {
#t1 { content: "FAIL" }
}
/* Negation */
@supports not (display: deadbeef) {
#t2 { content: "APPLIED" }
}
@supports not (display: none) {
#t3 { content: "FAIL" }
}
@supports not (not (display: none)) {
#t4 { content: "APPLIED" }
}
@supports not (not (not (display: none))) {
#t5 { content: "FAIL" }
}
/* Conjunction */
@supports (display: none) and (display: block) {
#t6 { content: "APPLIED" }
}
@supports (display: none) and (display: block) and (display: inline) {
#t7 { content: "APPLIED" }
}
@supports (display: none) and (display: block) and (display: deadbeef) and (display: inline) {
#t8 { content: "FAIL" }
}
/* Disjunction */
@supports (display: none) or (display: inline) {
#t9 { content: "APPLIED" }
}
@supports (display: none) or (display: block) or (display: inline) {
#t10 { content: "APPLIED" }
}
@supports (display: none) or (display: deadbeef) or (display: inline) {
#t11 { content: "APPLIED" }
}
@supports (display: ohhai) or (display: deadbeef) or (display: rainbows) {
#t12 { content: "FAIL" }
}
/* Bad syntax. Can't mix operators without a layer of parentheses. */
@supports (display: none) and (display: block) or (display: inline) {
#t13 { content: "FAIL" }
}
@supports not (display: deadbeef) and (display: block) {
#t14 { content: "FAIL" }
}
/* Mix 'n match */
@supports (not (border: 1px 1px 1px 1px 1px solid #000)) and (display: block) {
#t15 { content: "APPLIED" }
}
@supports (display: block !important) and ((display: inline) or (display: deadbeef)){
#t16 { content: "APPLIED" }
}
@supports not ((not (display: block)) or ((display: none) and (deadbeef: 1px))) {
#t17 { content: "APPLIED" }
}
/* Whitespace/Syntax */
@supports not( display: deadbeef) {
#t22 { content: "APPLIED" }
}
@supports (display: none)and ( -webkit-transition: all 1s ) {
#t23 { content: "APPLIED" }
}
@supports (display: none)or(-webkit-transition: all 1s) {
#t24 { content: "APPLIED" }
}
@supports (display: none) or(-webkit-transition: all 1s ) {
#t25 { content: "APPLIED" }
}
@supports (((((((display: none))))))) {
#t26 { content: "APPLIED" }
}
@supports(((((((display: none))))))) {
#t27 { content: "APPLIED" }
}
@supports (!important) {
#t28 { content: "FAIL" }
}
@supports not not not not (display: none) {
#t29 { content: "FAIL" }
}
/* Functions */
@supports (top: -webkit-calc(80% - 20px)) {
#t30 { content: "APPLIED" }
}
@supports (background-color: rgb(0, 128, 0)) {
#t31 { content: "APPLIED" }
}
@supports (background: url("/blah")) {
#t32 { content: "APPLIED" }
}
@supports ((top: -webkit-calc(80% - 20px)) and (not (background-color: rgb(0, 128, 0)))) or (background: url("/blah")) {
#t33 { content: "APPLIED" }
}
@supports (background: invalid("/blah")) {
#t34 { content: "FAIL" }
}
Implement CSSSupportsRule https://bugs.webkit.org/show_bug.cgi?id=104822 Patch by Pablo Flouret <pablof@motorola.com> on 2013-01-16 Reviewed by Allan Sandfeld Jensen. Source/WebCore: http://dev.w3.org/csswg/css3-conditional/#the-csssupportsrule-interface Right now, @supports is not implemented as a proper CSSRule. Apart from the CSSOM implications it gives wrong results when, for instance, an @supports rule is nested inside a @media rule. Test: css3/supports-cssom.html * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * DerivedSources.pri: * GNUmakefile.list.am: * Target.pri: * WebCore.exp.in: * WebCore.gypi: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: Add CSSSupportsRule.* and associated files. * bindings/js/JSCSSRuleCustom.cpp: (WebCore::toJS): * bindings/objc/DOMCSS.mm: (kitClass): * bindings/v8/custom/V8CSSRuleCustom.cpp: (WebCore::wrap): Create the correct wrappers for the rule. * css/CSSGrammar.y.in: * css/CSSParser.cpp: (WebCore::CSSParser::createSupportsRule): (WebCore::CSSParser::markSupportsRuleHeaderStart): (WebCore::CSSParser::markSupportsRuleHeaderEnd): * css/CSSParser.h: Create the supports rule when parsing and add it where it corresponds, instead of directly adding the child rules to the stylesheet. * css/CSSPropertySourceData.h: * css/CSSRule.h: * css/CSSRule.idl: Add SUPPORTS_RULE type to enums. * css/CSSSupportsRule.cpp: Added. (WebCore::CSSSupportsRule::CSSSupportsRule): (WebCore::CSSSupportsRule::~CSSSupportsRule): (WebCore::CSSSupportsRule::cssText): (WebCore::CSSSupportsRule::conditionText): * css/CSSSupportsRule.h: Added. (WebCore::CSSSupportsRule::create): * css/CSSSupportsRule.idl: Added. DOM interface. * css/RuleSet.cpp: (WebCore::RuleSet::addChildRules): Add rules included in the @supports rule. * css/StyleResolver.cpp: (WebCore::collectCSSOMWrappers): Collect CSSSupportsRule wrappers. * css/StyleRule.cpp: (WebCore::StyleRuleBase::reportMemoryUsage): (WebCore::StyleRuleBase::destroy): (WebCore::StyleRuleBase::copy): (WebCore::StyleRuleBase::createCSSOMWrapper): (WebCore::StyleRuleSupports::StyleRuleSupports): * css/StyleRule.h: (StyleRuleBase): (WebCore::StyleRuleBase::isSupportsRule): (StyleRuleSupports): (WebCore::StyleRuleSupports::create): (WebCore::StyleRuleSupports::conditionText): (WebCore::StyleRuleSupports::conditionIsSupported): (WebCore::StyleRuleSupports::copy): (WebCore::toStyleRuleSupports): New subclass of StyleRuleBlock: StyleRuleSupports. * css/StyleSheetContents.cpp: (WebCore::childRulesHaveFailedOrCanceledSubresources): * inspector/InspectorStyleSheet.cpp: (flattenSourceData): (WebCore::asCSSRuleList): Handle @supports rules where needed. LayoutTests: * css3/supports-cssom-expected.txt: Added. * css3/supports-cssom.html: Added. * css3/supports-expected.txt: * css3/supports.html: * platform/chromium/TestExpectations: * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/qt/TestExpectations: * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * platform/wk2/TestExpectations: Canonical link: https://commits.webkit.org/125247@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139866 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-01-16 11:30:50 +00:00
/* Nesting. */
@supports (display: none) {
@supports (display: deadbeef) {
#t18 { content: "FAIL" }
}
@supports (display: inline) {
#t19 { content: "APPLIED" }
}
@supports (display: inline) {
}
@media all {
#t20 { content: "APPLIED" }
@supports (display: inline) {
#t21 { content: "APPLIED" }
}
}
}
@media all {
@supports (display: inline) {
@media all {
@supports (display: none) {
#t35 { content: "APPLIED" }
}
}
}
}
@media not all {
@supports (display: none) {
#t36 { content: "FAIL" }
}
}
/* Invalid syntax error recovery */
@supports (display: none);
@supports (display: none) and ( (display: none) ) {
#t37 { content: "APPLIED" }
}
@supports (display: none)) ;
@supports (display: none) {
#t38 { content: "APPLIED" }
}
@supports;
@supports (display: none) {
#t39 { content: "APPLIED" }
}
@supports ;
@supports (display: none) {
#t40 { content: "APPLIED" }
}
@supports (display: none)) {
#t41 { content: "FAIL" }
}
@supports (display: none) {
#t41 { content: "APPLIED" }
}
@supports (display: )) {
#t42 { content: "FAIL" }
}
@supports (display: none) {
#t42 { content: "APPLIED" }
}
@supports ((display: none) and {
#t43 { content: "FAIL" }
}
@supports (display: none) {
#t43 { content: "FAIL" }
}
);
@supports ((display: none) and ;
@supports (display: none) {
#t44 { content: "FAIL" }
}
);
Implement css3-conditional's @supports rule https://bugs.webkit.org/show_bug.cgi?id=86146 Patch by Pablo Flouret <pablof@motorola.com> on 2012-10-18 Reviewed by Antti Koivisto. .: * Source/cmake/WebKitFeatures.cmake: * Source/cmakeconfig.h.cmake: * configure.ac: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebCore: The "@supports" rule is a conditional group rule whose condition tests whether the user agent supports CSS property:value pairs. http://dev.w3.org/csswg/css3-conditional/#at-supports Test: css3/supports.html * Configurations/FeatureDefines.xcconfig: * GNUmakefile.am: * GNUmakefile.features.am: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. * css/CSSGrammar.y.in: * css/CSSParser.cpp: (WebCore): (WebCore::CSSParser::detectSupportsToken): Tries to find 'and', 'not' and 'or' tokens. (WebCore::CSSParser::detectAtToken): Enter SupportsMode if @supports is detected. (WebCore::CSSParser::realLex): Try to detect supports tokens when in SupportsMode. * css/CSSParser.h: Added new SupportsMode parsing mode. (CSSParser): Source/WebKit/chromium: * features.gypi: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit/mac: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit2: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Tools: * Scripts/webkitperl/FeatureList.pm: * qmake/mkspecs/features/features.pri: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. WebKitLibraries: * win/tools/vsprops/FeatureDefines.vsprops: * win/tools/vsprops/FeatureDefinesCairo.vsprops: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. LayoutTests: * css3/supports-expected.txt: Added. * css3/supports.html: Added. * platform/chromium/TestExpectations: * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/qt/TestExpectations: * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * platform/wk2/TestExpectations: Skip the test until the feature is enabled. Canonical link: https://commits.webkit.org/117727@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-18 18:43:15 +00:00
</style>
</head>
<body>
<div id="test_container"></div>
<script>
description("Test the @supports rule.");
var numTests = 45;
var untouchedTests = [1, 3, 5, 8, 12, 13, 14, 18, 28, 29, 34, 36, 43, 44]; // Tests whose content shouldn't change from the UNTOUCHED default.
Implement css3-conditional's @supports rule https://bugs.webkit.org/show_bug.cgi?id=86146 Patch by Pablo Flouret <pablof@motorola.com> on 2012-10-18 Reviewed by Antti Koivisto. .: * Source/cmake/WebKitFeatures.cmake: * Source/cmakeconfig.h.cmake: * configure.ac: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebCore: The "@supports" rule is a conditional group rule whose condition tests whether the user agent supports CSS property:value pairs. http://dev.w3.org/csswg/css3-conditional/#at-supports Test: css3/supports.html * Configurations/FeatureDefines.xcconfig: * GNUmakefile.am: * GNUmakefile.features.am: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. * css/CSSGrammar.y.in: * css/CSSParser.cpp: (WebCore): (WebCore::CSSParser::detectSupportsToken): Tries to find 'and', 'not' and 'or' tokens. (WebCore::CSSParser::detectAtToken): Enter SupportsMode if @supports is detected. (WebCore::CSSParser::realLex): Try to detect supports tokens when in SupportsMode. * css/CSSParser.h: Added new SupportsMode parsing mode. (CSSParser): Source/WebKit/chromium: * features.gypi: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit/mac: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit2: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Tools: * Scripts/webkitperl/FeatureList.pm: * qmake/mkspecs/features/features.pri: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. WebKitLibraries: * win/tools/vsprops/FeatureDefines.vsprops: * win/tools/vsprops/FeatureDefinesCairo.vsprops: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. LayoutTests: * css3/supports-expected.txt: Added. * css3/supports.html: Added. * platform/chromium/TestExpectations: * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/qt/TestExpectations: * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * platform/wk2/TestExpectations: Skip the test until the feature is enabled. Canonical link: https://commits.webkit.org/117727@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-18 18:43:15 +00:00
var container = document.getElementById("test_container");
for (var i=0; i < numTests; i++) {
var div = document.createElement("div");
div.id = "t" + i;
div.className = "test";
container.appendChild(div);
Handle custom identifiers and strings separately, so we can quote strings correctly consistently https://bugs.webkit.org/show_bug.cgi?id=226694 Reviewed by Sam Weinig. LayoutTests/imported/w3c: * web-platform-tests/css/css-animations/parsing/animation-name-valid-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-negative-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-pad-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-prefix-suffix-syntax-expected.txt: * web-platform-tests/css/css-counter-styles/counter-style-symbols-syntax-expected.txt: * web-platform-tests/css/css-grid/parsing/grid-area-computed-expected.txt: * web-platform-tests/css/css-grid/parsing/grid-area-shorthand-expected.txt: * web-platform-tests/css/css-grid/parsing/grid-area-valid-expected.txt: * web-platform-tests/css/css-lists/parsing/content-invalid-expected.txt: * web-platform-tests/css/css-transitions/transition-property-002-expected.txt: * web-platform-tests/css/cssom/getComputedStyle-pseudo-expected.txt: * web-platform-tests/css/cssom/serialize-values-expected.txt: Rebased to reflect progressions. In some cases the entire test passes, in other cases we still have failures, but the string serialization part of the test has progressed. Source/WebCore: Progressions in a number of WPT tests. * animation/CSSAnimation.cpp: (WebCore::CSSAnimation::CSSAnimation): Update since Animation::name() now returns a struct. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): Ditto. * css/CSSComputedStyleDeclaration.cpp: (WebCore::OrderedNamedLinesCollector::appendLines const): Use createCustomIdent for line names. (WebCore::valueForGridPosition): Use createCustomIdent for grid line name. (WebCore::createTransitionPropertyValue): Use createCustomIdent for animation property names. (WebCore::counterToCSSValue): Use createCustomIdent for counter names. (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): Use createCustomIdent for list-style-type, locale, animation names if they were created from a custom-ident, and line-grid. * css/CSSCustomIdentValue.cpp: Emptied out this file; we can delete it soon. * css/CSSCustomIdentValue.h: Ditto. * css/CSSMarkup.cpp: (WebCore::serializeCharacterAsCodePoint): Optimized to do a single StringBuilder::append call. (WebCore::serializeAsStringOrCustomIdent): Deleted. * css/CSSMarkup.h: Removed serializeAsStringOrCustomIdent. * css/CSSPrimitiveValue.cpp: (WebCore::isValidCSSUnitTypeForDoubleConversion): Added a case for CustomIdent. Changed CSS_IDENT to assert not reached, since it should never be passed to this function. More cleanup of CSSUnitType is needed, but for now mostly leaving it alone. (WebCore::isStringType): Added a case for CustomIdent. Moved CSS_DIMENSION, which was incorrectly returning true, to return false. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. (WebCore::CSSPrimitiveValue::primitiveType const): Added transformation from CustomIdent to CSS_IDENT as we do with CSS_PROPERTY_ID and CSS_VALUE_ID. (WebCore::CSSPrimitiveValue::cleanup): Added a case for CustomIdent. Moved CSS_DIMENSION to the correct section. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. (WebCore::CSSPrimitiveValue::setFloatValue): Deleted. (WebCore::CSSPrimitiveValue::setStringValue): Deleted. (WebCore::CSSPrimitiveValue::getStringValue const): Deleted. (WebCore::CSSPrimitiveValue::stringValue const): Added a case for CustomIdent. (WebCore::CSSPrimitiveValue::unitTypeString): Added a case for CustomIdent and an ASSERT_NOT_REACHED for invalid enumeration values. (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Removed inaccurate FIXME comment for CSS_DIMENSION and changed it to do something less wrong, but still incorrect. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. Changed CSS_STRING case to always serializeAsString. Added a CustomIdent case that always serializes as an identifier. (WebCore::CSSPrimitiveValue::equals const): Moved the CSS_DIMENSION to the correct part of this switch statement. Pretty sure there's no way to create one of these with CSS_DIMENSION, but this is less peculiar. Added case for CustomIdent. * css/CSSPrimitiveValue.h: Made isFontRelativeLength, isResolution, and isViewportPercentageLength private. Made those plus isLength all constexpr. Removed WEBCORE_EXPORT from primitiveType and getFloatValue: those needed to be exported when this was the web-exposed class, but that is now DeprecatedCSSOMPrimitiveValue. Deleted setFloatValue, setStringValue, and getStringValue for the same reason: those functions are now in DeprecatedCSSOMPrimitiveValue and don't need to be here. * css/CSSToStyleMap.cpp: (WebCore::CSSToStyleMap::mapAnimationName): Updated to pass a boolean in to the animation name to keep track of whether it was created with a string or a custom-ident so we it can properly round-trip in computed style. This is required to pass some of the WPT tests, although I could not find clear guidance in the specification that this behavior is required. The same name with a string and custom-ident are equivalent in other ways. * css/CSSUnits.cpp: (WebCore::operator<<): Added a case for CustomIdent. * css/CSSUnits.h: Added CustomIdent. Added some FIXME about how we can change this in the future. It's a remnant of the past when these were part of our web-facing API, and this can be greatly cleaned up. * css/CSSValue.cpp: (WebCore::CSSValue::cssText const): Removed CSSCustomIdentValue.h, CustomIdentClass, CSSCustomIdentValue. We are not going to use a separate class for custom-ident, just a separate type of primitive value. (WebCore::CSSValue::destroy): Ditto. * css/CSSValue.h: Deleted isCustomIdentValue and CustomIdentClass. * css/CSSValueList.cpp: (WebCore::CSSValueList::customCSSText const): Tweaked algorithm to be slightly more efficient. * css/CSSValuePool.h: Added createCustomIdent. Later should remove the create function that takes a string value and a type and use separate named functions for the few different cases, but doing the new one this way for now. * css/DeprecatedCSSOMPrimitiveValue.cpp: (WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType const): Rewrote this to be a switch that preserves the current behavior but no longer relies on the numeric values of CSSUnitType values. Added a FIXME about using CSS_UNKNOWN more: some of the numbers we are exposing to the web are doing no good. (WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue): Moved this function to the header. (WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue const): Rewrote this to be a switch as above. Preserves current behavior but stops relying on CSSUnitType numeric values. (WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue): Moved this function to the header. (WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue const): Ditto. By putting a switch on primitiveType here, we can enforce the desired exception behavior here, instead of getting it from CSSPrimitiveValue, and it's better for this class to deal with the legacy bindings issues. (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue const): Ditto. (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue const): Ditto. (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue const): Ditto. * css/DeprecatedCSSOMPrimitiveValue.h: Removed unneeded cssValueType function. Made both setFloatValue and setStringValue simpler since they always raise an exception and we do not intend to change that. Also stop using protected since we have no classes derived from this. Could do more cleanup, but this is a start. * css/DeprecatedCSSOMValue.cpp: (WebCore::DeprecatedCSSOMValue::cssValueType const): Put the constant values, CSS_PRIMITIVE_VALUE and CSS_VALUE_LIST, here rather than calling member functions. * css/DeprecatedCSSOMValueList.cpp: (WebCore::DeprecatedCSSOMValueList::cssText const): Tweaked to make the code more efficient. * css/DeprecatedCSSOMValueList.h: Removed unneeded cssValueType function and const overload of item function. Also stop using protected since we have no classes derived from this. * css/MediaQueryExpression.cpp: (WebCore::featureWithValidIdent): Fixed indentation to match WebKit style. (WebCore::featureWithValidDensity): Ditto. (WebCore::featureWithValidPositiveLength): Ditto. (WebCore::featureExpectingPositiveInteger): Ditto. (WebCore::featureWithPositiveNumber): Ditto. * css/calc/CSSCalcCategoryMapping.cpp: (WebCore::hasDoubleValue): Added a case for CustomIdent. * css/parser/CSSPropertyParser.cpp: (WebCore::consumeWillChange): Removed comment saying we should use CSSCustomIdentValue since using a property ID for the value is great. (WebCore::consumeAnimationName): Removed comment saying we should use CSSCustomIdentValue here because that would be incorrect: we need to preserve and round-trip the fact that this was string, not custom-ident. (WebCore::consumeTransitionProperty): Remove special case for CSSValueAll that wasn't doing anything. Removed comment saying we should use CSSCustomIdentValue since using a value ID for the value is great. (WebCore::consumeAttr): Updated comment. (WebCore::isCustomIdentValue): Updated to work with the new primitive value. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomIdent): Use the new createCustomIdent and removed an outdated comment. While we might some day want to implement custom-ident differently, we won't need to change the code here to make that happen. * platform/animation/Animation.cpp: (WebCore::Animation::animationsMatch const): Update since m_name now is a struct. (WebCore::Animation::initialName): Update to return Name instead of String. (WebCore::operator<<): Update since name() now returns a struct. * platform/animation/Animation.h: Added the Name struct so we can store a boolean to indicate whether it's a string or custom-ident for round tripping. Update types and implementations of function and data members accordingly. * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::createGridPosition): Update code to expect custom-ident instead of string; they used to both be the same thing. * style/Styleable.cpp: (WebCore::shouldConsiderAnimation): Update since Animation::name() now returns a struct. Also got rid of unsuccessful attempt to optimize comparison againt the string "none"; later might be good to clean out that special case. (WebCore::Styleable::updateCSSAnimations const): Ditto. Tools: * TestRunnerShared/TestFeatures.cpp: (WTR::parseTestHeader): Fixed a missing quote that made a log message read strangely. LayoutTests: * TestExpectations: Removed expected failures from 13 css-counter-styles tests that are not currently failing. I had planned to work on making more of these pass, but first found I could fix them with a corrected custom-ident implementation. * css3/supports-expected.txt: Rebased. * css3/supports.html: Updated to expect the value of the content property to be a quoted string, rather than the old behavior, which was to leave the string unquoted if it happened to be a string with all characters legal for a custom-ident. New expectation is the correct behavior. * fast/css/alt-inherit-initial-expected.txt: Rebased. * fast/css/alt-inherit-initial.html: Updated to expect the value of the language property to be a custom-ident, and serialize unusual cases with custom-ident rules, not as a quoted string. New expectation is the correct behavior. * fast/css/content-language-comma-separated-list-expected.txt: Ditto. * fast/css/content-language-empty-expected.txt: Ditto. * fast/css/content-language-only-whitespace-expected.txt: Ditto. * fast/css/content-language-with-whitespace-expected.txt: Ditto. * fast/css/getComputedStyle/computed-style-properties-expected.txt: Rebased. * fast/css/getComputedStyle/computed-style-properties.html: Expect content string (see above). * fast/css/lang-mapped-to-webkit-locale-expected.txt: Rebased. * fast/css/lang-mapped-to-webkit-locale.xhtml: Expect language custom-ident (see above). * fast/css/nested-at-rules-expected.txt: Rebased. * fast/css/nested-at-rules.html: Expect content string (see above). * fast/css/parsing-text-emphasis-expected.txt: Rebased. * fast/css/parsing-text-emphasis.html: Updated to expect strings to remaing quoted strings in the text-emphasis property, not change into custom-ident if all characters happen to fit. * fast/encoding/css-charset-default-expected.txt: Expect content string (see above). * inspector/css/pseudo-element-matches-for-pseudo-element-node-expected.txt: Ditto. Canonical link: https://commits.webkit.org/238538@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-07 02:39:33 +00:00
shouldBeEqualToString("getComputedStyle(document.getElementById('t"+i+"')).content", untouchedTests.indexOf(i) >= 0 ? '"UNTOUCHED"' : '"APPLIED"');
Implement css3-conditional's @supports rule https://bugs.webkit.org/show_bug.cgi?id=86146 Patch by Pablo Flouret <pablof@motorola.com> on 2012-10-18 Reviewed by Antti Koivisto. .: * Source/cmake/WebKitFeatures.cmake: * Source/cmakeconfig.h.cmake: * configure.ac: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebCore: The "@supports" rule is a conditional group rule whose condition tests whether the user agent supports CSS property:value pairs. http://dev.w3.org/csswg/css3-conditional/#at-supports Test: css3/supports.html * Configurations/FeatureDefines.xcconfig: * GNUmakefile.am: * GNUmakefile.features.am: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. * css/CSSGrammar.y.in: * css/CSSParser.cpp: (WebCore): (WebCore::CSSParser::detectSupportsToken): Tries to find 'and', 'not' and 'or' tokens. (WebCore::CSSParser::detectAtToken): Enter SupportsMode if @supports is detected. (WebCore::CSSParser::realLex): Try to detect supports tokens when in SupportsMode. * css/CSSParser.h: Added new SupportsMode parsing mode. (CSSParser): Source/WebKit/chromium: * features.gypi: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit/mac: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit2: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Tools: * Scripts/webkitperl/FeatureList.pm: * qmake/mkspecs/features/features.pri: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. WebKitLibraries: * win/tools/vsprops/FeatureDefines.vsprops: * win/tools/vsprops/FeatureDefinesCairo.vsprops: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. LayoutTests: * css3/supports-expected.txt: Added. * css3/supports.html: Added. * platform/chromium/TestExpectations: * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/qt/TestExpectations: * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * platform/wk2/TestExpectations: Skip the test until the feature is enabled. Canonical link: https://commits.webkit.org/117727@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-18 18:43:15 +00:00
}
test_container.parentNode.removeChild(test_container);
</script>
Change LayoutTests' c* files to use pre and post js files in LayoutTests/resources. https://bugs.webkit.org/show_bug.cgi?id=120986. Rubber stamped by Filip Pizlo. * canvas/philip/tests/2d.composite.globalComposite.html: * compositing/repaint/shrink-layer.html: * css1/units/rounding.html: * css3/calc/color-hsl.html: * css3/calc/color-rgb.html: * css3/calc/font-size-fractional.html: * css3/calc/font-size.html: * css3/calc/font.html: * css3/calc/getComputedStyle-margin-percentage.html: * css3/calc/line-height.html: * css3/calc/margin.html: * css3/calc/table-border-spacing.html: * css3/calc/table-calcs.html: * css3/calc/zoom-with-em.html: * css3/compositing/background-blend-mode-property-parsing.html: * css3/compositing/background-blend-mode-property.html: * css3/compositing/blend-mode-property-parsing-invalid.html: * css3/compositing/blend-mode-property-parsing.html: * css3/compositing/blend-mode-property.html: * css3/compositing/should-have-compositing-layer.html: * css3/filters/custom-with-at-rule-syntax/parsing-at-rule-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-at-rule-valid.html: * css3/filters/custom-with-at-rule-syntax/parsing-custom-function-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-custom-function-valid.html: * css3/filters/custom-with-at-rule-syntax/parsing-geometry-property-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-geometry-property-valid.html: * css3/filters/custom-with-at-rule-syntax/parsing-mix-property-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-mix-property-valid.html: * css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid.html: * css3/filters/custom-with-at-rule-syntax/parsing-src-property-invalid.html: * css3/filters/custom-with-at-rule-syntax/parsing-src-property-valid.html: * css3/filters/custom/custom-filter-crash-inline-computed-style.html: * css3/filters/custom/custom-filter-mix-bindings.html: * css3/filters/custom/custom-filter-property-computed-style.html: * css3/filters/custom/custom-filter-property-parsing-invalid.html: * css3/filters/custom/custom-filter-property-parsing.html: * css3/filters/custom/effect-custom-disabled.html: * css3/filters/effect-reference-delete-crash.html: * css3/filters/effect-reference-reset-style-delete-crash.html: * css3/filters/filter-property-computed-style.html: * css3/filters/filter-property-parsing-invalid.html: * css3/filters/filter-property-parsing.html: * css3/filters/filter-property.html: * css3/filters/script-tests/TEMPLATE.html: * css3/filters/should-not-have-compositing-layer.html: * css3/flexbox/align-absolute-child.html: * css3/flexbox/css-properties.html: * css3/flexbox/display-flexbox-set-get.html: * css3/flexbox/flex-align-baseline.html: * css3/flexbox/flex-flow-initial.html: * css3/flexbox/flex-longhand-parsing.html: * css3/flexbox/flex-property-parsing.html: * css3/flexbox/flexitem-no-margin-collapsing.html: * css3/flexbox/overflow-keep-scrollpos.html: * css3/font-feature-settings-parsing.html: * css3/supports-cssom.html: * css3/supports-dom-api.html: * css3/supports.html: * css3/unicode-bidi-insolate-parse.html: * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle.html: * css3/zoom-coords.xhtml: Canonical link: https://commits.webkit.org/138879@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-08 02:07:30 +00:00
<script src="../resources/js-test-post.js"></script>
Implement css3-conditional's @supports rule https://bugs.webkit.org/show_bug.cgi?id=86146 Patch by Pablo Flouret <pablof@motorola.com> on 2012-10-18 Reviewed by Antti Koivisto. .: * Source/cmake/WebKitFeatures.cmake: * Source/cmakeconfig.h.cmake: * configure.ac: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebCore: The "@supports" rule is a conditional group rule whose condition tests whether the user agent supports CSS property:value pairs. http://dev.w3.org/csswg/css3-conditional/#at-supports Test: css3/supports.html * Configurations/FeatureDefines.xcconfig: * GNUmakefile.am: * GNUmakefile.features.am: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. * css/CSSGrammar.y.in: * css/CSSParser.cpp: (WebCore): (WebCore::CSSParser::detectSupportsToken): Tries to find 'and', 'not' and 'or' tokens. (WebCore::CSSParser::detectAtToken): Enter SupportsMode if @supports is detected. (WebCore::CSSParser::realLex): Try to detect supports tokens when in SupportsMode. * css/CSSParser.h: Added new SupportsMode parsing mode. (CSSParser): Source/WebKit/chromium: * features.gypi: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit/mac: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Source/WebKit2: * Configurations/FeatureDefines.xcconfig: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. Tools: * Scripts/webkitperl/FeatureList.pm: * qmake/mkspecs/features/features.pri: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. WebKitLibraries: * win/tools/vsprops/FeatureDefines.vsprops: * win/tools/vsprops/FeatureDefinesCairo.vsprops: Add an ENABLE_CSS3_CONDITIONAL_RULES flag. LayoutTests: * css3/supports-expected.txt: Added. * css3/supports.html: Added. * platform/chromium/TestExpectations: * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/qt/TestExpectations: * platform/win/TestExpectations: * platform/wincairo/TestExpectations: * platform/wk2/TestExpectations: Skip the test until the feature is enabled. Canonical link: https://commits.webkit.org/117727@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-18 18:43:15 +00:00
</body>
</html>