W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2017

Re: [csswg-drafts] [cssom] Serialization of CSS declaration block returned from getComputedStyle

From: Simon Pieters via GitHub <sysbot+gh@w3.org>
Date: Wed, 15 Mar 2017 13:02:56 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-286734493-1489582975-sysbot+gh@w3.org>
Given the following case, it seems browsers all have some logic to try to serialize as shorthands when possible. It's unclear to me why we want to avoid doing that for `getComputedStyle` specifically?

 http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4948
```
<!DOCTYPE html>
<p style="border:1em solid">
<p style="border:1em solid; border-right-width: 1px">
<p style="border:1em solid; border-right-width: 1px !important">
<script>
for (var p of document.querySelectorAll('p'))
  p.style.color = 'purple';
</script>
```
(check the value of the `style` attributes after the script has run.)

-- 
GitHub Notification of comment by zcorpan
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1033#issuecomment-286734493 using your GitHub account
Received on Wednesday, 15 March 2017 13:03:03 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:09 UTC