Changeset 240011 in webkit
- Timestamp:
- Jan 15, 2019 2:57:27 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r240005 r240011 1 2019-01-15 Simon Fraser <simon.fraser@apple.com> 2 3 Clean up code related to the updating of Dashboard and touch event regions 4 https://bugs.webkit.org/show_bug.cgi?id=193460 5 6 Reviewed by Zalan Bujtas. 7 8 In preparation for layout testing that can count the number of event region 9 updates, move the code related to updating "annotated" (Dashboard) regions, and 10 touch event regions into bottleneck functions in Document. 11 12 Updating these two kinds of regions is generally similar, but there are some code paths 13 that eagerly update annotated regions. 14 15 No behavior change. 16 17 * dom/Document.cpp: 18 (WebCore::Document::updateAnnotatedRegions): Moved from FrameView. 19 (WebCore::Document::invalidateRenderingDependentRegions): 20 (WebCore::Document::invalidateScrollbarDependentRegions): 21 (WebCore::Document::updateZOrderDependentRegions): 22 * dom/Document.h: 23 (WebCore::Document::setAnnotatedRegionsDirty): 24 (WebCore::Document::annotatedRegionsDirty const): 25 (WebCore::Document::hasAnnotatedRegions const): 26 * page/FrameView.cpp: 27 (WebCore::FrameView::didLayout): 28 (WebCore::FrameView::didPaintContents): 29 (WebCore::FrameView::updateAnnotatedRegions): Deleted. 30 * page/FrameView.h: 31 * rendering/RenderElement.cpp: Drive-by header cleanup. 32 (WebCore::RenderElement::styleWillChange): 33 * rendering/RenderLayer.cpp: 34 (WebCore::RenderLayer::scrollTo): 35 (WebCore::RenderLayer::setHasHorizontalScrollbar): 36 (WebCore::RenderLayer::setHasVerticalScrollbar): 37 (WebCore::RenderLayer::updateScrollbarsAfterLayout): 38 (WebCore::RenderLayer::calculateClipRects const): 39 * rendering/RenderListBox.cpp: 40 (WebCore::RenderListBox::setHasVerticalScrollbar): 41 1 42 2019-01-15 David Kilzer <ddkilzer@apple.com> 2 43 -
trunk/Source/WebCore/dom/Document.cpp
r239904 r240011 4100 4100 4101 4101 #if ENABLE(DASHBOARD_SUPPORT) 4102 4103 4102 const Vector<AnnotatedRegionValue>& Document::annotatedRegions() const 4104 4103 { … … 4112 4111 } 4113 4112 4114 #endif 4113 void Document::updateAnnotatedRegions() 4114 { 4115 if (!hasAnnotatedRegions()) 4116 return; 4117 4118 Vector<AnnotatedRegionValue> newRegions; 4119 renderBox()->collectAnnotatedRegions(newRegions); // FIXME. 4120 if (newRegions == annotatedRegions()) 4121 return; 4122 4123 setAnnotatedRegions(newRegions); 4124 4125 if (Page* page = this->page()) 4126 page->chrome().client().annotatedRegionsChanged(); 4127 } 4128 #endif 4129 4130 void Document::invalidateRenderingDependentRegions(AnnotationsAction annotationsAction) 4131 { 4132 #if ENABLE(DASHBOARD_SUPPORT) 4133 // FIXME: we don't have a good invalidation/update policy for Dashboard regions. They get eagerly updated 4134 // on forced layouts, and don't need to be. 4135 if (annotationsAction == AnnotationsAction::Update) 4136 updateAnnotatedRegions(); 4137 else 4138 setAnnotatedRegionsDirty(); 4139 #else 4140 UNUSED_PARAM(annotationsAction); 4141 #endif 4142 4143 #if PLATFORM(IOS_FAMILY) && ENABLE(TOUCH_EVENTS) 4144 setTouchEventRegionsNeedUpdate(); 4145 #endif 4146 } 4147 4148 void Document::invalidateScrollbarDependentRegions() 4149 { 4150 #if ENABLE(DASHBOARD_SUPPORT) 4151 if (hasAnnotatedRegions()) 4152 setAnnotatedRegionsDirty(); 4153 #endif 4154 } 4155 4156 void Document::updateZOrderDependentRegions() 4157 { 4158 #if ENABLE(DASHBOARD_SUPPORT) 4159 if (annotatedRegionsDirty()) 4160 updateAnnotatedRegions(); 4161 #endif 4162 } 4115 4163 4116 4164 bool Document::setFocusedElement(Element* element, FocusDirection direction, FocusRemovalEventsMode eventsMode) -
trunk/Source/WebCore/dom/Document.h
r239864 r240011 1138 1138 1139 1139 #if ENABLE(DASHBOARD_SUPPORT) 1140 void setAnnotatedRegionsDirty(bool f) { m_annotatedRegionsDirty = f; }1141 bool annotatedRegionsDirty() const { return m_annotatedRegionsDirty; }1142 bool hasAnnotatedRegions () const { return m_hasAnnotatedRegions; }1143 1140 void setHasAnnotatedRegions(bool f) { m_hasAnnotatedRegions = f; } 1144 1141 WEBCORE_EXPORT const Vector<AnnotatedRegionValue>& annotatedRegions() const; 1145 void setAnnotatedRegions(const Vector<AnnotatedRegionValue>&); 1146 #endif 1142 #endif 1143 1144 enum class AnnotationsAction { Invalidate, Update }; 1145 void invalidateRenderingDependentRegions(AnnotationsAction = AnnotationsAction::Invalidate); 1146 void invalidateScrollbarDependentRegions(); 1147 void updateZOrderDependentRegions(); 1147 1148 1148 1149 void removeAllEventListeners() final; … … 1635 1636 void wheelEventHandlersChanged(); 1636 1637 1638 #if ENABLE(DASHBOARD_SUPPORT) 1639 void setAnnotatedRegionsDirty(bool f = true) { m_annotatedRegionsDirty = f; } 1640 bool annotatedRegionsDirty() const { return m_annotatedRegionsDirty; } 1641 bool hasAnnotatedRegions () const { return m_hasAnnotatedRegions; } 1642 void setAnnotatedRegions(const Vector<AnnotatedRegionValue>&); 1643 void updateAnnotatedRegions(); 1644 #endif 1645 1637 1646 HttpEquivPolicy httpEquivPolicy() const; 1638 1647 AXObjectCache* existingAXObjectCacheSlow() const; -
trunk/Source/WebCore/page/FrameView.cpp
r239689 r240011 1305 1305 #endif 1306 1306 1307 #if ENABLE(DASHBOARD_SUPPORT) 1308 updateAnnotatedRegions(); 1309 #endif 1310 1311 #if ENABLE(IOS_TOUCH_EVENTS) 1312 frame().document()->setTouchEventRegionsNeedUpdate(); 1313 #endif 1307 frame().document()->invalidateRenderingDependentRegions(Document::AnnotationsAction::Update); 1314 1308 1315 1309 updateCanBlitOnScrollRecursively(); … … 3882 3876 return false; 3883 3877 } 3884 3885 #if ENABLE(DASHBOARD_SUPPORT)3886 void FrameView::updateAnnotatedRegions()3887 {3888 Document* document = frame().document();3889 if (!document->hasAnnotatedRegions())3890 return;3891 Vector<AnnotatedRegionValue> newRegions;3892 document->renderBox()->collectAnnotatedRegions(newRegions);3893 if (newRegions == document->annotatedRegions())3894 return;3895 document->setAnnotatedRegions(newRegions);3896 Page* page = frame().page();3897 if (!page)3898 return;3899 page->chrome().client().annotatedRegionsChanged();3900 }3901 #endif3902 3878 3903 3879 void FrameView::updateScrollCorner() … … 4178 4154 4179 4155 // Regions may have changed as a result of the visibility/z-index of element changing. 4180 #if ENABLE(DASHBOARD_SUPPORT) 4181 if (frame().document()->annotatedRegionsDirty()) 4182 updateAnnotatedRegions(); 4183 #endif 4156 frame().document()->updateZOrderDependentRegions(); 4184 4157 4185 4158 if (paintingState.isTopLevelPainter) -
trunk/Source/WebCore/page/FrameView.h
r239689 r240011 334 334 void loadProgressingStatusChanged(); 335 335 336 #if ENABLE(DASHBOARD_SUPPORT)337 void updateAnnotatedRegions();338 #endif339 336 WEBCORE_EXPORT void updateControlTints(); 340 337 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r239173 r240011 49 49 #include "RenderFlexibleBox.h" 50 50 #include "RenderFragmentedFlow.h" 51 #include "RenderGrid.h" 51 52 #include "RenderImage.h" 52 53 #include "RenderImageResourceStyleImage.h" … … 79 80 #include <wtf/MathExtras.h> 80 81 #include <wtf/StackStats.h> 81 82 #include "RenderGrid.h"83 82 84 83 namespace WebCore { … … 710 709 || m_style.zIndex() != newStyle.zIndex() 711 710 || m_style.hasAutoZIndex() != newStyle.hasAutoZIndex(); 712 #if ENABLE(DASHBOARD_SUPPORT) 711 713 712 if (visibilityChanged) 714 document().setAnnotatedRegionsDirty(true); 715 #endif 716 #if PLATFORM(IOS_FAMILY) && ENABLE(TOUCH_EVENTS) 717 if (visibilityChanged) 718 document().setTouchEventRegionsNeedUpdate(); 719 #endif 713 document().invalidateRenderingDependentRegions(); 714 720 715 if (visibilityChanged) { 721 716 if (AXObjectCache* cache = document().existingAXObjectCache()) … … 738 733 if (m_parent && (newStyle.outlineSize() < m_style.outlineSize() || shouldRepaintForStyleDifference(diff))) 739 734 repaint(); 735 740 736 if (isFloating() && m_style.floating() != newStyle.floating()) { 741 737 // For changes in float styles, we need to conceivably remove ourselves -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r239985 r240011 2393 2393 // If we're in the middle of layout, we'll just update layers once layout has finished. 2394 2394 updateLayerPositionsAfterOverflowScroll(); 2395 // Update regions, scrolling may change the clip of a particular region. 2396 #if ENABLE(DASHBOARD_SUPPORT) 2397 view.frameView().updateAnnotatedRegions(); 2398 #endif 2395 2399 2396 view.frameView().scheduleUpdateWidgetPositions(); 2400 2397 … … 2412 2409 } 2413 2410 2414 #if PLATFORM(IOS_FAMILY) && ENABLE(TOUCH_EVENTS) 2415 renderer().document().setTouchEventRegionsNeedUpdate(); 2416 #endif 2411 // Update regions, scrolling may change the clip of a particular region. 2412 renderer().document().invalidateRenderingDependentRegions(Document::AnnotationsAction::Update); 2417 2413 DebugPageOverlays::didLayout(renderer().frame()); 2418 2414 } … … 3194 3190 m_vBar->styleChanged(); 3195 3191 3196 // Force an update since we know the scrollbars have changed things. 3197 #if ENABLE(DASHBOARD_SUPPORT) 3198 if (renderer().document().hasAnnotatedRegions()) 3199 renderer().document().setAnnotatedRegionsDirty(true); 3200 #endif 3192 renderer().document().invalidateScrollbarDependentRegions(); 3201 3193 } 3202 3194 … … 3225 3217 m_vBar->styleChanged(); 3226 3218 3227 // Force an update since we know the scrollbars have changed things. 3228 #if ENABLE(DASHBOARD_SUPPORT) 3229 if (renderer().document().hasAnnotatedRegions()) 3230 renderer().document().setAnnotatedRegionsDirty(true); 3231 #endif 3219 renderer().document().invalidateScrollbarDependentRegions(); 3232 3220 } 3233 3221 … … 3495 3483 updateSelfPaintingLayer(); 3496 3484 3497 // Force an update since we know the scrollbars have changed things. 3498 #if ENABLE(DASHBOARD_SUPPORT) 3499 if (renderer().document().hasAnnotatedRegions()) 3500 renderer().document().setAnnotatedRegionsDirty(true); 3501 #endif 3502 3485 renderer().document().invalidateScrollbarDependentRegions(); 3503 3486 renderer().repaint(); 3504 3487 … … 6380 6363 #if PLATFORM(IOS_FAMILY) && ENABLE(TOUCH_EVENTS) 6381 6364 if (diff == StyleDifference::RecompositeLayer || diff >= StyleDifference::LayoutPositionedMovementOnly) 6382 renderer().document(). setTouchEventRegionsNeedUpdate();6365 renderer().document().invalidateRenderingDependentRegions(); 6383 6366 #else 6384 6367 UNUSED_PARAM(diff); -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r239461 r240011 955 955 m_vBar->styleChanged(); 956 956 957 // Force an update since we know the scrollbars have changed things. 958 #if ENABLE(DASHBOARD_SUPPORT) 959 if (document().hasAnnotatedRegions()) 960 document().setAnnotatedRegionsDirty(true); 961 #endif 957 document().invalidateScrollbarDependentRegions(); 962 958 } 963 959
Note: See TracChangeset
for help on using the changeset viewer.