Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: Source/core/dom/Element.cpp

Issue 986583002: Collect host of Web Component usage to send to RAPPOR (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 #include "core/editing/markup.h" 80 #include "core/editing/markup.h"
81 #include "core/events/EventDispatcher.h" 81 #include "core/events/EventDispatcher.h"
82 #include "core/events/FocusEvent.h" 82 #include "core/events/FocusEvent.h"
83 #include "core/frame/FrameHost.h" 83 #include "core/frame/FrameHost.h"
84 #include "core/frame/FrameView.h" 84 #include "core/frame/FrameView.h"
85 #include "core/frame/LocalDOMWindow.h" 85 #include "core/frame/LocalDOMWindow.h"
86 #include "core/frame/LocalFrame.h" 86 #include "core/frame/LocalFrame.h"
87 #include "core/frame/PinchViewport.h" 87 #include "core/frame/PinchViewport.h"
88 #include "core/frame/ScrollToOptions.h" 88 #include "core/frame/ScrollToOptions.h"
89 #include "core/frame/Settings.h" 89 #include "core/frame/Settings.h"
90 #include "core/frame/UseByOriginCounter.h"
90 #include "core/frame/UseCounter.h" 91 #include "core/frame/UseCounter.h"
91 #include "core/frame/csp/ContentSecurityPolicy.h" 92 #include "core/frame/csp/ContentSecurityPolicy.h"
92 #include "core/html/ClassList.h" 93 #include "core/html/ClassList.h"
93 #include "core/html/HTMLCanvasElement.h" 94 #include "core/html/HTMLCanvasElement.h"
94 #include "core/html/HTMLCollection.h" 95 #include "core/html/HTMLCollection.h"
95 #include "core/html/HTMLDocument.h" 96 #include "core/html/HTMLDocument.h"
96 #include "core/html/HTMLElement.h" 97 #include "core/html/HTMLElement.h"
97 #include "core/html/HTMLFormControlsCollection.h" 98 #include "core/html/HTMLFormControlsCollection.h"
98 #include "core/html/HTMLFrameElementBase.h" 99 #include "core/html/HTMLFrameElementBase.h"
99 #include "core/html/HTMLFrameOwnerElement.h" 100 #include "core/html/HTMLFrameOwnerElement.h"
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1764 ensureElementRareData().setCustomElementDefinition(definition); 1765 ensureElementRareData().setCustomElementDefinition(definition);
1765 } 1766 }
1766 1767
1767 CustomElementDefinition* Element::customElementDefinition() const 1768 CustomElementDefinition* Element::customElementDefinition() const
1768 { 1769 {
1769 if (hasRareData()) 1770 if (hasRareData())
1770 return elementRareData()->customElementDefinition(); 1771 return elementRareData()->customElementDefinition();
1771 return nullptr; 1772 return nullptr;
1772 } 1773 }
1773 1774
1775 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ScriptState* script State, ExceptionState& exceptionState)
1776 {
1777 UseByOriginCounter::count(scriptState, document(), UseByOriginCounter::Featu re::ElementCreateShadowRoot);
1778 return createShadowRoot(exceptionState);
1779 }
1780
1774 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& exc eptionState) 1781 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& exc eptionState)
1775 { 1782 {
1776 if (alwaysCreateClosedShadowRoot()) 1783 if (alwaysCreateClosedShadowRoot())
1777 ensureClosedShadowRoot(); 1784 ensureClosedShadowRoot();
1778 1785
1779 // Some elements make assumptions about what kind of renderers they allow 1786 // Some elements make assumptions about what kind of renderers they allow
1780 // as children so we can't allow author shadows on them for now. An override 1787 // as children so we can't allow author shadows on them for now. An override
1781 // flag is provided for testing how author shadows interact on these element s. 1788 // flag is provided for testing how author shadows interact on these element s.
1782 if (!areAuthorShadowsAllowed() && !RuntimeEnabledFeatures::authorShadowDOMFo rAnyElementEnabled()) { 1789 if (!areAuthorShadowsAllowed() && !RuntimeEnabledFeatures::authorShadowDOMFo rAnyElementEnabled()) {
1783 exceptionState.throwDOMException(HierarchyRequestError, "Author-created shadow roots are disabled for this element."); 1790 exceptionState.throwDOMException(HierarchyRequestError, "Author-created shadow roots are disabled for this element.");
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
3372 { 3379 {
3373 #if ENABLE(OILPAN) 3380 #if ENABLE(OILPAN)
3374 if (hasRareData()) 3381 if (hasRareData())
3375 visitor->trace(elementRareData()); 3382 visitor->trace(elementRareData());
3376 visitor->trace(m_elementData); 3383 visitor->trace(m_elementData);
3377 #endif 3384 #endif
3378 ContainerNode::trace(visitor); 3385 ContainerNode::trace(visitor);
3379 } 3386 }
3380 3387
3381 } // namespace blink 3388 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698