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

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

Issue 130263005: Remove some childTypeAllowed implementations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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
« no previous file with comments | « Source/core/dom/shadow/ShadowRoot.h ('k') | no next file » | 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 { 141 {
142 if (isOrphan()) { 142 if (isOrphan()) {
143 exceptionState.throwDOMException(InvalidAccessError, "The ShadowRoot doe s not have a host."); 143 exceptionState.throwDOMException(InvalidAccessError, "The ShadowRoot doe s not have a host.");
144 return; 144 return;
145 } 145 }
146 146
147 if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(mark up, host(), AllowScriptingContent, "innerHTML", exceptionState)) 147 if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(mark up, host(), AllowScriptingContent, "innerHTML", exceptionState))
148 replaceChildrenWithFragment(this, fragment.release(), exceptionState); 148 replaceChildrenWithFragment(this, fragment.release(), exceptionState);
149 } 149 }
150 150
151 bool ShadowRoot::childTypeAllowed(NodeType type) const
152 {
153 switch (type) {
154 case ELEMENT_NODE:
155 case PROCESSING_INSTRUCTION_NODE:
156 case COMMENT_NODE:
157 case TEXT_NODE:
158 case CDATA_SECTION_NODE:
159 return true;
160 default:
161 return false;
162 }
163 }
164
165 void ShadowRoot::recalcStyle(StyleRecalcChange change) 151 void ShadowRoot::recalcStyle(StyleRecalcChange change)
166 { 152 {
167 // ShadowRoot doesn't support custom callbacks. 153 // ShadowRoot doesn't support custom callbacks.
168 ASSERT(!hasCustomStyleCallbacks()); 154 ASSERT(!hasCustomStyleCallbacks());
169 155
170 // If we're propagating an Inherit change and this ShadowRoot resets 156 // If we're propagating an Inherit change and this ShadowRoot resets
171 // inheritance we don't need to look at the children. 157 // inheritance we don't need to look at the children.
172 if (change <= Inherit && resetStyleInheritance() && !needsStyleRecalc() && ! childNeedsStyleRecalc()) 158 if (change <= Inherit && resetStyleInheritance() && !needsStyleRecalc() && ! childNeedsStyleRecalc())
173 return; 159 return;
174 160
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 402
417 StyleSheetList* ShadowRoot::styleSheets() 403 StyleSheetList* ShadowRoot::styleSheets()
418 { 404 {
419 if (!ensureShadowRootRareData()->styleSheets()) 405 if (!ensureShadowRootRareData()->styleSheets())
420 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); 406 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this));
421 407
422 return m_shadowRootRareData->styleSheets(); 408 return m_shadowRootRareData->styleSheets();
423 } 409 }
424 410
425 } 411 }
OLDNEW
« no previous file with comments | « Source/core/dom/shadow/ShadowRoot.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698