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

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

Issue 252713004: Make default for deep parameter in importNode false (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add use counter and rebase test results Created 6 years, 7 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
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/frame/UseCounter.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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 if (exceptionState.hadException()) 907 if (exceptionState.hadException())
908 return false; 908 return false;
909 newContainerNode->appendChild(newChild.release(), exceptionState); 909 newContainerNode->appendChild(newChild.release(), exceptionState);
910 if (exceptionState.hadException()) 910 if (exceptionState.hadException())
911 return false; 911 return false;
912 } 912 }
913 913
914 return true; 914 return true;
915 } 915 }
916 916
917 PassRefPtr<Node> Document::importNode(Node* importedNode, ExceptionState& ec)
918 {
919 UseCounter::count(this, UseCounter::DocumentImportNodeOptionalArgument);
Inactive 2014/04/30 15:47:44 UseCounter::countDeprecation()
920 addConsoleMessage(JSMessageSource, WarningMessageLevel, "The behavior of imp ortNode() with no boolean argument is about to change from doing a deep clone to doing a shallow clone. Make sure to pass an explicit boolean argument to keep your current behavior.");
Inactive 2014/04/30 15:47:44 We usually add the warning message to UseCounter.c
921 return importNode(importedNode, true, ec);
922 }
923
917 PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionSt ate& exceptionState) 924 PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionSt ate& exceptionState)
918 { 925 {
919 if (!importedNode) { 926 if (!importedNode) {
920 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::a rgumentNullOrIncorrectType(1, "Node")); 927 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::a rgumentNullOrIncorrectType(1, "Node"));
921 return nullptr; 928 return nullptr;
922 } 929 }
923 930
924 switch (importedNode->nodeType()) { 931 switch (importedNode->nodeType()) {
925 case TEXT_NODE: 932 case TEXT_NODE:
926 return createTextNode(importedNode->nodeValue()); 933 return createTextNode(importedNode->nodeValue());
(...skipping 4730 matching lines...) Expand 10 before | Expand all | Expand 10 after
5657 { 5664 {
5658 visitor->trace(m_styleSheetList); 5665 visitor->trace(m_styleSheetList);
5659 visitor->trace(m_visibilityObservers); 5666 visitor->trace(m_visibilityObservers);
5660 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); 5667 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this);
5661 Supplementable<Document>::trace(visitor); 5668 Supplementable<Document>::trace(visitor);
5662 TreeScope::trace(visitor); 5669 TreeScope::trace(visitor);
5663 ContainerNode::trace(visitor); 5670 ContainerNode::trace(visitor);
5664 } 5671 }
5665 5672
5666 } // namespace WebCore 5673 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698