You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For HTML templates containing static style/class attributes such as this:
<divclass=" foo bar baz "></div><divstyle=" color : red ! important "></div>
... we are inconsistent about how this is actually serialized to the DOM. For static-optimized nodes, the attributes are kept as-is. For non-static-optimized nodes, the whitespace/semicolons are normalized:
<divclass="foo bar baz"></div><divstyle="color: red !important;"></div>
This also applies to the case of blank vs missing attributes. For example:
<divclass=""></div><divstyle=""></div>
In the static-optimized case, these attributes are kept as-is. For the non-static-optimized case, the attributes are removed entirely:
<div></div><div></div>
This doesn't really matter unless the developer is doing something zany (e.g. querySelector('[class="foo bar baz"]') rather than querySelector('.foo.bar.baz')), but we should at least be consistent about it.
We have also warned developers about this in the past, but not every developer follows these guidelines.
This would be a potentially breaking change.
The text was updated successfully, but these errors were encountered:
For HTML templates containing static
style
/class
attributes such as this:... we are inconsistent about how this is actually serialized to the DOM. For static-optimized nodes, the attributes are kept as-is. For non-static-optimized nodes, the whitespace/semicolons are normalized:
This also applies to the case of blank vs missing attributes. For example:
In the static-optimized case, these attributes are kept as-is. For the non-static-optimized case, the attributes are removed entirely:
This doesn't really matter unless the developer is doing something zany (e.g.
querySelector('[class="foo bar baz"]')
rather thanquerySelector('.foo.bar.baz')
), but we should at least be consistent about it.We have also warned developers about this in the past, but not every developer follows these guidelines.
This would be a potentially breaking change.
The text was updated successfully, but these errors were encountered: