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

Side by Side Diff: sky/engine/core/dom/shadow/ShadowRoot.cpp

Issue 665613003: Remove the ability to parse HTML fragments (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 removeDetachedChildren(); 96 removeDetachedChildren();
97 } 97 }
98 #endif 98 #endif
99 99
100 PassRefPtrWillBeRawPtr<Node> ShadowRoot::cloneNode(bool, ExceptionState& excepti onState) 100 PassRefPtrWillBeRawPtr<Node> ShadowRoot::cloneNode(bool, ExceptionState& excepti onState)
101 { 101 {
102 exceptionState.throwDOMException(DataCloneError, "ShadowRoot nodes are not c lonable."); 102 exceptionState.throwDOMException(DataCloneError, "ShadowRoot nodes are not c lonable.");
103 return nullptr; 103 return nullptr;
104 } 104 }
105 105
106 String ShadowRoot::innerHTML() const
107 {
108 return createMarkup(this, ChildrenOnly);
109 }
110
111 void ShadowRoot::setInnerHTML(const String& markup, ExceptionState& exceptionSta te)
112 {
113 if (isOrphan()) {
114 exceptionState.throwDOMException(InvalidAccessError, "The ShadowRoot doe s not have a host.");
115 return;
116 }
117
118 if (RefPtrWillBeRawPtr<DocumentFragment> fragment = createFragmentForInnerOu terHTML(markup, host(), "innerHTML", exceptionState))
119 replaceChildrenWithFragment(this, fragment.release(), exceptionState);
120 }
121
122 void ShadowRoot::recalcStyle(StyleRecalcChange change) 106 void ShadowRoot::recalcStyle(StyleRecalcChange change)
123 { 107 {
124 // ShadowRoot doesn't support custom callbacks. 108 // ShadowRoot doesn't support custom callbacks.
125 ASSERT(!hasCustomStyleCallbacks()); 109 ASSERT(!hasCustomStyleCallbacks());
126 110
127 if (styleChangeType() >= SubtreeStyleChange) 111 if (styleChangeType() >= SubtreeStyleChange)
128 change = Force; 112 change = Force;
129 113
130 // There's no style to update so just calling recalcStyle means we're update d. 114 // There's no style to update so just calling recalcStyle means we're update d.
131 clearNeedsStyleRecalc(); 115 clearNeedsStyleRecalc();
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 void ShadowRoot::trace(Visitor* visitor) 295 void ShadowRoot::trace(Visitor* visitor)
312 { 296 {
313 visitor->trace(m_prev); 297 visitor->trace(m_prev);
314 visitor->trace(m_next); 298 visitor->trace(m_next);
315 visitor->trace(m_shadowRootRareData); 299 visitor->trace(m_shadowRootRareData);
316 TreeScope::trace(visitor); 300 TreeScope::trace(visitor);
317 DocumentFragment::trace(visitor); 301 DocumentFragment::trace(visitor);
318 } 302 }
319 303
320 } 304 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698