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_anchor.cpp | |
parent | 5784fc3a62b9136c6690ed45ec7b505f35512e08 (diff) |
litehtml - lightweight html renderer
Diffstat (limited to 'libs/litehtml/src/el_anchor.cpp')
-rw-r--r-- | libs/litehtml/src/el_anchor.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libs/litehtml/src/el_anchor.cpp b/libs/litehtml/src/el_anchor.cpp new file mode 100644 index 0000000000..372e4afb50 --- /dev/null +++ b/libs/litehtml/src/el_anchor.cpp @@ -0,0 +1,26 @@ +#include "html.h" +#include "el_anchor.h" +#include "document.h" + +litehtml::el_anchor::el_anchor(const std::shared_ptr<litehtml::document>& doc) : html_tag(doc) +{ +} + +void litehtml::el_anchor::on_click() +{ + const char* href = get_attr("href"); + + if(href) + { + get_document()->container()->on_anchor_click(href, shared_from_this()); + } +} + +void litehtml::el_anchor::apply_stylesheet( const litehtml::css& stylesheet ) +{ + if( get_attr("href") ) + { + m_pseudo_classes.push_back(_link_); + } + html_tag::apply_stylesheet(stylesheet); +} |