Chromium Code Reviews| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 DCHECK_EQ(type(), ShadowRootType::V0); | 94 DCHECK_EQ(type(), ShadowRootType::V0); |
| 95 ensureShadowRootRareDataV0().setOlderShadowRoot(root); | 95 ensureShadowRootRareDataV0().setOlderShadowRoot(root); |
| 96 } | 96 } |
| 97 | 97 |
| 98 SlotAssignment& ShadowRoot::ensureSlotAssignment() { | 98 SlotAssignment& ShadowRoot::ensureSlotAssignment() { |
| 99 if (!m_slotAssignment) | 99 if (!m_slotAssignment) |
| 100 m_slotAssignment = SlotAssignment::create(*this); | 100 m_slotAssignment = SlotAssignment::create(*this); |
| 101 return *m_slotAssignment; | 101 return *m_slotAssignment; |
| 102 } | 102 } |
| 103 | 103 |
| 104 HTMLSlotElement* ShadowRoot::assignedSlotFor(const Node& node) { | |
| 105 if (!m_slotAssignment) | |
| 106 return nullptr; | |
| 107 return m_slotAssignment->findSlot(node); | |
| 108 } | |
| 109 | |
| 110 void ShadowRoot::slotAdded(HTMLSlotElement& slot) { | |
|
esprehn
2017/01/17 10:48:18
DidAddSlot()
hayato
2017/01/19 03:13:50
Done
| |
| 111 DCHECK(isV1()); | |
| 112 ensureSlotAssignment().slotAdded(slot); | |
| 113 } | |
| 114 | |
| 115 void ShadowRoot::hostChildSlotNameChanged(const AtomicString& oldValue, | |
|
esprehn
2017/01/17 10:48:18
I prefer the did naming.
::DidChangeHostChildSlot
hayato
2017/01/19 03:13:50
Done
| |
| 116 const AtomicString& newValue) { | |
| 117 if (!m_slotAssignment) | |
| 118 return; | |
| 119 m_slotAssignment->hostChildSlotNameChanged(oldValue, newValue); | |
| 120 } | |
| 121 | |
| 104 Node* ShadowRoot::cloneNode(bool, ExceptionState& exceptionState) { | 122 Node* ShadowRoot::cloneNode(bool, ExceptionState& exceptionState) { |
| 105 exceptionState.throwDOMException(NotSupportedError, | 123 exceptionState.throwDOMException(NotSupportedError, |
| 106 "ShadowRoot nodes are not clonable."); | 124 "ShadowRoot nodes are not clonable."); |
| 107 return nullptr; | 125 return nullptr; |
| 108 } | 126 } |
| 109 | 127 |
| 110 String ShadowRoot::innerHTML() const { | 128 String ShadowRoot::innerHTML() const { |
| 111 return createMarkup(this, ChildrenOnly); | 129 return createMarkup(this, ChildrenOnly); |
| 112 } | 130 } |
| 113 | 131 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 ostream << "ShadowRootType::Open"; | 334 ostream << "ShadowRootType::Open"; |
| 317 break; | 335 break; |
| 318 case ShadowRootType::Closed: | 336 case ShadowRootType::Closed: |
| 319 ostream << "ShadowRootType::Closed"; | 337 ostream << "ShadowRootType::Closed"; |
| 320 break; | 338 break; |
| 321 } | 339 } |
| 322 return ostream; | 340 return ostream; |
| 323 } | 341 } |
| 324 | 342 |
| 325 } // namespace blink | 343 } // namespace blink |
| OLD | NEW |