| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 Element* element() const { return m_item->element(); } | 59 Element* element() const { return m_item->element(); } |
| 60 ContainerNode* node() const { return m_item->node(); } | 60 ContainerNode* node() const { return m_item->node(); } |
| 61 const AtomicString& namespaceURI() const { return m_item->namespaceURI()
; } | 61 const AtomicString& namespaceURI() const { return m_item->namespaceURI()
; } |
| 62 PassRefPtrWillBeRawPtr<HTMLStackItem> stackItem() const { return m_item;
} | 62 PassRefPtrWillBeRawPtr<HTMLStackItem> stackItem() const { return m_item;
} |
| 63 void replaceElement(PassRefPtrWillBeRawPtr<HTMLStackItem>); | 63 void replaceElement(PassRefPtrWillBeRawPtr<HTMLStackItem>); |
| 64 | 64 |
| 65 bool isAbove(ElementRecord*) const; | 65 bool isAbove(ElementRecord*) const; |
| 66 | 66 |
| 67 ElementRecord* next() const { return m_next.get(); } | 67 ElementRecord* next() const { return m_next.get(); } |
| 68 | 68 |
| 69 void trace(Visitor*); | 69 DECLARE_TRACE(); |
| 70 private: | 70 private: |
| 71 friend class HTMLElementStack; | 71 friend class HTMLElementStack; |
| 72 | 72 |
| 73 ElementRecord(PassRefPtrWillBeRawPtr<HTMLStackItem>, PassOwnPtrWillBeRaw
Ptr<ElementRecord>); | 73 ElementRecord(PassRefPtrWillBeRawPtr<HTMLStackItem>, PassOwnPtrWillBeRaw
Ptr<ElementRecord>); |
| 74 | 74 |
| 75 PassOwnPtrWillBeRawPtr<ElementRecord> releaseNext() { return m_next.rele
ase(); } | 75 PassOwnPtrWillBeRawPtr<ElementRecord> releaseNext() { return m_next.rele
ase(); } |
| 76 void setNext(PassOwnPtrWillBeRawPtr<ElementRecord> next) { m_next = next
; } | 76 void setNext(PassOwnPtrWillBeRawPtr<ElementRecord> next) { m_next = next
; } |
| 77 | 77 |
| 78 RefPtrWillBeMember<HTMLStackItem> m_item; | 78 RefPtrWillBeMember<HTMLStackItem> m_item; |
| 79 OwnPtrWillBeMember<ElementRecord> m_next; | 79 OwnPtrWillBeMember<ElementRecord> m_next; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 bool hasOnlyOneElement() const; | 157 bool hasOnlyOneElement() const; |
| 158 bool secondElementIsHTMLBodyElement() const; | 158 bool secondElementIsHTMLBodyElement() const; |
| 159 bool hasTemplateInHTMLScope() const; | 159 bool hasTemplateInHTMLScope() const; |
| 160 Element* htmlElement() const; | 160 Element* htmlElement() const; |
| 161 Element* headElement() const; | 161 Element* headElement() const; |
| 162 Element* bodyElement() const; | 162 Element* bodyElement() const; |
| 163 | 163 |
| 164 ContainerNode* rootNode() const; | 164 ContainerNode* rootNode() const; |
| 165 | 165 |
| 166 void trace(Visitor*); | 166 DECLARE_TRACE(); |
| 167 | 167 |
| 168 #ifndef NDEBUG | 168 #ifndef NDEBUG |
| 169 void show(); | 169 void show(); |
| 170 #endif | 170 #endif |
| 171 | 171 |
| 172 private: | 172 private: |
| 173 void pushCommon(PassRefPtrWillBeRawPtr<HTMLStackItem>); | 173 void pushCommon(PassRefPtrWillBeRawPtr<HTMLStackItem>); |
| 174 void pushRootNodeCommon(PassRefPtrWillBeRawPtr<HTMLStackItem>); | 174 void pushRootNodeCommon(PassRefPtrWillBeRawPtr<HTMLStackItem>); |
| 175 void popCommon(); | 175 void popCommon(); |
| 176 void removeNonTopCommon(Element*); | 176 void removeNonTopCommon(Element*); |
| 177 | 177 |
| 178 OwnPtrWillBeMember<ElementRecord> m_top; | 178 OwnPtrWillBeMember<ElementRecord> m_top; |
| 179 | 179 |
| 180 // We remember the root node, <head> and <body> as they are pushed. Their | 180 // We remember the root node, <head> and <body> as they are pushed. Their |
| 181 // ElementRecords keep them alive. The root node is never popped. | 181 // ElementRecords keep them alive. The root node is never popped. |
| 182 // FIXME: We don't currently require type-specific information about | 182 // FIXME: We don't currently require type-specific information about |
| 183 // these elements so we haven't yet bothered to plumb the types all the | 183 // these elements so we haven't yet bothered to plumb the types all the |
| 184 // way down through createElement, etc. | 184 // way down through createElement, etc. |
| 185 RawPtrWillBeMember<ContainerNode> m_rootNode; | 185 RawPtrWillBeMember<ContainerNode> m_rootNode; |
| 186 RawPtrWillBeMember<Element> m_headElement; | 186 RawPtrWillBeMember<Element> m_headElement; |
| 187 RawPtrWillBeMember<Element> m_bodyElement; | 187 RawPtrWillBeMember<Element> m_bodyElement; |
| 188 unsigned m_stackDepth; | 188 unsigned m_stackDepth; |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 WILL_NOT_BE_EAGERLY_TRACED_CLASS(HTMLElementStack::ElementRecord); | 191 WILL_NOT_BE_EAGERLY_TRACED_CLASS(HTMLElementStack::ElementRecord); |
| 192 | 192 |
| 193 } // namespace blink | 193 } // namespace blink |
| 194 | 194 |
| 195 #endif // HTMLElementStack_h | 195 #endif // HTMLElementStack_h |
| OLD | NEW |