Skip to content

fix(textbox): Draw spell-check squiggles below the descenders - #25392

Merged
ramezgerges merged 2 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/spellcheck-squiggle-below-descenders
Oct 15, 2026
Merged

ramezgerges merged 2 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/spellcheck-squiggle-below-descenders

Conversation

@ramezgerges

@ramezgerges ramezgerges commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: closes unoplatform/kahua-private#556

PR Type:

🐞 Bugfix

What changed? 🚀

In a TextBox, the spell-check squiggle overlapped the descenders of g, y and p. The text is clipped to its lines by the ScrollContentPresenter, and the line box ends less than a pixel below the descenders. The wave was therefore clamped into the line and overlapped them.

  • The wave's top edge now sits on the font's descent, below the line box.
  • The text no longer draws the squiggles in Draw. IParsedText.DrawSpellCheckSquiggles draws them on request, in the text's own coordinates.
  • TextBoxView draws them in a layer on its content element, using ElementCompositionPreview.SetElementChildVisual. TextBox and RichEditBox both host their text through TextBoxView, so both get the fix.
    • The layer sits above the text and is clipped to the padding box, so the text's own clipping is unchanged.
    • It draws through the transform from the text to its host, so it follows scrolling and flow direction. RichEditBox's composite text forwards the call to each paragraph at its offset.
    • It repaints when the text is parsed again or the view scrolls.

The squiggle can't be fixed by extending the presenter's clip instead. In a multi-line TextBox, that would let the next line's text show through the bottom padding.

Validation

  • Runtime tests on Skia desktop:
    • Given_TextBox.When_SpellCheck_Squiggle_Is_Below_Descenders (font sizes 14 and 20) fails before the fix and passes after it.
    • Given_TextBox.When_SpellCheck_Squiggle_Scrolled_Out_Of_View passes.
    • Given_RichEditBox.When_SpellCheck_Squiggle_Is_Below_Descenders passes. It fails if RichEditBox doesn't attach the layer, so it guards against RichEditBox losing its squiggles.
  • All of Given_TextBox, Given_TextBlock, Given_PasswordBox and Given_RichEditBox: 1,434 passed, 26 skipped, 0 failed.
  • Checked by eye in SamplesApp (TextBox_Simple): the squiggle sits below the descenders.
  • Not compared against native WinUI: WinUI drew no spell-check squiggles on the test machine.

PR Checklist ✅

🤖 Generated with Claude Code

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 239190 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • Buttons.png-dark
    • Buttons.png
    • ClipboardTests.png-dark
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
    • DropDownButtonPage.png-dark
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png
    • AppBar_KeyBoard.png-dark
    • ApplicationViewSpanningRectsPage.png-dark
    • AppWindowFeatures.png-dark
    • AppWindowTitleBar Properties.png
    • Arrange_Performance01.png-dark
    • Attributed_text_Simple.png-dark
    • AuthenticationBroker_Demo.png-dark
    • AutoBorderStretchwithrightmargin.png-dark
    • AutoBorderStretchwithrightmargin.png
    • AutomationProperties_Relations.png-dark
    • AutomationProperties_Relations.png
    • AutoSuggestBox_Description.png-dark
    • AutoSuggestBox_Description.png
    • AutoSuggestBox_Reason.png-dark
    • AutoSuggestBox_Reason.png
    • BasicAutoSuggestBox.png-dark
    • BasicAutoSuggestBox.png
    • BasicThemeResources.png-dark
    • BasicThemeResources.png

@ramezgerges
ramezgerges force-pushed the dev/rara/spellcheck-squiggle-below-descenders branch from 65123bc to 7547c67 Compare October 13, 2026 15:38
ramezgerges and others added 2 commits October 13, 2026 12:02
The squiggle crossed the descenders of g, y and p. A text box's text is
clipped to its lines by the scroll presenter, and the line box ends
less than a pixel below the descenders, so the wave was clamped into
the line and overlapped them.

