Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 Copyright (C) 1997 Martin Jones (mjones@kde.org) |
| 3 (C) 1998 Waldo Bastian (bastian@kde.org) | 3 (C) 1998 Waldo Bastian (bastian@kde.org) |
| 4 (C) 1998, 1999 Torben Weis (weis@kde.org) | 4 (C) 1998, 1999 Torben Weis (weis@kde.org) |
| 5 (C) 1999 Lars Knoll (knoll@kde.org) | 5 (C) 1999 Lars Knoll (knoll@kde.org) |
| 6 (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. | 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. |
| 8 | 8 |
| 9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
| 10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
| 11 License as published by the Free Software Foundation; either | 11 License as published by the Free Software Foundation; either |
| 12 version 2 of the License, or (at your option) any later version. | 12 version 2 of the License, or (at your option) any later version. |
| 13 | 13 |
| 14 This library is distributed in the hope that it will be useful, | 14 This library is distributed in the hope that it will be useful, |
| 15 but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 Library General Public License for more details. | 17 Library General Public License for more details. |
| 18 | 18 |
| 19 You should have received a copy of the GNU Library General Public License | 19 You should have received a copy of the GNU Library General Public License |
| 20 along with this library; see the file COPYING.LIB. If not, write to | 20 along with this library; see the file COPYING.LIB. If not, write to |
| 21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 Boston, MA 02110-1301, USA. | 22 Boston, MA 02110-1301, USA. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef FrameView_h | 25 #ifndef FrameView_h |
| 26 #define FrameView_h | 26 #define FrameView_h |
| 27 | 27 |
| 28 #include "core/CoreExport.h" | 28 #include "core/CoreExport.h" |
| 29 #include "core/dom/DocumentLifecycle.h" | |
| 29 #include "core/frame/FrameViewAutoSizeInfo.h" | 30 #include "core/frame/FrameViewAutoSizeInfo.h" |
| 30 #include "core/frame/LayoutSubtreeRootList.h" | 31 #include "core/frame/LayoutSubtreeRootList.h" |
| 31 #include "core/frame/RootFrameViewport.h" | 32 #include "core/frame/RootFrameViewport.h" |
| 32 #include "core/layout/LayoutAnalyzer.h" | 33 #include "core/layout/LayoutAnalyzer.h" |
| 33 #include "core/paint/PaintPhase.h" | 34 #include "core/paint/PaintPhase.h" |
| 34 #include "platform/RuntimeEnabledFeatures.h" | 35 #include "platform/RuntimeEnabledFeatures.h" |
| 35 #include "platform/Widget.h" | 36 #include "platform/Widget.h" |
| 36 #include "platform/geometry/IntRect.h" | 37 #include "platform/geometry/IntRect.h" |
| 37 #include "platform/geometry/LayoutRect.h" | 38 #include "platform/geometry/LayoutRect.h" |
| 38 #include "platform/graphics/Color.h" | 39 #include "platform/graphics/Color.h" |
| 39 #include "platform/scroll/ScrollTypes.h" | 40 #include "platform/scroll/ScrollTypes.h" |
| 40 #include "platform/scroll/ScrollableArea.h" | 41 #include "platform/scroll/ScrollableArea.h" |
| 41 #include "platform/scroll/Scrollbar.h" | 42 #include "platform/scroll/Scrollbar.h" |
| 42 #include "public/platform/WebDisplayMode.h" | 43 #include "public/platform/WebDisplayMode.h" |
| 43 #include "public/platform/WebRect.h" | 44 #include "public/platform/WebRect.h" |
| 44 #include "wtf/Allocator.h" | 45 #include "wtf/Allocator.h" |
| 45 #include "wtf/Forward.h" | 46 #include "wtf/Forward.h" |
| 46 #include "wtf/HashSet.h" | 47 #include "wtf/HashSet.h" |
| 47 #include "wtf/ListHashSet.h" | 48 #include "wtf/ListHashSet.h" |
| 48 #include "wtf/OwnPtr.h" | 49 #include "wtf/OwnPtr.h" |
| 49 #include "wtf/TemporaryChange.h" | 50 #include "wtf/TemporaryChange.h" |
| 50 #include "wtf/text/WTFString.h" | 51 #include "wtf/text/WTFString.h" |
| 51 | 52 |
| 52 namespace blink { | 53 namespace blink { |
| 53 | 54 |
| 54 class AXObjectCache; | 55 class AXObjectCache; |
| 56 class CancellableTaskFactory; | |
| 55 class ComputedStyle; | 57 class ComputedStyle; |
| 56 class DocumentLifecycle; | 58 class DocumentLifecycle; |
| 57 class Cursor; | 59 class Cursor; |
| 58 class Element; | 60 class Element; |
| 59 class FloatSize; | 61 class FloatSize; |
| 60 class HTMLFrameOwnerElement; | 62 class HTMLFrameOwnerElement; |
| 61 class LayoutPart; | 63 class LayoutPart; |
| 62 class LocalFrame; | 64 class LocalFrame; |
| 63 class KURL; | 65 class KURL; |
| 64 class Node; | 66 class Node; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 75 struct CompositedSelection; | 77 struct CompositedSelection; |
| 76 | 78 |
| 77 typedef unsigned long long DOMTimeStamp; | 79 typedef unsigned long long DOMTimeStamp; |
| 78 | 80 |
| 79 class CORE_EXPORT FrameView final : public Widget, public ScrollableArea { | 81 class CORE_EXPORT FrameView final : public Widget, public ScrollableArea { |
| 80 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FrameView); | 82 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FrameView); |
| 81 | 83 |
| 82 friend class PaintControllerPaintTestForSlimmingPaintV2; | 84 friend class PaintControllerPaintTestForSlimmingPaintV2; |
| 83 friend class Internals; | 85 friend class Internals; |
| 84 friend class LayoutPart; // for invalidateTreeIfNeeded | 86 friend class LayoutPart; // for invalidateTreeIfNeeded |
| 87 friend class FrameThrottlingTest; | |
| 85 | 88 |
| 86 public: | 89 public: |
| 87 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*); | 90 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*); |
| 88 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*, const IntSize& initialSize); | 91 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*, const IntSize& initialSize); |
| 89 | 92 |
| 90 ~FrameView() override; | 93 ~FrameView() override; |
| 91 | 94 |
| 92 void invalidateRect(const IntRect&) override; | 95 void invalidateRect(const IntRect&) override; |
| 93 void setFrameRect(const IntRect&) override; | 96 void setFrameRect(const IntRect&) override; |
| 94 | 97 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 218 | 221 |
| 219 void setIsPainting(bool val) const { m_isPainting = val; } | 222 void setIsPainting(bool val) const { m_isPainting = val; } |
| 220 bool isPainting() const; | 223 bool isPainting() const; |
| 221 | 224 |
| 222 void setNodeToDraw(Node*); | 225 void setNodeToDraw(Node*); |
| 223 Node* nodeToDraw() const { return m_nodeToDraw.get(); } | 226 Node* nodeToDraw() const { return m_nodeToDraw.get(); } |
| 224 | 227 |
| 225 Color documentBackgroundColor() const; | 228 Color documentBackgroundColor() const; |
| 226 | 229 |
| 227 // Run all needed lifecycle stages. After calling this method, all frames wi ll be in the lifecycle state PaintInvalidationClean. | 230 // Run all needed lifecycle stages. After calling this method, all frames wi ll be in the lifecycle state PaintInvalidationClean. |
| 231 // If lifecycle throttling is allowed, some frames may skip the lifecycle up date (e.g., based on visibility) and will not end | |
| 232 // up being PaintInvalidationClean. | |
| 228 // TODO(pdr): Update callers to pass in the interest rect. | 233 // TODO(pdr): Update callers to pass in the interest rect. |
| 229 void updateAllLifecyclePhases(const LayoutRect* interestRect = nullptr); | 234 void updateAllLifecyclePhases(DocumentLifecycle::ThrottlingMode = DocumentLi fecycle::ThrottlingMode::Disallow, const LayoutRect* interestRect = nullptr); |
|
esprehn
2015/10/14 22:09:46
We shouldn't need to pass this as an argument, jus
Sami
2015/10/16 16:48:08
Yeah, that's much cleaner. Thanks for the idea.
| |
| 230 | 235 |
| 231 // Computes the style, layout and compositing lifecycle stages if needed. Af ter calling this method, all frames wil lbe in a lifecycle | 236 // Computes the style, layout and compositing lifecycle stages if needed. Af ter calling this method, all frames wil lbe in a lifecycle |
| 232 // state >= CompositingClean, and scrolling has been updated. | 237 // state >= CompositingClean, and scrolling has been updated. |
| 233 void updateLifecycleToCompositingCleanPlusScrolling(); | 238 void updateLifecycleToCompositingCleanPlusScrolling(DocumentLifecycle::Throt tlingMode = DocumentLifecycle::ThrottlingMode::Disallow); |
| 234 | 239 |
| 235 // Computes only the style and layout lifecycle stages. | 240 // Computes only the style and layout lifecycle stages. |
| 236 // After calling this method, all frames will be in a lifecycle state >= Lay outClean. | 241 // After calling this method, all frames will be in a lifecycle state >= Lay outClean. |
| 237 void updateLifecycleToLayoutClean(); | 242 void updateLifecycleToLayoutClean(DocumentLifecycle::ThrottlingMode = Docume ntLifecycle::ThrottlingMode::Disallow); |
| 238 | 243 |
| 239 bool invalidateViewportConstrainedObjects(); | 244 bool invalidateViewportConstrainedObjects(); |
| 240 | 245 |
| 241 void incrementVisuallyNonEmptyCharacterCount(unsigned); | 246 void incrementVisuallyNonEmptyCharacterCount(unsigned); |
| 242 void incrementVisuallyNonEmptyPixelCount(const IntSize&); | 247 void incrementVisuallyNonEmptyPixelCount(const IntSize&); |
| 243 bool isVisuallyNonEmpty() const { return m_isVisuallyNonEmpty; } | 248 bool isVisuallyNonEmpty() const { return m_isVisuallyNonEmpty; } |
| 244 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } | 249 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } |
| 245 void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize); | 250 void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize); |
| 246 void disableAutoSizeMode(); | 251 void disableAutoSizeMode(); |
| 247 | 252 |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 549 // Returns true if the default scrolling direction is vertical. i.e. writing mode | 554 // Returns true if the default scrolling direction is vertical. i.e. writing mode |
| 550 // is horiziontal. In a vertical document, a spacebar scrolls down. | 555 // is horiziontal. In a vertical document, a spacebar scrolls down. |
| 551 bool isVerticalDocument() const; | 556 bool isVerticalDocument() const; |
| 552 | 557 |
| 553 // Returns true if the document's writing mode is right-to-left or bottom-to -top. | 558 // Returns true if the document's writing mode is right-to-left or bottom-to -top. |
| 554 bool isFlippedDocument() const; | 559 bool isFlippedDocument() const; |
| 555 | 560 |
| 556 void setFrameTimingRequestsDirty(bool isDirty) { m_frameTimingRequestsDirty = isDirty; } | 561 void setFrameTimingRequestsDirty(bool isDirty) { m_frameTimingRequestsDirty = isDirty; } |
| 557 bool frameTimingRequestsDirty() { return m_frameTimingRequestsDirty; } | 562 bool frameTimingRequestsDirty() { return m_frameTimingRequestsDirty; } |
| 558 | 563 |
| 564 // Returns true if this frame should skip rendering and avoid scheduling | |
| 565 // new visual updates. | |
| 566 bool shouldThrottleRendering() const; | |
| 567 | |
| 568 // Returns true if this frame should skip rendering and this has not been | |
| 569 // disallowed, e.g., because of a synchronous layout. | |
| 570 bool shouldThrottleRenderingIfAllowed() const; | |
| 571 | |
| 559 protected: | 572 protected: |
| 560 // Scroll the content via the compositor. | 573 // Scroll the content via the compositor. |
| 561 bool scrollContentsFastPath(const IntSize& scrollDelta); | 574 bool scrollContentsFastPath(const IntSize& scrollDelta); |
| 562 | 575 |
| 563 // Scroll the content by invalidating everything. | 576 // Scroll the content by invalidating everything. |
| 564 void scrollContentsSlowPath(const IntRect& updateRect); | 577 void scrollContentsSlowPath(const IntRect& updateRect); |
| 565 | 578 |
| 566 // These functions are used to create/destroy scrollbars. | 579 // These functions are used to create/destroy scrollbars. |
| 567 void setHasHorizontalScrollbar(bool); | 580 void setHasHorizontalScrollbar(bool); |
| 568 void setHasVerticalScrollbar(bool); | 581 void setHasVerticalScrollbar(bool); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 603 | 616 |
| 604 void setScrollOffset(const IntPoint&, ScrollType) override; | 617 void setScrollOffset(const IntPoint&, ScrollType) override; |
| 605 void setScrollOffset(const DoublePoint&, ScrollType) override; | 618 void setScrollOffset(const DoublePoint&, ScrollType) override; |
| 606 | 619 |
| 607 enum LifeCycleUpdateOption { | 620 enum LifeCycleUpdateOption { |
| 608 OnlyUpToLayoutClean, | 621 OnlyUpToLayoutClean, |
| 609 OnlyUpToCompositingCleanPlusScrolling, | 622 OnlyUpToCompositingCleanPlusScrolling, |
| 610 AllPhases, | 623 AllPhases, |
| 611 }; | 624 }; |
| 612 | 625 |
| 613 void updateLifecyclePhasesInternal(LifeCycleUpdateOption, const LayoutRect* interestRect); | 626 void updateLifecyclePhasesInternal(LifeCycleUpdateOption, DocumentLifecycle: :ThrottlingMode, const LayoutRect* interestRect); |
| 614 void invalidateTreeIfNeededRecursive(); | 627 void invalidateTreeIfNeededRecursive(); |
| 615 void scrollContentsIfNeededRecursive(); | 628 void scrollContentsIfNeededRecursive(); |
| 616 void updateStyleAndLayoutIfNeededRecursive(); | 629 void updateStyleAndLayoutIfNeededRecursive(); |
| 617 void updatePaintProperties(); | 630 void updatePaintProperties(); |
| 618 void synchronizedPaint(const LayoutRect* interestRect); | 631 void synchronizedPaint(const LayoutRect* interestRect); |
| 619 void synchronizedPaintRecursively(GraphicsLayer*, const LayoutRect* interest Rect); | 632 void synchronizedPaintRecursively(GraphicsLayer*, const LayoutRect* interest Rect); |
| 620 void compositeForSlimmingPaintV2(); | 633 void compositeForSlimmingPaintV2(); |
| 621 | 634 |
| 622 void reset(); | 635 void reset(); |
| 623 void init(); | 636 void init(); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 709 // LayoutObject for the viewport-defining element (see Document::viewportDef iningElement). | 722 // LayoutObject for the viewport-defining element (see Document::viewportDef iningElement). |
| 710 LayoutObject* viewportLayoutObject(); | 723 LayoutObject* viewportLayoutObject(); |
| 711 | 724 |
| 712 void collectAnnotatedRegions(LayoutObject&, Vector<AnnotatedRegionValue>&) c onst; | 725 void collectAnnotatedRegions(LayoutObject&, Vector<AnnotatedRegionValue>&) c onst; |
| 713 | 726 |
| 714 typedef WTF::HashMap <const GraphicsLayer*, Vector<std::pair<int64_t, WebRec t>>> GraphicsLayerFrameTimingRequests; | 727 typedef WTF::HashMap <const GraphicsLayer*, Vector<std::pair<int64_t, WebRec t>>> GraphicsLayerFrameTimingRequests; |
| 715 void updateFrameTimingRequestsIfNeeded(); | 728 void updateFrameTimingRequestsIfNeeded(); |
| 716 void collectFrameTimingRequests(GraphicsLayerFrameTimingRequests&); | 729 void collectFrameTimingRequests(GraphicsLayerFrameTimingRequests&); |
| 717 void collectFrameTimingRequestsRecursive(GraphicsLayerFrameTimingRequests&); | 730 void collectFrameTimingRequestsRecursive(GraphicsLayerFrameTimingRequests&); |
| 718 | 731 |
| 732 void setLifecycleThrottlingMode(DocumentLifecycle::ThrottlingMode); | |
| 733 void setNeedsUpdateViewportIntersection(); | |
| 734 void updateViewportIntersectionsForSubtree(); | |
| 735 void updateViewportIntersectionIfNeeded(); | |
| 736 void notifyIntersectionObservers(); | |
| 737 | |
| 719 LayoutSize m_size; | 738 LayoutSize m_size; |
| 720 | 739 |
| 721 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet; | 740 typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet; |
| 722 EmbeddedObjectSet m_partUpdateSet; | 741 EmbeddedObjectSet m_partUpdateSet; |
| 723 | 742 |
| 724 // FIXME: These are just "children" of the FrameView and should be RefPtrWil lBeMember<Widget> instead. | 743 // FIXME: These are just "children" of the FrameView and should be RefPtrWil lBeMember<Widget> instead. |
| 725 HashSet<RefPtr<LayoutPart>> m_parts; | 744 HashSet<RefPtr<LayoutPart>> m_parts; |
| 726 | 745 |
| 727 // The RefPtr cycle between LocalFrame and FrameView is broken | 746 // The RefPtr cycle between LocalFrame and FrameView is broken |
| 728 // when a LocalFrame is detached by LocalFrame::detach(). | 747 // when a LocalFrame is detached by LocalFrame::detach(). |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 743 bool m_hasPendingLayout; | 762 bool m_hasPendingLayout; |
| 744 LayoutSubtreeRootList m_layoutSubtreeRootList; | 763 LayoutSubtreeRootList m_layoutSubtreeRootList; |
| 745 | 764 |
| 746 bool m_layoutSchedulingEnabled; | 765 bool m_layoutSchedulingEnabled; |
| 747 bool m_inPerformLayout; | 766 bool m_inPerformLayout; |
| 748 bool m_inSynchronousPostLayout; | 767 bool m_inSynchronousPostLayout; |
| 749 int m_layoutCount; | 768 int m_layoutCount; |
| 750 unsigned m_nestedLayoutCount; | 769 unsigned m_nestedLayoutCount; |
| 751 Timer<FrameView> m_postLayoutTasksTimer; | 770 Timer<FrameView> m_postLayoutTasksTimer; |
| 752 Timer<FrameView> m_updateWidgetsTimer; | 771 Timer<FrameView> m_updateWidgetsTimer; |
| 772 OwnPtr<CancellableTaskFactory> m_intersectionObserverNotificationFactory; | |
| 753 | 773 |
| 754 bool m_firstLayout; | 774 bool m_firstLayout; |
| 755 bool m_isTransparent; | 775 bool m_isTransparent; |
| 756 Color m_baseBackgroundColor; | 776 Color m_baseBackgroundColor; |
| 757 IntSize m_lastViewportSize; | 777 IntSize m_lastViewportSize; |
| 758 float m_lastZoomFactor; | 778 float m_lastZoomFactor; |
| 759 | 779 |
| 760 AtomicString m_mediaType; | 780 AtomicString m_mediaType; |
| 761 AtomicString m_mediaTypeWhenNotPrinting; | 781 AtomicString m_mediaTypeWhenNotPrinting; |
| 762 | 782 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 790 IntSize m_layoutSize; | 810 IntSize m_layoutSize; |
| 791 bool m_layoutSizeFixedToFrameSize; | 811 bool m_layoutSizeFixedToFrameSize; |
| 792 | 812 |
| 793 Timer<FrameView> m_didScrollTimer; | 813 Timer<FrameView> m_didScrollTimer; |
| 794 | 814 |
| 795 Vector<IntRect> m_tickmarks; | 815 Vector<IntRect> m_tickmarks; |
| 796 | 816 |
| 797 float m_topControlsViewportAdjustment; | 817 float m_topControlsViewportAdjustment; |
| 798 | 818 |
| 799 bool m_needsUpdateWidgetPositions; | 819 bool m_needsUpdateWidgetPositions; |
| 820 bool m_needsUpdateViewportIntersection; | |
| 821 bool m_needsUpdateViewportIntersectionInSubtree; | |
| 800 | 822 |
| 801 #if ENABLE(ASSERT) | 823 #if ENABLE(ASSERT) |
| 802 // Verified when finalizing. | 824 // Verified when finalizing. |
| 803 bool m_hasBeenDisposed; | 825 bool m_hasBeenDisposed; |
| 804 #endif | 826 #endif |
| 805 | 827 |
| 806 RefPtrWillBeMember<Scrollbar> m_horizontalScrollbar; | 828 RefPtrWillBeMember<Scrollbar> m_horizontalScrollbar; |
| 807 RefPtrWillBeMember<Scrollbar> m_verticalScrollbar; | 829 RefPtrWillBeMember<Scrollbar> m_verticalScrollbar; |
| 808 ScrollbarMode m_horizontalScrollbarMode; | 830 ScrollbarMode m_horizontalScrollbarMode; |
| 809 ScrollbarMode m_verticalScrollbarMode; | 831 ScrollbarMode m_verticalScrollbarMode; |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 825 OwnPtr<LayoutAnalyzer> m_analyzer; | 847 OwnPtr<LayoutAnalyzer> m_analyzer; |
| 826 | 848 |
| 827 // Mark if something has changed in the mapping from Frame to GraphicsLayer | 849 // Mark if something has changed in the mapping from Frame to GraphicsLayer |
| 828 // and the Frame Timing regions should be recalculated. | 850 // and the Frame Timing regions should be recalculated. |
| 829 bool m_frameTimingRequestsDirty; | 851 bool m_frameTimingRequestsDirty; |
| 830 | 852 |
| 831 // Exists only on root frame. | 853 // Exists only on root frame. |
| 832 // TODO(bokan): crbug.com/484188. We should specialize FrameView for the | 854 // TODO(bokan): crbug.com/484188. We should specialize FrameView for the |
| 833 // main frame. | 855 // main frame. |
| 834 OwnPtrWillBeMember<ScrollableArea> m_viewportScrollableArea; | 856 OwnPtrWillBeMember<ScrollableArea> m_viewportScrollableArea; |
| 857 | |
| 858 // This frame's bounds in the root frame's content coordinates, clipped | |
| 859 // recursively through every ancestor view. | |
| 860 IntRect m_viewportIntersection; | |
| 861 bool m_viewportIntersectionValid; | |
| 862 | |
| 863 enum class ViewportVisibility { Hidden, Visible }; | |
| 864 enum class SecurityOriginStatus { IsSameOrigin, IsCrossOrigin }; | |
|
esprehn
2015/10/14 22:09:46
ditto, this can just be a boolean
Sami
2015/10/16 16:48:08
Done.
| |
| 865 | |
| 866 // The following members control rendering pipeline throttling for this | |
| 867 // frame. They are only updated at the end of the pipeline (after painting) | |
| 868 // to avoid running further pipeline stages for a frame without having gone | |
| 869 // through the previous ones. | |
| 870 ViewportVisibility m_viewportVisibilityForThrottling; | |
|
esprehn
2015/10/14 22:09:46
this should just be a boolean
Sami
2015/10/16 16:48:08
Done.
| |
| 871 SecurityOriginStatus m_securityOriginStatusForThrottling; | |
| 835 }; | 872 }; |
| 836 | 873 |
| 837 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) | 874 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) |
| 838 { | 875 { |
| 839 if (m_isVisuallyNonEmpty) | 876 if (m_isVisuallyNonEmpty) |
| 840 return; | 877 return; |
| 841 m_visuallyNonEmptyCharacterCount += count; | 878 m_visuallyNonEmptyCharacterCount += count; |
| 842 // Use a threshold value to prevent very small amounts of visible content fr om triggering didMeaningfulLayout. | 879 // Use a threshold value to prevent very small amounts of visible content fr om triggering didMeaningfulLayout. |
| 843 // The first few hundred characters rarely contain the interesting content o f the page. | 880 // The first few hundred characters rarely contain the interesting content o f the page. |
| 844 static const unsigned visualCharacterThreshold = 200; | 881 static const unsigned visualCharacterThreshold = 200; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 855 static const unsigned visualPixelThreshold = 32 * 32; | 892 static const unsigned visualPixelThreshold = 32 * 32; |
| 856 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 893 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
| 857 setIsVisuallyNonEmpty(); | 894 setIsVisuallyNonEmpty(); |
| 858 } | 895 } |
| 859 | 896 |
| 860 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); | 897 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); |
| 861 | 898 |
| 862 } // namespace blink | 899 } // namespace blink |
| 863 | 900 |
| 864 #endif // FrameView_h | 901 #endif // FrameView_h |
| OLD | NEW |