1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

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.
This commit is contained in:
Sam Atkins 2022-02-25 16:58:56 +00:00 committed by Andreas Kling
parent b76ee0e30d
commit 5113128bc9

View file

@ -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.