haikuwebkit/LayoutTests/fast/selectors/hover-invalidation-descenda...

40 lines
672 B
HTML
Raw Permalink Normal View History

REGRESSION (r271584): Hovering slowly over and out of "Top 100" items on liberation.fr does not restore animated state https://bugs.webkit.org/show_bug.cgi?id=220862 <rdar://problem/73501684> Reviewed by Simon Fraser. Source/WebCore: The optimization in r271584 fails to invalidate hover/active style when clearing the existing state under some circumstances. Test: fast/selectors/hover-invalidation-descendant-clear.html * dom/Document.cpp: (WebCore::Document::updateHoverActiveState): We would do descendant invalidation when changing the hover/active state of the rootmost changing element. However since the state of descendants was changed before this invalidation happened we would try to invalidate them in a tree that was already in the new state. Fix by scoping the descendant invalidation over all changes. * dom/Element.cpp: (WebCore::Element::setActive): (WebCore::Element::setHovered): Switch to new 3-state enum type that allows us to skip descendant invalidation that has already been done by the caller. Skope it to Style namepace. * dom/Element.h: * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::setActive): * html/HTMLAnchorElement.h: * html/HTMLLabelElement.cpp: (WebCore::HTMLLabelElement::setActive): (WebCore::HTMLLabelElement::setHovered): * html/HTMLLabelElement.h: * html/shadow/SpinButtonElement.cpp: (WebCore::SpinButtonElement::setHovered): * html/shadow/SpinButtonElement.h: * style/PseudoClassChangeInvalidation.cpp: (WebCore::Style::PseudoClassChangeInvalidation::computeInvalidation): * style/PseudoClassChangeInvalidation.h: (WebCore::Style::PseudoClassChangeInvalidation::PseudoClassChangeInvalidation): * style/StyleValidity.h: LayoutTests: * fast/selectors/hover-invalidation-descendant-clear-expected.html: Added. * fast/selectors/hover-invalidation-descendant-clear.html: Added. Canonical link: https://commits.webkit.org/233376@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-27 02:38:15 +00:00
<!DOCTYPE html>
<html>
<head>
<style>
.parent {
position: relative;
padding: 10px;
background-color: silver;
}
.child {
position: absolute;
width: 200px;
height: 200px;
top: 0px;
background-color: green;
display: none;
}
#target2 .child {
display: block;
}
</style>
</head>
<body>
<div>
Test that clearing dynamically activated :hover rule affecting descendants works.
</div>
<div id="target" class="parent enableHover">
Hover to see a green box below.
<div class="child"></div>
</div>
<div id="target2" class="parent enableHover">
Hover to see a green box below.
<div class="child"></div>
</div>
</body>
</html>