The wave's top edge now sits on the font's descent, below the line
box. The parsed text no longer draws the squiggles with the text:
IParsedText.DrawSpellCheckSquiggles draws them on request, and
TextBoxView draws them in a layer on its content element, clipped to
the padding box, so the text's own clipping is unchanged. TextBox and
RichEditBox both host their text through TextBoxView. The layer
follows scrolling and repaints when the text is parsed again.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Checks the squiggle is drawn below the text's descenders, and that it
scrolls out of view with its word.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@ramezgerges
ramezgerges force-pushed the dev/rara/spellcheck-squiggle-below-descenders branch from 7547c67 to 29b0b42 Compare October 13, 2026 16:02
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Oct 13, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 239223 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DisplayInformation.png-dark
    • DoubleImageBrushInList.png-dark
    • DropDownButtonPage.png-dark
    • DoubleImageBrushInList.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Examples.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png
    • AnimatedBackVisualSourceSamplePage.png
    • AnimatedIconPage.png-dark
    • AnimatedIconPage.png
    • AndroidWindowInsets.png-dark
    • Accessibility_ScreenReader.png-dark
    • AnimatedVisualsTestbedPage.png
    • AppBarButtonWithIconTest.png
    • AppBarButtonTest.png
    • AppBarButtonTest.png-dark
    • AnimatedVisualsTestbedPage.png-dark
    • AppBarToggleButtonTest.png
    • ApplicationViewSpanningRectsPage.png-dark
    • ApplicationViewSizing.png-dark
    • ApplicationViewMode.png
    • AppBar_KeyBoard.png
    • AppBar_KeyBoard.png-dark
    • ApplicationViewSpanningRectsPage.png
    • AppWindowClosing.png-dark
    • AppWindowClosing.png

@mergify

mergify Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@ramezgerges
ramezgerges merged commit 9c63ba7 into unoplatform:master Oct 15, 2026
47 checks passed
@ramezgerges
ramezgerges deleted the dev/rara/spellcheck-squiggle-below-descenders branch October 15, 2026 11:03
ramezgerges added a commit to ramezgerges/uno that referenced this pull request Oct 28, 2026
The squiggle crossed the descenders of g, y and p. A text box's text is
clipped to its lines by the scroll presenter, and the line box ends
less than a pixel below the descenders, so the wave was clamped into
the line and overlapped them.

The wave's top edge now sits on the font's descent, below the line
box. The parsed text no longer draws the squiggles with the text:
IParsedText.DrawSpellCheckSquiggles draws them on request, and
TextBoxView draws them in a layer on its content element, clipped to
the padding box, so the text's own clipping is unchanged. The layer
follows scrolling and repaints when the text is parsed again.

Backport of unoplatform#25392, adapted to 6.8's SkiaSharp text stack.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ramezgerges added a commit to ramezgerges/uno that referenced this pull request Oct 28, 2026
Checks the squiggle is drawn below the text's descenders, and that it
scrolls out of view with its word.

Backport of unoplatform#25392.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ramezgerges added a commit that referenced this pull request Oct 29, 2026
…le-6.8

fix(textbox): Draw spell-check squiggles below the descenders (6.8, backport of #25392)
agneszitte pushed a commit that referenced this pull request Nov 2, 2026
The squiggle crossed the descenders of g, y and p. A text box's text is
clipped to its lines by the scroll presenter, and the line box ends
less than a pixel below the descenders, so the wave was clamped into
the line and overlapped them.

The wave's top edge now sits on the font's descent, below the line
box. The parsed text no longer draws the squiggles with the text:
IParsedText.DrawSpellCheckSquiggles draws them on request, and
TextBoxView draws them in a layer on its content element, clipped to
the padding box, so the text's own clipping is unchanged. The layer
follows scrolling and repaints when the text is parsed again.

Backport of #25392, adapted to 6.8's SkiaSharp text stack.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
(cherry picked from commit f03ee12)
agneszitte pushed a commit that referenced this pull request Nov 2, 2026
Checks the squiggle is drawn below the text's descenders, and that it
scrolls out of view with its word.

Backport of #25392.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
(cherry picked from commit 0b341f8)
agneszitte added a commit that referenced this pull request Nov 2, 2026
…le-6.7

fix(textbox): Draw spell-check squiggles below the descenders (6.7, backport of #25392)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants