mirror of
https://github.com/servo/servo
synced 2026-05-09 08:32:31 +02:00
Fix a panic when calling `determine_auto_margins` for nodes without
`.style()`. Now it returns an empty `AutoMargins` (all options set to
`None`), which matches the behaviour in Firefox:
```json
"autoMargins": {}
"autoMargins": {"top": "auto", "bottom": "auto", "left": "auto", "right": "auto"}
```
Refactor `GetLayoutReply` and `ComputedNodeLayout` to take advantage of
serde's flatten feature, making the serialization much cleaner.
Testing: Manual testing with the example provided in the issue.
Fixes: #41743
---------
Signed-off-by: eri <eri@igalia.com>