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

Side by Side Diff: third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h

Issue 1407183002: Rename ShadowRootType::OpenByDefault to ShadowRootType::V0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v1-attach-shadow
Patch Set: Created 5 years, 2 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) 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 28 matching lines...) Expand all
39 class Document; 39 class Document;
40 class ElementShadow; 40 class ElementShadow;
41 class ExceptionState; 41 class ExceptionState;
42 class HTMLShadowElement; 42 class HTMLShadowElement;
43 class InsertionPoint; 43 class InsertionPoint;
44 class ShadowRootRareData; 44 class ShadowRootRareData;
45 class StyleSheetList; 45 class StyleSheetList;
46 46
47 enum class ShadowRootType { 47 enum class ShadowRootType {
48 UserAgent, 48 UserAgent,
49 OpenByDefault, 49 V0,
50 Open, 50 Open,
51 Closed 51 Closed
52 }; 52 };
53 53
54 class CORE_EXPORT ShadowRoot final : public DocumentFragment, public TreeScope, public DoublyLinkedListNode<ShadowRoot> { 54 class CORE_EXPORT ShadowRoot final : public DocumentFragment, public TreeScope, public DoublyLinkedListNode<ShadowRoot> {
55 DEFINE_WRAPPERTYPEINFO(); 55 DEFINE_WRAPPERTYPEINFO();
56 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ShadowRoot); 56 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ShadowRoot);
57 friend class WTF::DoublyLinkedListNode<ShadowRoot>; 57 friend class WTF::DoublyLinkedListNode<ShadowRoot>;
58 public: 58 public:
59 // FIXME: Current implementation does not work well if a shadow root is dyna mically created. 59 // FIXME: Current implementation does not work well if a shadow root is dyna mically created.
(...skipping 11 matching lines...) Expand all
71 using TreeScope::getElementById; 71 using TreeScope::getElementById;
72 72
73 // TODO(kochi): crbug.com/507413 In non-Oilpan, host() may return null durin g queued 73 // TODO(kochi): crbug.com/507413 In non-Oilpan, host() may return null durin g queued
74 // event handling (e.g. during execCommand()). 74 // event handling (e.g. during execCommand()).
75 Element* host() const { return toElement(parentOrShadowHostNode()); } 75 Element* host() const { return toElement(parentOrShadowHostNode()); }
76 ElementShadow* owner() const { return host() ? host()->shadow() : 0; } 76 ElementShadow* owner() const { return host() ? host()->shadow() : 0; }
77 77
78 ShadowRoot* youngerShadowRoot() const { return prev(); } 78 ShadowRoot* youngerShadowRoot() const { return prev(); }
79 79
80 ShadowRoot* olderShadowRootForBindings() const; 80 ShadowRoot* olderShadowRootForBindings() const;
81 bool isOpen() const { return type() == ShadowRootType::OpenByDefault || type () == ShadowRootType::Open; } 81 bool isOpen() const { return type() == ShadowRootType::V0 || type() == Shado wRootType::Open; }
82 82
83 bool isYoungest() const { return !youngerShadowRoot(); } 83 bool isYoungest() const { return !youngerShadowRoot(); }
84 bool isOldest() const { return !olderShadowRoot(); } 84 bool isOldest() const { return !olderShadowRoot(); }
85 85
86 void attach(const AttachContext& = AttachContext()) override; 86 void attach(const AttachContext& = AttachContext()) override;
87 87
88 InsertionNotificationRequest insertedInto(ContainerNode*) override; 88 InsertionNotificationRequest insertedInto(ContainerNode*) override;
89 void removedFrom(ContainerNode*) override; 89 void removedFrom(ContainerNode*) override;
90 90
91 void registerScopedHTMLStyleChild(); 91 void registerScopedHTMLStyleChild();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 return adjustedFocusedElement(); 170 return adjustedFocusedElement();
171 } 171 }
172 172
173 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot()); 173 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot());
174 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad owRoot(), treeScope.rootNode().isShadowRoot()); 174 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad owRoot(), treeScope.rootNode().isShadowRoot());
175 DEFINE_TYPE_CASTS(TreeScope, ShadowRoot, shadowRoot, true, true); 175 DEFINE_TYPE_CASTS(TreeScope, ShadowRoot, shadowRoot, true, true);
176 176
177 } // namespace blink 177 } // namespace blink
178 178
179 #endif // ShadowRoot_h 179 #endif // ShadowRoot_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698