Chromium Code Reviews| 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 443 return last; | 443 return last; |
| 444 last = currentElement->lastChild(); | 444 last = currentElement->lastChild(); |
| 445 if (!last) | 445 if (!last) |
| 446 last = currentElement->pseudoElement(BEFORE); | 446 last = currentElement->pseudoElement(BEFORE); |
| 447 return last; | 447 return last; |
| 448 } | 448 } |
| 449 | 449 |
| 450 return lastChild(); | 450 return lastChild(); |
| 451 } | 451 } |
| 452 | 452 |
| 453 Node* Node::treeRoot() | |
| 454 { | |
| 455 if (this->inDocument() || this->isInShadowTree()) | |
|
kochi
2016/01/28 06:46:11
You can combine this 2 conditions into isInTreeSco
yuzuchan
2016/02/01 04:59:54
Done.
| |
| 456 return &this->treeScope().rootNode(); | |
|
kochi
2016/01/28 06:46:11
You can omit 'this->'.
yuzuchan
2016/02/01 04:59:54
Done.
| |
| 457 Node* node = this; | |
| 458 while (node->parentNode()) | |
| 459 node = node->parentNode(); | |
| 460 return node; | |
| 461 } | |
| 462 | |
| 453 PassRefPtrWillBeRawPtr<Node> Node::insertBefore(PassRefPtrWillBeRawPtr<Node> new Child, Node* refChild, ExceptionState& exceptionState) | 463 PassRefPtrWillBeRawPtr<Node> Node::insertBefore(PassRefPtrWillBeRawPtr<Node> new Child, Node* refChild, ExceptionState& exceptionState) |
| 454 { | 464 { |
| 455 if (isContainerNode()) | 465 if (isContainerNode()) |
| 456 return toContainerNode(this)->insertBefore(newChild, refChild, exception State); | 466 return toContainerNode(this)->insertBefore(newChild, refChild, exception State); |
| 457 | 467 |
| 458 exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method."); | 468 exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method."); |
| 459 return nullptr; | 469 return nullptr; |
| 460 } | 470 } |
| 461 | 471 |
| 462 PassRefPtrWillBeRawPtr<Node> Node::replaceChild(PassRefPtrWillBeRawPtr<Node> new Child, PassRefPtrWillBeRawPtr<Node> oldChild, ExceptionState& exceptionState) | 472 PassRefPtrWillBeRawPtr<Node> Node::replaceChild(PassRefPtrWillBeRawPtr<Node> new Child, PassRefPtrWillBeRawPtr<Node> oldChild, ExceptionState& exceptionState) |
| (...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2403 | 2413 |
| 2404 void showNodePath(const blink::Node* node) | 2414 void showNodePath(const blink::Node* node) |
| 2405 { | 2415 { |
| 2406 if (node) | 2416 if (node) |
| 2407 node->showNodePathForThis(); | 2417 node->showNodePathForThis(); |
| 2408 else | 2418 else |
| 2409 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2419 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
| 2410 } | 2420 } |
| 2411 | 2421 |
| 2412 #endif | 2422 #endif |
| OLD | NEW |