blob: 29ed576a1a3fbf2b1f88ad4f384b8f98cf08bae9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
import types/enums
import css/values
import html/dom
type
CSSRect* = object
x1*: int
y1*: int
x2*: int
y2*: int
CSSBox* = ref CSSBoxObj
CSSBoxObj = object of RootObj
x*: int
y*: int
width*: int
height*: int
children*: seq[CSSBox]
icontext*: InlineContext
bcontext*: BlockContext
cssvalues*: CSSComputedValues
#TODO move fromy
InlineContext* = ref object
fromx*: int
fromy*: int
conty*: bool
whitespace*: bool
ws_initial*: bool
BlockContext* = ref object
fromy*: int
margin_done*: int
margin_todo*: int
LayoutState* = object
nodes*: seq[Node]
CSSRowBox* = object
x*: int
y*: int
width*: int
height*: int
color*: CSSColor
fontstyle*: CSSFontStyle
fontweight*: int
textdecoration*: CSSTextDecoration
str*: string
nodes*: seq[Node]
CSSInlineBox* = ref CSSInlineBoxObj
CSSInlineBoxObj = object of CSSBox
content*: seq[CSSRowBox]
CSSBlockBox* = ref CSSBlockBoxObj
CSSBlockBoxObj = object of CSSBox
|