-
Notifications
You must be signed in to change notification settings - Fork 142
[css-layout-api] Assorted TAG feedback #760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think there is a distinction here worth emphasizing, though, since intrinsic sizes are a layout function of all fragments, and |
The Working Group just discussed
The full IRC log of that discussion |
The Houdini Task Force just discussed The full IRC log of that discussion |
This is a summary of the TAG Review comments for the CSS Layout API.
The major issue of feedback is already covered by #750 (where we asked why a Promise-style design was not used).
Constructors for Fragments
We generally try to enable constructors for objects returned by the platform (like Events) to enable JS authors to synthesize the same behavior. As such, we were wondering why there's no way to construct the
Fragment
types returned?Expectations for thrown exceptions
In
create a layout fragment
algorithm, what happens if theStructuredDeserialize
operation fails? Is it the "otherwise null" result, or something else? Larger question: what is the expectation if the script powering the layout function throws? Does it keep trying over and over? Or does is abandon the script and stop executing it?IntrinsicSizes object as a dictionary type
Is the
IntrinsicSizes
object reused across layout passes? If the developer caches anIntrinsicSizes
object and retrieves it in a later layout pass, will it have the same data? If not, should this be a dictionary structure instead, as it appears to be purely for containing data w/no operations...layoutNextFragment
->layout
?In reflecting about the recursive nature of how a given pass through the layout generator function can recursively call
layoutNextFragment
on it's children, it seems to me thatlayoutNextFragment
should really be calledlayout
instead; this would appear to matchintrinsicSizes()
which is already named the same as the generator function required at registration. Iflayout
is too general, then maybelayoutFragment
?IDL/usage bugs
layoutNextFragment
takes aLayoutConstraints
IDL object in all cases--however, in many of the examples, you pass aLayoutConstraintsOptions
dictionary into the method--this is not allowed per the IDL--you'll either want to new-up aLayoutConstraints
object wrapped around your dictionary, or just change the API to take the dictionary instead for simplicity. This might be an early opportunity to throw if the wrong data-types would be passed back.layoutFragment
method tries to get thefragmentRequest.layoutChild
but that doesn't exist (I think it's supposed to bebox
instead).layout
API is invoked with arguments in the wrong positions, per the definition (e.g.,constraints
is not the first argument).Readability
In general, this is a complex spec--there's no way around that. IMHO, the conceptual contents of section 5 (Layout) including some much-needed diagrams, would be a better lead-in to the spec than diving into section 3 right away.
The text was updated successfully, but these errors were encountered: