mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Currently we are unsafely unquoting CSS values which in some cases causes valid values to become invalid and invalid values to become valid.
Example:
```html
<div style="width:"1px;""></div>
```
In the above case, `width` has an invalid value of `"1px"`, however the compiler will transform it to `1px` which makes it valid.
On the other hand, in the below case
```html
<div style="content:"foo""></div>
```
`content` has a valid value of `"foo"`, but since the compiler unwraps it to `foo` it becomes invalid. For correctness, we should not remove quotes.
```js
const div = document.createElement('div');
div.style.width='"1px"';
div.style.content='foo';
div.style.width; // ''
div.style.content; // ''
div.style.width='1px';
div.style.content='"foo"';
div.style.width; // '1px'
div.style.content; // '"foo"'
```
More information about values can be found https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
PR Close #49460
|
||
|---|---|---|
| .. | ||
| expression_parser | ||
| i18n | ||
| ml_parser | ||
| output | ||
| render3 | ||
| schema | ||
| selector | ||
| shadow_css | ||
| BUILD.bazel | ||
| compiler_facade_interface_spec.ts | ||
| integration_spec.ts | ||
| security_spec.ts | ||
| style_url_resolver_spec.ts | ||
| util_spec.ts | ||