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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 return document(); | 629 return document(); |
630 Node* root = const_cast<Node*>(this); | 630 Node* root = const_cast<Node*>(this); |
631 while (Node* host = root->shadowHost()) | 631 while (Node* host = root->shadowHost()) |
632 root = host; | 632 root = host; |
633 while (Node* ancestor = root->parentNode()) | 633 while (Node* ancestor = root->parentNode()) |
634 root = ancestor; | 634 root = ancestor; |
635 DCHECK(!root->shadowHost()); | 635 DCHECK(!root->shadowHost()); |
636 return *root; | 636 return *root; |
637 } | 637 } |
638 | 638 |
| 639 bool Node::isUnclosedNodeOf(const Node& other) const |
| 640 { |
| 641 if (!isInShadowTree() || treeScope() == other.treeScope()) |
| 642 return true; |
| 643 |
| 644 const TreeScope* scope = &treeScope(); |
| 645 for (; scope->parentTreeScope(); scope = scope->parentTreeScope()) { |
| 646 const ContainerNode& root = scope->rootNode(); |
| 647 if (root.isShadowRoot() && !toShadowRoot(root).isOpenOrV0()) |
| 648 break; |
| 649 } |
| 650 |
| 651 for (TreeScope* otherScope = &other.treeScope(); otherScope; otherScope = ot
herScope->parentTreeScope()) { |
| 652 if (otherScope == scope) |
| 653 return true; |
| 654 } |
| 655 return false; |
| 656 } |
| 657 |
639 bool Node::needsDistributionRecalc() const | 658 bool Node::needsDistributionRecalc() const |
640 { | 659 { |
641 return shadowIncludingRoot().childNeedsDistributionRecalc(); | 660 return shadowIncludingRoot().childNeedsDistributionRecalc(); |
642 } | 661 } |
643 | 662 |
644 void Node::updateDistribution() | 663 void Node::updateDistribution() |
645 { | 664 { |
646 // Extra early out to avoid spamming traces. | 665 // Extra early out to avoid spamming traces. |
647 if (inShadowIncludingDocument() && !document().childNeedsDistributionRecalc(
)) | 666 if (inShadowIncludingDocument() && !document().childNeedsDistributionRecalc(
)) |
648 return; | 667 return; |
(...skipping 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2482 | 2501 |
2483 void showNodePath(const blink::Node* node) | 2502 void showNodePath(const blink::Node* node) |
2484 { | 2503 { |
2485 if (node) | 2504 if (node) |
2486 node->showNodePathForThis(); | 2505 node->showNodePathForThis(); |
2487 else | 2506 else |
2488 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2507 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
2489 } | 2508 } |
2490 | 2509 |
2491 #endif | 2510 #endif |
OLD | NEW |