| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |