| 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 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1658 } | 1658 } |
| 1659 } | 1659 } |
| 1660 | 1660 |
| 1661 // There was no difference between the two parent chains, i.e., one was a su
bset of the other. The shorter | 1661 // There was no difference between the two parent chains, i.e., one was a su
bset of the other. The shorter |
| 1662 // chain is the ancestor. | 1662 // chain is the ancestor. |
| 1663 return index1 < index2 ? | 1663 return index1 < index2 ? |
| 1664 DOCUMENT_POSITION_FOLLOWING | DOCUMENT_POSITION_CONTAINED_BY | co
nnection : | 1664 DOCUMENT_POSITION_FOLLOWING | DOCUMENT_POSITION_CONTAINED_BY | co
nnection : |
| 1665 DOCUMENT_POSITION_PRECEDING | DOCUMENT_POSITION_CONTAINS | connec
tion; | 1665 DOCUMENT_POSITION_PRECEDING | DOCUMENT_POSITION_CONTAINS | connec
tion; |
| 1666 } | 1666 } |
| 1667 | 1667 |
| 1668 FloatPoint Node::convertToPage(const FloatPoint& p) const | |
| 1669 { | |
| 1670 // If there is a renderer, just ask it to do the conversion | |
| 1671 if (renderer()) | |
| 1672 return renderer()->localToAbsolute(p, UseTransforms); | |
| 1673 | |
| 1674 // Otherwise go up the tree looking for a renderer | |
| 1675 if (Element* parent = parentElement()) | |
| 1676 return parent->convertToPage(p); | |
| 1677 | |
| 1678 // No parent - no conversion needed | |
| 1679 return p; | |
| 1680 } | |
| 1681 | |
| 1682 FloatPoint Node::convertFromPage(const FloatPoint& p) const | |
| 1683 { | |
| 1684 // If there is a renderer, just ask it to do the conversion | |
| 1685 if (renderer()) | |
| 1686 return renderer()->absoluteToLocal(p, UseTransforms); | |
| 1687 | |
| 1688 // Otherwise go up the tree looking for a renderer | |
| 1689 if (Element* parent = parentElement()) | |
| 1690 return parent->convertFromPage(p); | |
| 1691 | |
| 1692 // No parent - no conversion needed | |
| 1693 return p; | |
| 1694 } | |
| 1695 | |
| 1696 String Node::debugName() const | 1668 String Node::debugName() const |
| 1697 { | 1669 { |
| 1698 StringBuilder name; | 1670 StringBuilder name; |
| 1699 name.append(nodeName()); | 1671 name.append(nodeName()); |
| 1700 | 1672 |
| 1701 if (isElementNode()) { | 1673 if (isElementNode()) { |
| 1702 const Element& thisElement = toElement(*this); | 1674 const Element& thisElement = toElement(*this); |
| 1703 if (thisElement.hasID()) { | 1675 if (thisElement.hasID()) { |
| 1704 name.appendLiteral(" id=\'"); | 1676 name.appendLiteral(" id=\'"); |
| 1705 name.append(thisElement.getIdAttribute()); | 1677 name.append(thisElement.getIdAttribute()); |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2572 node->showTreeForThis(); | 2544 node->showTreeForThis(); |
| 2573 } | 2545 } |
| 2574 | 2546 |
| 2575 void showNodePath(const blink::Node* node) | 2547 void showNodePath(const blink::Node* node) |
| 2576 { | 2548 { |
| 2577 if (node) | 2549 if (node) |
| 2578 node->showNodePathForThis(); | 2550 node->showNodePathForThis(); |
| 2579 } | 2551 } |
| 2580 | 2552 |
| 2581 #endif | 2553 #endif |
| OLD | NEW |