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

Side by Side Diff: Source/core/inspector/InspectorDOMAgent.cpp

Issue 289273002: Oilpan: make DocumentFragment a heap allocated object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + add WillBeGarbageCollected FIXME. 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/inspector/DOMPatchSupport.cpp ('k') | Source/core/page/DragController.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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 m_domEditor->setAttribute(element, name, value, errorString); 663 m_domEditor->setAttribute(element, name, value, errorString);
664 } 664 }
665 665
666 void InspectorDOMAgent::setAttributesAsText(ErrorString* errorString, int elemen tId, const String& text, const String* const name) 666 void InspectorDOMAgent::setAttributesAsText(ErrorString* errorString, int elemen tId, const String& text, const String* const name)
667 { 667 {
668 Element* element = assertEditableElement(errorString, elementId); 668 Element* element = assertEditableElement(errorString, elementId);
669 if (!element) 669 if (!element)
670 return; 670 return;
671 671
672 String markup = "<span " + text + "></span>"; 672 String markup = "<span " + text + "></span>";
673 RefPtr<DocumentFragment> fragment = element->document().createDocumentFragme nt(); 673 RefPtrWillBeRawPtr<DocumentFragment> fragment = element->document().createDo cumentFragment();
674 674
675 bool shouldIgnoreCase = element->document().isHTMLDocument() && element->isH TMLElement(); 675 bool shouldIgnoreCase = element->document().isHTMLDocument() && element->isH TMLElement();
676 // Not all elements can represent the context (i.e. IFRAME), hence using doc ument.body. 676 // Not all elements can represent the context (i.e. IFRAME), hence using doc ument.body.
677 if (shouldIgnoreCase && element->document().body()) 677 if (shouldIgnoreCase && element->document().body())
678 fragment->parseHTML(markup, element->document().body(), AllowScriptingCo ntent); 678 fragment->parseHTML(markup, element->document().body(), AllowScriptingCo ntent);
679 else 679 else
680 fragment->parseXML(markup, 0, AllowScriptingContent); 680 fragment->parseXML(markup, 0, AllowScriptingContent);
681 681
682 Element* parsedElement = fragment->firstChild() && fragment->firstChild()->i sElementNode() ? toElement(fragment->firstChild()) : 0; 682 Element* parsedElement = fragment->firstChild() && fragment->firstChild()->i sElementNode() ? toElement(fragment->firstChild()) : 0;
683 if (!parsedElement) { 683 if (!parsedElement) {
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 if (!m_documentNodeToIdMap.contains(m_document)) { 2063 if (!m_documentNodeToIdMap.contains(m_document)) {
2064 RefPtr<TypeBuilder::DOM::Node> root; 2064 RefPtr<TypeBuilder::DOM::Node> root;
2065 getDocument(errorString, root); 2065 getDocument(errorString, root);
2066 return errorString->isEmpty(); 2066 return errorString->isEmpty();
2067 } 2067 }
2068 return true; 2068 return true;
2069 } 2069 }
2070 2070
2071 } // namespace WebCore 2071 } // namespace WebCore
2072 2072
OLDNEW
« no previous file with comments | « Source/core/inspector/DOMPatchSupport.cpp ('k') | Source/core/page/DragController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698