Changeset 33577
- Timestamp:
- 2008-05-19 12:12:55 (6 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 20 modified
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/xmlhttprequest/serialize-document-expected.txt (added)
-
LayoutTests/http/tests/xmlhttprequest/serialize-document.html (added)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/bindings/js/JSXMLHttpRequestCustom.cpp (modified) (2 diffs)
-
WebCore/dom/Attr.cpp (modified) (1 diff)
-
WebCore/dom/Attr.h (modified) (1 diff)
-
WebCore/dom/Document.cpp (modified) (1 diff)
-
WebCore/dom/Document.h (modified) (1 diff)
-
WebCore/dom/DocumentFragment.cpp (modified) (1 diff)
-
WebCore/dom/DocumentFragment.h (modified) (1 diff)
-
WebCore/dom/Element.cpp (modified) (1 diff)
-
WebCore/dom/Element.h (modified) (1 diff)
-
WebCore/dom/Entity.cpp (modified) (1 diff)
-
WebCore/dom/Entity.h (modified) (1 diff)
-
WebCore/dom/EntityReference.cpp (modified) (1 diff)
-
WebCore/dom/EntityReference.h (modified) (1 diff)
-
WebCore/dom/Node.h (modified) (1 diff)
-
WebCore/dom/Text.cpp (modified) (1 diff)
-
WebCore/dom/Text.h (modified) (1 diff)
-
WebCore/html/HTMLElement.cpp (modified) (1 diff)
-
WebCore/html/HTMLElement.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r33567 r33577 1 2008-05-19 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Darin. 4 5 https://bugs.webkit.org/show_bug.cgi?id=18421 6 <rdar://problem/5857369> XMLHttpRequest does not properly encode & and < in outgoing messages 7 8 * http/tests/xmlhttprequest/serialize-document-expected.txt: Added. 9 * http/tests/xmlhttprequest/serialize-document.html: Added. 10 1 11 2008-05-18 Darin Adler <darin@apple.com> 2 12 -
trunk/WebCore/ChangeLog
r33576 r33577 1 2008-05-19 Alexey Proskuryakov <ap@webkit.org> 2 3 Reviewed by Darin. 4 5 https://bugs.webkit.org/show_bug.cgi?id=18421 6 <rdar://problem/5857369> XMLHttpRequest does not properly encode & and < in outgoing messages 7 8 Test: http/tests/xmlhttprequest/serialize-document.html 9 10 * bindings/js/JSXMLHttpRequestCustom.cpp: 11 (WebCore::JSXMLHttpRequest::send): Use createMarkup() instead of Document::toString(). 12 13 * dom/Attr.cpp: 14 * dom/Attr.h: 15 * dom/Document.cpp: 16 * dom/Document.h: 17 * dom/DocumentFragment.cpp: 18 * dom/DocumentFragment.h: 19 * dom/Element.cpp: 20 * dom/Element.h: 21 * dom/Entity.cpp: 22 * dom/Entity.h: 23 * dom/EntityReference.cpp: 24 * dom/EntityReference.h: 25 * dom/Node.h: 26 * dom/Text.cpp: 27 * dom/Text.h: 28 * html/HTMLElement.cpp: 29 * html/HTMLElement.h: 30 Removed most Node::toString() methods, which were massively wrong, and only used for 31 XMLHttpRequest::send(). The remanining ones are still used in markup.cpp, but should probably 32 be folded into it for consistency. 33 1 34 2008-05-19 Anders Carlsson <andersca@apple.com> 2 35 -
trunk/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
r33038 r33577 41 41 #include "JSEvent.h" 42 42 #include "kjs_events.h" 43 #include "markup.h" 43 44 44 45 using namespace KJS; … … 167 168 if (args.size() >= 1) { 168 169 if (args[0]->toObject(exec)->inherits(&JSDocument::s_info)) 169 body = static_cast<Document*>(static_cast<JSDocument*>(args[0]->toObject(exec))->impl())->toString();170 body = createMarkup(static_cast<Document*>(static_cast<JSDocument*>(args[0]->toObject(exec))->impl())); 170 171 else { 171 172 // converting certain values (like null) to object can set an exception -
trunk/WebCore/dom/Attr.cpp
r33442 r33577 169 169 } 170 170 171 String Attr::toString() const172 {173 String result;174 175 result += nodeName();176 177 // FIXME: substitute entities for any instances of " or ' --178 // maybe easier to just use text value and ignore existing179 // entity refs?180 181 if (firstChild() != NULL) {182 result += "=\"";183 184 for (Node *child = firstChild(); child != NULL; child = child->nextSibling()) {185 result += child->toString();186 }187 188 result += "\"";189 }190 191 return result;192 171 } 193 194 } -
trunk/WebCore/dom/Attr.h
r30633 r33577 79 79 80 80 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0); 81 virtual String toString() const;82 81 83 82 Attribute* attr() const { return m_attribute.get(); } -
trunk/WebCore/dom/Document.cpp
r33538 r33577 3077 3077 } 3078 3078 3079 String Document::toString() const3080 {3081 String result;3082 3083 for (Node *child = firstChild(); child != NULL; child = child->nextSibling()) {3084 result += child->toString();3085 }3086 3087 return result;3088 }3089 3090 3079 // Support for Javascript execCommand, and related methods 3091 3080 -
trunk/WebCore/dom/Document.h
r33538 r33577 637 637 HTMLHeadElement* head(); 638 638 639 String toString() const;640 641 639 bool execCommand(const String& command, bool userInterface = false, const String& value = String()); 642 640 bool queryCommandEnabled(const String& command); -
trunk/WebCore/dom/DocumentFragment.cpp
r25754 r33577 59 59 } 60 60 61 String DocumentFragment::toString() const62 {63 String result;64 for (Node *child = firstChild(); child != NULL; child = child->nextSibling())65 result += child->toString();66 return result;67 }68 69 61 PassRefPtr<Node> DocumentFragment::cloneNode(bool deep) 70 62 { -
trunk/WebCore/dom/DocumentFragment.h
r25754 r33577 40 40 virtual PassRefPtr<Node> cloneNode(bool deep); 41 41 virtual bool childTypeAllowed(NodeType); 42 virtual String toString() const;43 42 }; 44 43 -
trunk/WebCore/dom/Element.cpp
r33510 r33577 998 998 } 999 999 1000 String Element::toString() const1001 {1002 String result = openTagStartToString();1003 1004 if (hasChildNodes()) {1005 result += ">";1006 1007 for (Node *child = firstChild(); child != NULL; child = child->nextSibling()) {1008 result += child->toString();1009 }1010 1011 result += "</";1012 result += nodeName();1013 result += ">";1014 } else {1015 result += " />";1016 }1017 1018 return result;1019 }1020 1021 1000 void Element::updateId(const AtomicString& oldId, const AtomicString& newId) 1022 1001 { -
trunk/WebCore/dom/Element.h
r33510 r33577 157 157 virtual void accessKeyAction(bool sendToAnyEvent) { } 158 158 159 virtual String toString() const;160 161 159 virtual bool isURLAttribute(Attribute*) const; 162 160 virtual const QualifiedName& imageSourceAttributeName() const; -
trunk/WebCore/dom/Entity.cpp
r25754 r33577 77 77 } 78 78 79 String Entity::toString() const80 {81 String result = "<!ENTITY' ";82 83 if (!m_name.isEmpty()) {84 result += " ";85 result += m_name;86 }87 88 if (!m_publicId.isEmpty()) {89 result += " PUBLIC \"";90 result += m_publicId;91 result += "\" \"";92 result += m_systemId;93 result += "\"";94 } else if (!m_systemId.isEmpty()) {95 result += " SYSTEM \"";96 result += m_systemId;97 result += "\"";98 }99 100 if (!m_notationName.isEmpty()) {101 result += " NDATA ";102 result += m_notationName;103 }104 105 result += ">";106 107 return result;108 }109 110 79 } // namespace -
trunk/WebCore/dom/Entity.h
r25754 r33577 45 45 virtual PassRefPtr<Node> cloneNode(bool deep); 46 46 virtual bool childTypeAllowed(NodeType); 47 virtual String toString() const;48 47 49 48 private: -
trunk/WebCore/dom/EntityReference.cpp
r25754 r33577 73 73 } 74 74 75 String EntityReference::toString() const76 {77 String result = "&";78 result += m_entityName;79 result += ";";80 81 return result;82 }83 84 75 } // namespace -
trunk/WebCore/dom/EntityReference.h
r25754 r33577 39 39 virtual PassRefPtr<Node> cloneNode(bool deep); 40 40 virtual bool childTypeAllowed(NodeType); 41 virtual String toString() const;42 41 43 42 private: -
trunk/WebCore/dom/Node.h
r32664 r33577 439 439 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0) {}; 440 440 441 virtual String toString() const = 0;442 443 441 #ifndef NDEBUG 444 442 virtual void formatForDebugger(char* buffer, unsigned length) const; -
trunk/WebCore/dom/Text.cpp
r31075 r33577 274 274 } 275 275 276 String Text::toString() const277 {278 return nodeValue();279 }280 281 276 PassRefPtr<Text> Text::createWithLengthLimit(Document* doc, const String& text, unsigned& charsLeft, unsigned maxChars) 282 277 { -
trunk/WebCore/dom/Text.h
r30097 r33577 59 59 virtual bool childTypeAllowed(NodeType); 60 60 61 virtual String toString() const;62 63 61 static PassRefPtr<Text> createWithLengthLimit(Document*, const String&, unsigned& charsLeft, unsigned maxChars = cTextNodeLengthLimit); 64 62 -
trunk/WebCore/html/HTMLElement.cpp
r33524 r33577 640 640 } 641 641 642 String HTMLElement::toString() const643 {644 if (!hasChildNodes() && document()->isHTMLDocument()) {645 String result = openTagStartToString();646 result += ">";647 648 if (endTagRequirement() == TagStatusRequired) {649 result += "</";650 result += nodeName();651 result += ">";652 }653 654 return result;655 }656 657 return Element::toString();658 }659 660 642 String HTMLElement::id() const 661 643 { -
trunk/WebCore/html/HTMLElement.h
r32664 r33577 84 84 virtual bool isGenericFormElement() const { return false; } 85 85 86 virtual String toString() const;87 88 86 virtual HTMLTagStatus endTagRequirement() const; 89 87 virtual int tagPriority() const;