LibWeb; Handle calculated number values for stroke-width and stroke-dashoffset - #10953
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (8)
📝 WalkthroughWalkthroughSVG stroke width and dash offset now use shared computed-property accessors. Numeric calculated values convert to pixel lengths. Length-percentage parsing rejects calculated values that do not resolve to lengths. Border image widths and outsets accept calculated numeric values. ChangesSVG stroke conversion
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Libraries/LibWeb/CSS/PercentageOr.h`:
- Line 99: Update the LengthPercentage handling near the shown VERIFY and the
ComputedProperties::border_image() path to recognize calculated values that
resolve to numbers before enforcing the length/percentage invariant, routing
them through the existing numeric BorderImageWidthValue branch. Preserve literal
number handling and add a regression test covering border-image-width: calc(1).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e16288c6-ea59-4bcf-a54a-9d9f0d4b367e
📒 Files selected for processing (6)
Libraries/LibWeb/CSS/ComputedProperties.cppLibraries/LibWeb/CSS/ComputedProperties.hLibraries/LibWeb/CSS/ComputedValues.cppLibraries/LibWeb/CSS/PercentageOr.hTests/LibWeb/Crash/CSS/calculated-number-stroke-dashoffset.htmlTests/LibWeb/Crash/CSS/calculated-number-stroke-width.html
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Tests/LibWeb/Crash/CSS/calculated-number-border-image-width.html`:
- Around line 4-7: Add a valid border-image-source referencing a reusable image,
and set non-zero border widths on the test element so painting enters
paint_border_image() and resolves border-image-width: calc(42) through
resolve_border_image_geometry().
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7081d5de-edb3-4b92-8dec-9f2e16f7bb36
📒 Files selected for processing (2)
Libraries/LibWeb/CSS/ComputedProperties.cppTests/LibWeb/Crash/CSS/calculated-number-border-image-width.html
🚧 Files skipped from review as they are similar to previous changes (1)
- Libraries/LibWeb/CSS/ComputedProperties.cpp
Previously we only checked for literal `<number>` values and fell back to storing calculated number values within a `LengthPercentage` which subsequently crashed when resolving the value. We also introduce a `VERIFY` to ensure calculated values in a `LengthPercentage` resolve to a length. Fixes LadybirdBrowser#10909
Previously we only checked for literal `<number>` values and fell back to storing calculated number values within a `LengthPercentage` which subsequently crashed when resolving the value.
Previously we only checked for literal `<number>` values and fell back to storing calculated number values within a `LengthPercentage` which subsequently crashed when resolving the value.
Previously we only checked for literal `<number>` values and fell back to resolving calculated number values as a `Length` which crashed
e0a652b to
0672f9b
Compare
|
Changes:
|
Previously we only checked for literal
<number>values and fell back to storing calculated number values within aLengthPercentagewhich subsequently crashed when resolving the value.We also introduce a
VERIFYto ensure calculated values in aLengthPercentageresolve to a length.Fixes #10909