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

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

Issue 251633002: Add support for DocumentFragment.getElementById() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix createElement() calls Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/DocumentFragment.idl ('k') | Source/core/svg/SVGSVGElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 static PassRefPtr<ShadowRoot> create(Document& document, ShadowRootType type ) 58 static PassRefPtr<ShadowRoot> create(Document& document, ShadowRootType type )
59 { 59 {
60 return adoptRef(new ShadowRoot(document, type)); 60 return adoptRef(new ShadowRoot(document, type));
61 } 61 }
62 62
63 void recalcStyle(StyleRecalcChange); 63 void recalcStyle(StyleRecalcChange);
64 64
65 // Disambiguate between Node and TreeScope hierarchies; TreeScope's implemen tation is simpler. 65 // Disambiguate between Node and TreeScope hierarchies; TreeScope's implemen tation is simpler.
66 using TreeScope::document; 66 using TreeScope::document;
67 using TreeScope::getElementById;
67 68
68 Element* host() const { return toElement(parentOrShadowHostNode()); } 69 Element* host() const { return toElement(parentOrShadowHostNode()); }
69 ElementShadow* owner() const { return host() ? host()->shadow() : 0; } 70 ElementShadow* owner() const { return host() ? host()->shadow() : 0; }
70 71
71 ShadowRoot* youngerShadowRoot() const { return prev(); } 72 ShadowRoot* youngerShadowRoot() const { return prev(); }
72 73
73 ShadowRoot* olderShadowRootForBindings() const; 74 ShadowRoot* olderShadowRootForBindings() const;
74 bool shouldExposeToBindings() const { return type() == AuthorShadowRoot; } 75 bool shouldExposeToBindings() const { return type() == AuthorShadowRoot; }
75 76
76 bool isYoungest() const { return !youngerShadowRoot(); } 77 bool isYoungest() const { return !youngerShadowRoot(); }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 { 156 {
156 return adjustedFocusedElement(); 157 return adjustedFocusedElement();
157 } 158 }
158 159
159 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot()); 160 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot());
160 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad owRoot(), treeScope.rootNode().isShadowRoot()); 161 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad owRoot(), treeScope.rootNode().isShadowRoot());
161 162
162 } // namespace 163 } // namespace
163 164
164 #endif 165 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/DocumentFragment.idl ('k') | Source/core/svg/SVGSVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698