Skip to content

DOM renderer: care package issue #4658

Open
@jerch

Description

@jerch

Thanks to @willmcgugan I have some heavy load examples to test on the DOM renderer, in particular:

  • the colortest file for here
  • textual easing to spot render glitches and update behavior (install with pip install textual-dev)

Issues found so far:

  • The PR Fix for #2488. Use element offsetHeight rather than getBoundingRect #4366 changed char measuring to the integer based value retrieved from offsetWidth. Already suspected this to introduce artifacts for the letter-spacing trick, where rounding offsets will stack up, and yes it does showing staggering at the right side (scale demo to 310x70 to see the colortest file at full glory):

    image

    Not sure yet what the right solution to this is, at least getBoundingRect gets the values right not showing the staggering.

  • getAttribute & setAttribute are very expensive in the colortest accounting for 50% of script runtime (~800 ms), we prolly should resort to collecting style entries in JS and setting it only once on the element.

  • Overall render runtime is bad for the colortest, it takes ~3 s on my machine. Can be made faster by:

    Still underwhelming, but at least ~2x faster (note that the webgl renderer takes only ~50 ms to paint colortest).

  • As already mentioned by @mofux, block chars render poorly in the DOM renderer. textual uses those to color its surface, which results in ugly stripes. It is also the root cause for the staggering above, as colortest also uses different block chars. We should investigate, if we can draw block chars ourselves not relying on the font renderer.

  • textual easing does some weird color trickery at the menu on the left side to give the illusion of raised button borders. While the canvas and the webgl renderer show these, the DOM renderer shows plain colors. Prolly related to our decoration/line-height in the DOM renderer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions