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

104 lines
1.9 KiB
Plaintext
Raw Permalink Normal View History

Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Specified in parent, inherits=true
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Specified in parent, inherits=false
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Specified in parent, not registered
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Initial
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Unset, inherits=true
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Unset, inherits=false
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
A cycle between an inherits=true and inherits=false property
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
A cycle between an inherits=true and inherits=false property
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
A cycle between an inherits=true and inherits=false property with fallback
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Inheritance should not create a cycle
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
A cycle between two unregistered properties
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Revert, inherits=true
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Revert, inherits=false
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Revert, unregistered
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Inherit, unregistered
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Test that inherited properties do variable substitution before being inherited - registered
test
Test that inherited properties do variable substitution before being inherited - unregistered
test
No initial value in registered property should act like unregistered
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
(unregistered)
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
Inherit should be substituted for unregistered property
Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Re-import tests and adjust expected results. Some of the tests go from pass to fail because this patch adds some extra dependency checking to property registrations to fix a crash, but now unsupported syntaxes like <length-percentage> do not register properly. * web-platform-tests/css/css-properties-values-api/register-property-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing-expected.txt: * web-platform-tests/css/css-properties-values-api/register-property-syntax-parsing.html: * web-platform-tests/css/css-properties-values-api/register-property.html: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance.html: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation.html: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom.html: * web-platform-tests/css/css-properties-values-api/registered-property-initial-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-initial.html: * web-platform-tests/css/css-properties-values-api/resources/utils.js: Added. (generate_name): (any_initial_value): (generate_property): (all_syntaxes): * web-platform-tests/css/css-properties-values-api/resources/w3c-import.log: Added. * web-platform-tests/css/css-properties-values-api/self-utils-expected.txt: Added. * web-platform-tests/css/css-properties-values-api/self-utils.html: Added. * web-platform-tests/css/css-properties-values-api/typedom.tentative-expected.txt: * web-platform-tests/css/css-properties-values-api/typedom.tentative.html: * web-platform-tests/css/css-properties-values-api/unit-cycles-expected.txt: * web-platform-tests/css/css-properties-values-api/unit-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-cycles.html: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties-expected.txt: * web-platform-tests/css/css-properties-values-api/var-reference-registered-properties.html: * web-platform-tests/css/css-properties-values-api/w3c-import.log: Source/WebCore: Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): LayoutTests: * css-custom-properties-api/crash.html: * css-custom-properties-api/inherits-expected.txt: * css-custom-properties-api/inherits.html: * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: Canonical link: https://commits.webkit.org/207412@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-19 03:21:15 +00:00
test
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00
PASS Registration is successful
PASS JS Attributes are valid for element 1
PASS JS Attributes are valid for element 2
PASS JS Attributes are valid for element 3
PASS JS Attributes are valid for element 4
PASS JS Attributes are valid for element 5
PASS JS Attributes are valid for element 6
PASS JS Attributes are valid for element 7
PASS JS Attributes are valid for element 8
PASS JS Attributes are valid for element 9
PASS JS Attributes are valid for element 10
PASS JS Attributes are valid for element 11
PASS JS Attributes are valid for element 12
PASS JS Attributes are valid for element 13
PASS JS Attributes are valid for element 14
PASS JS Attributes are valid for element 14-1
PASS JS Attributes are valid for element 15
PASS JS Attributes are valid for element 16
PASS JS Attributes are valid for element 17
PASS JS Attributes are valid for element 18
PASS JS Attributes are valid for element 19
Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-10-03 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Update web platform tests for css registered custom properties to fail in a different way. * web-platform-tests/css/css-properties-values-api/registered-properties-inheritance-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-computation-expected.txt: * web-platform-tests/css/css-properties-values-api/registered-property-cssom-expected.txt: * web-platform-tests/css/css-properties-values-api/url-resolution-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: Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. LayoutTests: Add tests to check css registered custom properties with inherits. Also test calc expression evaluation for inherited registered custom properties. * css-custom-properties-api/inherits-expected.txt: Added. * css-custom-properties-api/inherits.html: Added. * css-custom-properties-api/length-expected.txt: Added. * css-custom-properties-api/length.html: Added. * css-custom-properties-api/length2-expected.txt: Added. * css-custom-properties-api/length2.html: Added. Canonical link: https://commits.webkit.org/205226@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-04 06:23:02 +00:00