scarpe-team / scarpe

Scarpe - shoes but running on webview
Other
162 stars 29 forks source link

Text Drawables should declare all the visible Shoes styles, not just the ones HTML doesn't handle #519

Open noahgibbs opened 8 months ago

noahgibbs commented 8 months ago

Schwad asked a great question in PR #517: where do you look for the Shoes styles that define a given TextDrawable, like the fact that del is strikethrough and ins is single-underline. I basically said "I mostly did this how we've been doing it, so I'm using HTML and CSS defaults everywhere we can and then declaring ins-is-underline with a Shoes default."

That's not actually a good answer. It leaks HTML-based implementation knowledge: display service has to know all the Shoes-equivalent styles, except for ins because HTML doesn't have it. The current way works, but it's inelegant.

It also means the styles aren't available in Lacci - calling em("foo").style won't return them. That's not really a Shoes-compatibility argument, though, because .style (no args, return the styles) has to be called on a slot instead of a Drawable or TextDrawable in Shoes. Still, it would be nice if those things were visible in Lacci, even if Shoes3 didn't do that. And it would be nice if there were one place in Lacci or Scarpe-Webview to see all the definitions together.

Here are some ways we might solve that (pick one, not do all of them):