OLD | NEW |
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 Loading... |
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 RefPtrWillBeRawPtr<DocumentFragment> fragment = element->document().createDo
cumentFragment(); | 673 RefPtr<DocumentFragment> fragment = element->document().createDocumentFragme
nt(); |
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 Loading... |
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 |
OLD | NEW |