aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikita Baryshnikov <[email protected]>2025-06-03 16:44:49 +0300
committerNikita Baryshnikov <[email protected]>2025-06-12 13:33:51 +0000
commitc76136afd28d03306bdc10bc396a94e812aeabb1 (patch)
tree6ebe85a5a35ea2d9e1d7ba7d3276a705ab236670 /src
parent3fe5821dad98747d6e41c9ed54b86c3d0eee9daf (diff)
DocumentContainerPrivate: use tag instead of tagName for known elementsHEADmaster
such as body Change-Id: I0e0a8cf1ef4d8efad62b621f55b362e6cd2764dc Reviewed-by: Eike Ziller <[email protected]> Reviewed-by: Audun Sutterud <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/container_qpainter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/container_qpainter.cpp b/src/container_qpainter.cpp
index 00d77d7..1299e77 100644
--- a/src/container_qpainter.cpp
+++ b/src/container_qpainter.cpp
@@ -200,8 +200,8 @@ static bool deepest_child_at_point(const litehtml::element::ptr &element,
// Do not continue down elements that do not cover the position. Exceptions:
// - elements with 0 size (includes anchors and other weird elements)
// - html and body, which for some reason have size == viewport size
- if (!placement.size().isEmpty() && element->tag() != litehtml::_html_
- && element->tag() != litehtml::_body_ && !placement.contains(pos)) {
+ if (!placement.size().isEmpty() && element->tag() != litehtml::string_id::_html_
+ && element->tag() != litehtml::string_id::_body_ && !placement.contains(pos)) {
return false /*continue iterating*/;
}
// qDebug() << qPrintable(QString(level * 2, ' ')) << element->dump_get_name() << placement << pos;
@@ -624,9 +624,9 @@ void DocumentContainerPrivate::drawSelection(QPainter *painter, const QRect &cli
static bool isInBody(const litehtml::element::ptr &e)
{
litehtml::element::ptr current = e;
- while (current && QString::fromUtf8(current->get_tagName()).toLower() != "body")
+ while (current && current->tag() != litehtml::string_id::_body_)
current = current->parent();
- return (bool)current;
+ return current.get() != nullptr;
}
void DocumentContainerPrivate::buildIndex()