diff options
author | George Hazan <george.hazan@gmail.com> | 2024-03-18 12:13:54 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-03-18 12:13:54 +0300 |
commit | 705c4d24c9c61edffc82864bf9c24384dc29a8d7 (patch) | |
tree | 4d21f87671db36b99402da3221d45b64c257c1fe /libs/litehtml/src/el_style.cpp | |
parent | 5784fc3a62b9136c6690ed45ec7b505f35512e08 (diff) |
litehtml - lightweight html renderer
Diffstat (limited to 'libs/litehtml/src/el_style.cpp')
-rw-r--r-- | libs/litehtml/src/el_style.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/libs/litehtml/src/el_style.cpp b/libs/litehtml/src/el_style.cpp new file mode 100644 index 0000000000..cc2f0bab6d --- /dev/null +++ b/libs/litehtml/src/el_style.cpp @@ -0,0 +1,36 @@ +#include "html.h" +#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) +{ + m_children.push_back(el); + return true; +} + +litehtml::string_id litehtml::el_style::tag() const +{ + return _style_; +} + +const char* litehtml::el_style::get_tagName() const +{ + return "style"; +} |