Div A" + "
Div B" + "
Div C" + "
Div D"
30 | + "
"
31 | + "
" + "
" + "
" + "
Adham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWAAdham Enaya from palestine I am working at UNRWA as ABAP developer can youUNRWA as ABAP developer can youUNRWA as ABAP developer can youUNRWA as ABAP developer can youUNRWA as ABAP developer can you check my LinkedIn profile
";
32 |
33 | String css = " * { display: block; padding: 12px;}" + ".a { background: #ff0000; }" + ".b { background: #ffa500; }"
34 | + ".c { background: #ffff00; }" + ".d { background: #008000; }" + ".e { background: #0000ff; }"
35 | + ".f { background: #4b0082; }" + ".g { background: #800080; }";
36 |
37 | Dimensions initialBlock = new Dimensions();
38 |
39 | initialBlock.content = new Rect(0.0f, 0.0f, 800.0f, 600.0f);
40 | initialBlock.border = new EdgeSizes();
41 | initialBlock.margin = new EdgeSizes();
42 | initialBlock.padding = new EdgeSizes();
43 |
44 | CSSParser cssParser = new CSSParser();
45 | HTMLParser htmlParser = new HTMLParser();
46 | StyleBuilder styleBuilder = new StyleBuilder();
47 | LayoutTreeBuilder layoutBuilder = new LayoutTreeBuilder();
48 | DisplayListBuilder displayListBuilder = new DisplayListBuilder();
49 | LayoutCanvas layoutCanvas = new LayoutCanvas();
50 |
51 | // 1. Parse CSS file
52 | StyleSheet style = cssParser.parse(css);
53 |
54 | // 2. Parse HTML file
55 | Node htmlTree = htmlParser.parse(html);
56 |
57 | // 3. Generate the style tree
58 | StyledNode styleTree = styleBuilder.build(htmlTree, style);
59 |
60 | // 4. Generate the layout boxes tree
61 | LayoutBox box = layoutBuilder.layoutTree(styleTree, initialBlock);
62 |
63 | // 5. Generate the paint command list
64 | Vector