Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: Source/core/dom/TreeScope.cpp

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: add test for browser zoom Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 if (equalIgnoringCase(element->fastGetAttribute(accesskeyAttr), key)) 490 if (equalIgnoringCase(element->fastGetAttribute(accesskeyAttr), key))
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 void TreeScope::setNeedsStyleRecalcForViewportUnits()
501 {
502 for (Element* element = ElementTraversal::firstWithin(*rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) {
503 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root ->olderShadowRoot())
504 root->setNeedsStyleRecalcForViewportUnits();
505 RenderStyle* style = element->renderStyle();
506 if (style && style->hasViewportUnits())
507 element->setNeedsStyleRecalc(LocalStyleChange);
508 }
509 }
510
500 } // namespace WebCore 511 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698