-
Notifications
You must be signed in to change notification settings - Fork 3
Fix CSS position: static to ignore top/left/right/bottom properties per web standards #379
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
Open
Copilot
wants to merge
9
commits into
main
Choose a base branch
from
copilot/fix-35ef6218-037d-48e8-9668-823386827c48
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bd73c5d
Initial plan
Copilot a547a22
Fix CSS position: static bug - ignore inset properties for static pos…
Copilot 90f4218
Extend position enum with Static and implement layout-layer fix for C…
Copilot 4d59900
Add Static position support to C++ bindings.layout.hpp
Copilot 4841d0c
Add static positioning styles for #static-div and enhance hover effect
EndlessJour9527 4956153
Create dedicated CSS position: static test fixture and clean up simpl…
Copilot f7bbbe9
Fix test context creation and clarify bidirectional mapping limitations
Copilot 70cd709
Remove static position test case and related includes from layout pos…
EndlessJour9527 d7f673a
Add support for static position mapping in ffi::Position conversion
EndlessJour9527 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes the information missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot taffy::P osition only has Relative and Absolute, while Web standards and front-end business logic require Static (default), Relative, Absolute (as well as Fixed, Sticky).
ffi::P osition also only has relative and absolute, even if the business logic is static, the final pass to taffy/ffi will only be relative/absolute, resulting in the loss of static information.
In bidirectional mapping (taffy <-> ffi), static becomes relative, and then may reverse to static or relative, and the information is lost and inconsistent.
At the DOM/CSS layer of JSAR, always maintain a shadow_position variable that records the original static/relative/absolute.
When passed to taffy/ffi, if taffy only supports relative/absolute, the static maps to relative (or otherwise), but the shadow var records the true intent.
When reverse mapping, only refer to shadow_position and do not directly backtrack from the taffy/ffi results to avoid losing static information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the comment to clarify the information loss limitation.
The bidirectional mapping has inherent limitations because taffy only supports Relative/Absolute while CSS requires Static/Relative/Absolute. The key points:
The CSS position: static fix works correctly since it operates during forward conversion where original position information is preserved. The reverse mapping limitation doesn't affect the core positioning functionality.
Commit: f7bbbe9