| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |