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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
366 } | 366 } |
367 } | 367 } |
368 return nullptr; | 368 return nullptr; |
369 } | 369 } |
370 | 370 |
371 void TreeScope::adoptIfNeeded(Node& node) | 371 void TreeScope::adoptIfNeeded(Node& node) |
372 { | 372 { |
373 DCHECK(this); | 373 DCHECK(this); |
374 DCHECK(!node.isDocumentNode()); | 374 DCHECK(!node.isDocumentNode()); |
375 TreeScopeAdopter adopter(node, *this); | 375 TreeScopeAdopter adopter(node, *this); |
376 if (adopter.needsScopeChange()) | 376 if (adopter.needsScopeChange()) { |
377 ScriptForbiddenScope forbidScript; | |
esprehn
2016/04/25 20:55:22
This should be at the top of the function. ScriptF
| |
377 adopter.execute(); | 378 adopter.execute(); |
379 } | |
378 } | 380 } |
379 | 381 |
380 Element* TreeScope::retarget(const Element& target) const | 382 Element* TreeScope::retarget(const Element& target) const |
381 { | 383 { |
382 for (const Element* ancestor = ⌖ ancestor; ancestor = ancestor->shado wHost()) { | 384 for (const Element* ancestor = ⌖ ancestor; ancestor = ancestor->shado wHost()) { |
383 if (this == ancestor->treeScope()) | 385 if (this == ancestor->treeScope()) |
384 return const_cast<Element*>(ancestor); | 386 return const_cast<Element*>(ancestor); |
385 } | 387 } |
386 return nullptr; | 388 return nullptr; |
387 } | 389 } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 visitor->trace(m_idTargetObserverRegistry); | 532 visitor->trace(m_idTargetObserverRegistry); |
531 visitor->trace(m_selection); | 533 visitor->trace(m_selection); |
532 visitor->trace(m_elementsById); | 534 visitor->trace(m_elementsById); |
533 visitor->trace(m_imageMapsByName); | 535 visitor->trace(m_imageMapsByName); |
534 visitor->trace(m_labelsByForAttribute); | 536 visitor->trace(m_labelsByForAttribute); |
535 visitor->trace(m_scopedStyleResolver); | 537 visitor->trace(m_scopedStyleResolver); |
536 visitor->trace(m_radioButtonGroupScope); | 538 visitor->trace(m_radioButtonGroupScope); |
537 } | 539 } |
538 | 540 |
539 } // namespace blink | 541 } // namespace blink |
OLD | NEW |