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

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

Issue 1058763002: Introduce Node::needsDistributionRecalc and use it in ElementShadow to fix the wrong assertions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix Todo in the comment Created 5 years, 8 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/Node.h ('k') | Source/core/dom/shadow/ElementShadow.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 return node.document(); 658 return node.document();
659 Node* root = &node; 659 Node* root = &node;
660 while (Node* host = root->shadowHost()) 660 while (Node* host = root->shadowHost())
661 root = host; 661 root = host;
662 while (Node* ancestor = root->parentNode()) 662 while (Node* ancestor = root->parentNode())
663 root = ancestor; 663 root = ancestor;
664 ASSERT(!root->shadowHost()); 664 ASSERT(!root->shadowHost());
665 return *root; 665 return *root;
666 } 666 }
667 667
668 #if ENABLE(ASSERT)
669 bool Node::needsDistributionRecalc() const
670 {
671 // TODO(hayato): If we can prove that this->childNeedsDistributionRecalc()
672 // is enough for either case, in a document, not in a document, remove this
673 // function after renaming Node::childNeedsDistributionRecalc() to a more
674 // appropriate name.
675 if (inDocument())
676 return document().childNeedsDistributionRecalc();
677 return childNeedsDistributionRecalc();
678 }
679 #endif
680
668 void Node::updateDistribution() 681 void Node::updateDistribution()
669 { 682 {
670 TRACE_EVENT0("blink", "Node::updateDistribution"); 683 TRACE_EVENT0("blink", "Node::updateDistribution");
671 ScriptForbiddenScope forbidScript; 684 ScriptForbiddenScope forbidScript;
672 rootInTreeOfTrees(*this).recalcDistribution(); 685 rootInTreeOfTrees(*this).recalcDistribution();
673 } 686 }
674 687
675 void Node::recalcDistribution() 688 void Node::recalcDistribution()
676 { 689 {
677 if (isElementNode()) { 690 if (isElementNode()) {
(...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after
2493 node->showTreeForThis(); 2506 node->showTreeForThis();
2494 } 2507 }
2495 2508
2496 void showNodePath(const blink::Node* node) 2509 void showNodePath(const blink::Node* node)
2497 { 2510 {
2498 if (node) 2511 if (node)
2499 node->showNodePathForThis(); 2512 node->showNodePathForThis();
2500 } 2513 }
2501 2514
2502 #endif 2515 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698