diff options
author | bptato <nincsnevem662@gmail.com> | 2022-11-25 18:42:27 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-11-25 18:42:27 +0100 |
commit | 7ab7f28fdefe503fdde53ba9e253e308cb06b44f (patch) | |
tree | cd4cc561061c673999f9e8ecf1063a0664ba4dae /src/render | |
parent | d205ef228866cad35891ca96cacae547c02fd4ae (diff) | |
download | chawan-7ab7f28fdefe503fdde53ba9e253e308cb06b44f.tar.gz |
Add some quirks mode rules + presentational hints
Only as a POC for now.
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/renderdocument.nim | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/render/renderdocument.nim b/src/render/renderdocument.nim index e1342dbb..a039cc71 100644 --- a/src/render/renderdocument.nim +++ b/src/render/renderdocument.nim @@ -270,7 +270,7 @@ proc renderBlockContext(grid: var FlexibleGrid, ctx: BlockBox, x, y: int, window x += ctx.offset.x y += ctx.offset.y - if ctx.computed{"background-color"}.rgba.a != 0: #TODO color blending + if ctx.computed{"background-color"}.a != 0: #TODO color blending grid.paintBackground(ctx.computed{"background-color"}, x, y, x + ctx.width, y + ctx.height, window) if ctx of ListItemBox: @@ -287,7 +287,12 @@ proc renderBlockContext(grid: var FlexibleGrid, ctx: BlockBox, x, y: int, window const css = staticRead"res/ua.css" let uastyle = css.parseStylesheet() +const quirk = css & staticRead"res/quirk.css" +let quirkstyle = quirk.parseStylesheet() proc renderDocument*(document: Document, window: WindowAttributes, userstyle: CSSStylesheet, layout: var Viewport, previousStyled: StyledNode): (FlexibleGrid, StyledNode) = + var uastyle = uastyle + if document.mode == QUIRKS: + uastyle = quirkstyle let styledNode = document.applyStylesheets(uastyle, userstyle, previousStyled) result[1] = styledNode layout.renderLayout(document, styledNode) |