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

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

Issue 2197653002: CL for perf try job on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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) 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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 return document(); 577 return document();
578 Node* root = const_cast<Node*>(this); 578 Node* root = const_cast<Node*>(this);
579 while (Node* host = root->shadowHost()) 579 while (Node* host = root->shadowHost())
580 root = host; 580 root = host;
581 while (Node* ancestor = root->parentNode()) 581 while (Node* ancestor = root->parentNode())
582 root = ancestor; 582 root = ancestor;
583 DCHECK(!root->shadowHost()); 583 DCHECK(!root->shadowHost());
584 return *root; 584 return *root;
585 } 585 }
586 586
587 bool Node::isUnclosedNodeOf(const Node& other) const
588 {
589 if (!isInShadowTree() || treeScope() == other.treeScope())
590 return true;
591
592 const TreeScope* scope = &treeScope();
593 for (; scope->parentTreeScope(); scope = scope->parentTreeScope()) {
594 const ContainerNode& root = scope->rootNode();
595 if (root.isShadowRoot() && !toShadowRoot(root).isOpenOrV0())
596 break;
597 }
598
599 for (TreeScope* otherScope = &other.treeScope(); otherScope; otherScope = ot herScope->parentTreeScope()) {
600 if (otherScope == scope)
601 return true;
602 }
603 return false;
604 }
605
606 bool Node::needsDistributionRecalc() const 587 bool Node::needsDistributionRecalc() const
607 { 588 {
608 return shadowIncludingRoot().childNeedsDistributionRecalc(); 589 return shadowIncludingRoot().childNeedsDistributionRecalc();
609 } 590 }
610 591
611 void Node::updateDistribution() 592 void Node::updateDistribution()
612 { 593 {
613 // Extra early out to avoid spamming traces. 594 // Extra early out to avoid spamming traces.
614 if (isConnected() && !document().childNeedsDistributionRecalc()) 595 if (isConnected() && !document().childNeedsDistributionRecalc())
615 return; 596 return;
(...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after
2404 2385
2405 void showNodePath(const blink::Node* node) 2386 void showNodePath(const blink::Node* node)
2406 { 2387 {
2407 if (node) 2388 if (node)
2408 node->showNodePathForThis(); 2389 node->showNodePathForThis();
2409 else 2390 else
2410 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2391 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2411 } 2392 }
2412 2393
2413 #endif 2394 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/html/HTMLElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698