Changeset 202324 in webkit
- Timestamp:
- Jun 21, 2016, 10:52:05 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/ancestor-of-hovered-element-detached-expected.txt (added)
-
LayoutTests/fast/css/ancestor-of-hovered-element-detached.html (added)
-
LayoutTests/fast/css/ancestor-of-hovered-element-removed-expected.txt (added)
-
LayoutTests/fast/css/ancestor-of-hovered-element-removed.html (added)
-
LayoutTests/platform/ios-simulator/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/style/RenderTreeUpdater.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202322 r202324 1 2016-06-21 Benjamin Poulain <bpoulain@apple.com> 2 3 :hover CSS pseudo-class sometimes keeps matching ever after mouse has left the element 4 https://bugs.webkit.org/show_bug.cgi?id=158340 5 6 Reviewed by Simon Fraser. 7 8 * fast/css/ancestor-of-hovered-element-detached-expected.txt: Added. 9 * fast/css/ancestor-of-hovered-element-detached.html: Added. 10 * fast/css/ancestor-of-hovered-element-removed-expected.txt: Added. 11 * fast/css/ancestor-of-hovered-element-removed.html: Added. 12 1 13 2016-06-21 Alexey Proskuryakov <ap@apple.com> 2 14 -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r202292 r202324 1390 1390 fast/css-generated-content/table-parts-before-and-after.html [ Failure ] 1391 1391 fast/css/absolute-child-with-percent-height-inside-relative-parent.html [ Failure ] 1392 fast/css/ancestor-of-hovered-element-detached.html [ Failure ] 1393 fast/css/ancestor-of-hovered-element-removed.html [ Failure ] 1392 1394 fast/css/background-image-with-baseurl.html [ Failure ] 1393 1395 fast/css/button-height.html [ Failure ] -
trunk/Source/WebCore/ChangeLog
r202323 r202324 1 2016-06-21 Benjamin Poulain <bpoulain@apple.com> 2 3 :hover CSS pseudo-class sometimes keeps matching ever after mouse has left the element 4 https://bugs.webkit.org/show_bug.cgi?id=158340 5 6 Reviewed by Simon Fraser. 7 8 When removing a hovered subtree from the document, we were getting 9 into an inconsistent state where m_hoveredElement is in the detached 10 subtree and we have no way of clearing the existing IsHovered flags. 11 12 What happens is: 13 -The root "a" has an child "b" that is hovered. 14 -"a" starts being removed from the tree, its renderer is destroyed. 15 -RenderTreeUpdater::tearDownRenderers() pushes "a" on the teardownStack 16 and calls hoveredElementDidDetach(). 17 -hoveredElementDidDetach() is called with "a". "a" is not the hovered 18 element, the function does nothing. 19 -RenderTreeUpdater::tearDownRenderers() pushes "b" on the teardownStack 20 and calls hoveredElementDidDetach(). 21 -hoveredElementDidDetach() is called with "b". The next parent with a renderer 22 is "a", m_hoveredElement is set to "a". 23 -"a"'s parent is set to nullptr. 24 25 -> We have a m_hoveredElement on the root of a detached tree, making 26 it impossible to clear the real dirty tree. 27 28 This patch changes the order in which we clear the flags. 29 It is done in the order in which we clear the renderers to ensure 30 the last element with a dead renderer is the last to update m_hoveredElement. 31 32 Tests: fast/css/ancestor-of-hovered-element-detached.html 33 fast/css/ancestor-of-hovered-element-removed.html 34 35 * Source/WebCore/style/RenderTreeUpdater.cpp: 36 1 37 2016-06-21 Youenn Fablet <youennf@gmail.com> 2 38 -
trunk/Source/WebCore/style/RenderTreeUpdater.cpp
r201393 r202324 519 519 if (element.hasCustomStyleResolveCallbacks()) 520 520 element.willDetachRenderers(); 521 if (teardownType != TeardownType::KeepHoverAndActive)522 element.clearHoverAndActiveStatusBeforeDetachingRenderer();523 element.clearStyleDerivedDataBeforeDetachingRenderer();524 525 521 teardownStack.append(&element); 526 522 }; … … 529 525 while (teardownStack.size() > depth) { 530 526 auto& element = *teardownStack.takeLast(); 527 528 if (teardownType != TeardownType::KeepHoverAndActive) 529 element.clearHoverAndActiveStatusBeforeDetachingRenderer(); 530 element.clearStyleDerivedDataBeforeDetachingRenderer(); 531 531 532 532 if (auto* renderer = element.renderer()) {
Note:
See TracChangeset
for help on using the changeset viewer.