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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 } | 408 } |
409 | 409 |
410 void TreeScope::adoptIfNeeded(Node& node) | 410 void TreeScope::adoptIfNeeded(Node& node) |
411 { | 411 { |
412 ASSERT(this); | 412 ASSERT(this); |
413 ASSERT(!node.isDocumentNode()); | 413 ASSERT(!node.isDocumentNode()); |
414 #if !ENABLE(OILPAN) | 414 #if !ENABLE(OILPAN) |
415 ASSERT_WITH_SECURITY_IMPLICATION(!node.m_deletionHasBegun); | 415 ASSERT_WITH_SECURITY_IMPLICATION(!node.m_deletionHasBegun); |
416 #endif | 416 #endif |
417 TreeScopeAdopter adopter(node, *this); | 417 TreeScopeAdopter adopter(node, *this); |
418 if (adopter.needsScopeChange()) | 418 if (adopter.needsScopeChange()) { |
| 419 ScriptForbiddenScope forbidScript; |
419 adopter.execute(); | 420 adopter.execute(); |
| 421 } |
420 } | 422 } |
421 | 423 |
422 Element* TreeScope::adjustedFocusedElement() const | 424 Element* TreeScope::adjustedFocusedElement() const |
423 { | 425 { |
424 Document& document = rootNode().document(); | 426 Document& document = rootNode().document(); |
425 Element* element = document.focusedElement(); | 427 Element* element = document.focusedElement(); |
426 if (!element && document.page()) | 428 if (!element && document.page()) |
427 element = document.page()->focusController().focusedFrameOwnerElement(*d
ocument.frame()); | 429 element = document.page()->focusController().focusedFrameOwnerElement(*d
ocument.frame()); |
428 if (!element) | 430 if (!element) |
429 return 0; | 431 return 0; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 visitor->trace(m_parentTreeScope); | 576 visitor->trace(m_parentTreeScope); |
575 visitor->trace(m_idTargetObserverRegistry); | 577 visitor->trace(m_idTargetObserverRegistry); |
576 visitor->trace(m_selection); | 578 visitor->trace(m_selection); |
577 visitor->trace(m_elementsById); | 579 visitor->trace(m_elementsById); |
578 visitor->trace(m_imageMapsByName); | 580 visitor->trace(m_imageMapsByName); |
579 visitor->trace(m_labelsByForAttribute); | 581 visitor->trace(m_labelsByForAttribute); |
580 visitor->trace(m_scopedStyleResolver); | 582 visitor->trace(m_scopedStyleResolver); |
581 } | 583 } |
582 | 584 |
583 } // namespace blink | 585 } // namespace blink |
OLD | NEW |