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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
338 virtual bool isFrameView() const OVERRIDE { return true; } | 339 virtual bool isFrameView() const OVERRIDE { return true; } |
339 | 340 |
340 friend class RenderWidget; | 341 friend class RenderWidget; |
341 | 342 |
342 bool contentsInCompositedLayer() const; | 343 bool contentsInCompositedLayer() const; |
343 | 344 |
344 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo de, ScrollbarMode& vMode); | 345 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo de, ScrollbarMode& vMode); |
345 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); | 346 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); |
346 | 347 |
347 void updateCounters(); | 348 void updateCounters(); |
348 void autoSizeIfEnabled(); | |
349 void forceLayoutParentViewIfNeeded(); | 349 void forceLayoutParentViewIfNeeded(); |
350 void performPreLayoutTasks(); | 350 void performPreLayoutTasks(); |
351 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); | 351 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); |
352 void scheduleOrPerformPostLayoutTasks(); | 352 void scheduleOrPerformPostLayoutTasks(); |
353 void performPostLayoutTasks(); | 353 void performPostLayoutTasks(); |
354 | 354 |
355 void invalidateTreeIfNeeded(); | 355 void invalidateTreeIfNeeded(); |
356 | 356 |
357 void gatherDebugLayoutRects(RenderObject* layoutRoot); | 357 void gatherDebugLayoutRects(RenderObject* layoutRoot); |
358 | 358 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 AXObjectCache* axObjectCache() const; | 397 AXObjectCache* axObjectCache() const; |
398 void removeFromAXObjectCache(); | 398 void removeFromAXObjectCache(); |
399 | 399 |
400 void setLayoutSizeInternal(const IntSize&); | 400 void setLayoutSizeInternal(const IntSize&); |
401 | 401 |
402 bool paintInvalidationIsAllowed() const | 402 bool paintInvalidationIsAllowed() const |
403 { | 403 { |
404 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); | 404 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); |
405 } | 405 } |
406 | 406 |
407 FrameViewAutoSizeInfo& autoSizeInfo() | |
408 { | |
409 if (!m_autoSizeInfo) | |
410 m_autoSizeInfo = adoptPtr(new FrameViewAutoSizeInfo(this)); | |
eseidel
2014/08/19 16:35:00
Note that the way this is designed, we're always g
Shanmuga Pandi
2014/08/20 14:54:12
Changed logic.
| |
411 return *m_autoSizeInfo.get(); | |
412 } | |
413 | |
407 static double s_currentFrameTimeStamp; // used for detecting decoded resourc e thrash in the cache | 414 static double s_currentFrameTimeStamp; // used for detecting decoded resourc e thrash in the cache |
408 static bool s_inPaintContents; | 415 static bool s_inPaintContents; |
409 | 416 |
410 LayoutSize m_size; | 417 LayoutSize m_size; |
411 | 418 |
412 typedef WillBeHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > Embedde dObjectSet; | 419 typedef WillBeHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > Embedde dObjectSet; |
413 WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > m_wid getUpdateSet; | 420 WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > m_wid getUpdateSet; |
414 | 421 |
415 // FIXME: These are just "children" of the FrameView and should be RefPtr<Wi dget> instead. | 422 // FIXME: These are just "children" of the FrameView and should be RefPtr<Wi dget> instead. |
416 WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderWidget> > m_widgets; | 423 WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderWidget> > m_widgets; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 unsigned m_visuallyNonEmptyCharacterCount; | 472 unsigned m_visuallyNonEmptyCharacterCount; |
466 unsigned m_visuallyNonEmptyPixelCount; | 473 unsigned m_visuallyNonEmptyPixelCount; |
467 bool m_isVisuallyNonEmpty; | 474 bool m_isVisuallyNonEmpty; |
468 bool m_firstVisuallyNonEmptyLayoutCallbackPending; | 475 bool m_firstVisuallyNonEmptyLayoutCallbackPending; |
469 | 476 |
470 RefPtrWillBePersistent<Node> m_maintainScrollPositionAnchor; | 477 RefPtrWillBePersistent<Node> m_maintainScrollPositionAnchor; |
471 | 478 |
472 // Renderer to hold our custom scroll corner. | 479 // Renderer to hold our custom scroll corner. |
473 RawPtrWillBePersistent<RenderScrollbarPart> m_scrollCorner; | 480 RawPtrWillBePersistent<RenderScrollbarPart> m_scrollCorner; |
474 | 481 |
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; | 482 OwnPtr<ScrollableAreaSet> m_scrollableAreas; |
486 OwnPtr<ResizerAreaSet> m_resizerAreas; | 483 OwnPtr<ResizerAreaSet> m_resizerAreas; |
487 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; | 484 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; |
485 OwnPtr<FrameViewAutoSizeInfo> m_autoSizeInfo; | |
488 | 486 |
489 bool m_hasSoftwareFilters; | 487 bool m_hasSoftwareFilters; |
490 | 488 |
491 float m_visibleContentScaleFactor; | 489 float m_visibleContentScaleFactor; |
492 IntSize m_inputEventsOffsetForEmulation; | 490 IntSize m_inputEventsOffsetForEmulation; |
493 float m_inputEventsScaleFactorForEmulation; | 491 float m_inputEventsScaleFactorForEmulation; |
494 | 492 |
495 IntSize m_layoutSize; | 493 IntSize m_layoutSize; |
496 bool m_layoutSizeFixedToFrameSize; | 494 bool m_layoutSizeFixedToFrameSize; |
497 | 495 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
545 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); | 543 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); |
546 } | 544 } |
547 private: | 545 private: |
548 FrameView* m_view; | 546 FrameView* m_view; |
549 bool m_originalValue; | 547 bool m_originalValue; |
550 }; | 548 }; |
551 | 549 |
552 } // namespace blink | 550 } // namespace blink |
553 | 551 |
554 #endif // FrameView_h | 552 #endif // FrameView_h |
OLD | NEW |