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

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

Issue 1803933002: Use correct cascading order for Shadow DOM v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for comments Created 4 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 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 if (!tagNameIsSupported) { 1945 if (!tagNameIsSupported) {
1946 exceptionState.throwDOMException(NotSupportedError, "This element does n ot support attachShadow"); 1946 exceptionState.throwDOMException(NotSupportedError, "This element does n ot support attachShadow");
1947 return nullptr; 1947 return nullptr;
1948 } 1948 }
1949 1949
1950 if (shadowRootInitDict.hasMode() && shadowRoot()) { 1950 if (shadowRootInitDict.hasMode() && shadowRoot()) {
1951 exceptionState.throwDOMException(InvalidStateError, "Shadow root cannot be created on a host which already hosts a shadow tree."); 1951 exceptionState.throwDOMException(InvalidStateError, "Shadow root cannot be created on a host which already hosts a shadow tree.");
1952 return nullptr; 1952 return nullptr;
1953 } 1953 }
1954 1954
1955 document().styleEngine().setUseCascadeOrderForShadowDOMV1();
1956
1955 ShadowRootType type = ShadowRootType::V0; 1957 ShadowRootType type = ShadowRootType::V0;
1956 if (shadowRootInitDict.hasMode()) 1958 if (shadowRootInitDict.hasMode())
1957 type = shadowRootInitDict.mode() == "open" ? ShadowRootType::Open : Shad owRootType::Closed; 1959 type = shadowRootInitDict.mode() == "open" ? ShadowRootType::Open : Shad owRootType::Closed;
1958 1960
1959 if (type == ShadowRootType::Closed) 1961 if (type == ShadowRootType::Closed)
1960 UseCounter::count(document(), UseCounter::ElementAttachShadowClosed); 1962 UseCounter::count(document(), UseCounter::ElementAttachShadowClosed);
1961 else if (type == ShadowRootType::Open) 1963 else if (type == ShadowRootType::Open)
1962 UseCounter::count(document(), UseCounter::ElementAttachShadowOpen); 1964 UseCounter::count(document(), UseCounter::ElementAttachShadowOpen);
1963 1965
1964 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootInternal(type, e xceptionState); 1966 RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRootInternal(type, e xceptionState);
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after
3670 { 3672 {
3671 #if ENABLE(OILPAN) 3673 #if ENABLE(OILPAN)
3672 if (hasRareData()) 3674 if (hasRareData())
3673 visitor->trace(elementRareData()); 3675 visitor->trace(elementRareData());
3674 visitor->trace(m_elementData); 3676 visitor->trace(m_elementData);
3675 #endif 3677 #endif
3676 ContainerNode::trace(visitor); 3678 ContainerNode::trace(visitor);
3677 } 3679 }
3678 3680
3679 } // namespace blink 3681 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698