CssStyleDeclaration setProperty doesn't work with -webkit-* properties #18167
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
area-web
Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.
library-html
status-blocked
Blocked from making progress by another (referenced) issue
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
web-libraries
Issues impacting dart:html, etc., libraries
This issue was originally filed by djean...@google.com
What steps will reproduce the problem?
DivElement e = querySelector("#a-div");
e.style.setProperty("-webkit-mask-image", "-webkit-gradient(linear, "
"left top, right top, "
"from(rgba(0,0,0,0)), "
"color-stop(0.7, rgba(0,0,0,0)), "
"to(rgba(0,0,0,1)));");
print("with setProperty: ${e.style.getPropertyValue("-webkit-mask-image")}");
e.style.cssText = "-webkit-mask-image: -webkit-gradient(linear, "
"left top, right top, "
"from(rgba(0,0,0,0)), "
"color-stop(0.7, rgba(0,0,0,0)), "
"to(rgba(0,0,0,1)));";
print("with cssText: ${e.style.getPropertyValue("-webkit-mask-image")}");
e.style.setProperty("opacity", "0.7");
print("with setProperty: ${e.style.getPropertyValue("opacity")}");
e.style.cssText = "opacity: 0.7;";
print("with cssText: ${e.style.getPropertyValue("opacity")}");
What is the expected output? What do you see instead?
Result:
with setProperty:
with cssText: -webkit-gradient(linear, 0% 0%, 100% 0%, from(rgba(0, 0, 0, 0)), color-stop(0.7, rgba(0, 0, 0, 0)), to(rgb(0, 0, 0)))
with setProperty: 0.7
with cssText: 0.7
Expected:
with setProperty: -webkit-gradient(linear, 0% 0%, 100% 0%, from(rgba(0, 0, 0, 0)), color-stop(0.7, rgba(0, 0, 0, 0)), to(rgb(0, 0, 0)))
with cssText: -webkit-gradient(linear, 0% 0%, 100% 0%, from(rgba(0, 0, 0, 0)), color-stop(0.7, rgba(0, 0, 0, 0)), to(rgb(0, 0, 0)))
with setProperty: 0.7
with cssText: 0.7
What version of the product are you using? On what operating system?
Linux, 1.4.0-dev.2.0
Please provide any additional information below.
The text was updated successfully, but these errors were encountered: