diff options
| author | bptato <nincsnevem662@gmail.com> | 2024-10-15 17:21:57 +0200 |
|---|---|---|
| committer | bptato <nincsnevem662@gmail.com> | 2024-10-15 17:36:48 +0200 |
| commit | db0fc5a55e797044c5e404f301f12dba9969e4d8 (patch) | |
| tree | 392c6b2999836deb95a917ec9de9bc1a3bd99c18 /src | |
| parent | 1cac5ae3ce2286b8fc7a591a26e5a0cc3e4f775a (diff) | |
| download | chawan-db0fc5a55e797044c5e404f301f12dba9969e4d8.tar.gz | |
css: add reverse video extension
Called -cha-reverse.
Mostly to solve the problem that code tags are indistinguishable from
regular text - on a graphical browser this is normally served by
monospace font, but we always use monospace...
So now the default ua.css adds reverse video to code and xmp. pre
remains as it was, because it means "preformatted", not "monospaced".
Also, it would mess with our whatever-to-HTML converter output.
Diffstat (limited to 'src')
| -rw-r--r-- | src/css/cssvalues.nim | 1 | ||||
| -rw-r--r-- | src/layout/renderdocument.nim | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/css/cssvalues.nim b/src/css/cssvalues.nim index 03543576..74e97aa5 100644 --- a/src/css/cssvalues.nim +++ b/src/css/cssvalues.nim @@ -188,6 +188,7 @@ type TextDecorationOverline = "overline" TextDecorationLineThrough = "line-through" TextDecorationBlink = "blink" + TextDecorationReverse = "-cha-reverse" CSSWordBreak* = enum WordBreakNormal = "normal" diff --git a/src/layout/renderdocument.nim b/src/layout/renderdocument.nim index 5ea01b8a..0dafc25c 100644 --- a/src/layout/renderdocument.nim +++ b/src/layout/renderdocument.nim @@ -66,6 +66,8 @@ func toFormat(computed: CSSComputedValues): Format = flags.incl(ffStrike) if TextDecorationBlink in computed{"text-decoration"}: flags.incl(ffBlink) + if TextDecorationReverse in computed{"text-decoration"}: + flags.incl(ffReverse) return Format( #TODO this ignores alpha; we should blend somewhere. fgcolor: computed{"color"}.cellColor(), |