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

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

Issue 459633002: Autosizing storage doesnot belong on FrameView (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed deadcode Created 6 years, 4 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 | « no previous file | 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 23 matching lines...) Expand all
34 #include "wtf/OwnPtr.h" 34 #include "wtf/OwnPtr.h"
35 #include "wtf/text/WTFString.h" 35 #include "wtf/text/WTFString.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 class AXObjectCache; 39 class AXObjectCache;
40 class DocumentLifecycle; 40 class DocumentLifecycle;
41 class Cursor; 41 class Cursor;
42 class Element; 42 class Element;
43 class FloatSize; 43 class FloatSize;
44 class FrameView;
44 class HTMLFrameOwnerElement; 45 class HTMLFrameOwnerElement;
45 class LocalFrame; 46 class LocalFrame;
46 class KURL; 47 class KURL;
47 class Node; 48 class Node;
48 class Page; 49 class Page;
49 class RenderBox; 50 class RenderBox;
50 class RenderEmbeddedObject; 51 class RenderEmbeddedObject;
51 class RenderObject; 52 class RenderObject;
52 class RenderScrollbarPart; 53 class RenderScrollbarPart;
53 class RenderStyle; 54 class RenderStyle;
54 class RenderView; 55 class RenderView;
55 class RenderWidget; 56 class RenderWidget;
56 57
57 typedef unsigned long long DOMTimeStamp; 58 typedef unsigned long long DOMTimeStamp;
58 59
60 struct FrameViewAutoSizeData {
ostap 2014/08/10 05:01:51 Shouldn't it go into separate .h & .cpp ?
Shanmuga Pandi 2014/08/10 09:56:48 I thought it is going to be used only in FrameView
Shanmuga Pandi 2014/08/11 08:58:00 Done.
ostap 2014/08/11 19:24:27 I see. Ok.
61 WTF_MAKE_NONCOPYABLE(FrameViewAutoSizeData); WTF_MAKE_FAST_ALLOCATED;
62 public:
63 FrameViewAutoSizeData(FrameView *view)
64 : m_frameView(view)
65 , m_shouldAutoSize(false)
66 , m_inAutoSize(false)
67 , m_didRunAutosize(false)
68 {
69 }
70
71 void enableAutoSizeMode(bool enable, const IntSize& minSize, const IntSize& maxSize);
72 void autoSizeIfEnabled();
73
74 private:
75 FrameView *m_frameView;
76
77 // If true, automatically resize the frame view around its content.
78 bool m_shouldAutoSize;
79 bool m_inAutoSize;
80 // True if autosize has been run since m_shouldAutoSize was set.
81 bool m_didRunAutosize;
82 // The lower bound on the size when autosizing.
83 IntSize m_minAutoSize;
84 // The upper bound on the size when autosizing.
85 IntSize m_maxAutoSize;
86 };
87
59 class FrameView FINAL : public ScrollView { 88 class FrameView FINAL : public ScrollView {
60 public: 89 public:
61 friend class RenderView; 90 friend class RenderView;
62 friend class Internals; 91 friend class Internals;
63 92
64 static PassRefPtr<FrameView> create(LocalFrame*); 93 static PassRefPtr<FrameView> create(LocalFrame*);
65 static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize) ; 94 static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize) ;
66 95
67 virtual ~FrameView(); 96 virtual ~FrameView();
68 97
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 friend class RenderWidget; 377 friend class RenderWidget;
349 bool useSlowRepaints(bool considerOverlap = true) const; 378 bool useSlowRepaints(bool considerOverlap = true) const;
350 bool useSlowRepaintsIfNotOverlapped() const; 379 bool useSlowRepaintsIfNotOverlapped() const;
351 380
352 bool contentsInCompositedLayer() const; 381 bool contentsInCompositedLayer() const;
353 382
354 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo de, ScrollbarMode& vMode); 383 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo de, ScrollbarMode& vMode);
355 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); 384 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
356 385
357 void updateCounters(); 386 void updateCounters();
358 void autoSizeIfEnabled();
359 void forceLayoutParentViewIfNeeded(); 387 void forceLayoutParentViewIfNeeded();
360 void performPreLayoutTasks(); 388 void performPreLayoutTasks();
361 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); 389 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout);
362 void scheduleOrPerformPostLayoutTasks(); 390 void scheduleOrPerformPostLayoutTasks();
363 void performPostLayoutTasks(); 391 void performPostLayoutTasks();
364 392
365 void invalidateTreeIfNeeded(); 393 void invalidateTreeIfNeeded();
366 394
367 void gatherDebugLayoutRects(RenderObject* layoutRoot); 395 void gatherDebugLayoutRects(RenderObject* layoutRoot);
368 396
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 AXObjectCache* axObjectCache() const; 435 AXObjectCache* axObjectCache() const;
408 void removeFromAXObjectCache(); 436 void removeFromAXObjectCache();
409 437
410 void setLayoutSizeInternal(const IntSize&); 438 void setLayoutSizeInternal(const IntSize&);
411 439
412 bool paintInvalidationIsAllowed() const 440 bool paintInvalidationIsAllowed() const
413 { 441 {
414 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); 442 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout();
415 } 443 }
416 444
445 FrameViewAutoSizeData& ensureAutoSizeData()
ostap 2014/08/10 05:01:51 autoSizeData() ?
Shanmuga Pandi 2014/08/10 09:56:48 I have referred ensureRareData in RenderBox.h. Ca
Shanmuga Pandi 2014/08/11 08:58:00 Done.
ostap 2014/08/11 19:24:26 I sees it both ways in code, so it should be fine
446 {
447 if (!m_autoSizeData)
448 m_autoSizeData = adoptPtr(new FrameViewAutoSizeData(this));
449 return *m_autoSizeData.get();
450 }
451
417 static double s_currentFrameTimeStamp; // used for detecting decoded resourc e thrash in the cache 452 static double s_currentFrameTimeStamp; // used for detecting decoded resourc e thrash in the cache
418 static bool s_inPaintContents; 453 static bool s_inPaintContents;
419 454
420 LayoutSize m_size; 455 LayoutSize m_size;
421 456
422 typedef HashSet<RefPtr<RenderEmbeddedObject> > EmbeddedObjectSet; 457 typedef HashSet<RefPtr<RenderEmbeddedObject> > EmbeddedObjectSet;
423 EmbeddedObjectSet m_widgetUpdateSet; 458 EmbeddedObjectSet m_widgetUpdateSet;
424 459
425 // FIXME: These are just "children" of the FrameView and should be RefPtr<Wi dget> instead. 460 // FIXME: These are just "children" of the FrameView and should be RefPtr<Wi dget> instead.
426 HashSet<RefPtr<RenderWidget> > m_widgets; 461 HashSet<RefPtr<RenderWidget> > m_widgets;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 unsigned m_visuallyNonEmptyCharacterCount; 513 unsigned m_visuallyNonEmptyCharacterCount;
479 unsigned m_visuallyNonEmptyPixelCount; 514 unsigned m_visuallyNonEmptyPixelCount;
480 bool m_isVisuallyNonEmpty; 515 bool m_isVisuallyNonEmpty;
481 bool m_firstVisuallyNonEmptyLayoutCallbackPending; 516 bool m_firstVisuallyNonEmptyLayoutCallbackPending;
482 517
483 RefPtrWillBePersistent<Node> m_maintainScrollPositionAnchor; 518 RefPtrWillBePersistent<Node> m_maintainScrollPositionAnchor;
484 519
485 // Renderer to hold our custom scroll corner. 520 // Renderer to hold our custom scroll corner.
486 RenderScrollbarPart* m_scrollCorner; 521 RenderScrollbarPart* m_scrollCorner;
487 522
488 // If true, automatically resize the frame view around its content.
489 bool m_shouldAutoSize;
490 bool m_inAutoSize;
491 // True if autosize has been run since m_shouldAutoSize was set.
492 bool m_didRunAutosize;
493 // The lower bound on the size when autosizing.
494 IntSize m_minAutoSize;
495 // The upper bound on the size when autosizing.
496 IntSize m_maxAutoSize;
497
498 OwnPtr<ScrollableAreaSet> m_scrollableAreas; 523 OwnPtr<ScrollableAreaSet> m_scrollableAreas;
499 OwnPtr<ResizerAreaSet> m_resizerAreas; 524 OwnPtr<ResizerAreaSet> m_resizerAreas;
500 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; 525 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects;
526 OwnPtr<FrameViewAutoSizeData> m_autoSizeData;
501 527
502 bool m_hasSoftwareFilters; 528 bool m_hasSoftwareFilters;
503 529
504 float m_visibleContentScaleFactor; 530 float m_visibleContentScaleFactor;
505 IntSize m_inputEventsOffsetForEmulation; 531 IntSize m_inputEventsOffsetForEmulation;
506 float m_inputEventsScaleFactorForEmulation; 532 float m_inputEventsScaleFactorForEmulation;
507 533
508 IntSize m_layoutSize; 534 IntSize m_layoutSize;
509 bool m_layoutSizeFixedToFrameSize; 535 bool m_layoutSizeFixedToFrameSize;
510 536
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); 584 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue);
559 } 585 }
560 private: 586 private:
561 FrameView* m_view; 587 FrameView* m_view;
562 bool m_originalValue; 588 bool m_originalValue;
563 }; 589 };
564 590
565 } // namespace blink 591 } // namespace blink
566 592
567 #endif // FrameView_h 593 #endif // FrameView_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698