diff options
| author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-23 10:25:11 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-23 10:25:11 +0200 |
| commit | 5ea819f80c6840c492386bfafbffb059c7e2091f (patch) | |
| tree | 42ad0b1d82eff090d14278a088ea0f4840a0f938 /Source/WebCore/dom/ShadowRoot.cpp | |
| parent | 43a42f108af6bcbd91f2672731c3047c26213af1 (diff) | |
| download | qtwebkit-5ea819f80c6840c492386bfafbffb059c7e2091f.tar.gz | |
Imported WebKit commit 20434eb8eb95065803473139d8794e98a7672f75 (http://svn.webkit.org/repository/webkit/trunk@132191)
New snapshot that should fix build with latest qtbase and the QPlastiqueStyle removal
Diffstat (limited to 'Source/WebCore/dom/ShadowRoot.cpp')
| -rw-r--r-- | Source/WebCore/dom/ShadowRoot.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/Source/WebCore/dom/ShadowRoot.cpp b/Source/WebCore/dom/ShadowRoot.cpp index 0da9f27a9..75192cded 100644 --- a/Source/WebCore/dom/ShadowRoot.cpp +++ b/Source/WebCore/dom/ShadowRoot.cpp @@ -38,6 +38,7 @@ #include "HTMLInputElement.h" #include "HTMLNames.h" #include "HTMLTextAreaElement.h" +#include "HistogramSupport.h" #include "InsertionPoint.h" #include "NodeRareData.h" #include "RuntimeEnabledFeatures.h" @@ -86,8 +87,28 @@ static bool allowsAuthorShadowRoot(Element* element) return element->areAuthorShadowsAllowed(); } +enum ShadowRootUsageOriginType { + ShadowRootUsageOriginWeb = 0, + ShadowRootUsageOriginNotWeb, + ShadowRootUsageOriginTypes +}; + +static inline ShadowRootUsageOriginType determineUsageType(Element* host) +{ + // Enables only on CHROMIUM since this cost won't worth paying for platforms which don't collect this metrics. +#if PLATFORM(CHROMIUM) + if (!host) + return ShadowRootUsageOriginWeb; + return host->document()->url().string().startsWith("http") ? ShadowRootUsageOriginWeb : ShadowRootUsageOriginNotWeb; +#else + UNUSED_PARAM(host); + return ShadowRootUsageOriginWeb; +#endif +} + PassRefPtr<ShadowRoot> ShadowRoot::create(Element* element, ExceptionCode& ec) { + HistogramSupport::histogramEnumeration("WebCore.ShadowRoot.constructor", determineUsageType(element), ShadowRootUsageOriginTypes); return create(element, AuthorShadowRoot, ec); } @@ -215,8 +236,7 @@ void ShadowRoot::attach() { StyleResolver* styleResolver = document()->styleResolver(); styleResolver->pushParentShadowRoot(this); - attachChildren(); - attachAsNode(); + DocumentFragment::attach(); styleResolver->popParentShadowRoot(this); } |
