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

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

Issue 49613005: Have TreeScrope::adoptIfNeeded() take a reference instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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/ContainerNodeAlgorithms.h ('k') | Source/core/dom/Element.cpp » ('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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 { 648 {
649 return inQuirksMode() ? "BackCompat" : "CSS1Compat"; 649 return inQuirksMode() ? "BackCompat" : "CSS1Compat";
650 } 650 }
651 651
652 void Document::setDoctype(PassRefPtr<DocumentType> docType) 652 void Document::setDoctype(PassRefPtr<DocumentType> docType)
653 { 653 {
654 // This should never be called more than once. 654 // This should never be called more than once.
655 ASSERT(!m_docType || !docType); 655 ASSERT(!m_docType || !docType);
656 m_docType = docType; 656 m_docType = docType;
657 if (m_docType) { 657 if (m_docType) {
658 this->adoptIfNeeded(m_docType.get()); 658 this->adoptIfNeeded(*m_docType);
659 if (m_docType->publicId().startsWith("-//wapforum//dtd xhtml mobile 1.", /* caseSensitive */ false)) 659 if (m_docType->publicId().startsWith("-//wapforum//dtd xhtml mobile 1.", /* caseSensitive */ false))
660 m_isMobileDocument = true; 660 m_isMobileDocument = true;
661 } 661 }
662 // Doctype affects the interpretation of the stylesheets. 662 // Doctype affects the interpretation of the stylesheets.
663 clearStyleResolver(); 663 clearStyleResolver();
664 } 664 }
665 665
666 DOMImplementation* Document::implementation() 666 DOMImplementation* Document::implementation()
667 { 667 {
668 if (!m_implementation) 668 if (!m_implementation)
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 return 0; 950 return 0;
951 } 951 }
952 } 952 }
953 if (source->parentNode()) { 953 if (source->parentNode()) {
954 source->parentNode()->removeChild(source.get(), es); 954 source->parentNode()->removeChild(source.get(), es);
955 if (es.hadException()) 955 if (es.hadException())
956 return 0; 956 return 0;
957 } 957 }
958 } 958 }
959 959
960 this->adoptIfNeeded(source.get()); 960 this->adoptIfNeeded(*source);
961 961
962 return source; 962 return source;
963 } 963 }
964 964
965 bool Document::hasValidNamespaceForElements(const QualifiedName& qName) 965 bool Document::hasValidNamespaceForElements(const QualifiedName& qName)
966 { 966 {
967 // These checks are from DOM Core Level 2, createElementNS 967 // These checks are from DOM Core Level 2, createElementNS
968 // http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-DocCrElNS 968 // http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-DocCrElNS
969 if (!qName.prefix().isEmpty() && qName.namespaceURI().isNull()) // createEle mentNS(null, "html:div") 969 if (!qName.prefix().isEmpty() && qName.namespaceURI().isNull()) // createEle mentNS(null, "html:div")
970 return false; 970 return false;
(...skipping 4309 matching lines...) Expand 10 before | Expand all | Expand 10 after
5280 void Document::modifiedStyleSheet(StyleSheet* sheet, RecalcStyleTime when, Style ResolverUpdateMode updateMode) 5280 void Document::modifiedStyleSheet(StyleSheet* sheet, RecalcStyleTime when, Style ResolverUpdateMode updateMode)
5281 { 5281 {
5282 if (!isActive()) 5282 if (!isActive())
5283 return; 5283 return;
5284 5284
5285 styleEngine()->modifiedStyleSheet(sheet); 5285 styleEngine()->modifiedStyleSheet(sheet);
5286 styleResolverChanged(when, updateMode); 5286 styleResolverChanged(when, updateMode);
5287 } 5287 }
5288 5288
5289 } // namespace WebCore 5289 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/ContainerNodeAlgorithms.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698