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, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 IntRect pixelSnappedRenderRect(bool* isReplaced) { return pixelSnappedIntRec
t(renderRect(isReplaced)); } | 474 IntRect pixelSnappedRenderRect(bool* isReplaced) { return pixelSnappedIntRec
t(renderRect(isReplaced)); } |
475 | 475 |
476 // Returns true if the node has a non-empty bounding box in layout. | 476 // Returns true if the node has a non-empty bounding box in layout. |
477 // This does not 100% guarantee the user can see it, but is pretty close. | 477 // This does not 100% guarantee the user can see it, but is pretty close. |
478 // Note: This method only works properly after layout has occurred. | 478 // Note: This method only works properly after layout has occurred. |
479 bool hasNonEmptyBoundingBox() const; | 479 bool hasNonEmptyBoundingBox() const; |
480 | 480 |
481 unsigned nodeIndex() const; | 481 unsigned nodeIndex() const; |
482 | 482 |
483 // Returns the DOM ownerDocument attribute. This method never returns NULL,
except in the case | 483 // Returns the DOM ownerDocument attribute. This method never returns NULL,
except in the case |
484 // of (1) a Document node or (2) a DocumentType node that is not used with a
ny Document yet. | 484 // of a Document node. |
485 Document* ownerDocument() const; | 485 Document* ownerDocument() const; |
486 | 486 |
487 // Returns the document associated with this node. This method never returns
NULL, except in the case | 487 // FIXME: This should return a reference. |
488 // of a DocumentType node that is not used with any Document yet. A Document
node returns itself. | 488 // Returns the document associated with this node. This method never returns
0. |
| 489 // A Document node returns itself. |
489 Document* document() const | 490 Document* document() const |
490 { | 491 { |
491 ASSERT(this); | 492 ASSERT(this); |
492 // FIXME: below ASSERT is useful, but prevents the use of document() in
the constructor or destructor | 493 ASSERT(documentInternal()); |
493 // due to the virtual function call to nodeType(). | |
494 ASSERT(documentInternal() || (nodeType() == DOCUMENT_TYPE_NODE && !inDoc
ument())); | |
495 return documentInternal(); | 494 return documentInternal(); |
496 } | 495 } |
497 | 496 |
498 TreeScope* treeScope() const { return m_treeScope; } | 497 TreeScope* treeScope() const { return m_treeScope; } |
499 | 498 |
500 // Returns true if this node is associated with a document and is in its ass
ociated document's | 499 // Returns true if this node is associated with a document and is in its ass
ociated document's |
501 // node tree, false otherwise. | 500 // node tree, false otherwise. |
502 bool inDocument() const | 501 bool inDocument() const |
503 { | 502 { |
504 ASSERT(documentInternal() || !getFlag(InDocumentFlag)); | 503 ASSERT(documentInternal() || !getFlag(InDocumentFlag)); |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 | 943 |
945 } //namespace | 944 } //namespace |
946 | 945 |
947 #ifndef NDEBUG | 946 #ifndef NDEBUG |
948 // Outside the WebCore namespace for ease of invocation from gdb. | 947 // Outside the WebCore namespace for ease of invocation from gdb. |
949 void showTree(const WebCore::Node*); | 948 void showTree(const WebCore::Node*); |
950 void showNodePath(const WebCore::Node*); | 949 void showNodePath(const WebCore::Node*); |
951 #endif | 950 #endif |
952 | 951 |
953 #endif | 952 #endif |
OLD | NEW |