From 705c4d24c9c61edffc82864bf9c24384dc29a8d7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Mar 2024 12:13:54 +0300 Subject: litehtml - lightweight html renderer --- libs/litehtml/src/el_anchor.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 libs/litehtml/src/el_anchor.cpp (limited to 'libs/litehtml/src/el_anchor.cpp') 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& 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); +} -- cgit v1.2.3