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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 #include "config.h" | 27 #include "config.h" |
28 #include "core/dom/TreeScope.h" | 28 #include "core/dom/TreeScope.h" |
29 | 29 |
30 #include "HTMLNames.h" | 30 #include "HTMLNames.h" |
31 #include "core/dom/ContainerNode.h" | 31 #include "core/dom/ContainerNode.h" |
32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
33 #include "core/dom/Element.h" | 33 #include "core/dom/Element.h" |
34 #include "core/dom/ElementTraversal.h" | 34 #include "core/dom/ElementTraversal.h" |
35 #include "core/dom/IdTargetObserverRegistry.h" | 35 #include "core/dom/IdTargetObserverRegistry.h" |
| 36 #include "core/dom/NodeRenderStyle.h" |
36 #include "core/dom/TreeScopeAdopter.h" | 37 #include "core/dom/TreeScopeAdopter.h" |
37 #include "core/dom/shadow/ElementShadow.h" | 38 #include "core/dom/shadow/ElementShadow.h" |
38 #include "core/dom/shadow/ShadowRoot.h" | 39 #include "core/dom/shadow/ShadowRoot.h" |
39 #include "core/events/EventPath.h" | 40 #include "core/events/EventPath.h" |
40 #include "core/html/HTMLAnchorElement.h" | 41 #include "core/html/HTMLAnchorElement.h" |
41 #include "core/html/HTMLFrameOwnerElement.h" | 42 #include "core/html/HTMLFrameOwnerElement.h" |
42 #include "core/html/HTMLLabelElement.h" | 43 #include "core/html/HTMLLabelElement.h" |
43 #include "core/html/HTMLMapElement.h" | 44 #include "core/html/HTMLMapElement.h" |
44 #include "core/page/DOMSelection.h" | 45 #include "core/page/DOMSelection.h" |
45 #include "core/page/FocusController.h" | 46 #include "core/page/FocusController.h" |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 if (equalIgnoringCase(element->fastGetAttribute(accesskeyAttr), key)) | 501 if (equalIgnoringCase(element->fastGetAttribute(accesskeyAttr), key)) |
501 result = element; | 502 result = element; |
502 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot;
shadowRoot = shadowRoot->olderShadowRoot()) { | 503 for (ShadowRoot* shadowRoot = element->youngestShadowRoot(); shadowRoot;
shadowRoot = shadowRoot->olderShadowRoot()) { |
503 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key)) | 504 if (Element* shadowResult = shadowRoot->getElementByAccessKey(key)) |
504 result = shadowResult; | 505 result = shadowResult; |
505 } | 506 } |
506 } | 507 } |
507 return result; | 508 return result; |
508 } | 509 } |
509 | 510 |
| 511 void TreeScope::setNeedsStyleRecalcForViewportUnits() |
| 512 { |
| 513 for (Element* element = ElementTraversal::firstWithin(*rootNode()); element;
element = ElementTraversal::nextIncludingPseudo(*element)) { |
| 514 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root
->olderShadowRoot()) |
| 515 root->setNeedsStyleRecalcForViewportUnits(); |
| 516 RenderStyle* style = element->renderStyle(); |
| 517 if (style && style->hasViewportUnits()) |
| 518 element->setNeedsStyleRecalc(LocalStyleChange); |
| 519 } |
| 520 } |
| 521 |
510 } // namespace WebCore | 522 } // namespace WebCore |
OLD | NEW |