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/frame/FrameViewAutoSizeInfo.h" |
28 #include "core/rendering/PaintPhase.h" | 29 #include "core/rendering/PaintPhase.h" |
29 #include "platform/RuntimeEnabledFeatures.h" | 30 #include "platform/RuntimeEnabledFeatures.h" |
30 #include "platform/geometry/LayoutRect.h" | 31 #include "platform/geometry/LayoutRect.h" |
31 #include "platform/graphics/Color.h" | 32 #include "platform/graphics/Color.h" |
32 #include "platform/scroll/ScrollView.h" | 33 #include "platform/scroll/ScrollView.h" |
33 #include "wtf/Forward.h" | 34 #include "wtf/Forward.h" |
34 #include "wtf/OwnPtr.h" | 35 #include "wtf/OwnPtr.h" |
35 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 static double currentFrameTimeStamp() { return s_currentFrameTimeStamp; } | 211 static double currentFrameTimeStamp() { return s_currentFrameTimeStamp; } |
211 | 212 |
212 void updateLayoutAndStyleForPainting(); | 213 void updateLayoutAndStyleForPainting(); |
213 void updateLayoutAndStyleIfNeededRecursive(); | 214 void updateLayoutAndStyleIfNeededRecursive(); |
214 | 215 |
215 void invalidateTreeIfNeededRecursive(); | 216 void invalidateTreeIfNeededRecursive(); |
216 | 217 |
217 void incrementVisuallyNonEmptyCharacterCount(unsigned); | 218 void incrementVisuallyNonEmptyCharacterCount(unsigned); |
218 void incrementVisuallyNonEmptyPixelCount(const IntSize&); | 219 void incrementVisuallyNonEmptyPixelCount(const IntSize&); |
219 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } | 220 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } |
220 void enableAutoSizeMode(bool enable, const IntSize& minSize, const IntSize&
maxSize); | 221 void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize); |
| 222 void disableAutoSizeMode() { m_autoSizeInfo = 0; } |
221 | 223 |
222 void forceLayout(bool allowSubtree = false); | 224 void forceLayout(bool allowSubtree = false); |
223 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or
iginalPageSize, float maximumShrinkFactor); | 225 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or
iginalPageSize, float maximumShrinkFactor); |
224 | 226 |
225 bool scrollToFragment(const KURL&); | 227 bool scrollToFragment(const KURL&); |
226 bool scrollToAnchor(const String&); | 228 bool scrollToAnchor(const String&); |
227 void maintainScrollPositionAtAnchor(Node*); | 229 void maintainScrollPositionAtAnchor(Node*); |
228 void scrollElementToRect(Element*, const IntRect&); | 230 void scrollElementToRect(Element*, const IntRect&); |
229 void scrollContentsIfNeededRecursive(); | 231 void scrollContentsIfNeededRecursive(); |
230 | 232 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 virtual bool isFrameView() const OVERRIDE { return true; } | 340 virtual bool isFrameView() const OVERRIDE { return true; } |
339 | 341 |
340 friend class RenderWidget; | 342 friend class RenderWidget; |
341 | 343 |
342 bool contentsInCompositedLayer() const; | 344 bool contentsInCompositedLayer() const; |
343 | 345 |
344 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo
de, ScrollbarMode& vMode); | 346 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo
de, ScrollbarMode& vMode); |
345 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); | 347 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); |
346 | 348 |
347 void updateCounters(); | 349 void updateCounters(); |
348 void autoSizeIfEnabled(); | |
349 void forceLayoutParentViewIfNeeded(); | 350 void forceLayoutParentViewIfNeeded(); |
350 void performPreLayoutTasks(); | 351 void performPreLayoutTasks(); |
351 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); | 352 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); |
352 void scheduleOrPerformPostLayoutTasks(); | 353 void scheduleOrPerformPostLayoutTasks(); |
353 void performPostLayoutTasks(); | 354 void performPostLayoutTasks(); |
354 | 355 |
355 void invalidateTreeIfNeeded(); | 356 void invalidateTreeIfNeeded(); |
356 | 357 |
357 void gatherDebugLayoutRects(RenderObject* layoutRoot); | 358 void gatherDebugLayoutRects(RenderObject* layoutRoot); |
358 | 359 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 unsigned m_visuallyNonEmptyCharacterCount; | 466 unsigned m_visuallyNonEmptyCharacterCount; |
466 unsigned m_visuallyNonEmptyPixelCount; | 467 unsigned m_visuallyNonEmptyPixelCount; |
467 bool m_isVisuallyNonEmpty; | 468 bool m_isVisuallyNonEmpty; |
468 bool m_firstVisuallyNonEmptyLayoutCallbackPending; | 469 bool m_firstVisuallyNonEmptyLayoutCallbackPending; |
469 | 470 |
470 RefPtrWillBePersistent<Node> m_maintainScrollPositionAnchor; | 471 RefPtrWillBePersistent<Node> m_maintainScrollPositionAnchor; |
471 | 472 |
472 // Renderer to hold our custom scroll corner. | 473 // Renderer to hold our custom scroll corner. |
473 RawPtrWillBePersistent<RenderScrollbarPart> m_scrollCorner; | 474 RawPtrWillBePersistent<RenderScrollbarPart> m_scrollCorner; |
474 | 475 |
475 // If true, automatically resize the frame view around its content. | |
476 bool m_shouldAutoSize; | |
477 bool m_inAutoSize; | |
478 // True if autosize has been run since m_shouldAutoSize was set. | |
479 bool m_didRunAutosize; | |
480 // The lower bound on the size when autosizing. | |
481 IntSize m_minAutoSize; | |
482 // The upper bound on the size when autosizing. | |
483 IntSize m_maxAutoSize; | |
484 | |
485 OwnPtr<ScrollableAreaSet> m_scrollableAreas; | 476 OwnPtr<ScrollableAreaSet> m_scrollableAreas; |
486 OwnPtr<ResizerAreaSet> m_resizerAreas; | 477 OwnPtr<ResizerAreaSet> m_resizerAreas; |
487 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; | 478 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; |
| 479 OwnPtr<FrameViewAutoSizeInfo> m_autoSizeInfo; |
488 | 480 |
489 bool m_hasSoftwareFilters; | 481 bool m_hasSoftwareFilters; |
490 | 482 |
491 float m_visibleContentScaleFactor; | 483 float m_visibleContentScaleFactor; |
492 IntSize m_inputEventsOffsetForEmulation; | 484 IntSize m_inputEventsOffsetForEmulation; |
493 float m_inputEventsScaleFactorForEmulation; | 485 float m_inputEventsScaleFactorForEmulation; |
494 | 486 |
495 IntSize m_layoutSize; | 487 IntSize m_layoutSize; |
496 bool m_layoutSizeFixedToFrameSize; | 488 bool m_layoutSizeFixedToFrameSize; |
497 | 489 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); | 537 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); |
546 } | 538 } |
547 private: | 539 private: |
548 FrameView* m_view; | 540 FrameView* m_view; |
549 bool m_originalValue; | 541 bool m_originalValue; |
550 }; | 542 }; |
551 | 543 |
552 } // namespace blink | 544 } // namespace blink |
553 | 545 |
554 #endif // FrameView_h | 546 #endif // FrameView_h |
OLD | NEW |