Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 | * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 | * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 | * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 6 | * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) |
| 7 | * Copyright (C) 2011 Google Inc. All rights reserved. |
| 8 | * |
| 9 | * This library is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU Library General Public |
| 11 | * License as published by the Free Software Foundation; either |
| 12 | * version 2 of the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This library is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | * Library General Public License for more details. |
| 18 | * |
| 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 |
| 21 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 | * Boston, MA 02110-1301, USA. |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | #ifndef NodeRenderingContext_h |
| 27 | #define NodeRenderingContext_h |
| 28 | |
| 29 | #include "core/dom/NodeRenderingTraversal.h" |
| 30 | |
Ben Murdoch | 591b958 | 2013-07-10 11:41:44 +0100 | [diff] [blame] | 31 | #include "wtf/RefPtr.h" |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 32 | |
| 33 | namespace WebCore { |
| 34 | |
| 35 | class ContainerNode; |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 36 | class Node; |
| 37 | class RenderNamedFlowThread; |
| 38 | class RenderObject; |
| 39 | class RenderStyle; |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 40 | |
| 41 | class NodeRenderingContext { |
| 42 | public: |
Ben Murdoch | 8375017 | 2013-07-24 10:36:59 +0100 | [diff] [blame] | 43 | NodeRenderingContext(Node*, RenderStyle* = 0); |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 44 | |
| 45 | void createRendererForTextIfNeeded(); |
| 46 | void createRendererForElementIfNeeded(); |
| 47 | |
Ben Murdoch | 3464d02 | 2013-07-25 10:06:57 +0100 | [diff] [blame] | 48 | Node* node() const { return m_node; } |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 49 | RenderObject* parentRenderer() const; |
| 50 | RenderObject* nextRenderer() const; |
| 51 | RenderObject* previousRenderer() const; |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 52 | |
Ben Murdoch | 3464d02 | 2013-07-25 10:06:57 +0100 | [diff] [blame] | 53 | const RenderStyle* style() const { return m_style.get(); } |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 54 | |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 55 | private: |
| 56 | bool shouldCreateRenderer() const; |
| 57 | void moveToFlowThreadIfNeeded(); |
Ben Murdoch | 591b958 | 2013-07-10 11:41:44 +0100 | [diff] [blame] | 58 | bool elementInsideRegionNeedsRenderer(); |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 59 | |
| 60 | Node* m_node; |
| 61 | ContainerNode* m_renderingParent; |
| 62 | NodeRenderingTraversal::ParentDetails m_parentDetails; |
| 63 | RefPtr<RenderStyle> m_style; |
| 64 | RenderNamedFlowThread* m_parentFlowRenderer; |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 65 | }; |
| 66 | |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 67 | } // namespace WebCore |
| 68 | |
| 69 | #endif |