- From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
- Date: Thu, 07 Feb 2019 01:05:05 +0000
- To: public-css-archive@w3.org
The CSS Working Group just discussed `Identity of Element.pseudo() return value`. <details><summary>The full IRC log of that discussion</summary> <heycam> Topic: Identity of Element.pseudo() return value<br> <heycam> github: https://github.com/w3c/csswg-drafts/issues/3607<br> <fantasai> ScribeNicK: fantasai<br> <fantasai> heycam: The issue here is that the spec doesn't say anything currently about when we need to return the same object that we used before on this function<br> <fantasai> heycam: The other confusing par tis, the function is defined ot return null if the pseudo doesn't currently exisst<br> <fantasai> heycam: Already we have a case where sometimes it'll return different values<br> <fantasai> heycam: But what is meant to happen if e.g. you restyle the element and its ::before content changes to something different<br> <fantasai> heycam: Do we keep track of whether we went ot null in the interim?<br> <fantasai> heycam: what is meant to happen?<br> <fantasai> florian: Would you prefer to return the same object in general to avoid garbage?<br> <fantasai> florian: or return different objects<br> <fantasai> heycam: given you want to use these as event targets, I thin it would be best to return the same object<br> <fantasai> heycam: Otherwise you grabe an object, attach an element, then pull it again to remove your event handler, and it's not there so you can't remove it<br> <fantasai> florian: You could maybe have an object that is a shallow copy?<br> <fantasai> florian: Then you'd have the same items on it<br> <fantasai> florian: that you could reach, although the object identity would be different<br> <fantasai> heycam: I think that'd be weird<br> <fantasai> Rossen: How is that different from having a reference to an element<br> <fantasai> Rossen: and referencing... asynchronously<br> <fantasai> Rossen: In terms of lifetime and identity, original reference will be held<br> <fantasai> Rossen: You'll have an element disconnected from the tree<br> <fantasai> Rossen: You will have some sort of state of whatever it is, and you may use it if it's useful to you<br> <fantasai> Rossen: but you have understanding that this element is no longer part of DOM<br> <fantasai> heycam: One difference is that it's a lot less obvious when the underlying thing goes away<br> <fantasai> heycam: It's determined just by the style values of the element, e.g. what 'content' property value is<br> <fantasai> heycam: whereas normal elements, it's more obvious when the thing has gone away<br> <fantasai> Rossen: To me what you're describing is the same as saying, if I have the pseudo element and I ask the containing element<br> <fantasai> Rossen: If I change the pseudo element to the extent that I need to generate a new pseudo elemen<br> <fantasai> Rossen: then I expect that everything gets disconnected<br> <fantasai> Rossen: This would be the same pattern as disconnecting a node from the DOM and still having a reference to it<br> <fantasai> heycam: I didn't considere that .parent would become null in that sense<br> <fantasai> heycam: could change the spec<br> <fantasai> Rossen: It's one thing to change state<br> <fantasai> Rossen: Different thing to completely change the element<br> <fantasai> Rossen: which in DOM case, this is removing the element and creating a new one<br> <fantasai> Rossen: for example, changing a div with a text node<br> <fantasai> Rossen: That would be equivalent transformation<br> <fantasai> Rossen: in either case if you get disconnected you still have a reference to the original source element<br> <fantasai> Rossen: or in this case pseudoelement<br> <fantasai> Rossen: But it's no longer useful to you, and is discoverable that it's no longer useful to you<br> <fantasai> florian: To concerns<br> <fantasai> florian: One, elements that are disconnected from the tree is a thing that exists already<br> <fantasai> florian: Pseudo-elements isn't<br> <fantasai> florian: Wondering how many odd entities or situations we'll create by making that exist<br> <fantasai> florian: Also, for ::before / ::after, that sort-of makes sense<br> <fantasai> florian: But with e.g. ::selection, the lifecycle is less clear<br> <fantasai> florian: If you select different things, have you collapsed the range or ... does it change when you change your selection???<br> <fantasai> florian: having an object that you always return regardless of styling<br> <fantasai> florian: is not so consistent with the element view of the world you were talking about<br> <fantasai> florian: But exposes a lot less details that are hard to understand for the author<br> <fantasai> Rossen: I don't have a ready answer, but I still think that mixing identies and lifetimes is going to be ..<br> <fantasai> Rossen: Keeping identity but changing type would be horrible<br> <fantasai> Rossen: Also, we're over time.<br> <fantasai> Rossen: I don't think we can resolve on this atm<br> <fantasai> heycam: I think it'd be good for more people to put opinions in the issues<br> <fantasai> heycam: I think in your model, we'd need to know what causes the identity of the object to chnage.<br> <fantasai> Rossen: Ok, let's end the call here. Thanks for calling in. We'll chat again next week<br> <fantasai> Meeting closed.<br> <heycam> github: end topic<br> <Rossen> trackbot, end meeting<br> </details> -- GitHub Notification of comment by css-meeting-bot Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3607#issuecomment-461251301 using your GitHub account
Received on Thursday, 7 February 2019 01:05:07 UTC