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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated change after Doug's review. Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Text.cpp ('k') | Source/core/editing/ApplyBlockElementCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 } 500 }
501 } 501 }
502 return result; 502 return result;
503 } 503 }
504 504
505 void TreeScope::setNeedsStyleRecalcForViewportUnits() 505 void TreeScope::setNeedsStyleRecalcForViewportUnits()
506 { 506 {
507 for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) { 507 for (Element* element = ElementTraversal::firstWithin(rootNode()); element; element = ElementTraversal::nextIncludingPseudo(*element)) {
508 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root ->olderShadowRoot()) 508 for (ShadowRoot* root = element->youngestShadowRoot(); root; root = root ->olderShadowRoot())
509 root->setNeedsStyleRecalcForViewportUnits(); 509 root->setNeedsStyleRecalcForViewportUnits();
510 LayoutStyle* style = element->layoutStyle(); 510 const LayoutStyle* style = element->layoutStyle();
511 if (style && style->hasViewportUnits()) 511 if (style && style->hasViewportUnits())
512 element->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForT racing::create(StyleChangeReason::ViewportUnits)); 512 element->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForT racing::create(StyleChangeReason::ViewportUnits));
513 } 513 }
514 } 514 }
515 515
516 void TreeScope::trace(Visitor* visitor) 516 void TreeScope::trace(Visitor* visitor)
517 { 517 {
518 visitor->trace(m_rootNode); 518 visitor->trace(m_rootNode);
519 visitor->trace(m_document); 519 visitor->trace(m_document);
520 visitor->trace(m_parentTreeScope); 520 visitor->trace(m_parentTreeScope);
521 visitor->trace(m_idTargetObserverRegistry); 521 visitor->trace(m_idTargetObserverRegistry);
522 visitor->trace(m_selection); 522 visitor->trace(m_selection);
523 visitor->trace(m_elementsById); 523 visitor->trace(m_elementsById);
524 visitor->trace(m_imageMapsByName); 524 visitor->trace(m_imageMapsByName);
525 visitor->trace(m_labelsByForAttribute); 525 visitor->trace(m_labelsByForAttribute);
526 visitor->trace(m_scopedStyleResolver); 526 visitor->trace(m_scopedStyleResolver);
527 } 527 }
528 528
529 } // namespace blink 529 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Text.cpp ('k') | Source/core/editing/ApplyBlockElementCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698