Re: [css-houdini-drafts] [css-layout-api] Assorted TAG feedback

The Working Group just discussed `TAG feedback`, and agreed to the following:

* `RESOLVED: No change in behavior, add a note as to why constructors are not exposed`
* `RESOLVED: Add a new LayoutFragmentResult object with a constructor.`
* `RESOLVED: Keep the layoutNextFragment name.`

<details><summary>The full IRC log of that discussion</summary>
&lt;heycam> Topic: TAG feedback<br>
&lt;heycam> github: https://github.com/w3c/css-houdini-drafts/issues/760<br>
&lt;heycam> iank_: this is a bunch of assorted TAG feedback<br>
&lt;heycam> ... a lot of editorial stuff, but 3 or 4 issues we can talk about<br>
&lt;heycam> ... the first one is having a constructor for layout fragments<br>
&lt;heycam> ... in summary, currently today the only thing that can produce a layout fragment is the rendering engine<br>
&lt;heycam> ... call on the child, hey lay out this fragment, it does some work, and gives back a fragment<br>
&lt;heycam> ... the useful information is the width and height of the fragment, and you can return it in your list of children<br>
&lt;heycam> ... do we want a constructor for this?<br>
&lt;heycam> ... we can add this, I'm not objecting, but the constraint is that this isn't a valid fragment you could return to the engine<br>
&lt;heycam> ... just a placeholder for testing<br>
&lt;heycam> Rossen: the current design has a farily rigid assumption of who can produce fragments<br>
&lt;heycam> ... and be responsible for their lifteime<br>
&lt;heycam> ... and it's not the script, it's the layout engine<br>
&lt;heycam> ... exposing a constructor, you are fooling the user that they have control over it<br>
&lt;heycam> ... so I would push back on this issue with that reasoning<br>
&lt;heycam> eae: unless it's a valid fragment, it would be more confusing than it's worth<br>
&lt;heycam> Rossen: again, it would lead down the path of considering those as user space objects when they're actually browser objects<br>
&lt;heycam> dbaron: what would it mean to have a real constructor for a fragment?<br>
&lt;heycam> iank_: what Travis brings up here is events in the platform<br>
&lt;heycam> ... synthesizing an event through the system<br>
&lt;heycam> ... this is quite often used for testing<br>
&lt;heycam> ... it's not a real event<br>
&lt;heycam> ... they're already second class citizens<br>
&lt;heycam> ... for us, I'm struggling to come up with use cases for synthesizing events like that<br>
&lt;heycam> Rossen: again, the fragment projection we give back to the user is just an interace with a bunch of functionality to interrogate properties<br>
&lt;heycam> ... ti's meant to be a black box that you can move around and that's it<br>
&lt;heycam> iank_: the things you can read from it are teh width, height, baseline info (in the future0, and basically just position it<br>
&lt;heycam> ... if the child is also a custom layout it can pass information up via structured cloning<br>
&lt;heycam> ... but that's basically it<br>
&lt;heycam> iank_: dbaron or plinss anythign to add?<br>
&lt;heycam> plinss: that's reasonable<br>
&lt;heycam> Rossen: probably something that they didn't grok entirely, and they look similar on the surface but they're not<br>
&lt;heycam> plinss: in general the TAG likes to see constructors on everything<br>
&lt;heycam> ... but I agree here<br>
&lt;heycam> astearns: would it make sense to add a note saying usually we have constructors but not here?<br>
&lt;heycam> Rossen: if it's lacking explanation let's add that<br>
&lt;heycam> RESOLVED: No change in behavior, add a note as to why constructors are not exposed<br>
&lt;heycam> iank_: the second point, is that we return an options bag from layout<br>
&lt;heycam> ... which does some magic<br>
&lt;heycam> ... explicitly you return the child fragments, auto block size, some other info<br>
&lt;heycam> ... the engine goes and synthesizes a fragment fro you with correct internal representation<br>
&lt;heycam> ... shoudl that operation have a constructor, so you can create a new layout result fragment<br>
&lt;heycam> ... and check if that operation fails<br>
&lt;heycam> ... there are some cases where that operation could fail<br>
&lt;heycam> s/shoudl/should/<br>
&lt;heycam> ... for example, you pass it auto block size, create a new result fragment, atm it's just an options bag<br>
&lt;heycam> ... and then inspect what your output box size is going to be, maybe do something different based on that<br>
&lt;heycam> ... the other thing that can fail is when you deserialize the extra data you can pass up the tree<br>
&lt;heycam> ... when you try to structured clone that, like adding a SharedArrayBuffer or something<br>
&lt;heycam> ... currently we just say it threw an exception<br>
&lt;heycam> ... with a constructor the user could detect that it threw an exception<br>
&lt;heycam> ... I think it's reasonable, but would need to work out what the constructor's option bag argument would be<br>
&lt;heycam> ... it's not entirely clear to me yet<br>
&lt;heycam> frremy: when I tried it, something I found frustrating is you can have a big option you want to give, only a few props on the object can't be serialized<br>
&lt;heycam> ... then you have to clone the entire object yourself, by removing the stuff you can't serialize<br>
&lt;heycam> ... maybe would be nicer to set null for props you can't serialize for example<br>
&lt;heycam> iank_: I think that's a bigger ask<br>
&lt;heycam> ... structured clone is painful for people to use<br>
&lt;heycam> ... would that have been useful?  there's a bit out of your control<br>
&lt;heycam> ... would it be useful to ensure that operation doesn't fail?<br>
&lt;heycam> frremy: something like JSON.stringify, with a callback to handle the unserializable stuff<br>
&lt;heycam> iank_: that would be a slightly larger change in the HTML spec<br>
&lt;heycam> frremy: I don't think having a constructor would change anything<br>
&lt;heycam> ... only solution is to clone<br>
&lt;heycam> iank_: would it have been useful to just get say the auto block size?<br>
&lt;heycam> frremy: not sure<br>
&lt;heycam> iank_: I think that's a reasonable ask, shouldn't be too much work, not sure many people would use it<br>
&lt;heycam> ... can always add it and use count it, remove if it's unused<br>
&lt;heycam> iank_: we need to add a constructor, not jsut returning a FragmentResultOptions, but a constructor for a type like FragmentResult<br>
&lt;heycam> ... then run all the steps for userland layout, structure clone, sanitize the output<br>
&lt;heycam> ... by running the constructor you could catch an error that would happen during that process<br>
&lt;heycam> Rossen: as to the larger question, about expectations of what happens if the script starts throwing?<br>
&lt;heycam> iank_: I think we just fall back<br>
&lt;heycam> ... I think that larger question is just a misunderstanding, editorial<br>
&lt;heycam> Rossen: objections to adding the new LayoutFragmentResult object?<br>
&lt;heycam> RESOLVED: Add a new LayoutFragmentResult object with a constructor.<br>
&lt;heycam> iank_: final piece of discussable feedback here<br>
&lt;heycam> ... confusion about layoutNextFragment name<br>
&lt;heycam> ... do we want to go back to layout?<br>
&lt;heycam> Rossen: no<br>
&lt;heycam> ... that's like call everything object<br>
&lt;heycam> iank_: David or Peter?<br>
&lt;heycam> dbaron: I already disagreed with Travis on that one<br>
&lt;heycam> frremy: I like that "next fragment" knowing that you're getting a fragment<br>
&lt;heycam> ... "layout" is too general<br>
&lt;heycam> iank_: Rossen and David want layout<br>
&lt;heycam> plinss: I tend to prefer verbosity<br>
&lt;heycam> iank_: Ian and Francois don't care<br>
&lt;heycam> Rossen: other opinions or objections?<br>
&lt;heycam> RESOLVED: Keep the layoutNextFragment name.<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/760#issuecomment-401643323 using your GitHub account

Received on Monday, 2 July 2018 00:18:08 UTC