Cogs.Core
el_style.cpp
1#include "html.h"
2#include "el_style.h"
3#include "document.h"
4
5
6litehtml::el_style::el_style(const std::shared_ptr<litehtml::document>& doc) : litehtml::element(doc)
7{
8
9}
10
11litehtml::el_style::~el_style()
12{
13
14}
15
16void litehtml::el_style::parse_attributes()
17{
18 tstring text;
19
20 for(auto& el : m_children)
21 {
22 el->get_text(text);
23 }
24 get_document()->add_stylesheet( text.c_str(), 0, get_attr(_t("media")) );
25}
26
27bool litehtml::el_style::appendChild(const ptr &el)
28{
29 m_children.push_back(el);
30 return true;
31}
32
33const litehtml::tchar_t* litehtml::el_style::get_tagName() const
34{
35 return _t("style");
36}