| 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 return layoutObject && layoutObject->isBoxModelObject() ? toLayoutBoxModelOb
ject(layoutObject) : nullptr; | 598 return layoutObject && layoutObject->isBoxModelObject() ? toLayoutBoxModelOb
ject(layoutObject) : nullptr; |
| 599 } | 599 } |
| 600 | 600 |
| 601 LayoutRect Node::boundingBox() const | 601 LayoutRect Node::boundingBox() const |
| 602 { | 602 { |
| 603 if (layoutObject()) | 603 if (layoutObject()) |
| 604 return LayoutRect(layoutObject()->absoluteBoundingBoxRect()); | 604 return LayoutRect(layoutObject()->absoluteBoundingBoxRect()); |
| 605 return LayoutRect(); | 605 return LayoutRect(); |
| 606 } | 606 } |
| 607 | 607 |
| 608 #ifndef NDEBUG | 608 //#ifndef NDEBUG |
| 609 inline static ShadowRoot* oldestShadowRootFor(const Node* node) | 609 inline static ShadowRoot* oldestShadowRootFor(const Node* node) |
| 610 { | 610 { |
| 611 if (!node->isElementNode()) | 611 if (!node->isElementNode()) |
| 612 return nullptr; | 612 return nullptr; |
| 613 if (ElementShadow* shadow = toElement(node)->shadow()) | 613 if (ElementShadow* shadow = toElement(node)->shadow()) |
| 614 return shadow->oldestShadowRoot(); | 614 return shadow->oldestShadowRoot(); |
| 615 return nullptr; | 615 return nullptr; |
| 616 } | 616 } |
| 617 #endif | 617 //#endif |
| 618 | 618 |
| 619 Node& Node::shadowIncludingRoot() const | 619 Node& Node::shadowIncludingRoot() const |
| 620 { | 620 { |
| 621 if (inShadowIncludingDocument()) | 621 if (inShadowIncludingDocument()) |
| 622 return document(); | 622 return document(); |
| 623 Node* root = const_cast<Node*>(this); | 623 Node* root = const_cast<Node*>(this); |
| 624 while (Node* host = root->shadowHost()) | 624 while (Node* host = root->shadowHost()) |
| 625 root = host; | 625 root = host; |
| 626 while (Node* ancestor = root->parentNode()) | 626 while (Node* ancestor = root->parentNode()) |
| 627 root = ancestor; | 627 root = ancestor; |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 return ostream; | 1565 return ostream; |
| 1566 } | 1566 } |
| 1567 | 1567 |
| 1568 std::ostream& operator<<(std::ostream& ostream, const Node* node) | 1568 std::ostream& operator<<(std::ostream& ostream, const Node* node) |
| 1569 { | 1569 { |
| 1570 if (!node) | 1570 if (!node) |
| 1571 return ostream << "null"; | 1571 return ostream << "null"; |
| 1572 return ostream << *node; | 1572 return ostream << *node; |
| 1573 } | 1573 } |
| 1574 | 1574 |
| 1575 #ifndef NDEBUG | 1575 //#ifndef NDEBUG |
| 1576 | 1576 |
| 1577 static void appendAttributeDesc(const Node* node, StringBuilder& stringBuilder,
const QualifiedName& name, const char* attrDesc) | 1577 static void appendAttributeDesc(const Node* node, StringBuilder& stringBuilder,
const QualifiedName& name, const char* attrDesc) |
| 1578 { | 1578 { |
| 1579 if (!node->isElementNode()) | 1579 if (!node->isElementNode()) |
| 1580 return; | 1580 return; |
| 1581 | 1581 |
| 1582 String attr = toElement(node)->getAttribute(name); | 1582 String attr = toElement(node)->getAttribute(name); |
| 1583 if (attr.isEmpty()) | 1583 if (attr.isEmpty()) |
| 1584 return; | 1584 return; |
| 1585 | 1585 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1802 } | 1802 } |
| 1803 | 1803 |
| 1804 void Node::showTreeForThisAcrossFrame() const | 1804 void Node::showTreeForThisAcrossFrame() const |
| 1805 { | 1805 { |
| 1806 const Node* rootNode = this; | 1806 const Node* rootNode = this; |
| 1807 while (parentOrShadowHostOrFrameOwner(rootNode)) | 1807 while (parentOrShadowHostOrFrameOwner(rootNode)) |
| 1808 rootNode = parentOrShadowHostOrFrameOwner(rootNode); | 1808 rootNode = parentOrShadowHostOrFrameOwner(rootNode); |
| 1809 showSubTreeAcrossFrame(rootNode, this, ""); | 1809 showSubTreeAcrossFrame(rootNode, this, ""); |
| 1810 } | 1810 } |
| 1811 | 1811 |
| 1812 #endif | 1812 //#endif |
| 1813 | 1813 |
| 1814 // -------- | 1814 // -------- |
| 1815 | 1815 |
| 1816 Element* Node::enclosingLinkEventParentOrSelf() const | 1816 Element* Node::enclosingLinkEventParentOrSelf() const |
| 1817 { | 1817 { |
| 1818 const Node* result = nullptr; | 1818 const Node* result = nullptr; |
| 1819 for (const Node* node = this; node; node = FlatTreeTraversal::parent(*node))
{ | 1819 for (const Node* node = this; node; node = FlatTreeTraversal::parent(*node))
{ |
| 1820 // For imagemaps, the enclosing link node is the associated area element
not the image itself. | 1820 // For imagemaps, the enclosing link node is the associated area element
not the image itself. |
| 1821 // So we don't let images be the enclosingLinkNode, even though isLink s
ometimes returns true | 1821 // So we don't let images be the enclosingLinkNode, even though isLink s
ometimes returns true |
| 1822 // for them. | 1822 // for them. |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2478 | 2478 |
| 2479 void showNodePath(const blink::Node* node) | 2479 void showNodePath(const blink::Node* node) |
| 2480 { | 2480 { |
| 2481 if (node) | 2481 if (node) |
| 2482 node->showNodePathForThis(); | 2482 node->showNodePathForThis(); |
| 2483 else | 2483 else |
| 2484 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2484 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
| 2485 } | 2485 } |
| 2486 | 2486 |
| 2487 #endif | 2487 #endif |
| OLD | NEW |