Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: Source/core/frame/FrameView.h

Issue 1162623007: Removed redundant rect methods on FrameView (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 Color baseBackgroundColor() const; 157 Color baseBackgroundColor() const;
158 void setBaseBackgroundColor(const Color&); 158 void setBaseBackgroundColor(const Color&);
159 void updateBackgroundRecursively(const Color&, bool); 159 void updateBackgroundRecursively(const Color&, bool);
160 160
161 void adjustViewSize(); 161 void adjustViewSize();
162 162
163 // |unobscuredRect| receives the clip rect that is not clipped to the root w indow. It may be nullptr. 163 // |unobscuredRect| receives the clip rect that is not clipped to the root w indow. It may be nullptr.
164 IntRect clipRectsForFrameOwner(const HTMLFrameOwnerElement*, IntRect* unobsc uredRect) const; 164 IntRect clipRectsForFrameOwner(const HTMLFrameOwnerElement*, IntRect* unobsc uredRect) const;
165 165
166 float visibleContentScaleFactor() const { return m_visibleContentScaleFactor ; } 166 // Scale used to convert incoming input events.
167 void setVisibleContentScaleFactor(float); 167 float inputEventsScaleFactor() const;
168 168
169 // Scale used to convert incoming input events. Usually the same as visibleC ontentScaleFactor(), unless specifically changed.
170 float inputEventsScaleFactor() const;
171 // Offset used to convert incoming input events while emulating device metic s. 169 // Offset used to convert incoming input events while emulating device metic s.
172 IntSize inputEventsOffsetForEmulation() const; 170 IntSize inputEventsOffsetForEmulation() const;
173 void setInputEventsTransformForEmulation(const IntSize&, float); 171 void setInputEventsTransformForEmulation(const IntSize&, float);
174 172
175 virtual void setScrollPosition(const DoublePoint&, ScrollBehavior = ScrollBe haviorInstant) override; 173 virtual void setScrollPosition(const DoublePoint&, ScrollBehavior = ScrollBe haviorInstant) override;
176 174
177 FloatSize elasticOverscroll() const { return m_elasticOverscroll; } 175 FloatSize elasticOverscroll() const { return m_elasticOverscroll; }
178 void setElasticOverscroll(const FloatSize&); 176 void setElasticOverscroll(const FloatSize&);
179 177
180 // This is different than visibleContentRect() in that it takes zooming into account. 178 void viewportSizeChanged(bool widthChanged, bool heightChanged);
181 LayoutRect viewportConstrainedVisibleContentRect() const;
182 void viewportConstrainedVisibleContentSizeChanged(bool widthChanged, bool he ightChanged);
183 179
184 AtomicString mediaType() const; 180 AtomicString mediaType() const;
185 void setMediaType(const AtomicString&); 181 void setMediaType(const AtomicString&);
186 void adjustMediaTypeForPrinting(bool printing); 182 void adjustMediaTypeForPrinting(bool printing);
187 183
188 WebDisplayMode displayMode() { return m_displayMode; } 184 WebDisplayMode displayMode() { return m_displayMode; }
189 void setDisplayMode(WebDisplayMode); 185 void setDisplayMode(WebDisplayMode);
190 186
191 void addSlowRepaintObject(); 187 void addSlowRepaintObject();
192 void removeSlowRepaintObject(); 188 void removeSlowRepaintObject();
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 305
310 // This function exists for ports that need to handle wheel events manually. 306 // This function exists for ports that need to handle wheel events manually.
311 // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but o n most other platforms 307 // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but o n most other platforms
312 // we need this function in order to do the scroll ourselves. 308 // we need this function in order to do the scroll ourselves.
313 ScrollResult wheelEvent(const PlatformWheelEvent&); 309 ScrollResult wheelEvent(const PlatformWheelEvent&);
314 310
315 virtual bool shouldUseIntegerScrollOffset() const override; 311 virtual bool shouldUseIntegerScrollOffset() const override;
316 312
317 virtual bool isActive() const override; 313 virtual bool isActive() const override;
318 314
319 IntSize scrollOffsetForViewportConstrainedObjects() const;
320
321 // Override scrollbar notifications to update the AXObject cache. 315 // Override scrollbar notifications to update the AXObject cache.
322 virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation) override; 316 virtual void didAddScrollbar(Scrollbar*, ScrollbarOrientation) override;
323 virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) override; 317 virtual void willRemoveScrollbar(Scrollbar*, ScrollbarOrientation) override;
324 318
325 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter 319 // FIXME: This should probably be renamed as the 'inSubtreeLayout' parameter
326 // passed around the FrameView layout methods can be true while this returns 320 // passed around the FrameView layout methods can be true while this returns
327 // false. 321 // false.
328 bool isSubtreeLayout() const { return !m_layoutSubtreeRoots.isEmpty(); } 322 bool isSubtreeLayout() const { return !m_layoutSubtreeRoots.isEmpty(); }
329 323
330 // Sets the tickmarks for the FrameView, overriding the default behavior 324 // Sets the tickmarks for the FrameView, overriding the default behavior
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 402
409 void setScrollingModesLock(bool lock = true) { m_horizontalScrollbarLock = m _verticalScrollbarLock = lock; } 403 void setScrollingModesLock(bool lock = true) { m_horizontalScrollbarLock = m _verticalScrollbarLock = lock; }
410 404
411 bool canHaveScrollbars() const { return horizontalScrollbarMode() != Scrollb arAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; } 405 bool canHaveScrollbars() const { return horizontalScrollbarMode() != Scrollb arAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; }
412 406
413 // By default, paint events are clipped to the visible area. If set to 407 // By default, paint events are clipped to the visible area. If set to
414 // false, paint events are no longer clipped. 408 // false, paint events are no longer clipped.
415 bool clipsPaintInvalidations() const { return m_clipsRepaints; } 409 bool clipsPaintInvalidations() const { return m_clipsRepaints; }
416 void setClipsRepaints(bool); 410 void setClipsRepaints(bool);
417 411
418 // The visible content rect has a location that is the scrolled offset of th e document. The width and height are the viewport width 412 // The visible content rect has a location that is the scrolled offset of
419 // and height. By default the scrollbars themselves are excluded from this r ectangle, but an optional boolean argument allows them to be 413 // the document. The width and height are the layout viewport width and
420 // included. 414 // height. By default the scrollbars themselves are excluded from this
415 // rectangle, but an optional boolean argument allows them to be included.
421 virtual IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollba rs) const override; 416 virtual IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollba rs) const override;
422 IntSize visibleSize() const { return visibleContentRect().size(); } 417 IntSize visibleContentSize(IncludeScrollbarsInRect = ExcludeScrollbars) cons t;
423
424 // visibleContentRect().size() is computed from unscaledVisibleContentSize() divided by the value of visibleContentScaleFactor.
425 // For the main frame, visibleContentScaleFactor is equal to the page's page ScaleFactor; it's 1 otherwise.
426 IntSize unscaledVisibleContentSize(IncludeScrollbarsInRect = ExcludeScrollba rs) const;
427 418
428 // Functions for getting/setting the size of the document contained inside t he FrameView (as an IntSize or as individual width and height 419 // Functions for getting/setting the size of the document contained inside t he FrameView (as an IntSize or as individual width and height
429 // values). 420 // values).
430 virtual IntSize contentsSize() const override; // Always at least as big as the visibleWidth()/visibleHeight(). 421 virtual IntSize contentsSize() const override; // Always at least as big as the visibleWidth()/visibleHeight().
431 int contentsWidth() const { return contentsSize().width(); } 422 int contentsWidth() const { return contentsSize().width(); }
432 int contentsHeight() const { return contentsSize().height(); } 423 int contentsHeight() const { return contentsSize().height(); }
433 424
434 // Functions for querying the current scrolled position (both as a point, a size, or as individual X and Y values). 425 // Functions for querying the current scrolled position (both as a point, a size, or as individual X and Y values).
435 // Be careful in using the Double version scrollPositionDouble() and scrollO ffsetDouble(). They are meant to be 426 // Be careful in using the Double version scrollPositionDouble() and scrollO ffsetDouble(). They are meant to be
436 // used to communicate the fractional scroll position/offset with chromium c ompositor which can do sub-pixel positioning. 427 // used to communicate the fractional scroll position/offset with chromium c ompositor which can do sub-pixel positioning.
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 796
806 // layoutObject to hold our custom scroll corner. 797 // layoutObject to hold our custom scroll corner.
807 LayoutScrollbarPart* m_scrollCorner; 798 LayoutScrollbarPart* m_scrollCorner;
808 799
809 OwnPtr<ScrollableAreaSet> m_scrollableAreas; 800 OwnPtr<ScrollableAreaSet> m_scrollableAreas;
810 OwnPtr<ScrollableAreaSet> m_animatingScrollableAreas; 801 OwnPtr<ScrollableAreaSet> m_animatingScrollableAreas;
811 OwnPtr<ResizerAreaSet> m_resizerAreas; 802 OwnPtr<ResizerAreaSet> m_resizerAreas;
812 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; 803 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects;
813 OwnPtrWillBeMember<FrameViewAutoSizeInfo> m_autoSizeInfo; 804 OwnPtrWillBeMember<FrameViewAutoSizeInfo> m_autoSizeInfo;
814 805
815 float m_visibleContentScaleFactor;
816 IntSize m_inputEventsOffsetForEmulation; 806 IntSize m_inputEventsOffsetForEmulation;
817 float m_inputEventsScaleFactorForEmulation; 807 float m_inputEventsScaleFactorForEmulation;
818 808
819 IntSize m_layoutSize; 809 IntSize m_layoutSize;
820 bool m_layoutSizeFixedToFrameSize; 810 bool m_layoutSizeFixedToFrameSize;
821 811
822 Timer<FrameView> m_didScrollTimer; 812 Timer<FrameView> m_didScrollTimer;
823 813
824 Vector<IntRect> m_tickmarks; 814 Vector<IntRect> m_tickmarks;
825 815
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 static const unsigned visualPixelThreshold = 32 * 32; 878 static const unsigned visualPixelThreshold = 32 * 32;
889 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) 879 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
890 setIsVisuallyNonEmpty(); 880 setIsVisuallyNonEmpty();
891 } 881 }
892 882
893 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); 883 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView());
894 884
895 } // namespace blink 885 } // namespace blink
896 886
897 #endif // FrameView_h 887 #endif // FrameView_h
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698