diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-10-24 11:30:15 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-10-30 12:56:19 +0000 |
commit | 6036726eb981b6c4b42047513b9d3f4ac865daac (patch) | |
tree | 673593e70678e7789766d1f732eb51f613a2703b /chromium/third_party/blink/renderer/core/frame/local_frame_view.h | |
parent | 466052c4e7c052268fd931888cd58961da94c586 (diff) | |
download | qtwebengine-chromium-6036726eb981b6c4b42047513b9d3f4ac865daac.tar.gz |
BASELINE: Update Chromium to 70.0.3538.78
Change-Id: Ie634710bf039e26c1957f4ae45e101bd4c434ae7
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/frame/local_frame_view.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/frame/local_frame_view.h | 96 |
1 files changed, 81 insertions, 15 deletions
diff --git a/chromium/third_party/blink/renderer/core/frame/local_frame_view.h b/chromium/third_party/blink/renderer/core/frame/local_frame_view.h index 9e546708d7c..b8103714e46 100644 --- a/chromium/third_party/blink/renderer/core/frame/local_frame_view.h +++ b/chromium/third_party/blink/renderer/core/frame/local_frame_view.h @@ -41,8 +41,8 @@ #include "third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.h" #include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h" #include "third_party/blink/renderer/core/paint/layout_object_counter.h" +#include "third_party/blink/renderer/core/scroll/scrollable_area.h" #include "third_party/blink/renderer/platform/graphics/graphics_layer_client.h" -#include "third_party/blink/renderer/platform/scroll/scrollable_area.h" namespace blink { @@ -56,7 +56,6 @@ class Frame; class FloatSize; class FrameViewAutoSizeInfo; class IntRect; -class JSONArray; class JSONObject; class LayoutEmbeddedContent; class LocalFrame; @@ -152,7 +151,11 @@ class CORE_EXPORT LocalFrameView final bool HasOrthogonalWritingModeRoots() const; void LayoutOrthogonalWritingModeRoots(); void ScheduleOrthogonalWritingModeRootsForLayout(); - int LayoutCount() const { return layout_count_; } + + unsigned LayoutCountForTesting() const { return layout_count_for_testing_; } + unsigned LifecycleUpdateCountForTesting() const { + return lifecycle_update_count_for_testing_; + } void CountObjectsNeedingLayout(unsigned& needs_layout_objects, unsigned& total_objects, @@ -386,7 +389,13 @@ class CORE_EXPORT LocalFrameView final } void TrackObjectPaintInvalidation(const DisplayItemClient&, PaintInvalidationReason); - std::unique_ptr<JSONArray> TrackedObjectPaintInvalidationsAsJSON() const; + struct ObjectPaintInvalidation { + String name; + PaintInvalidationReason reason; + }; + Vector<ObjectPaintInvalidation>* TrackedObjectPaintInvalidations() const { + return tracked_object_paint_invalidations_.get(); + } using ScrollableAreaSet = HeapHashSet<Member<PaintLayerScrollableArea>>; void AddScrollableArea(PaintLayerScrollableArea*); @@ -420,7 +429,7 @@ class CORE_EXPORT LocalFrameView final // The window that hosts the LocalFrameView. The LocalFrameView will // communicate scrolls and repaints to the host window in the window's // coordinate space. - PlatformChromeClient* GetChromeClient() const; + ChromeClient* GetChromeClient() const; // Functions for child manipulation and inspection. bool IsSelfVisible() const { @@ -618,7 +627,8 @@ class CORE_EXPORT LocalFrameView final const WebScrollIntoViewParams&); PaintArtifactCompositor* GetPaintArtifactCompositorForTesting() { - DCHECK(RuntimeEnabledFeatures::SlimmingPaintV2Enabled()); + DCHECK(RuntimeEnabledFeatures::SlimmingPaintV2Enabled() || + RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled()); return paint_artifact_compositor_.get(); } @@ -654,6 +664,34 @@ class CORE_EXPORT LocalFrameView final void NotifyFrameRectsChangedIfNeeded(); private: +#if DCHECK_IS_ON() + class DisallowLayoutInvalidationScope { + public: + DisallowLayoutInvalidationScope(LocalFrameView* view) + : local_frame_view_(view) { + local_frame_view_->allows_layout_invalidation_after_layout_clean_ = false; + local_frame_view_->ForAllChildLocalFrameViews( + [](LocalFrameView& frame_view) { + if (!frame_view.ShouldThrottleRendering()) + frame_view.CheckDoesNotNeedLayout(); + frame_view.allows_layout_invalidation_after_layout_clean_ = false; + }); + } + ~DisallowLayoutInvalidationScope() { + local_frame_view_->allows_layout_invalidation_after_layout_clean_ = true; + local_frame_view_->ForAllChildLocalFrameViews( + [](LocalFrameView& frame_view) { + if (!frame_view.ShouldThrottleRendering()) + frame_view.CheckDoesNotNeedLayout(); + frame_view.allows_layout_invalidation_after_layout_clean_ = true; + }); + } + + private: + UntracedMember<LocalFrameView> local_frame_view_; + }; +#endif + explicit LocalFrameView(LocalFrame&, IntRect); void PaintInternal(GraphicsContext&, @@ -668,10 +706,24 @@ class CORE_EXPORT LocalFrameView final void SetupPrintContext(); void ClearPrintContext(); - // Returns whethre the lifecycle was succesfully updated to the + // Returns whether the lifecycle was succesfully updated to the // target state. - bool UpdateLifecyclePhasesInternal( + bool UpdateLifecyclePhases(DocumentLifecycle::LifecycleState target_state); + // The internal version that does the work after the proper context and checks + // have passed in the above function call. + void UpdateLifecyclePhasesInternal( + DocumentLifecycle::LifecycleState target_state); + // Four lifecycle phases helper functions corresponding to StyleAndLayout, + // Compositing, PrePaint, and Paint phases. If the return value is true, it + // means further lifecycle phases need to be run. This is used to abort + // earlier if we don't need to run future lifecycle phases. + bool RunStyleAndLayoutLifecyclePhases( DocumentLifecycle::LifecycleState target_state); + bool RunCompositingLifecyclePhase( + DocumentLifecycle::LifecycleState target_state); + bool RunPrePaintLifecyclePhase( + DocumentLifecycle::LifecycleState target_state); + void RunPaintLifecyclePhase(); void NotifyFrameRectsChangedIfNeededRecursive(); void UpdateStyleAndLayoutIfNeededRecursive(); @@ -786,7 +838,8 @@ class CORE_EXPORT LocalFrameView final bool layout_scheduling_enabled_; bool in_synchronous_post_layout_; - int layout_count_; + unsigned layout_count_for_testing_; + unsigned lifecycle_update_count_for_testing_; unsigned nested_layout_count_; TaskRunnerTimer<LocalFrameView> post_layout_tasks_timer_; TaskRunnerTimer<LocalFrameView> update_plugins_timer_; @@ -866,8 +919,11 @@ class CORE_EXPORT LocalFrameView final AnchoringAdjustmentQueue anchoring_adjustment_queue_; bool suppress_adjust_view_size_; - bool allows_layout_invalidation_after_layout_clean_; - +#if DCHECK_IS_ON() + // In DCHECK on builds, this is set to false when we're running lifecycle + // phases past layout to ensure that phases after layout don't dirty layout. + bool allows_layout_invalidation_after_layout_clean_ = true; +#endif IntersectionObservationState intersection_observation_state_; bool needs_forced_compositing_update_; @@ -881,10 +937,6 @@ class CORE_EXPORT LocalFrameView final mutable std::unique_ptr<ScrollingCoordinatorContext> scrolling_context_; // For testing. - struct ObjectPaintInvalidation { - String name; - PaintInvalidationReason reason; - }; std::unique_ptr<Vector<ObjectPaintInvalidation>> tracked_object_paint_invalidations_; @@ -932,6 +984,20 @@ inline void LocalFrameView::IncrementVisuallyNonEmptyPixelCount( SetIsVisuallyNonEmpty(); } +inline bool operator==(const LocalFrameView::ObjectPaintInvalidation& a, + const LocalFrameView::ObjectPaintInvalidation& b) { + return a.name == b.name && a.reason == b.reason; +} +inline bool operator!=(const LocalFrameView::ObjectPaintInvalidation& a, + const LocalFrameView::ObjectPaintInvalidation& b) { + return !(a == b); +} +inline std::ostream& operator<<( + std::ostream& os, + const LocalFrameView::ObjectPaintInvalidation& info) { + return os << info.name << " reason=" << info.reason; +} + DEFINE_TYPE_CASTS(LocalFrameView, EmbeddedContentView, embedded_content_view, |