aboutsummaryrefslogtreecommitdiffstats
path: root/src/el_style.cpp
blob: f0fbc66fa2703e7e4de308264c9664b1e47bdcb9 (plain)
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
#include "el_style.h"
#include "document.h"


litehtml::el_style::el_style(const std::shared_ptr<document>& doc) : element(doc)
{

}

void litehtml::el_style::parse_attributes()
{
	string text;

	for(auto& el : m_children)
	{
		el->get_text(text);
	}
	get_document()->add_stylesheet( text.c_str(), nullptr, get_attr("media") );
}

bool litehtml::el_style::appendChild(const ptr &el)
{
	if(el && el->is_text())
	{
		m_children.push_back(el);
		return true;
	}
	return false;
}

void litehtml::el_style::compute_styles(bool /* recursive */)
{
	css_w().set_display(display_none);
}

litehtml::string_id litehtml::el_style::tag() const
{
	return _style_;
}

const char* litehtml::el_style::get_tagName() const
{
	return "style";
}