Bug 1918762 - Use ElementState rather than the hover attribute to determine scrollbar hover state. r=mac-reviewers,mstange

That's what we use for painting in all platforms except macOS with
overlay scrollbars, where we make it sticky. Make the stickiness more
explicit (this also fixes the sticky state getting cleaned up too
early).

Differential Revision: https://phabricator.services.mozilla.com/D222161
This commit is contained in:
Emilio Cobos Álvarez
2024-09-17 08:08:20 +00:00
parent 6a3990e155
commit 117a44742f
7 changed files with 94 additions and 84 deletions

View File

@@ -3409,7 +3409,8 @@ static void AppendToTop(nsDisplayListBuilder* aBuilder,
struct HoveredStateComparator {
static bool Hovered(const nsIFrame* aFrame) {
return aFrame->GetContent()->IsElement() &&
aFrame->GetContent()->AsElement()->HasAttr(nsGkAtoms::hover);
aFrame->GetContent()->AsElement()->State().HasState(
ElementState::HOVER);
}
bool Equals(nsIFrame* A, nsIFrame* B) const {