| 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 16 matching lines...) Expand all Loading... |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/dom/TreeScope.h" | 28 #include "core/dom/TreeScope.h" |
| 29 | 29 |
| 30 #include "core/HTMLNames.h" | 30 #include "core/HTMLNames.h" |
| 31 #include "core/css/resolver/ScopedStyleResolver.h" | 31 #include "core/css/resolver/ScopedStyleResolver.h" |
| 32 #include "core/dom/ContainerNode.h" | 32 #include "core/dom/ContainerNode.h" |
| 33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
| 34 #include "core/dom/Element.h" | 34 #include "core/dom/Element.h" |
| 35 #include "core/dom/ElementTraversal.h" | 35 #include "core/dom/ElementTraversal.h" |
| 36 #include "core/dom/IdTargetObserverRegistry.h" | 36 #include "core/dom/IdTargetObserverRegistry.h" |
| 37 #include "core/dom/NodeLayoutStyle.h" | 37 #include "core/dom/NodeComputedStyle.h" |
| 38 #include "core/dom/TreeScopeAdopter.h" | 38 #include "core/dom/TreeScopeAdopter.h" |
| 39 #include "core/dom/shadow/ElementShadow.h" | 39 #include "core/dom/shadow/ElementShadow.h" |
| 40 #include "core/dom/shadow/ShadowRoot.h" | 40 #include "core/dom/shadow/ShadowRoot.h" |
| 41 #include "core/editing/DOMSelection.h" | 41 #include "core/editing/DOMSelection.h" |
| 42 #include "core/events/EventPath.h" | 42 #include "core/events/EventPath.h" |
| 43 #include "core/frame/FrameView.h" | 43 #include "core/frame/FrameView.h" |
| 44 #include "core/frame/LocalFrame.h" | 44 #include "core/frame/LocalFrame.h" |
| 45 #include "core/html/HTMLAnchorElement.h" | 45 #include "core/html/HTMLAnchorElement.h" |
| 46 #include "core/html/HTMLFrameOwnerElement.h" | 46 #include "core/html/HTMLFrameOwnerElement.h" |
| 47 #include "core/html/HTMLLabelElement.h" | 47 #include "core/html/HTMLLabelElement.h" |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 } | 555 } |
| 556 } | 556 } |
| 557 return result; | 557 return result; |
| 558 } | 558 } |
| 559 | 559 |
| 560 void TreeScope::setNeedsStyleRecalcForViewportUnits() | 560 void TreeScope::setNeedsStyleRecalcForViewportUnits() |
| 561 { | 561 { |
| 562 for (Element* element = ElementTraversal::firstWithin(rootNode()); element;
element = ElementTraversal::nextIncludingPseudo(*element)) { | 562 for (Element* element = ElementTraversal::firstWithin(rootNode()); element;
element = ElementTraversal::nextIncludingPseudo(*element)) { |
| 563 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root
->olderShadowRoot()) | 563 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root
->olderShadowRoot()) |
| 564 root->setNeedsStyleRecalcForViewportUnits(); | 564 root->setNeedsStyleRecalcForViewportUnits(); |
| 565 const LayoutStyle* style = element->layoutStyle(); | 565 const ComputedStyle* style = element->computedStyle(); |
| 566 if (style && style->hasViewportUnits()) | 566 if (style && style->hasViewportUnits()) |
| 567 element->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForT
racing::create(StyleChangeReason::ViewportUnits)); | 567 element->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForT
racing::create(StyleChangeReason::ViewportUnits)); |
| 568 } | 568 } |
| 569 } | 569 } |
| 570 | 570 |
| 571 DEFINE_TRACE(TreeScope) | 571 DEFINE_TRACE(TreeScope) |
| 572 { | 572 { |
| 573 visitor->trace(m_rootNode); | 573 visitor->trace(m_rootNode); |
| 574 visitor->trace(m_document); | 574 visitor->trace(m_document); |
| 575 visitor->trace(m_parentTreeScope); | 575 visitor->trace(m_parentTreeScope); |
| 576 visitor->trace(m_idTargetObserverRegistry); | 576 visitor->trace(m_idTargetObserverRegistry); |
| 577 visitor->trace(m_selection); | 577 visitor->trace(m_selection); |
| 578 visitor->trace(m_elementsById); | 578 visitor->trace(m_elementsById); |
| 579 visitor->trace(m_imageMapsByName); | 579 visitor->trace(m_imageMapsByName); |
| 580 visitor->trace(m_labelsByForAttribute); | 580 visitor->trace(m_labelsByForAttribute); |
| 581 visitor->trace(m_scopedStyleResolver); | 581 visitor->trace(m_scopedStyleResolver); |
| 582 } | 582 } |
| 583 | 583 |
| 584 } // namespace blink | 584 } // namespace blink |
| OLD | NEW |