Repository navigation
Prepend bold/italic styles for XHTML B/I elements (issue 22023) - #22083
cestercian wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #22083 +/- ##
==========================================
- Coverage 90.30% 90.17% -0.13%
==========================================
Files 269 275 +6
Lines 67362 67833 +471
==========================================
+ Hits 60828 61166 +338
- Misses 6534 6667 +133
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Snuffleupagus
left a comment
There was a problem hiding this comment.
#22023 (comment) outlines a another possible, and shorter, solution. Would that work instead?
B and I called measure.pushFont in $pushGlyphs, but TextMeasure never had that method, so rich text with <b> or <i> in an auto-sized field failed during layout. Prepend font-weight:bold / font-style:italic in the constructors (so explicit overrides like font-weight:normal still win) and drop the $pushGlyphs overrides, letting the existing XhtmlObject path handle measurement and rendering.
b9b6390 to
11e274b
Compare
|
@Snuffleupagus Good call, thanks. Switched to the shorter style-prepend approach from that issue comment: |
TextMeasure.prototype.pushFont method (issue 22023)
Viewer previewCommit 11e274b (build logs).
🔒 A user with write access must approve this commit with the |
BandIcalledmeasure.pushFont()in$pushGlyphs, butTextMeasurenever had that method, so laying out rich text with<b>or<i>in an auto-sized field threw and the whole form failed to render.Following the shorter approach from #22023 (comment): prepend
font-weight:bold/font-style:italicin theBandIconstructors (so explicit styles likefont-weight:normalstill win) and drop their$pushGlyphsoverrides, letting the existingXhtmlObjectpath handle measurement and rendering.Added a unit test with bold and italic rich text in a draw without a height; it fails without the change.
Fixes #22023