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 |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "core/frame/FrameViewAutoSizeInfo.h" | 29 #include "core/frame/FrameViewAutoSizeInfo.h" |
30 #include "core/frame/LayoutSubtreeRootList.h" | 30 #include "core/frame/LayoutSubtreeRootList.h" |
31 #include "core/frame/RootFrameViewport.h" | 31 #include "core/frame/RootFrameViewport.h" |
32 #include "core/layout/LayoutAnalyzer.h" | 32 #include "core/layout/LayoutAnalyzer.h" |
33 #include "core/paint/PaintPhase.h" | 33 #include "core/paint/PaintPhase.h" |
34 #include "platform/RuntimeEnabledFeatures.h" | 34 #include "platform/RuntimeEnabledFeatures.h" |
35 #include "platform/Widget.h" | 35 #include "platform/Widget.h" |
36 #include "platform/geometry/IntRect.h" | 36 #include "platform/geometry/IntRect.h" |
37 #include "platform/geometry/LayoutRect.h" | 37 #include "platform/geometry/LayoutRect.h" |
38 #include "platform/graphics/Color.h" | 38 #include "platform/graphics/Color.h" |
| 39 #include "platform/graphics/paint/TransformPaintPropertyNode.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" |
(...skipping 500 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 | 550 // Returns true if the default scrolling direction is vertical. i.e. writing
mode |
550 // is horiziontal. In a vertical document, a spacebar scrolls down. | 551 // is horiziontal. In a vertical document, a spacebar scrolls down. |
551 bool isVerticalDocument() const; | 552 bool isVerticalDocument() const; |
552 | 553 |
553 // Returns true if the document's writing mode is right-to-left or bottom-to
-top. | 554 // Returns true if the document's writing mode is right-to-left or bottom-to
-top. |
554 bool isFlippedDocument() const; | 555 bool isFlippedDocument() const; |
555 | 556 |
556 void setFrameTimingRequestsDirty(bool isDirty) { m_frameTimingRequestsDirty
= isDirty; } | 557 void setFrameTimingRequestsDirty(bool isDirty) { m_frameTimingRequestsDirty
= isDirty; } |
557 bool frameTimingRequestsDirty() { return m_frameTimingRequestsDirty; } | 558 bool frameTimingRequestsDirty() { return m_frameTimingRequestsDirty; } |
558 | 559 |
| 560 // Paint properties for SPv2 Only. |
| 561 void setPreTranslation(PassRefPtr<TransformPaintPropertyNode> preTranslation
) { m_preTranslation = preTranslation; } |
| 562 const TransformPaintPropertyNode* preTranslation() const { return m_preTrans
lation.get(); } |
| 563 |
| 564 void setScrollTranslation(PassRefPtr<TransformPaintPropertyNode> scrollTrans
lation) { m_scrollTranslation = scrollTranslation; } |
| 565 const TransformPaintPropertyNode* scrollTranslation() const { return m_scrol
lTranslation.get(); } |
| 566 |
559 protected: | 567 protected: |
560 // Scroll the content via the compositor. | 568 // Scroll the content via the compositor. |
561 bool scrollContentsFastPath(const IntSize& scrollDelta); | 569 bool scrollContentsFastPath(const IntSize& scrollDelta); |
562 | 570 |
563 // Scroll the content by invalidating everything. | 571 // Scroll the content by invalidating everything. |
564 void scrollContentsSlowPath(const IntRect& updateRect); | 572 void scrollContentsSlowPath(const IntRect& updateRect); |
565 | 573 |
566 // These functions are used to create/destroy scrollbars. | 574 // These functions are used to create/destroy scrollbars. |
567 void setHasHorizontalScrollbar(bool); | 575 void setHasHorizontalScrollbar(bool); |
568 void setHasVerticalScrollbar(bool); | 576 void setHasVerticalScrollbar(bool); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 OwnPtr<LayoutAnalyzer> m_analyzer; | 833 OwnPtr<LayoutAnalyzer> m_analyzer; |
826 | 834 |
827 // Mark if something has changed in the mapping from Frame to GraphicsLayer | 835 // Mark if something has changed in the mapping from Frame to GraphicsLayer |
828 // and the Frame Timing regions should be recalculated. | 836 // and the Frame Timing regions should be recalculated. |
829 bool m_frameTimingRequestsDirty; | 837 bool m_frameTimingRequestsDirty; |
830 | 838 |
831 // Exists only on root frame. | 839 // Exists only on root frame. |
832 // TODO(bokan): crbug.com/484188. We should specialize FrameView for the | 840 // TODO(bokan): crbug.com/484188. We should specialize FrameView for the |
833 // main frame. | 841 // main frame. |
834 OwnPtrWillBeMember<ScrollableArea> m_viewportScrollableArea; | 842 OwnPtrWillBeMember<ScrollableArea> m_viewportScrollableArea; |
| 843 |
| 844 // Paint properties for SPv2 Only. |
| 845 // The hierarchy of transform subtree created by a FrameView. |
| 846 // [ preTranslation ] The offset from Widget::frameRect. Estab
lishes viewport. |
| 847 // +---[ scrollTranslation ] Frame scrolling. This is going away in f
avor of Settings::rootLayerScrolls. |
| 848 RefPtr<TransformPaintPropertyNode> m_preTranslation; |
| 849 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; |
835 }; | 850 }; |
836 | 851 |
837 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) | 852 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) |
838 { | 853 { |
839 if (m_isVisuallyNonEmpty) | 854 if (m_isVisuallyNonEmpty) |
840 return; | 855 return; |
841 m_visuallyNonEmptyCharacterCount += count; | 856 m_visuallyNonEmptyCharacterCount += count; |
842 // Use a threshold value to prevent very small amounts of visible content fr
om triggering didMeaningfulLayout. | 857 // 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. | 858 // The first few hundred characters rarely contain the interesting content o
f the page. |
844 static const unsigned visualCharacterThreshold = 200; | 859 static const unsigned visualCharacterThreshold = 200; |
(...skipping 10 matching lines...) Expand all Loading... |
855 static const unsigned visualPixelThreshold = 32 * 32; | 870 static const unsigned visualPixelThreshold = 32 * 32; |
856 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 871 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
857 setIsVisuallyNonEmpty(); | 872 setIsVisuallyNonEmpty(); |
858 } | 873 } |
859 | 874 |
860 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); | 875 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); |
861 | 876 |
862 } // namespace blink | 877 } // namespace blink |
863 | 878 |
864 #endif // FrameView_h | 879 #endif // FrameView_h |
OLD | NEW |