| 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/rendering/PaintPhase.h" | 28 #include "core/rendering/PaintPhase.h" |
| 29 #include "platform/FrameWidget.h" | |
| 30 #include "platform/HostWindow.h" | 29 #include "platform/HostWindow.h" |
| 31 #include "platform/RuntimeEnabledFeatures.h" | 30 #include "platform/RuntimeEnabledFeatures.h" |
| 32 #include "platform/Widget.h" | 31 #include "platform/Widget.h" |
| 33 #include "platform/Widget.h" | |
| 34 #include "platform/geometry/LayoutRect.h" | 32 #include "platform/geometry/LayoutRect.h" |
| 35 #include "platform/graphics/Color.h" | 33 #include "platform/graphics/Color.h" |
| 36 #include "platform/scroll/ScrollableArea.h" | 34 #include "platform/scroll/ScrollableArea.h" |
| 37 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
| 38 #include "wtf/HashSet.h" | 36 #include "wtf/HashSet.h" |
| 39 #include "wtf/OwnPtr.h" | 37 #include "wtf/OwnPtr.h" |
| 40 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
| 41 | 39 |
| 42 namespace blink { | 40 namespace blink { |
| 43 | 41 |
| 44 class DocumentLifecycle; | 42 class DocumentLifecycle; |
| 45 class Cursor; | 43 class Cursor; |
| 46 class Element; | 44 class Element; |
| 47 class FloatSize; | 45 class FloatSize; |
| 48 class LocalFrame; | 46 class LocalFrame; |
| 49 class KURL; | 47 class KURL; |
| 50 class Node; | 48 class Node; |
| 51 class Page; | 49 class Page; |
| 52 class RenderBox; | 50 class RenderBox; |
| 53 class RenderObject; | 51 class RenderObject; |
| 54 class RenderStyle; | 52 class RenderStyle; |
| 55 class RenderView; | 53 class RenderView; |
| 56 | 54 |
| 57 typedef unsigned long long DOMTimeStamp; | 55 typedef unsigned long long DOMTimeStamp; |
| 58 | 56 |
| 59 class FrameView final : public FrameWidget { | 57 class FrameView final : public Widget { |
| 60 public: | 58 public: |
| 61 friend class RenderView; | 59 friend class RenderView; |
| 62 | 60 |
| 63 static PassRefPtr<FrameView> create(LocalFrame*); | 61 static PassRefPtr<FrameView> create(LocalFrame*); |
| 64 static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize)
; | 62 static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize)
; |
| 65 | 63 |
| 66 virtual ~FrameView(); | 64 virtual ~FrameView(); |
| 67 | 65 |
| 68 HostWindow* hostWindow() const; | 66 HostWindow* hostWindow() const; |
| 69 | 67 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.
get(); } | 195 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas.
get(); } |
| 198 | 196 |
| 199 // With CSS style "resize:" enabled, a little resizer handle will appear at
the bottom | 197 // With CSS style "resize:" enabled, a little resizer handle will appear at
the bottom |
| 200 // right of the object. We keep track of these resizer areas for checking if
touches | 198 // right of the object. We keep track of these resizer areas for checking if
touches |
| 201 // (implemented using Scroll gesture) are targeting the resizer. | 199 // (implemented using Scroll gesture) are targeting the resizer. |
| 202 typedef HashSet<RenderBox*> ResizerAreaSet; | 200 typedef HashSet<RenderBox*> ResizerAreaSet; |
| 203 void addResizerArea(RenderBox&); | 201 void addResizerArea(RenderBox&); |
| 204 void removeResizerArea(RenderBox&); | 202 void removeResizerArea(RenderBox&); |
| 205 const ResizerAreaSet* resizerAreas() const { return m_resizerAreas.get(); } | 203 const ResizerAreaSet* resizerAreas() const { return m_resizerAreas.get(); } |
| 206 | 204 |
| 207 void addChild(PassRefPtr<Widget>); | |
| 208 void removeChild(Widget*) final; | |
| 209 | |
| 210 // This function exists for ports that need to handle wheel events manually. | 205 // This function exists for ports that need to handle wheel events manually. |
| 211 // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but o
n most other platforms | 206 // On Mac WebKit1 the underlying NSScrollView just does the scrolling, but o
n most other platforms |
| 212 // we need this function in order to do the scroll ourselves. | 207 // we need this function in order to do the scroll ourselves. |
| 213 bool wheelEvent(const PlatformWheelEvent&); | 208 bool wheelEvent(const PlatformWheelEvent&); |
| 214 | 209 |
| 215 bool inProgrammaticScroll() const { return m_inProgrammaticScroll; } | 210 bool inProgrammaticScroll() const { return m_inProgrammaticScroll; } |
| 216 void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScro
ll = programmaticScroll; } | 211 void setInProgrammaticScroll(bool programmaticScroll) { m_inProgrammaticScro
ll = programmaticScroll; } |
| 217 | 212 |
| 218 void setHasSoftwareFilters(bool hasSoftwareFilters) { m_hasSoftwareFilters =
hasSoftwareFilters; } | 213 void setHasSoftwareFilters(bool hasSoftwareFilters) { m_hasSoftwareFilters =
hasSoftwareFilters; } |
| 219 bool hasSoftwareFilters() const { return m_hasSoftwareFilters; } | 214 bool hasSoftwareFilters() const { return m_hasSoftwareFilters; } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 266 |
| 272 bool isVerticalDocument() const; | 267 bool isVerticalDocument() const; |
| 273 bool isFlippedDocument() const; | 268 bool isFlippedDocument() const; |
| 274 | 269 |
| 275 private: | 270 private: |
| 276 explicit FrameView(LocalFrame*); | 271 explicit FrameView(LocalFrame*); |
| 277 | 272 |
| 278 void reset(); | 273 void reset(); |
| 279 void init(); | 274 void init(); |
| 280 | 275 |
| 281 virtual void frameRectsChanged() override; | |
| 282 virtual bool isFrameView() const override { return true; } | 276 virtual bool isFrameView() const override { return true; } |
| 283 | 277 |
| 284 bool contentsInCompositedLayer() const; | 278 bool contentsInCompositedLayer() const; |
| 285 | 279 |
| 286 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo
de, ScrollbarMode& vMode); | 280 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo
de, ScrollbarMode& vMode); |
| 287 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); | 281 void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow); |
| 288 | 282 |
| 289 void forceLayoutParentViewIfNeeded(); | 283 void forceLayoutParentViewIfNeeded(); |
| 290 void performPreLayoutTasks(); | 284 void performPreLayoutTasks(); |
| 291 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); | 285 void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 { | 318 { |
| 325 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); | 319 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); |
| 326 } | 320 } |
| 327 | 321 |
| 328 static double s_currentFrameTimeStamp; // used for detecting decoded resourc
e thrash in the cache | 322 static double s_currentFrameTimeStamp; // used for detecting decoded resourc
e thrash in the cache |
| 329 static bool s_inPaintContents; | 323 static bool s_inPaintContents; |
| 330 | 324 |
| 331 LayoutSize m_size; | 325 LayoutSize m_size; |
| 332 | 326 |
| 333 RefPtr<LocalFrame> m_frame; | 327 RefPtr<LocalFrame> m_frame; |
| 334 HashSet<RefPtr<Widget> > m_children; | |
| 335 | 328 |
| 336 bool m_doFullPaintInvalidation; | 329 bool m_doFullPaintInvalidation; |
| 337 | 330 |
| 338 // FIXME(sky): Remove | 331 // FIXME(sky): Remove |
| 339 bool m_canHaveScrollbars; | 332 bool m_canHaveScrollbars; |
| 340 | 333 |
| 341 bool m_hasPendingLayout; | 334 bool m_hasPendingLayout; |
| 342 RenderObject* m_layoutSubtreeRoot; | 335 RenderObject* m_layoutSubtreeRoot; |
| 343 | 336 |
| 344 bool m_layoutSchedulingEnabled; | 337 bool m_layoutSchedulingEnabled; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); | 407 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); |
| 415 } | 408 } |
| 416 private: | 409 private: |
| 417 FrameView* m_view; | 410 FrameView* m_view; |
| 418 bool m_originalValue; | 411 bool m_originalValue; |
| 419 }; | 412 }; |
| 420 | 413 |
| 421 } // namespace blink | 414 } // namespace blink |
| 422 | 415 |
| 423 #endif // FrameView_h | 416 #endif // FrameView_h |
| OLD | NEW |