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

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

Issue 1126883002: Change all one-off lifecycle callers to FrameView::updateLayoutAndStyleForPainting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 void setIsPainting(bool val) { m_isPainting = val; } 220 void setIsPainting(bool val) { m_isPainting = val; }
221 bool isPainting() const; 221 bool isPainting() const;
222 void setLastPaintTime(double val) { m_lastPaintTime = val; } 222 void setLastPaintTime(double val) { m_lastPaintTime = val; }
223 bool hasEverPainted() const { return m_lastPaintTime; } 223 bool hasEverPainted() const { return m_lastPaintTime; }
224 void setNodeToDraw(Node*); 224 void setNodeToDraw(Node*);
225 Node* nodeToDraw() { return m_nodeToDraw.get(); } 225 Node* nodeToDraw() { return m_nodeToDraw.get(); }
226 226
227 Color documentBackgroundColor() const; 227 Color documentBackgroundColor() const;
228 228
229 void updateLayoutAndStyleForPainting(); 229 void updateLayoutAndStyleForPainting();
230 void updateLayoutAndStyleIfNeededRecursive();
231 230
232 void invalidateTreeIfNeededRecursive();
233 bool invalidateViewportConstrainedObjects(); 231 bool invalidateViewportConstrainedObjects();
234 232
235 void incrementVisuallyNonEmptyCharacterCount(unsigned); 233 void incrementVisuallyNonEmptyCharacterCount(unsigned);
236 void incrementVisuallyNonEmptyPixelCount(const IntSize&); 234 void incrementVisuallyNonEmptyPixelCount(const IntSize&);
237 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } 235 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; }
238 void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize); 236 void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize);
239 void disableAutoSizeMode(); 237 void disableAutoSizeMode();
240 238
241 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or iginalPageSize, float maximumShrinkFactor); 239 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or iginalPageSize, float maximumShrinkFactor);
242 240
243 bool scrollToFragment(const KURL&); 241 bool scrollToFragment(const KURL&);
244 bool scrollToAnchor(const String&); 242 bool scrollToAnchor(const String&);
245 void maintainScrollPositionAtAnchor(Node*); 243 void maintainScrollPositionAtAnchor(Node*);
246 244
247 // Scrolls an |element| into a given |rect| in the frame view. The given 245 // Scrolls an |element| into a given |rect| in the frame view. The given
248 // |element| must either be in this Frame's document, or the document of one 246 // |element| must either be in this Frame's document, or the document of one
249 // of this Frame's child Frames. This method is not recursive; it will not 247 // of this Frame's child Frames. This method is not recursive; it will not
250 // scroll the child Frames so that the |element| is in view. Returns the 248 // scroll the child Frames so that the |element| is in view. Returns the
251 // amount of scroll remaining to center the |element|, e.g. this can happen 249 // amount of scroll remaining to center the |element|, e.g. this can happen
252 // if the FrameView becomes fully scrolled but |element| still isn't 250 // if the FrameView becomes fully scrolled but |element| still isn't
253 // centered in |rect|. 251 // centered in |rect|.
254 DoubleSize scrollElementToRect(Element*, const FloatRect&); 252 DoubleSize scrollElementToRect(Element*, const FloatRect&);
255 void scrollContentsIfNeededRecursive();
256 253
257 // Methods to convert points and rects between the coordinate space of the l ayoutObject, and this view. 254 // Methods to convert points and rects between the coordinate space of the l ayoutObject, and this view.
258 IntRect convertFromLayoutObject(const LayoutObject&, const IntRect&) const; 255 IntRect convertFromLayoutObject(const LayoutObject&, const IntRect&) const;
259 IntRect convertToLayoutObject(const LayoutObject&, const IntRect&) const; 256 IntRect convertToLayoutObject(const LayoutObject&, const IntRect&) const;
260 IntPoint convertFromLayoutObject(const LayoutObject&, const IntPoint&) const ; 257 IntPoint convertFromLayoutObject(const LayoutObject&, const IntPoint&) const ;
261 IntPoint convertToLayoutObject(const LayoutObject&, const IntPoint&) const; 258 IntPoint convertToLayoutObject(const LayoutObject&, const IntPoint&) const;
262 259
263 bool isFrameViewScrollCorner(LayoutScrollbarPart* scrollCorner) const { retu rn m_scrollCorner == scrollCorner; } 260 bool isFrameViewScrollCorner(LayoutScrollbarPart* scrollCorner) const { retu rn m_scrollCorner == scrollCorner; }
264 261
265 enum ScrollingReasons { 262 enum ScrollingReasons {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 explicit InUpdateScrollbarsScope(FrameView* view) 613 explicit InUpdateScrollbarsScope(FrameView* view)
617 : m_scope(view->m_inUpdateScrollbars, true) 614 : m_scope(view->m_inUpdateScrollbars, true)
618 { } 615 { }
619 private: 616 private:
620 TemporaryChange<bool> m_scope; 617 TemporaryChange<bool> m_scope;
621 }; 618 };
622 619
623 private: 620 private:
624 explicit FrameView(LocalFrame*); 621 explicit FrameView(LocalFrame*);
625 622
623 void updateLayoutAndStyleForPaintingInternal();
624 void invalidateTreeIfNeededRecursive();
625 void scrollContentsIfNeededRecursive();
626 void updateLayoutAndStyleIfNeededRecursive();
627
626 void reset(); 628 void reset();
627 void init(); 629 void init();
628 630
629 void clearLayoutSubtreeRootsAndMarkContainingBlocks(); 631 void clearLayoutSubtreeRootsAndMarkContainingBlocks();
630 632
631 // Called when our frame rect changes (or the rect/scroll position of an anc estor changes). 633 // Called when our frame rect changes (or the rect/scroll position of an anc estor changes).
632 virtual void frameRectsChanged() override; 634 virtual void frameRectsChanged() override;
633 635
634 friend class LayoutPart; 636 friend class LayoutPart;
635 637
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 static const unsigned visualPixelThreshold = 32 * 32; 874 static const unsigned visualPixelThreshold = 32 * 32;
873 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) 875 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
874 setIsVisuallyNonEmpty(); 876 setIsVisuallyNonEmpty();
875 } 877 }
876 878
877 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); 879 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView());
878 880
879 } // namespace blink 881 } // namespace blink
880 882
881 #endif // FrameView_h 883 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698