-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compiler): do not unquote CSS values (#49460)
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
- Loading branch information
1 parent
d201fc2
commit 077f6b4
Showing
3 changed files
with
40 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters