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

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

Issue 547823002: Track reasons for |Node::SetNeedsStyleRecalc| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: reasons as tuple Created 6 years, 3 months 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 return result; 535 return result;
536 } 536 }
537 537
538 void TreeScope::setNeedsStyleRecalcForViewportUnits() 538 void TreeScope::setNeedsStyleRecalcForViewportUnits()
539 { 539 {
540 for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) { 540 for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) {
541 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root ->olderShadowRoot()) 541 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root ->olderShadowRoot())
542 root->setNeedsStyleRecalcForViewportUnits(); 542 root->setNeedsStyleRecalcForViewportUnits();
543 RenderStyle* style = element->renderStyle(); 543 RenderStyle* style = element->renderStyle();
544 if (style && style->hasViewportUnits()) 544 if (style && style->hasViewportUnits())
545 element->setNeedsStyleRecalc(LocalStyleChange); 545 element->setNeedsStyleRecalc(StyleChangeReasonForTracing::create(Sty leChangeReason::ViewportUnits), LocalStyleChange);
esprehn 2014/09/26 03:53:01 Can we make this the second argument instead? Now
kouhei (in TOK) 2014/09/29 02:05:32 Done.
546 } 546 }
547 } 547 }
548 548
549 void TreeScope::trace(Visitor* visitor) 549 void TreeScope::trace(Visitor* visitor)
550 { 550 {
551 visitor->trace(m_rootNode); 551 visitor->trace(m_rootNode);
552 visitor->trace(m_document); 552 visitor->trace(m_document);
553 visitor->trace(m_parentTreeScope); 553 visitor->trace(m_parentTreeScope);
554 visitor->trace(m_idTargetObserverRegistry); 554 visitor->trace(m_idTargetObserverRegistry);
555 visitor->trace(m_selection); 555 visitor->trace(m_selection);
556 visitor->trace(m_elementsById); 556 visitor->trace(m_elementsById);
557 visitor->trace(m_imageMapsByName); 557 visitor->trace(m_imageMapsByName);
558 visitor->trace(m_labelsByForAttribute); 558 visitor->trace(m_labelsByForAttribute);
559 visitor->trace(m_scopedStyleResolver); 559 visitor->trace(m_scopedStyleResolver);
560 } 560 }
561 561
562 } // namespace blink 562 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698