Merge pull request #3208 from wdscxsj/patch-1

Remove description of inconsistency between Chrome and Firefox
This commit is contained in:
Ilya Kantor 2022-09-30 19:47:44 +02:00 committed by GitHub
commit fde193a356
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -269,20 +269,6 @@ So nowadays `getComputedStyle` actually returns the resolved value of the proper
We should always ask for the exact property that we want, like `paddingLeft` or `marginTop` or `borderTopWidth`. Otherwise the correct result is not guaranteed.
For instance, if there are properties `paddingLeft/paddingTop`, then what should we get for `getComputedStyle(elem).padding`? Nothing, or maybe a "generated" value from known paddings? There's no standard rule here.
There are other inconsistencies. As an example, some browsers (Chrome) show `10px` in the document below, and some of them (Firefox) -- do not:
```html run
<style>
body {
margin: 10px;
}
</style>
<script>
let style = getComputedStyle(document.body);
alert(style.margin); // empty string in Firefox
</script>
```
````
```smart header="Styles applied to `:visited` links are hidden!"