| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 * | 19 * |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #ifndef SKY_ENGINE_CORE_RENDERING_RENDERVIEW_H_ | 22 #ifndef SKY_ENGINE_CORE_RENDERING_RENDERVIEW_H_ |
| 23 #define SKY_ENGINE_CORE_RENDERING_RENDERVIEW_H_ | 23 #define SKY_ENGINE_CORE_RENDERING_RENDERVIEW_H_ |
| 24 | 24 |
| 25 #include "sky/engine/core/frame/FrameView.h" | 25 #include "sky/engine/core/frame/FrameView.h" |
| 26 #include "sky/engine/core/rendering/RenderBlockFlow.h" | 26 #include "sky/engine/core/rendering/RenderFlexibleBox.h" |
| 27 #include "sky/engine/core/rendering/RenderIFrame.h" | 27 #include "sky/engine/core/rendering/RenderIFrame.h" |
| 28 #include "sky/engine/wtf/OwnPtr.h" | 28 #include "sky/engine/wtf/OwnPtr.h" |
| 29 | 29 |
| 30 namespace blink { | 30 namespace blink { |
| 31 | 31 |
| 32 // The root of the render tree, corresponding to the CSS initial containing bloc
k. | 32 // The root of the render tree, corresponding to the CSS initial containing bloc
k. |
| 33 // It's dimensions match that of the logical viewport (which may be different fr
om | 33 // It's dimensions match that of the logical viewport (which may be different fr
om |
| 34 // the visible viewport in fixed-layout mode), and it is always at position (0,0
) | 34 // the visible viewport in fixed-layout mode), and it is always at position (0,0
) |
| 35 // relative to the document (and so isn't necessarily in view). | 35 // relative to the document (and so isn't necessarily in view). |
| 36 class RenderView final : public RenderBlockFlow { | 36 class RenderView final : public RenderFlexibleBox { |
| 37 public: | 37 public: |
| 38 explicit RenderView(Document*); | 38 explicit RenderView(Document*); |
| 39 virtual ~RenderView(); | 39 virtual ~RenderView(); |
| 40 | 40 |
| 41 bool hitTest(const HitTestRequest&, HitTestResult&); | 41 bool hitTest(const HitTestRequest&, HitTestResult&); |
| 42 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); | 42 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); |
| 43 | 43 |
| 44 // Returns the total count of calls to HitTest, for testing. | 44 // Returns the total count of calls to HitTest, for testing. |
| 45 unsigned hitTestCount() const { return m_hitTestCount; } | 45 unsigned hitTestCount() const { return m_hitTestCount; } |
| 46 | 46 |
| 47 virtual const char* renderName() const override { return "RenderView"; } | 47 virtual const char* renderName() const override { return "RenderView"; } |
| 48 | 48 |
| 49 virtual bool isRenderView() const override { return true; } | 49 virtual bool isRenderView() const override { return true; } |
| 50 | 50 |
| 51 virtual LayerType layerTypeRequired() const override { return NormalLayer; } | 51 virtual LayerType layerTypeRequired() const override { return NormalLayer; } |
| 52 | 52 |
| 53 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const override; | 53 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const override; |
| 54 | 54 |
| 55 virtual void layout() override; | 55 virtual void layout() override; |
| 56 virtual void updateLogicalWidth() override; | 56 virtual void updateLogicalWidth() override; |
| 57 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; | 57 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; |
| 58 | 58 |
| 59 virtual LayoutUnit availableLogicalHeight(AvailableLogicalHeightType) const
override; | |
| 60 | |
| 61 // The same as the FrameView's layoutHeight/layoutWidth but with null check
guards. | 59 // The same as the FrameView's layoutHeight/layoutWidth but with null check
guards. |
| 62 int viewHeight() const; | 60 int viewHeight() const; |
| 63 int viewWidth() const; | 61 int viewWidth() const; |
| 64 int viewLogicalWidth() const { return viewWidth(); } | 62 int viewLogicalWidth() const { return viewWidth(); } |
| 65 int viewLogicalHeight() const; | 63 int viewLogicalHeight() const; |
| 66 LayoutUnit viewLogicalHeightForPercentages() const; | 64 LayoutUnit viewLogicalHeightForPercentages() const; |
| 67 | 65 |
| 68 FrameView* frameView() const { return m_frameView; } | 66 FrameView* frameView() const { return m_frameView; } |
| 69 | 67 |
| 70 virtual void paint(PaintInfo&, const LayoutPoint&, Vector<RenderBox*>& layer
s) override; | 68 virtual void paint(PaintInfo&, const LayoutPoint&, Vector<RenderBox*>& layer
s) override; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 unsigned m_hitTestCount; | 112 unsigned m_hitTestCount; |
| 115 | 113 |
| 116 WTF::HashSet<RenderIFrame*> m_iframes; | 114 WTF::HashSet<RenderIFrame*> m_iframes; |
| 117 }; | 115 }; |
| 118 | 116 |
| 119 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderView, isRenderView()); | 117 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderView, isRenderView()); |
| 120 | 118 |
| 121 } // namespace blink | 119 } // namespace blink |
| 122 | 120 |
| 123 #endif // SKY_ENGINE_CORE_RENDERING_RENDERVIEW_H_ | 121 #endif // SKY_ENGINE_CORE_RENDERING_RENDERVIEW_H_ |
| OLD | NEW |