Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: Source/core/dom/Node.cpp

Issue 22417002: Rename ASSERT_NO_EXCEPTION_STATE and IGNORE_EXCEPTION_STATE (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/MessagePort.cpp ('k') | Source/core/dom/Range.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 node = NodeTraversal::nextPostOrder(node.get()); 571 node = NodeTraversal::nextPostOrder(node.get());
572 continue; 572 continue;
573 } 573 }
574 574
575 RefPtr<Text> text = toText(node.get()); 575 RefPtr<Text> text = toText(node.get());
576 576
577 // Remove empty text nodes. 577 // Remove empty text nodes.
578 if (!text->length()) { 578 if (!text->length()) {
579 // Care must be taken to get the next node before removing the curre nt node. 579 // Care must be taken to get the next node before removing the curre nt node.
580 node = NodeTraversal::nextPostOrder(node.get()); 580 node = NodeTraversal::nextPostOrder(node.get());
581 text->remove(IGNORE_EXCEPTION_STATE); 581 text->remove(IGNORE_EXCEPTION);
582 continue; 582 continue;
583 } 583 }
584 584
585 // Merge text nodes. 585 // Merge text nodes.
586 while (Node* nextSibling = node->nextSibling()) { 586 while (Node* nextSibling = node->nextSibling()) {
587 if (nextSibling->nodeType() != TEXT_NODE) 587 if (nextSibling->nodeType() != TEXT_NODE)
588 break; 588 break;
589 RefPtr<Text> nextText = toText(nextSibling); 589 RefPtr<Text> nextText = toText(nextSibling);
590 590
591 // Remove empty text nodes. 591 // Remove empty text nodes.
592 if (!nextText->length()) { 592 if (!nextText->length()) {
593 nextText->remove(IGNORE_EXCEPTION_STATE); 593 nextText->remove(IGNORE_EXCEPTION);
594 continue; 594 continue;
595 } 595 }
596 596
597 // Both non-empty text nodes. Merge them. 597 // Both non-empty text nodes. Merge them.
598 unsigned offset = text->length(); 598 unsigned offset = text->length();
599 text->appendData(nextText->data()); 599 text->appendData(nextText->data());
600 document()->textNodesMerged(nextText.get(), offset); 600 document()->textNodesMerged(nextText.get(), offset);
601 nextText->remove(IGNORE_EXCEPTION_STATE); 601 nextText->remove(IGNORE_EXCEPTION);
602 } 602 }
603 603
604 node = NodeTraversal::nextPostOrder(node.get()); 604 node = NodeTraversal::nextPostOrder(node.get());
605 } 605 }
606 } 606 }
607 607
608 const AtomicString& Node::prefix() const 608 const AtomicString& Node::prefix() const
609 { 609 {
610 // For nodes other than elements and attributes, the prefix is always null 610 // For nodes other than elements and attributes, the prefix is always null
611 return nullAtom; 611 return nullAtom;
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after
2578 2578
2579 #ifndef NDEBUG 2579 #ifndef NDEBUG
2580 m_deletionHasBegun = true; 2580 m_deletionHasBegun = true;
2581 #endif 2581 #endif
2582 delete this; 2582 delete this;
2583 } 2583 }
2584 2584
2585 void Node::textRects(Vector<IntRect>& rects) const 2585 void Node::textRects(Vector<IntRect>& rects) const
2586 { 2586 {
2587 RefPtr<Range> range = Range::create(document()); 2587 RefPtr<Range> range = Range::create(document());
2588 range->selectNodeContents(const_cast<Node*>(this), IGNORE_EXCEPTION_STATE); 2588 range->selectNodeContents(const_cast<Node*>(this), IGNORE_EXCEPTION);
2589 range->textRects(rects); 2589 range->textRects(rects);
2590 } 2590 }
2591 2591
2592 unsigned Node::connectedSubframeCount() const 2592 unsigned Node::connectedSubframeCount() const
2593 { 2593 {
2594 return hasRareData() ? rareData()->connectedSubframeCount() : 0; 2594 return hasRareData() ? rareData()->connectedSubframeCount() : 0;
2595 } 2595 }
2596 2596
2597 void Node::incrementConnectedSubframeCount(unsigned amount) 2597 void Node::incrementConnectedSubframeCount(unsigned amount)
2598 { 2598 {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
2731 node->showTreeForThis(); 2731 node->showTreeForThis();
2732 } 2732 }
2733 2733
2734 void showNodePath(const WebCore::Node* node) 2734 void showNodePath(const WebCore::Node* node)
2735 { 2735 {
2736 if (node) 2736 if (node)
2737 node->showNodePathForThis(); 2737 node->showNodePathForThis();
2738 } 2738 }
2739 2739
2740 #endif 2740 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/MessagePort.cpp ('k') | Source/core/dom/Range.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698