| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 6 * rights reserved. | 6 * rights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 8 * (http://www.torchmobile.com/) | 8 * (http://www.torchmobile.com/) |
| 9 * Copyright (C) 2011 Google Inc. All rights reserved. | 9 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 class ComputedStyle; | 40 class ComputedStyle; |
| 41 | 41 |
| 42 template <typename NodeType> | 42 template <typename NodeType> |
| 43 class LayoutTreeBuilder { | 43 class LayoutTreeBuilder { |
| 44 STACK_ALLOCATED(); | 44 STACK_ALLOCATED(); |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 LayoutTreeBuilder(NodeType& node, LayoutObject* layoutObjectParent) | 47 LayoutTreeBuilder(NodeType& node, LayoutObject* layoutObjectParent) |
| 48 : m_node(node), m_layoutObjectParent(layoutObjectParent) { | 48 : m_node(node), m_layoutObjectParent(layoutObjectParent) { |
| 49 DCHECK(!node.layoutObject()); | 49 DCHECK(!node.layoutObject()); |
| 50 DCHECK(node.needsAttach()); | 50 DCHECK(node.needsReattachLayoutTree()); |
| 51 DCHECK(node.document().inStyleRecalc()); | 51 DCHECK(node.document().inStyleRecalc()); |
| 52 DCHECK(node.inActiveDocument()); | 52 DCHECK(node.inActiveDocument()); |
| 53 } | 53 } |
| 54 | 54 |
| 55 LayoutObject* nextLayoutObject() const { | 55 LayoutObject* nextLayoutObject() const { |
| 56 DCHECK(m_layoutObjectParent); | 56 DCHECK(m_layoutObjectParent); |
| 57 | 57 |
| 58 // Avoid an O(N^2) walk over the children when reattaching all children of a | 58 // Avoid an O(N^2) walk over the children when reattaching all children of a |
| 59 // node. | 59 // node. |
| 60 if (m_layoutObjectParent->node() && | 60 if (m_layoutObjectParent->node() && |
| 61 m_layoutObjectParent->node()->needsAttach()) | 61 m_layoutObjectParent->node()->needsReattachLayoutTree()) |
| 62 return 0; | 62 return 0; |
| 63 | 63 |
| 64 return LayoutTreeBuilderTraversal::nextSiblingLayoutObject(*m_node); | 64 return LayoutTreeBuilderTraversal::nextSiblingLayoutObject(*m_node); |
| 65 } | 65 } |
| 66 | 66 |
| 67 Member<NodeType> m_node; | 67 Member<NodeType> m_node; |
| 68 LayoutObject* m_layoutObjectParent; | 68 LayoutObject* m_layoutObjectParent; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 class LayoutTreeBuilderForElement : public LayoutTreeBuilder<Element> { | 71 class LayoutTreeBuilderForElement : public LayoutTreeBuilder<Element> { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 91 public: | 91 public: |
| 92 LayoutTreeBuilderForText(Text& text, LayoutObject* layoutParent) | 92 LayoutTreeBuilderForText(Text& text, LayoutObject* layoutParent) |
| 93 : LayoutTreeBuilder(text, layoutParent) {} | 93 : LayoutTreeBuilder(text, layoutParent) {} |
| 94 | 94 |
| 95 void createLayoutObject(); | 95 void createLayoutObject(); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 } // namespace blink | 98 } // namespace blink |
| 99 | 99 |
| 100 #endif | 100 #endif |
| OLD | NEW |