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

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

Issue 1841353002: Implement ShadowRoot.mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modify test results Created 4 years, 8 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 81
82 String mode() const { return (type() == ShadowRootType::V0 || type() == Shad owRootType::Open) ? "open" : "closed"; };
kochi 2016/03/31 06:19:15 If type() returns ShadowRootType::UserAgent, this
yuzuchan 2016/03/31 07:51:07 Okay, I added a test case for UA shadow root :)
83
82 bool isOpenOrV0() const { return type() == ShadowRootType::V0 || type() == S hadowRootType::Open; } 84 bool isOpenOrV0() const { return type() == ShadowRootType::V0 || type() == S hadowRootType::Open; }
83 85
84 bool isV1() const { return type() == ShadowRootType::Open || type() == Shado wRootType::Closed; } 86 bool isV1() const { return type() == ShadowRootType::Open || type() == Shado wRootType::Closed; }
85 87
86 bool isYoungest() const { return !youngerShadowRoot(); } 88 bool isYoungest() const { return !youngerShadowRoot(); }
87 bool isOldest() const { return !olderShadowRoot(); } 89 bool isOldest() const { return !olderShadowRoot(); }
88 90
89 void attach(const AttachContext& = AttachContext()) override; 91 void attach(const AttachContext& = AttachContext()) override;
90 92
91 InsertionNotificationRequest insertedInto(ContainerNode*) override; 93 InsertionNotificationRequest insertedInto(ContainerNode*) override;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 return adjustedFocusedElement(); 182 return adjustedFocusedElement();
181 } 183 }
182 184
183 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot()); 185 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot());
184 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad owRoot(), treeScope.rootNode().isShadowRoot()); 186 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad owRoot(), treeScope.rootNode().isShadowRoot());
185 DEFINE_TYPE_CASTS(TreeScope, ShadowRoot, shadowRoot, true, true); 187 DEFINE_TYPE_CASTS(TreeScope, ShadowRoot, shadowRoot, true, true);
186 188
187 } // namespace blink 189 } // namespace blink
188 190
189 #endif // ShadowRoot_h 191 #endif // ShadowRoot_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698