| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 if (focusedFrame->tree().parent() == currentFrame) | 344 if (focusedFrame->tree().parent() == currentFrame) |
| 345 return focusedFrame->ownerElement(); | 345 return focusedFrame->ownerElement(); |
| 346 } | 346 } |
| 347 return 0; | 347 return 0; |
| 348 } | 348 } |
| 349 | 349 |
| 350 Element* TreeScope::adjustedFocusedElement() const | 350 Element* TreeScope::adjustedFocusedElement() const |
| 351 { | 351 { |
| 352 Document& document = rootNode().document(); | 352 Document& document = rootNode().document(); |
| 353 Element* element = document.focusedElement(); | 353 Element* element = document.focusedElement(); |
| 354 // FIXME(kenrb): The toLocalFrame() cast should be removed when RemoteFrames
can have FrameTrees. |
| 355 // At that point, focusedFrameOwnerElement should take a Frame instead of a
LocalFrame. |
| 354 if (!element && document.page()) | 356 if (!element && document.page()) |
| 355 element = focusedFrameOwnerElement(document.page()->focusController().fo
cusedFrame(), document.frame()); | 357 element = focusedFrameOwnerElement(toLocalFrame(document.page()->focusCo
ntroller().focusedFrame()), document.frame()); |
| 356 if (!element) | 358 if (!element) |
| 357 return 0; | 359 return 0; |
| 358 | 360 |
| 359 EventPath eventPath(element); | 361 EventPath eventPath(element); |
| 360 for (size_t i = 0; i < eventPath.size(); ++i) { | 362 for (size_t i = 0; i < eventPath.size(); ++i) { |
| 361 if (eventPath[i].node() == rootNode()) { | 363 if (eventPath[i].node() == rootNode()) { |
| 362 // eventPath.at(i).target() is one of the followings: | 364 // eventPath.at(i).target() is one of the followings: |
| 363 // - InsertionPoint | 365 // - InsertionPoint |
| 364 // - shadow host | 366 // - shadow host |
| 365 // - Document::focusedElement() | 367 // - Document::focusedElement() |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 for (Element* element = ElementTraversal::firstWithin(rootNode()); element;
element = ElementTraversal::nextIncludingPseudo(*element)) { | 495 for (Element* element = ElementTraversal::firstWithin(rootNode()); element;
element = ElementTraversal::nextIncludingPseudo(*element)) { |
| 494 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root
->olderShadowRoot()) | 496 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root
->olderShadowRoot()) |
| 495 root->setNeedsStyleRecalcForViewportUnits(); | 497 root->setNeedsStyleRecalcForViewportUnits(); |
| 496 RenderStyle* style = element->renderStyle(); | 498 RenderStyle* style = element->renderStyle(); |
| 497 if (style && style->hasViewportUnits()) | 499 if (style && style->hasViewportUnits()) |
| 498 element->setNeedsStyleRecalc(LocalStyleChange); | 500 element->setNeedsStyleRecalc(LocalStyleChange); |
| 499 } | 501 } |
| 500 } | 502 } |
| 501 | 503 |
| 502 } // namespace WebCore | 504 } // namespace WebCore |
| OLD | NEW |