Disable stack execution on plugins
[claws.git] / src / plugins / litehtml_viewer / litehtml / el_link.cpp
blobaa3bc7659729ea4dd19a6d17011230eb4f72f494
1 #include "html.h"
2 #include "el_link.h"
3 #include "document.h"
6 litehtml::el_link::el_link(const std::shared_ptr<document>& doc) : litehtml::html_tag(doc)
11 void litehtml::el_link::parse_attributes()
13 bool processed = false;
15 document::ptr doc = get_document();
17 const char* rel = get_attr("rel");
18 if(rel && !strcmp(rel, "stylesheet"))
20 const char* media = get_attr("media");
21 const char* href = get_attr("href");
22 if(href && href[0])
24 string css_text;
25 string css_baseurl;
26 doc->container()->import_css(css_text, href, css_baseurl);
27 if(!css_text.empty())
29 doc->add_stylesheet(css_text.c_str(), css_baseurl.c_str(), media);
30 processed = true;
35 if(!processed)
37 doc->container()->link(doc, shared_from_this());