summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-02-25 16:58:56 +0000
committerAndreas Kling <kling@serenityos.org>2022-02-25 19:35:34 +0100
commit5113128bc9a7f904d43ba5b74f2e9ad02c597a73 (patch)
treea078ac52458239ad31b82c50b10f53dd4298c60b /Userland
parentb76ee0e30d38200b1416a11d0daecb138daded0f (diff)
downloadserenity-5113128bc9a7f904d43ba5b74f2e9ad02c597a73.zip
LibWeb: Paint InlineNode overlay in correct phase, skip pseudo-elements
We were painting this in the Foreground phase by mistake. Also, the `inspected_node() == dom_node()` check returns true for pseudo-elements (both values are nullptr) so I've added an extra check there. As noted, once pseudo-elements are inspectable we will need to revisit this.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/Layout/InlineNode.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/InlineNode.cpp b/Userland/Libraries/LibWeb/Layout/InlineNode.cpp
index 2422d4b356..68048e7cb8 100644
--- a/Userland/Libraries/LibWeb/Layout/InlineNode.cpp
+++ b/Userland/Libraries/LibWeb/Layout/InlineNode.cpp
@@ -112,7 +112,9 @@ void InlineNode::paint(PaintContext& context, PaintPhase phase)
});
}
- if (phase == PaintPhase::Foreground && document().inspected_node() == dom_node()) {
+ // FIXME: We check for a non-null dom_node(), since pseudo-elements have a null one and were getting
+ // highlighted incorrectly. A better solution will be needed if we want to inspect them too.
+ if (phase == PaintPhase::Overlay && dom_node() && document().inspected_node() == dom_node()) {
// FIXME: This paints a double-thick border between adjacent fragments, where ideally there
// would be none. Once we implement non-rectangular outlines for the `outline` CSS
// property, we can use that here instead.