[ <length-percentage> ]
[ <length-percentage> ] && hanging? && each-line?
but this allocates 2 bytes padding for each `ComputedStyle`.class TextIndent {Length length_;bool is_each_line_;bool is_hanging_;};
Hi style experts,I'm thinking about extending `text-indent` from:[ <length-percentage> ]to:[ <length-percentage> ] && hanging? && each-line?To do this, I can create:class TextIndent {Length length_;bool is_each_line_;bool is_hanging_;};
but this allocates 2 bytes padding for each `ComputedStyle`.
I can think of a few ways to avoid this, such as:
- Serialize to a bit stream of 10 bits, and declare as `field_size: 10`.
- Add bits to `computed_style_extra_fields.json5` and somehow combine with the `Length` in getter/setters.
These options look a bit tricky. Is there a best practice to do this?I checked existing examples. For example, `StyleIntrinsicLength` is 16 bytes. Out of the 16 bytes, 7 bytes are padding (2 in `Length`, 3 in `optional`, 2 in `StyleIntrinsicLength`). Do we prefer readability over reducing these padding?
--
You received this message because you are subscribed to the Google Groups "style-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to style-dev+...@chromium.org.
To view this discussion, visit https://groups.google.com/a/chromium.org/d/msgid/style-dev/CAHe_1dK2GUP9y9rQSycQjN6j6xyDdtkpucXFmE%3Dtun8GYtT9Eg%40mail.gmail.com.
Thank you for the prompt response.Only top-level properties are worth the complexity, that makes sense.The `text-indent` is 35% used, so we probably want to keep it at top-level.
I'm interested in experimenting with all properties used only in line-breaker and inline-layout into a group, but that's a separate discussion.
Another possible idea is to create internal longhands and make `text-indent` a shorthand of them. But that'd change web-visible things of the property, so it doesn't seem to work.