W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2020

[csswg-drafts] [css-position] Insets don't reduce the cb when sizing an abspos (#5082)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Mon, 18 May 2020 21:54:41 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-620529380-1589838880-sysbot+gh@w3.org>
Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-position] Insets don't reduce the cb when sizing an abspos ==
From https://drafts.csswg.org/css-position/#abspos-insets

> For an absolutely positioned box, the inset properties effectively reduce the containing block into which it is **sized** and positioned by the specified amounts.

And https://drafts.csswg.org/css-position/#abspos-layout goes on with

> 1. First, its inset-modified containing block is calculated, defining its available space. (See § 3.5 Absolute (and Fixed) Positioning.) [...]
> 2. Next, its **width and height are resolved against this definite available space** [...]

But that's not actually the case. Percentages are resolved with respect to the original containing block size, not the inset-modified one. E.g.

```css
#cb {
  position: relative;
  width: 100px;
}
#abspos {
  position: absolute;
  left: 25px;
  right: 25px;
  width: 100%;
  height: 100px;
  background: blue;
}
```
```html
<div id="cb">
  <div id="abspos"></div>
</div>
```

results in a 100x100 square, not a 50x100 rectangle. https://software.hixie.ch/utilities/js/live-dom-viewer/saved/8114

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5082 using your GitHub account
Received on Monday, 18 May 2020 21:54:43 UTC

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