| 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 21 matching lines...) Expand all Loading... |
| 32 #include "core/css/StyleSheetList.h" | 32 #include "core/css/StyleSheetList.h" |
| 33 #include "core/css/resolver/StyleResolver.h" | 33 #include "core/css/resolver/StyleResolver.h" |
| 34 #include "core/dom/ElementTraversal.h" | 34 #include "core/dom/ElementTraversal.h" |
| 35 #include "core/dom/StyleEngine.h" | 35 #include "core/dom/StyleEngine.h" |
| 36 #include "core/dom/Text.h" | 36 #include "core/dom/Text.h" |
| 37 #include "core/dom/WhitespaceChildList.h" | 37 #include "core/dom/WhitespaceChildList.h" |
| 38 #include "core/dom/shadow/ElementShadow.h" | 38 #include "core/dom/shadow/ElementShadow.h" |
| 39 #include "core/dom/shadow/InsertionPoint.h" | 39 #include "core/dom/shadow/InsertionPoint.h" |
| 40 #include "core/dom/shadow/ShadowRootRareData.h" | 40 #include "core/dom/shadow/ShadowRootRareData.h" |
| 41 #include "core/editing/markup.h" | 41 #include "core/editing/markup.h" |
| 42 #include "core/platform/HistogramSupport.h" | 42 #include "public/platform/Platform.h" |
| 43 | 43 |
| 44 namespace WebCore { | 44 namespace WebCore { |
| 45 | 45 |
| 46 struct SameSizeAsShadowRoot : public DocumentFragment, public TreeScope, public
DoublyLinkedListNode<ShadowRoot> { | 46 struct SameSizeAsShadowRoot : public DocumentFragment, public TreeScope, public
DoublyLinkedListNode<ShadowRoot> { |
| 47 void* pointers[3]; | 47 void* pointers[3]; |
| 48 unsigned countersAndFlags[1]; | 48 unsigned countersAndFlags[1]; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 COMPILE_ASSERT(sizeof(ShadowRoot) == sizeof(SameSizeAsShadowRoot), shadowroot_sh
ould_stay_small); | 51 COMPILE_ASSERT(sizeof(ShadowRoot) == sizeof(SameSizeAsShadowRoot), shadowroot_sh
ould_stay_small); |
| 52 | 52 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 66 , m_resetStyleInheritance(false) | 66 , m_resetStyleInheritance(false) |
| 67 , m_type(type) | 67 , m_type(type) |
| 68 , m_registeredWithParentShadowRoot(false) | 68 , m_registeredWithParentShadowRoot(false) |
| 69 , m_childInsertionPointsIsValid(false) | 69 , m_childInsertionPointsIsValid(false) |
| 70 { | 70 { |
| 71 ASSERT(document); | 71 ASSERT(document); |
| 72 ScriptWrappable::init(this); | 72 ScriptWrappable::init(this); |
| 73 | 73 |
| 74 if (type == ShadowRoot::AuthorShadowRoot) { | 74 if (type == ShadowRoot::AuthorShadowRoot) { |
| 75 ShadowRootUsageOriginType usageType = document->url().protocolIsInHTTPFa
mily() ? ShadowRootUsageOriginWeb : ShadowRootUsageOriginNotWeb; | 75 ShadowRootUsageOriginType usageType = document->url().protocolIsInHTTPFa
mily() ? ShadowRootUsageOriginWeb : ShadowRootUsageOriginNotWeb; |
| 76 HistogramSupport::histogramEnumeration("WebCore.ShadowRoot.constructor",
usageType, ShadowRootUsageOriginMax); | 76 WebKit::Platform::current()->histogramEnumeration("WebCore.ShadowRoot.co
nstructor", usageType, ShadowRootUsageOriginMax); |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 ShadowRoot::~ShadowRoot() | 80 ShadowRoot::~ShadowRoot() |
| 81 { | 81 { |
| 82 ASSERT(!m_prev); | 82 ASSERT(!m_prev); |
| 83 ASSERT(!m_next); | 83 ASSERT(!m_next); |
| 84 | 84 |
| 85 if (m_shadowRootRareData && m_shadowRootRareData->styleSheets()) | 85 if (m_shadowRootRareData && m_shadowRootRareData->styleSheets()) |
| 86 m_shadowRootRareData->styleSheets()->detachFromDocument(); | 86 m_shadowRootRareData->styleSheets()->detachFromDocument(); |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 | 414 |
| 415 StyleSheetList* ShadowRoot::styleSheets() | 415 StyleSheetList* ShadowRoot::styleSheets() |
| 416 { | 416 { |
| 417 if (!ensureShadowRootRareData()->styleSheets()) | 417 if (!ensureShadowRootRareData()->styleSheets()) |
| 418 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); | 418 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); |
| 419 | 419 |
| 420 return m_shadowRootRareData->styleSheets(); | 420 return m_shadowRootRareData->styleSheets(); |
| 421 } | 421 } |
| 422 | 422 |
| 423 } | 423 } |
| OLD | NEW |