| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
| 3 * Copyright (C) 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 { | 191 { |
| 192 if (!m_elementsById) | 192 if (!m_elementsById) |
| 193 return; | 193 return; |
| 194 m_elementsById->remove(elementId, element); | 194 m_elementsById->remove(elementId, element); |
| 195 m_idTargetObserverRegistry->notifyObservers(elementId); | 195 m_idTargetObserverRegistry->notifyObservers(elementId); |
| 196 } | 196 } |
| 197 | 197 |
| 198 Node* TreeScope::ancestorInThisScope(Node* node) const | 198 Node* TreeScope::ancestorInThisScope(Node* node) const |
| 199 { | 199 { |
| 200 while (node) { | 200 while (node) { |
| 201 if (node->treeScope() == this) | 201 if (node->treeScopeOrDocument() == this) |
| 202 return node; | 202 return node; |
| 203 if (!node->isInShadowTree()) | 203 if (!node->isInShadowTree()) |
| 204 return nullptr; | 204 return nullptr; |
| 205 | 205 |
| 206 node = node->shadowHost(); | 206 node = node->shadowHost(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 return nullptr; | 209 return nullptr; |
| 210 } | 210 } |
| 211 | 211 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 Document& document = rootNode().document(); | 425 Document& document = rootNode().document(); |
| 426 Element* element = document.focusedElement(); | 426 Element* element = document.focusedElement(); |
| 427 if (!element && document.page()) | 427 if (!element && document.page()) |
| 428 element = document.page()->focusController().focusedFrameOwnerElement(*d
ocument.frame()); | 428 element = document.page()->focusController().focusedFrameOwnerElement(*d
ocument.frame()); |
| 429 if (!element) | 429 if (!element) |
| 430 return nullptr; | 430 return nullptr; |
| 431 | 431 |
| 432 if (rootNode().isInV1ShadowTree()) { | 432 if (rootNode().isInV1ShadowTree()) { |
| 433 if (Node* retargeted = rootNode().retarget(*element)) { | 433 if (Node* retargeted = rootNode().retarget(*element)) { |
| 434 DCHECK(retargeted->isElementNode()); | 434 DCHECK(retargeted->isElementNode()); |
| 435 return this == &retargeted->treeScope() ? toElement(retargeted) : nu
llptr; | 435 return this == &retargeted->treeScopeOrDocument() ? toElement(retarg
eted) : nullptr; |
| 436 } | 436 } |
| 437 return nullptr; | 437 return nullptr; |
| 438 } | 438 } |
| 439 | 439 |
| 440 EventPath* eventPath = new EventPath(*element); | 440 EventPath* eventPath = new EventPath(*element); |
| 441 for (size_t i = 0; i < eventPath->size(); ++i) { | 441 for (size_t i = 0; i < eventPath->size(); ++i) { |
| 442 if (eventPath->at(i).node() == rootNode()) { | 442 if (eventPath->at(i).node() == rootNode()) { |
| 443 // eventPath->at(i).target() is one of the followings: | 443 // eventPath->at(i).target() is one of the followings: |
| 444 // - InsertionPoint | 444 // - InsertionPoint |
| 445 // - shadow host | 445 // - shadow host |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 visitor->trace(m_idTargetObserverRegistry); | 584 visitor->trace(m_idTargetObserverRegistry); |
| 585 visitor->trace(m_selection); | 585 visitor->trace(m_selection); |
| 586 visitor->trace(m_elementsById); | 586 visitor->trace(m_elementsById); |
| 587 visitor->trace(m_imageMapsByName); | 587 visitor->trace(m_imageMapsByName); |
| 588 visitor->trace(m_labelsByForAttribute); | 588 visitor->trace(m_labelsByForAttribute); |
| 589 visitor->trace(m_scopedStyleResolver); | 589 visitor->trace(m_scopedStyleResolver); |
| 590 visitor->trace(m_radioButtonGroupScope); | 590 visitor->trace(m_radioButtonGroupScope); |
| 591 } | 591 } |
| 592 | 592 |
| 593 } // namespace blink | 593 } // namespace blink |
| OLD | NEW |