haikuwebkit/LayoutTests/css-custom-properties-api/inline-expected.txt

16 lines
666 B
Plaintext
Raw Permalink Normal View History

CSS Custom Properties API Should Support syntax="*" and "<length>", and handle cycles properly https://bugs.webkit.org/show_bug.cgi?id=191042 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: Source/WebCore: Refactor code so that: - All properties applied in StyleResolver::applyMatchedProperties are only applied once. - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved every time they were referenced, and again in RenderStyle. - The font-size property is applied after its variable references, but before custom properties that depend on it. - Cycles are detected at the same time as resolution. - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type. If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty. This behaviour matches chrome, but is not documented in the spec. - Custom property values have more explicit resolved/unresolved state. - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties. Tests: css-custom-properties-api/crash.html css-custom-properties-api/cycles.html css-custom-properties-api/inline.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::equals const): (WebCore::CSSCustomPropertyValue::customCSSText const): (WebCore::CSSCustomPropertyValue::tokens const): (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted. (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted. (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted. * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): * css/CSSRegisteredCustomProperty.h: * css/CSSVariableData.cpp: (WebCore::CSSVariableData::CSSVariableData): (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted. (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted. (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted. (WebCore::CSSVariableData::resolveVariableFallback const): Deleted. (WebCore::CSSVariableData::resolveVariableReference const): Deleted. (WebCore::CSSVariableData::resolveVariableReferences const): Deleted. (WebCore::CSSVariableData::resolveTokenRange const): Deleted. * css/CSSVariableData.h: (WebCore::CSSVariableData::create): (WebCore::CSSVariableData::createResolved): Deleted. (WebCore::CSSVariableData::needsVariableResolution const): Deleted. (WebCore::CSSVariableData::CSSVariableData): Deleted. * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableFallback): (WebCore::resolveVariableReference): (WebCore::resolveTokenRange): (WebCore::CSSVariableReferenceValue::resolveVariableReferences const): (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted. * css/CSSVariableReferenceValue.h: (WebCore::CSSVariableReferenceValue::create): (WebCore::CSSVariableReferenceValue::equals const): (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted. * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::setProperty): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleProperties.cpp: (WebCore::MutableStyleProperties::setCustomProperty): * css/StyleProperties.h: * css/StyleResolver.cpp: (WebCore::StyleResolver::State::setStyle): (WebCore::StyleResolver::styleForKeyframe): (WebCore::StyleResolver::styleForPage): (WebCore::StyleResolver::applyMatchedProperties): (WebCore::StyleResolver::applyPropertyToCurrentStyle): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties): (WebCore::StyleResolver::CascadedProperties::Property::apply): (WebCore::StyleResolver::applyCascadedCustomProperty): (WebCore::StyleResolver::applyCascadedProperties): * css/StyleResolver.h: * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::CSSPropertyParser): (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): (WebCore::CSSPropertyParser::parseValueStart): (WebCore::CSSPropertyParser::parseSingleValue): * css/parser/CSSPropertyParser.h: * css/parser/CSSVariableParser.cpp: (WebCore::CSSVariableParser::parseDeclarationValue): * dom/ConstantPropertyMap.cpp: (WebCore::ConstantPropertyMap::setValueForProperty): (WebCore::variableDataForPositivePixelLength): (WebCore::variableDataForPositiveDuration): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): * rendering/style/StyleCustomPropertyData.h: (WebCore::StyleCustomPropertyData::operator== const): (WebCore::StyleCustomPropertyData::setCustomPropertyValue): (WebCore::StyleCustomPropertyData::StyleCustomPropertyData): (): Deleted. LayoutTests: * css-custom-properties-api/crash-expected.txt: Added. * css-custom-properties-api/crash.html: Added. * css-custom-properties-api/cycles-expected.txt: Added. * css-custom-properties-api/cycles.html: Added. * css-custom-properties-api/inline-expected.txt: Added. * css-custom-properties-api/inline.html: Added. Canonical link: https://commits.webkit.org/205971@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-01 20:35:27 +00:00
test
PASS CSSOM setters function as expected for unregistered properties
PASS CSS.registerProperty
PASS Formerly valid values are still readable from inline styles but are computed as the unset value
PASS Values not matching the registered type can't be set
PASS Values can be removed from inline styles
PASS Stylesheets can be modified by CSSOM
PASS Valid values can be set on inline styles
PASS Var values are accepted
PASS Var values are accepted without validation
PASS Var values are accepted without validation, even when it is obvious they will not parse
PASS Var values are accepted without validation, even when it is obvious they will not parse (typed)
CSS Custom Properties API Should Support syntax="*" and "<length>", and handle cycles properly https://bugs.webkit.org/show_bug.cgi?id=191042 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: Source/WebCore: Refactor code so that: - All properties applied in StyleResolver::applyMatchedProperties are only applied once. - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved every time they were referenced, and again in RenderStyle. - The font-size property is applied after its variable references, but before custom properties that depend on it. - Cycles are detected at the same time as resolution. - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type. If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty. This behaviour matches chrome, but is not documented in the spec. - Custom property values have more explicit resolved/unresolved state. - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties. Tests: css-custom-properties-api/crash.html css-custom-properties-api/cycles.html css-custom-properties-api/inline.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::equals const): (WebCore::CSSCustomPropertyValue::customCSSText const): (WebCore::CSSCustomPropertyValue::tokens const): (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted. (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted. (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted. * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): * css/CSSRegisteredCustomProperty.h: * css/CSSVariableData.cpp: (WebCore::CSSVariableData::CSSVariableData): (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted. (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted. (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted. (WebCore::CSSVariableData::resolveVariableFallback const): Deleted. (WebCore::CSSVariableData::resolveVariableReference const): Deleted. (WebCore::CSSVariableData::resolveVariableReferences const): Deleted. (WebCore::CSSVariableData::resolveTokenRange const): Deleted. * css/CSSVariableData.h: (WebCore::CSSVariableData::create): (WebCore::CSSVariableData::createResolved): Deleted. (WebCore::CSSVariableData::needsVariableResolution const): Deleted. (WebCore::CSSVariableData::CSSVariableData): Deleted. * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableFallback): (WebCore::resolveVariableReference): (WebCore::resolveTokenRange): (WebCore::CSSVariableReferenceValue::resolveVariableReferences const): (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted. * css/CSSVariableReferenceValue.h: (WebCore::CSSVariableReferenceValue::create): (WebCore::CSSVariableReferenceValue::equals const): (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted. * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::setProperty): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleProperties.cpp: (WebCore::MutableStyleProperties::setCustomProperty): * css/StyleProperties.h: * css/StyleResolver.cpp: (WebCore::StyleResolver::State::setStyle): (WebCore::StyleResolver::styleForKeyframe): (WebCore::StyleResolver::styleForPage): (WebCore::StyleResolver::applyMatchedProperties): (WebCore::StyleResolver::applyPropertyToCurrentStyle): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties): (WebCore::StyleResolver::CascadedProperties::Property::apply): (WebCore::StyleResolver::applyCascadedCustomProperty): (WebCore::StyleResolver::applyCascadedProperties): * css/StyleResolver.h: * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::CSSPropertyParser): (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): (WebCore::CSSPropertyParser::parseValueStart): (WebCore::CSSPropertyParser::parseSingleValue): * css/parser/CSSPropertyParser.h: * css/parser/CSSVariableParser.cpp: (WebCore::CSSVariableParser::parseDeclarationValue): * dom/ConstantPropertyMap.cpp: (WebCore::ConstantPropertyMap::setValueForProperty): (WebCore::variableDataForPositivePixelLength): (WebCore::variableDataForPositiveDuration): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): * rendering/style/StyleCustomPropertyData.h: (WebCore::StyleCustomPropertyData::operator== const): (WebCore::StyleCustomPropertyData::setCustomPropertyValue): (WebCore::StyleCustomPropertyData::StyleCustomPropertyData): (): Deleted. LayoutTests: * css-custom-properties-api/crash-expected.txt: Added. * css-custom-properties-api/crash.html: Added. * css-custom-properties-api/cycles-expected.txt: Added. * css-custom-properties-api/cycles.html: Added. * css-custom-properties-api/inline-expected.txt: Added. * css-custom-properties-api/inline.html: Added. Canonical link: https://commits.webkit.org/205971@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-01 20:35:27 +00:00