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.
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.
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.
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.
26 #ifndef NodeRenderingContext_h
27 #define NodeRenderingContext_h
29 #include "NodeRenderingTraversal.h"
31 #include <wtf/Noncopyable.h>
32 #include <wtf/RefPtr.h>
33 #include <wtf/text/AtomicString.h>
41 class RenderNamedFlowThread;
46 class NodeRenderingContext {
48 explicit NodeRenderingContext(Node*);
49 NodeRenderingContext(Node*, RenderStyle*);
50 ~NodeRenderingContext();
52 void createRendererForTextIfNeeded();
53 void createRendererForElementIfNeeded();
56 ContainerNode* parentNodeForRenderingAndStyle() const;
57 bool resetStyleInheritance() const;
58 RenderObject* parentRenderer() const;
59 RenderObject* nextRenderer() const;
60 RenderObject* previousRenderer() const;
61 InsertionPoint* insertionPoint() const;
63 const RenderStyle* style() const;
65 bool isOnUpperEncapsulationBoundary() const;
66 bool isOnEncapsulationBoundary() const;
69 bool shouldCreateRenderer() const;
70 void moveToFlowThreadIfNeeded();
73 ContainerNode* m_renderingParent;
74 NodeRenderingTraversal::ParentDetails m_parentDetails;
75 RefPtr<RenderStyle> m_style;
76 RenderNamedFlowThread* m_parentFlowRenderer;
77 AtomicString m_flowThread;
80 inline Node* NodeRenderingContext::node() const
85 inline ContainerNode* NodeRenderingContext::parentNodeForRenderingAndStyle() const
87 return m_renderingParent;
90 inline bool NodeRenderingContext::resetStyleInheritance() const
92 return m_parentDetails.resetStyleInheritance();
95 inline const RenderStyle* NodeRenderingContext::style() const
100 inline InsertionPoint* NodeRenderingContext::insertionPoint() const
102 return m_parentDetails.insertionPoint();
105 } // namespace WebCore