New style getters and cleanups in CSSNode #146
Reference in New Issue
Block a user
No description provided.
Delete Branch "style-getters"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adds all missing getters for style properties in CSSNode for consistency and because now we have some use cases for it.
Furthermore, I've renamed the existing getters and some setters to follow a more consistent pattern. This involves an API break so I'm considering this part kinda optional (even though I really think we should do it).
Having "Style" in the method names seems redundant given that we currently have setters that implicitly set style and don't have "style" in their name. For example, we have
setPadding()
but the getter is calledgetStylePadding()
. We should be more consistent about this.The following methods are renamed:
With these changes, the CSSNode API will be more like "all setters/getters members affect style, unless they "Layout" in their name, which sounds simpler and more consistent.
looks good.
@facebook-github-bot import
Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/1476275942680136/int_phab to review.
Changed my mind after fiddling a bit more with this new API. I think we should keep the "Style" in getters that are present in both style and layout for clarity e.g. node bounds and layout direction. It still makes sense to rename getStylePadding() to getPadding() as it's a style-only attribute.