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
|
||
|---|---|---|
| .. | ||
| util | ||
| view | ||
| BUILD.bazel | ||
| r3_ast_absolute_span_spec.ts | ||
| r3_ast_spans_spec.ts | ||
| r3_template_transform_spec.ts | ||
| README.md | ||
| style_parser_spec.ts | ||
Tests in this directory are excluded from running in the browser and only run in node.