| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 bool ShadowRoot::isOldestAuthorShadowRoot() const | 120 bool ShadowRoot::isOldestAuthorShadowRoot() const |
| 121 { | 121 { |
| 122 if (type() != AuthorShadowRoot) | 122 if (type() != AuthorShadowRoot) |
| 123 return false; | 123 return false; |
| 124 if (ShadowRoot* older = olderShadowRoot()) | 124 if (ShadowRoot* older = olderShadowRoot()) |
| 125 return older->type() == UserAgentShadowRoot; | 125 return older->type() == UserAgentShadowRoot; |
| 126 return true; | 126 return true; |
| 127 } | 127 } |
| 128 | 128 |
| 129 PassRefPtr<Node> ShadowRoot::cloneNode(bool, ExceptionState& es) | 129 PassRefPtr<Node> ShadowRoot::cloneNode(bool, ExceptionState& exceptionState) |
| 130 { | 130 { |
| 131 es.throwDOMException(DataCloneError, ExceptionMessages::failedToExecute("clo
neNode", "ShadowRoot", "ShadowRoot nodes are not clonable.")); | 131 exceptionState.throwDOMException(DataCloneError, ExceptionMessages::failedTo
Execute("cloneNode", "ShadowRoot", "ShadowRoot nodes are not clonable.")); |
| 132 return 0; | 132 return 0; |
| 133 } | 133 } |
| 134 | 134 |
| 135 String ShadowRoot::innerHTML() const | 135 String ShadowRoot::innerHTML() const |
| 136 { | 136 { |
| 137 return createMarkup(this, ChildrenOnly); | 137 return createMarkup(this, ChildrenOnly); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void ShadowRoot::setInnerHTML(const String& markup, ExceptionState& es) | 140 void ShadowRoot::setInnerHTML(const String& markup, ExceptionState& exceptionSta
te) |
| 141 { | 141 { |
| 142 if (isOrphan()) { | 142 if (isOrphan()) { |
| 143 es.throwDOMException(InvalidAccessError, ExceptionMessages::failedToExec
ute("setInnerHTML", "ShadowRoot", "The ShadowRoot does not have a host.")); | 143 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
failedToExecute("setInnerHTML", "ShadowRoot", "The ShadowRoot does not have a ho
st.")); |
| 144 return; | 144 return; |
| 145 } | 145 } |
| 146 | 146 |
| 147 if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(mark
up, host(), AllowScriptingContent, "innerHTML", es)) | 147 if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(mark
up, host(), AllowScriptingContent, "innerHTML", exceptionState)) |
| 148 replaceChildrenWithFragment(this, fragment.release(), es); | 148 replaceChildrenWithFragment(this, fragment.release(), exceptionState); |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool ShadowRoot::childTypeAllowed(NodeType type) const | 151 bool ShadowRoot::childTypeAllowed(NodeType type) const |
| 152 { | 152 { |
| 153 switch (type) { | 153 switch (type) { |
| 154 case ELEMENT_NODE: | 154 case ELEMENT_NODE: |
| 155 case PROCESSING_INSTRUCTION_NODE: | 155 case PROCESSING_INSTRUCTION_NODE: |
| 156 case COMMENT_NODE: | 156 case COMMENT_NODE: |
| 157 case TEXT_NODE: | 157 case TEXT_NODE: |
| 158 case CDATA_SECTION_NODE: | 158 case CDATA_SECTION_NODE: |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 405 |
| 406 StyleSheetList* ShadowRoot::styleSheets() | 406 StyleSheetList* ShadowRoot::styleSheets() |
| 407 { | 407 { |
| 408 if (!ensureShadowRootRareData()->styleSheets()) | 408 if (!ensureShadowRootRareData()->styleSheets()) |
| 409 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); | 409 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); |
| 410 | 410 |
| 411 return m_shadowRootRareData->styleSheets(); | 411 return m_shadowRootRareData->styleSheets(); |
| 412 } | 412 } |
| 413 | 413 |
| 414 } | 414 } |
| OLD | NEW |