haikuwebkit/LayoutTests/css-custom-properties-api/initialValue-expected.html

89 lines
1.9 KiB
HTML
Raw Permalink Normal View History

Implement initialValue support for CSS Custom Properties and Values API https://bugs.webkit.org/show_bug.cgi?id=189819 Patch by Justin Michaud <justin_michaud@apple.com> on 2018-09-21 Reviewed by Simon Fraser. Source/WebCore: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.h: * css/CSSVariableData.cpp: (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/DOMCSSRegisterCustomProperty.h: * css/DOMCSSRegisterCustomProperty.idl: * css/StyleResolver.cpp: (WebCore::StyleResolver::resolvedVariableValue): (WebCore::StyleResolver::applyCascadedProperties): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * dom/Document.h: (WebCore::Document::getCSSRegisteredCustomPropertySet const): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: LayoutTests: * css-custom-properties-api/initialValue-expected.html: Added. * css-custom-properties-api/initialValue.html: Added. * css-custom-properties-api/initialValueJS-expected.txt: Added. * css-custom-properties-api/initialValueJS.html: Added. * css-custom-properties-api/registerProperty-expected.txt: * css-custom-properties-api/registerProperty.html: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/204832@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-22 01:03:48 +00:00
<html>
<head>
<style>
html {
background: grey;
}
.parent1 {
width: 500px;
background: blue;
}
.child1 {
background: green;
width: 100px;
}
.parent2 {
width: 500px;
background: blue;
}
.child2 {
background: green;
width: 200px;
}
.parent3 {
width: 500px;
background: blue;
}
.child3 {
background: green;
width: 500px;
}
.parent4 {
width: 500px;
background: blue;
}
.child4 {
background: green;
width: 200px;
}
.parent5 {
width: 500px;
background: blue;
}
.child5 {
background: green;
width: 300px;
}
.parent6 {
width: 500px;
background: blue;
}
.child6 {
background: green;
width: 500px;
}
.parent7 {
width: 500px;
background: blue;
}
.child7 {
background: green;
width: 500px;
}
</style>
</head>
<body>
<p> Single values </p>
<p> Specified </p>
<div class="parent1"><div class="child1"><p>100px green</p></div> </div>
<p> Not specified, use initial value </p>
<div class="parent2"><div class="child2"><p>200px green</p></div> </div>
<p> Not specified, but not registered so use initial value for width </p>
<div class="parent3"><div class="child3"><p>500px green</p></div> </div>
<p> Has a fallback for registered property </p>
<div class="parent4"><div class="child4"><p>200px green</p></div> </div>
<p> Has a fallback for unregistered property </p>
<div class="parent5"><div class="child5"><p>300px green</p></div> </div>
<p> Having a fallback for a registered property that is a variable should not work</p>
<div class="parent6"><div class="child6"><p>500px green</p></div> </div>
<p> Having a variable in the initial value should not work</p>
<div class="parent7"><div class="child7"><p>500px green</p></div> </div>
</body>
</html>