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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 // By default, setting nodeValue has no effect. | 400 // By default, setting nodeValue has no effect. |
401 } | 401 } |
402 | 402 |
403 PassRefPtrWillBeRawPtr<NodeList> Node::childNodes() | 403 PassRefPtrWillBeRawPtr<NodeList> Node::childNodes() |
404 { | 404 { |
405 if (isContainerNode()) | 405 if (isContainerNode()) |
406 return ensureRareData().ensureNodeLists().ensureChildNodeList(toContaine
rNode(*this)); | 406 return ensureRareData().ensureNodeLists().ensureChildNodeList(toContaine
rNode(*this)); |
407 return ensureRareData().ensureNodeLists().ensureEmptyChildNodeList(*this); | 407 return ensureRareData().ensureNodeLists().ensureEmptyChildNodeList(*this); |
408 } | 408 } |
409 | 409 |
410 Node& Node::lastDescendantOrSelf() const | |
411 { | |
412 Node* n = const_cast<Node*>(this); | |
413 while (n && n->lastChild()) | |
414 n = n->lastChild(); | |
415 ASSERT(n); | |
416 return *n; | |
417 } | |
418 | |
419 Node* Node::pseudoAwarePreviousSibling() const | 410 Node* Node::pseudoAwarePreviousSibling() const |
420 { | 411 { |
421 if (parentElement() && !previousSibling()) { | 412 if (parentElement() && !previousSibling()) { |
422 Element* parent = parentElement(); | 413 Element* parent = parentElement(); |
423 if (isAfterPseudoElement() && parent->lastChild()) | 414 if (isAfterPseudoElement() && parent->lastChild()) |
424 return parent->lastChild(); | 415 return parent->lastChild(); |
425 if (!isBeforePseudoElement()) | 416 if (!isBeforePseudoElement()) |
426 return parent->pseudoElement(BEFORE); | 417 return parent->pseudoElement(BEFORE); |
427 } | 418 } |
428 return previousSibling(); | 419 return previousSibling(); |
(...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2550 node->showTreeForThis(); | 2541 node->showTreeForThis(); |
2551 } | 2542 } |
2552 | 2543 |
2553 void showNodePath(const blink::Node* node) | 2544 void showNodePath(const blink::Node* node) |
2554 { | 2545 { |
2555 if (node) | 2546 if (node) |
2556 node->showNodePathForThis(); | 2547 node->showNodePathForThis(); |
2557 } | 2548 } |
2558 | 2549 |
2559 #endif | 2550 #endif |
OLD | NEW |