| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/dom/shadow/ShadowRoot.h" | 28 #include "core/dom/shadow/ShadowRoot.h" |
| 29 | 29 |
| 30 #include "bindings/v8/ExceptionMessages.h" | 30 #include "bindings/v8/ExceptionMessages.h" |
| 31 #include "bindings/v8/ExceptionState.h" | 31 #include "bindings/v8/ExceptionState.h" |
| 32 #include "core/css/resolver/StyleResolver.h" | 32 #include "core/css/resolver/StyleResolver.h" |
| 33 #include "core/dom/ElementTraversal.h" | 33 #include "core/dom/ElementTraversal.h" |
| 34 #include "core/dom/StyleSheetCollections.h" | 34 #include "core/dom/StyleEngine.h" |
| 35 #include "core/dom/Text.h" | 35 #include "core/dom/Text.h" |
| 36 #include "core/dom/shadow/ElementShadow.h" | 36 #include "core/dom/shadow/ElementShadow.h" |
| 37 #include "core/dom/shadow/InsertionPoint.h" | 37 #include "core/dom/shadow/InsertionPoint.h" |
| 38 #include "core/dom/shadow/ShadowRootRareData.h" | 38 #include "core/dom/shadow/ShadowRootRareData.h" |
| 39 #include "core/editing/markup.h" | 39 #include "core/editing/markup.h" |
| 40 #include "core/platform/HistogramSupport.h" | 40 #include "core/platform/HistogramSupport.h" |
| 41 | 41 |
| 42 namespace WebCore { | 42 namespace WebCore { |
| 43 | 43 |
| 44 struct SameSizeAsShadowRoot : public DocumentFragment, public TreeScope, public
DoublyLinkedListNode<ShadowRoot> { | 44 struct SameSizeAsShadowRoot : public DocumentFragment, public TreeScope, public
DoublyLinkedListNode<ShadowRoot> { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 73 ShadowRootUsageOriginType usageType = document->url().protocolIsInHTTPFa
mily() ? ShadowRootUsageOriginWeb : ShadowRootUsageOriginNotWeb; | 73 ShadowRootUsageOriginType usageType = document->url().protocolIsInHTTPFa
mily() ? ShadowRootUsageOriginWeb : ShadowRootUsageOriginNotWeb; |
| 74 HistogramSupport::histogramEnumeration("WebCore.ShadowRoot.constructor",
usageType, ShadowRootUsageOriginMax); | 74 HistogramSupport::histogramEnumeration("WebCore.ShadowRoot.constructor",
usageType, ShadowRootUsageOriginMax); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 ShadowRoot::~ShadowRoot() | 78 ShadowRoot::~ShadowRoot() |
| 79 { | 79 { |
| 80 ASSERT(!m_prev); | 80 ASSERT(!m_prev); |
| 81 ASSERT(!m_next); | 81 ASSERT(!m_next); |
| 82 | 82 |
| 83 documentInternal()->styleSheetCollections()->didRemoveShadowRoot(this); | 83 documentInternal()->styleEngine()->didRemoveShadowRoot(this); |
| 84 | 84 |
| 85 // We cannot let ContainerNode destructor call willBeDeletedFrom() | 85 // We cannot let ContainerNode destructor call willBeDeletedFrom() |
| 86 // for this ShadowRoot instance because TreeScope destructor | 86 // for this ShadowRoot instance because TreeScope destructor |
| 87 // clears Node::m_treeScope thus ContainerNode is no longer able | 87 // clears Node::m_treeScope thus ContainerNode is no longer able |
| 88 // to access it Document reference after that. | 88 // to access it Document reference after that. |
| 89 willBeDeletedFrom(documentInternal()); | 89 willBeDeletedFrom(documentInternal()); |
| 90 | 90 |
| 91 // We must remove all of our children first before the TreeScope destructor | 91 // We must remove all of our children first before the TreeScope destructor |
| 92 // runs so we don't go through TreeScopeAdopter for each child with a | 92 // runs so we don't go through TreeScopeAdopter for each child with a |
| 93 // destructed tree scope in each descendant. | 93 // destructed tree scope in each descendant. |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 if (element->isInsertionPoint()) | 405 if (element->isInsertionPoint()) |
| 406 insertionPoints.append(toInsertionPoint(element)); | 406 insertionPoints.append(toInsertionPoint(element)); |
| 407 } | 407 } |
| 408 | 408 |
| 409 ensureShadowRootRareData()->setChildInsertionPoints(insertionPoints); | 409 ensureShadowRootRareData()->setChildInsertionPoints(insertionPoints); |
| 410 | 410 |
| 411 return m_shadowRootRareData->childInsertionPoints(); | 411 return m_shadowRootRareData->childInsertionPoints(); |
| 412 } | 412 } |
| 413 | 413 |
| 414 } | 414 } |
| OLD | NEW |