W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2016

Re: [csswg-drafts] HTMLElement.prototype.offsetParent leaks a node inside a shadow tree

From: Anton Platonov via GitHub <sysbot+gh@w3.org>
Date: Tue, 14 Jun 2016 13:39:33 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-225883539-1465911573-sysbot+gh@w3.org>
Now with the fix merged, what `offsetParent` would return for a node 
that has a container block with `position: fixed` inside a closed 
shadow root?

Considering the following code, what would be in the log output? Is it
 still possible for the node C to discover that it is inside a fixed 
container?

```js
var A = document.createElement('node-a');
document.body.appendChild(A);

var shadowRoot = A.attachShadow({mode: 'closed'});

var B = document.createElement('node-b');
shadowRoot.appendChild(B);
B.style.position = 'fixed';

var slot = document.createElement('slot');
B.appendChild(slot);

var C = document.createElement('node-c');
A.appendChild(C);

console.log(C.offsetParent.localName);
```

-- 
GitHub Notification of comment by platosha
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/159#issuecomment-225883539 
using your GitHub account
Received on Tuesday, 14 June 2016 13:39:35 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:30:20 UTC