-
Notifications
You must be signed in to change notification settings - Fork 1
/
el_tr.cpp
51 lines (42 loc) · 1.04 KB
/
el_tr.cpp
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
#include "litehtml/html.h"
#include "litehtml/el_tr.h"
litehtml::el_tr::el_tr(const std::shared_ptr<litehtml::document>& doc) : html_tag(doc)
{
}
litehtml::el_tr::~el_tr()
{
}
void litehtml::el_tr::parse_attributes()
{
const tchar_t* str = get_attr(_t("align"));
if(str)
{
m_style.add_property(_t("text-align"), str, 0, false);
}
str = get_attr(_t("valign"));
if(str)
{
m_style.add_property(_t("vertical-align"), str, 0, false);
}
str = get_attr(_t("bgcolor"));
if (str)
{
m_style.add_property(_t("background-color"), str, 0, false);
}
html_tag::parse_attributes();
}
void litehtml::el_tr::get_inline_boxes( position::vector& boxes )
{
position pos;
for(auto& el : m_children)
{
if(el->get_display() == display_table_cell)
{
pos.x = el->left() + el->margin_left();
pos.y = el->top() - m_padding.top - m_borders.top;
pos.width = el->right() - pos.x - el->margin_right() - el->margin_left();
pos.height = el->height() + m_padding.top + m_padding.bottom + m_borders.top + m_borders.bottom;
boxes.push_back(pos);
}
}
}