| 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 return ensureRareData().ensureNodeLists().ensureEmptyChildNodeList(*this); | 398 return ensureRareData().ensureNodeLists().ensureEmptyChildNodeList(*this); |
| 399 } | 399 } |
| 400 | 400 |
| 401 Node* Node::pseudoAwarePreviousSibling() const | 401 Node* Node::pseudoAwarePreviousSibling() const |
| 402 { | 402 { |
| 403 if (parentElement() && !previousSibling()) { | 403 if (parentElement() && !previousSibling()) { |
| 404 Element* parent = parentElement(); | 404 Element* parent = parentElement(); |
| 405 if (isAfterPseudoElement() && parent->lastChild()) | 405 if (isAfterPseudoElement() && parent->lastChild()) |
| 406 return parent->lastChild(); | 406 return parent->lastChild(); |
| 407 if (!isBeforePseudoElement()) | 407 if (!isBeforePseudoElement()) |
| 408 return parent->pseudoElement(BEFORE); | 408 return parent->pseudoElement(PseudoIdBefore); |
| 409 } | 409 } |
| 410 return previousSibling(); | 410 return previousSibling(); |
| 411 } | 411 } |
| 412 | 412 |
| 413 Node* Node::pseudoAwareNextSibling() const | 413 Node* Node::pseudoAwareNextSibling() const |
| 414 { | 414 { |
| 415 if (parentElement() && !nextSibling()) { | 415 if (parentElement() && !nextSibling()) { |
| 416 Element* parent = parentElement(); | 416 Element* parent = parentElement(); |
| 417 if (isBeforePseudoElement() && parent->hasChildren()) | 417 if (isBeforePseudoElement() && parent->hasChildren()) |
| 418 return parent->firstChild(); | 418 return parent->firstChild(); |
| 419 if (!isAfterPseudoElement()) | 419 if (!isAfterPseudoElement()) |
| 420 return parent->pseudoElement(AFTER); | 420 return parent->pseudoElement(PseudoIdAfter); |
| 421 } | 421 } |
| 422 return nextSibling(); | 422 return nextSibling(); |
| 423 } | 423 } |
| 424 | 424 |
| 425 Node* Node::pseudoAwareFirstChild() const | 425 Node* Node::pseudoAwareFirstChild() const |
| 426 { | 426 { |
| 427 if (isElementNode()) { | 427 if (isElementNode()) { |
| 428 const Element* currentElement = toElement(this); | 428 const Element* currentElement = toElement(this); |
| 429 Node* first = currentElement->pseudoElement(BEFORE); | 429 Node* first = currentElement->pseudoElement(PseudoIdBefore); |
| 430 if (first) | 430 if (first) |
| 431 return first; | 431 return first; |
| 432 first = currentElement->firstChild(); | 432 first = currentElement->firstChild(); |
| 433 if (!first) | 433 if (!first) |
| 434 first = currentElement->pseudoElement(AFTER); | 434 first = currentElement->pseudoElement(PseudoIdAfter); |
| 435 return first; | 435 return first; |
| 436 } | 436 } |
| 437 | 437 |
| 438 return firstChild(); | 438 return firstChild(); |
| 439 } | 439 } |
| 440 | 440 |
| 441 Node* Node::pseudoAwareLastChild() const | 441 Node* Node::pseudoAwareLastChild() const |
| 442 { | 442 { |
| 443 if (isElementNode()) { | 443 if (isElementNode()) { |
| 444 const Element* currentElement = toElement(this); | 444 const Element* currentElement = toElement(this); |
| 445 Node* last = currentElement->pseudoElement(AFTER); | 445 Node* last = currentElement->pseudoElement(PseudoIdAfter); |
| 446 if (last) | 446 if (last) |
| 447 return last; | 447 return last; |
| 448 last = currentElement->lastChild(); | 448 last = currentElement->lastChild(); |
| 449 if (!last) | 449 if (!last) |
| 450 last = currentElement->pseudoElement(BEFORE); | 450 last = currentElement->pseudoElement(PseudoIdBefore); |
| 451 return last; | 451 return last; |
| 452 } | 452 } |
| 453 | 453 |
| 454 return lastChild(); | 454 return lastChild(); |
| 455 } | 455 } |
| 456 | 456 |
| 457 Node& Node::treeRoot() const | 457 Node& Node::treeRoot() const |
| 458 { | 458 { |
| 459 if (isInTreeScope()) | 459 if (isInTreeScope()) |
| 460 return treeScope().rootNode(); | 460 return treeScope().rootNode(); |
| (...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1638 if (node == markedNode2) | 1638 if (node == markedNode2) |
| 1639 indent.append(markedLabel2); | 1639 indent.append(markedLabel2); |
| 1640 indent.append(baseIndent); | 1640 indent.append(baseIndent); |
| 1641 for (const Node* tmpNode = &node; tmpNode && tmpNode != rootNode; tmpNod
e = tmpNode->parentOrShadowHostNode()) | 1641 for (const Node* tmpNode = &node; tmpNode && tmpNode != rootNode; tmpNod
e = tmpNode->parentOrShadowHostNode()) |
| 1642 indent.append('\t'); | 1642 indent.append('\t'); |
| 1643 node.showNode(indent.toString().utf8().data()); | 1643 node.showNode(indent.toString().utf8().data()); |
| 1644 indent.append('\t'); | 1644 indent.append('\t'); |
| 1645 | 1645 |
| 1646 if (node.isElementNode()) { | 1646 if (node.isElementNode()) { |
| 1647 const Element& element = toElement(node); | 1647 const Element& element = toElement(node); |
| 1648 if (Element* pseudo = element.pseudoElement(BEFORE)) | 1648 if (Element* pseudo = element.pseudoElement(PseudoIdBefore)) |
| 1649 traverseTreeAndMark(indent.toString(), pseudo, markedNode1, mark
edLabel1, markedNode2, markedLabel2); | 1649 traverseTreeAndMark(indent.toString(), pseudo, markedNode1, mark
edLabel1, markedNode2, markedLabel2); |
| 1650 if (Element* pseudo = element.pseudoElement(AFTER)) | 1650 if (Element* pseudo = element.pseudoElement(PseudoIdAfter)) |
| 1651 traverseTreeAndMark(indent.toString(), pseudo, markedNode1, mark
edLabel1, markedNode2, markedLabel2); | 1651 traverseTreeAndMark(indent.toString(), pseudo, markedNode1, mark
edLabel1, markedNode2, markedLabel2); |
| 1652 if (Element* pseudo = element.pseudoElement(FIRST_LETTER)) | 1652 if (Element* pseudo = element.pseudoElement(PseudoIdFirstLetter)) |
| 1653 traverseTreeAndMark(indent.toString(), pseudo, markedNode1, mark
edLabel1, markedNode2, markedLabel2); | 1653 traverseTreeAndMark(indent.toString(), pseudo, markedNode1, mark
edLabel1, markedNode2, markedLabel2); |
| 1654 if (Element* pseudo = element.pseudoElement(BACKDROP)) | 1654 if (Element* pseudo = element.pseudoElement(PseudoIdBackdrop)) |
| 1655 traverseTreeAndMark(indent.toString(), pseudo, markedNode1, mark
edLabel1, markedNode2, markedLabel2); | 1655 traverseTreeAndMark(indent.toString(), pseudo, markedNode1, mark
edLabel1, markedNode2, markedLabel2); |
| 1656 } | 1656 } |
| 1657 | 1657 |
| 1658 if (node.isShadowRoot()) { | 1658 if (node.isShadowRoot()) { |
| 1659 if (ShadowRoot* youngerShadowRoot = toShadowRoot(node).youngerShadow
Root()) | 1659 if (ShadowRoot* youngerShadowRoot = toShadowRoot(node).youngerShadow
Root()) |
| 1660 traverseTreeAndMark(indent.toString(), youngerShadowRoot, marked
Node1, markedLabel1, markedNode2, markedLabel2); | 1660 traverseTreeAndMark(indent.toString(), youngerShadowRoot, marked
Node1, markedLabel1, markedNode2, markedLabel2); |
| 1661 } else if (ShadowRoot* oldestShadowRoot = oldestShadowRootFor(&node)) { | 1661 } else if (ShadowRoot* oldestShadowRoot = oldestShadowRootFor(&node)) { |
| 1662 traverseTreeAndMark(indent.toString(), oldestShadowRoot, markedNode1
, markedLabel1, markedNode2, markedLabel2); | 1662 traverseTreeAndMark(indent.toString(), oldestShadowRoot, markedNode1
, markedLabel1, markedNode2, markedLabel2); |
| 1663 } | 1663 } |
| 1664 } | 1664 } |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2429 | 2429 |
| 2430 void showNodePath(const blink::Node* node) | 2430 void showNodePath(const blink::Node* node) |
| 2431 { | 2431 { |
| 2432 if (node) | 2432 if (node) |
| 2433 node->showNodePathForThis(); | 2433 node->showNodePathForThis(); |
| 2434 else | 2434 else |
| 2435 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2435 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
| 2436 } | 2436 } |
| 2437 | 2437 |
| 2438 #endif | 2438 #endif |
| OLD | NEW |