Changeset 208003 in webkit
- Timestamp:
- Oct 27, 2016 1:56:17 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r208000 r208003 1 2016-10-25 Brent Fulgham <bfulgham@apple.com> 2 3 Prevent hit tests from being performed on an invalid render tree 4 https://bugs.webkit.org/show_bug.cgi?id=163877 5 <rdar://problem/28675761> 6 7 Reviewed by Simon Fraser. 8 9 * fast/layers/prevent-hit-test-during-layout-expected.txt: Added. 10 * fast/layers/prevent-hit-test-during-layout.html: Added. 11 * platform/efl/TestExpectations: Skip on this platform. 12 * platform/gtk/TestExpectations: Skip on this platform. 13 * platform/ios-simulator/TestExpectations: Skip on this platform. 14 * platform/win/TestExpectations: Skip on this platform. 15 1 16 2016-10-27 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/LayoutTests/platform/efl/TestExpectations
r207989 r208003 596 596 security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html [ Skip ] 597 597 security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html [ Skip ] 598 599 # Only Mac has implemented DictionaryLookup 600 fast/layers/prevent-hit-test-during-layout.html [ Skip ] 598 601 599 602 #//////////////////////////////////////////////////////////////////////////////////////// -
trunk/LayoutTests/platform/gtk/TestExpectations
r207989 r208003 1704 1704 webkit.org/b/152247 fast/forms/input-appearance-spinbutton.html [ Skip ] 1705 1705 webkit.org/b/152247 fast/forms/listbox-scrollbar-hit-test.html [ Skip ] 1706 1707 # Only Mac has implemented DictionaryLookup 1708 fast/layers/prevent-hit-test-during-layout.html [ Skip ] 1706 1709 1707 1710 #//////////////////////////////////////////////////////////////////////////////////////// -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r207841 r208003 2732 2732 2733 2733 webkit.org/b/158836 imported/w3c/web-platform-tests/encrypted-media [ Skip ] 2734 2735 # Only Mac has implemented DictionaryLookup 2736 fast/layers/prevent-hit-test-during-layout.html [ Skip ] -
trunk/LayoutTests/platform/win/TestExpectations
r207660 r208003 3623 3623 # html/syntax web platform tests are failing on Windows. 3624 3624 webkit.org/b/162415 imported/w3c/web-platform-tests/html/syntax [ Skip ] 3625 3626 # Only Mac has implemented DictionaryLookup 3627 fast/layers/prevent-hit-test-during-layout.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r208002 r208003 1 2016-10-27 Brent Fulgham <bfulgham@apple.com> 2 3 Prevent hit tests from being performed on an invalid render tree 4 https://bugs.webkit.org/show_bug.cgi?id=163877 5 <rdar://problem/28675761> 6 7 Reviewed by Simon Fraser. 8 9 Changeset r200971 added code to ensure that layout is up-to-date before hit testing, but did 10 so only for the main frame. It was still possible to enter cross-frame hit testing with a 11 subframe needing style recalc. In that situation, the subframe's updateLayout() would get 12 called, which could trigger a compositing change that marked the parent frame as needing style 13 recalc. A subsequent layout on the parent frame (for example by hit testing traversing into 14 a second subframe) could then mutate the parent frame's layer tree while hit testing was 15 traversing it. 16 17 This patch modifies the hit test logic to ensure that a recursive layout is performed so that 18 we always perform hit tests on a clean set of frames. It also adds some assertions to warn 19 us if we encounter this invalid state. 20 21 Tested by fast/layers/prevent-hit-test-during-layout.html. 22 23 * dom/Document.cpp: 24 (WebCore::Document::scheduleStyleRecalc): Assert that we are not hit testing 25 during style recalculation. 26 * page/EventHandler.cpp: 27 (WebCore::EventHandler::hitTestResultAtPoint): Ensure that we have a clean render tree 28 when hit testing. 29 * page/FrameView.cpp: 30 (WebCore::FrameView::setNeedsLayout): Assert that we are not in the process of hit testing 31 when we schedule a layout. 32 * rendering/RenderView.cpp: 33 (WebCore::RenderView::hitTest): Mark RenderView as in an active hit test. 34 * rendering/RenderView.h: 35 1 36 2016-10-27 Zan Dobersek <zdobersek@igalia.com> 2 37 -
trunk/Source/WebCore/dom/Document.cpp
r207810 r208003 1756 1756 void Document::scheduleStyleRecalc() 1757 1757 { 1758 ASSERT(!m_renderView || !m_renderView->inHitTesting()); 1759 1758 1760 if (m_styleRecalcTimer.isActive() || pageCacheState() != NotInPageCache) 1759 1761 return; -
trunk/Source/WebCore/page/EventHandler.cpp
r207689 r208003 1146 1146 unsigned nonNegativePaddingWidth = std::max<LayoutUnit>(0, padding.width()).toUnsigned(); 1147 1147 unsigned nonNegativePaddingHeight = std::max<LayoutUnit>(0, padding.height()).toUnsigned(); 1148 1148 1149 // We should always start hit testing a clean tree. 1149 if (m_frame.document()) 1150 m_frame.document()->updateLayoutIgnorePendingStylesheets(); 1150 if (auto* frameView = m_frame.view()) 1151 frameView->updateLayoutAndStyleIfNeededRecursive(); 1152 1151 1153 HitTestResult result(point, nonNegativePaddingHeight, nonNegativePaddingWidth, nonNegativePaddingHeight, nonNegativePaddingWidth); 1152 1154 RenderView* renderView = m_frame.contentRenderer(); -
trunk/Source/WebCore/page/FrameView.cpp
r207814 r208003 2846 2846 } 2847 2847 2848 if (RenderView* renderView = this->renderView()) 2848 if (auto* renderView = this->renderView()) { 2849 ASSERT(!renderView->inHitTesting()); 2849 2850 renderView->setNeedsLayout(); 2851 } 2850 2852 } 2851 2853 -
trunk/Source/WebCore/rendering/RenderView.cpp
r206538 r208003 53 53 #include "TransformState.h" 54 54 #include <wtf/StackStats.h> 55 #include <wtf/TemporaryChange.h> 55 56 56 57 namespace WebCore { … … 184 185 { 185 186 document().updateLayout(); 187 188 #if !ASSERT_DISABLED 189 TemporaryChange<bool> hitTestRestorer { m_inHitTesting, true }; 190 #endif 186 191 187 192 FrameFlatteningLayoutDisallower disallower(frameView()); -
trunk/Source/WebCore/rendering/RenderView.h
r204400 r208003 1 1 /* 2 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 * Copyright (C) 2006, 2015 Apple Inc.3 * Copyright (C) 2006, 2015-2016 Apple Inc. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 251 251 #endif 252 252 253 #if !ASSERT_DISABLED 254 bool inHitTesting() const { return m_inHitTesting; } 255 #endif 256 253 257 protected: 254 258 void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override; … … 361 365 bool m_usesFirstLineRules { false }; 362 366 bool m_usesFirstLetterRules { false }; 367 #if !ASSERT_DISABLED 368 bool m_inHitTesting { false }; 369 #endif 363 370 364 371 HashSet<RenderElement*> m_renderersWithPausedImageAnimation;
Note: See TracChangeset
for help on using the changeset viewer.