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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 ASSERT(node); | 339 ASSERT(node); |
340 ASSERT(!node->isDocumentNode()); | 340 ASSERT(!node->isDocumentNode()); |
341 ASSERT_WITH_SECURITY_IMPLICATION(!node->m_deletionHasBegun); | 341 ASSERT_WITH_SECURITY_IMPLICATION(!node->m_deletionHasBegun); |
342 TreeScopeAdopter adopter(node, this); | 342 TreeScopeAdopter adopter(node, this); |
343 if (adopter.needsScopeChange()) | 343 if (adopter.needsScopeChange()) |
344 adopter.execute(); | 344 adopter.execute(); |
345 } | 345 } |
346 | 346 |
347 static Element* focusedFrameOwnerElement(Frame* focusedFrame, Frame* currentFram
e) | 347 static Element* focusedFrameOwnerElement(Frame* focusedFrame, Frame* currentFram
e) |
348 { | 348 { |
349 for (; focusedFrame; focusedFrame = focusedFrame->tree()->parent()) { | 349 for (; focusedFrame; focusedFrame = focusedFrame->tree().parent()) { |
350 if (focusedFrame->tree()->parent() == currentFrame) | 350 if (focusedFrame->tree().parent() == currentFrame) |
351 return focusedFrame->ownerElement(); | 351 return focusedFrame->ownerElement(); |
352 } | 352 } |
353 return 0; | 353 return 0; |
354 } | 354 } |
355 | 355 |
356 Element* TreeScope::adjustedFocusedElement() | 356 Element* TreeScope::adjustedFocusedElement() |
357 { | 357 { |
358 Document& document = rootNode()->document(); | 358 Document& document = rootNode()->document(); |
359 Element* element = document.focusedElement(); | 359 Element* element = document.focusedElement(); |
360 if (!element && document.page()) | 360 if (!element && document.page()) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 result = element; | 491 result = element; |
492 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot;
shadowRoot = shadowRoot->olderShadowRoot()) { | 492 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot;
shadowRoot = shadowRoot->olderShadowRoot()) { |
493 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key)) | 493 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key)) |
494 result = shadowResult; | 494 result = shadowResult; |
495 } | 495 } |
496 } | 496 } |
497 return result; | 497 return result; |
498 } | 498 } |
499 | 499 |
500 } // namespace WebCore | 500 } // namespace WebCore |
OLD | NEW |