Changeset 177366 in webkit
- Timestamp:
- Dec 16, 2014 10:42:43 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 26 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r177364 r177366 1 2014-12-16 Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> 2 3 Document.contentType implementation 4 https://bugs.webkit.org/show_bug.cgi?id=132269 5 6 Reviewed by Darin Adler. 7 8 Chromium merge from https://codereview.chromium.org/151653004 9 10 * fast/dom/Document/clone-node-expected.txt: 11 * fast/dom/Document/clone-node.html: 12 * fast/dom/HTMLDocument/clone-node-quirks-mode-expected.txt: 13 * fast/dom/HTMLDocument/clone-node-quirks-mode.html: 14 * fast/dom/document-contentType-DOMParser-expected.txt: Added. 15 * fast/dom/document-contentType-DOMParser.html: Added. 16 * fast/dom/document-contentType-createDocument-expected.txt: Added. 17 * fast/dom/document-contentType-createDocument.html: Added. 18 * fast/dom/document-contentType-data-uri-expected.txt: Added. 19 * fast/dom/document-contentType-data-uri.html: Added. 20 * fast/xsl/xslt-contentType-expected.txt: Added. 21 * fast/xsl/xslt-contentType.html: Added. 22 * http/tests/dom/document-contentType-expected.txt: Added. 23 * http/tests/dom/document-contentType-meta-expected.txt: Added. 24 * http/tests/dom/document-contentType-meta.html: Added. 25 * http/tests/dom/document-contentType-xhr-expected.txt: Added. 26 * http/tests/dom/document-contentType-xhr.html: Added. 27 * http/tests/dom/document-contentType.html: Added. 28 * http/tests/dom/resources/dummy.css: Added. 29 (body): 30 * http/tests/dom/resources/dummy.html: Added. 31 * http/tests/dom/resources/dummy.js: Added. 32 * http/tests/dom/resources/dummy.txt: Added. 33 * http/tests/dom/resources/dummy.xml: Added. 34 * http/tests/dom/resources/send-mime-type.php: Added. 35 * http/tests/dom/resources/square20.bmp: Added. 36 * http/tests/dom/resources/square20.gif: Added. 37 * http/tests/dom/resources/square20.jpg: Added. 38 * http/tests/dom/resources/square20.png: Added. 39 * resources/js-test.js: 40 (shouldBeEqualToNumber): 41 1 42 2014-12-16 Alexey Proskuryakov <ap@apple.com> 2 43 -
trunk/LayoutTests/fast/dom/Document/clone-node-expected.txt
r160330 r177366 7 7 PASS className(doc.cloneNode(false)) is "Document" 8 8 PASS doc.cloneNode(true).documentElement.localName is "root" 9 PASS doc.cloneNode(true).contentType is "application/xml" 9 10 PASS document.cloneNode(true).compatMode is "CSS1Compat" 10 11 PASS document.cloneNode(false).URL is document.URL 11 12 PASS document.cloneNode(false).baseURI is document.baseURI 12 13 PASS document.cloneNode(false).characterSet is document.characterSet 14 PASS document.cloneNode(true).contentType is "text/html" 13 15 PASS successfullyParsed is true 14 16 -
trunk/LayoutTests/fast/dom/Document/clone-node.html
r160330 r177366 15 15 shouldBeEqualToString('className(doc.cloneNode(false))', 'Document'); 16 16 shouldBeEqualToString('doc.cloneNode(true).documentElement.localName', 'root'); 17 shouldBeEqualToString('doc.cloneNode(true).contentType', 'application/xml'); 17 18 shouldBeEqualToString('document.cloneNode(true).compatMode', 'CSS1Compat'); 18 19 shouldBe('document.cloneNode(false).URL', 'document.URL'); 19 20 shouldBe('document.cloneNode(false).baseURI', 'document.baseURI'); 20 21 shouldBe('document.cloneNode(false).characterSet', 'document.characterSet'); 22 shouldBeEqualToString('document.cloneNode(true).contentType', 'text/html'); 21 23 22 24 </script> -
trunk/LayoutTests/fast/dom/HTMLDocument/clone-node-quirks-mode-expected.txt
r160330 r177366 8 8 PASS document.cloneNode(true).title is document.title 9 9 PASS document.cloneNode(true).compatMode is "BackCompat" 10 PASS document.cloneNode(true).contentType is "text/html" 10 11 PASS doc.cloneNode(false).__proto__ is HTMLDocument.prototype 11 12 PASS className(doc.cloneNode(false)) is "HTMLDocument" 12 13 PASS doc.cloneNode(true).title is doc.title 13 14 PASS doc.cloneNode(true).compatMode is "CSS1Compat" 15 PASS doc.cloneNode(true).contentType is "text/html" 14 16 PASS successfullyParsed is true 15 17 -
trunk/LayoutTests/fast/dom/HTMLDocument/clone-node-quirks-mode.html
r160330 r177366 12 12 shouldBe('document.cloneNode(true).title', 'document.title'); 13 13 shouldBeEqualToString('document.cloneNode(true).compatMode', 'BackCompat'); 14 shouldBeEqualToString('document.cloneNode(true).contentType', 'text/html'); 14 15 15 16 var doc = document.implementation.createHTMLDocument('title'); … … 18 19 shouldBe('doc.cloneNode(true).title', 'doc.title'); 19 20 shouldBeEqualToString('doc.cloneNode(true).compatMode', 'CSS1Compat'); 21 shouldBeEqualToString('doc.cloneNode(true).contentType', 'text/html'); 20 22 21 23 </script> -
trunk/LayoutTests/resources/js-test.js
r166668 r177366 421 421 if (typeof a !== "string" || typeof b !== "string") 422 422 debug("WARN: shouldBeEqualToString() expects string arguments"); 423 var unevaledString = JSON.stringify(b); 424 shouldBe(a, unevaledString); 425 } 426 427 function shouldBeEqualToNumber(a, b) 428 { 429 if (typeof a !== "string" || typeof b !== "number") 430 debug("WARN: shouldBeEqualToNumber() expects a string and a number arguments"); 423 431 var unevaledString = JSON.stringify(b); 424 432 shouldBe(a, unevaledString); -
trunk/Source/WebCore/ChangeLog
r177365 r177366 1 2014-12-16 Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> 2 3 Document.contentType implementation 4 https://bugs.webkit.org/show_bug.cgi?id=132269 5 6 Reviewed by Darin Adler. 7 8 Chromium merge from https://codereview.chromium.org/151653004 9 10 Tests: fast/dom/document-contentType-DOMParser.html 11 fast/dom/document-contentType-createDocument.html 12 fast/dom/document-contentType-data-uri.html 13 fast/xsl/xslt-contentType.html 14 http/tests/dom/document-contentType-meta.html 15 http/tests/dom/document-contentType-xhr.html 16 http/tests/dom/document-contentType.html 17 18 * dom/Document.cpp: 19 (WebCore::Document::overrideMIMEType): 20 (WebCore::Document::contentType): 21 (WebCore::Document::cloneDataFromDocument): 22 * dom/Document.h: 23 * dom/Document.idl: 24 * loader/DocumentLoader.cpp: 25 (WebCore::DocumentLoader::currentContentType): 26 * loader/DocumentLoader.h: 27 * xml/XMLHttpRequest.cpp: 28 (WebCore::XMLHttpRequest::responseXML): 29 * xml/XSLTProcessor.cpp: 30 (WebCore::XSLTProcessor::createDocumentFromSource): 31 1 32 2014-12-16 Anders Carlsson <andersca@apple.com> 2 33 -
trunk/Source/WebCore/dom/Document.cpp
r177360 r177366 1377 1377 } 1378 1378 1379 void Document::overrideMIMEType(const String& mimeType) 1380 { 1381 m_overriddenMIMEType = mimeType; 1382 } 1383 1384 String Document::contentType() const 1385 { 1386 if (!m_overriddenMIMEType.isNull()) 1387 return m_overriddenMIMEType; 1388 1389 if (DocumentLoader* documentLoader = loader()) 1390 return documentLoader->currentContentType(); 1391 1392 String mimeType = suggestedMIMEType(); 1393 if (!mimeType.isNull()) 1394 return mimeType; 1395 1396 return ASCIILiteral("application/xml"); 1397 } 1398 1379 1399 Node* Document::nodeFromPoint(const LayoutPoint& clientPoint, LayoutPoint* localPoint) 1380 1400 { … … 3217 3237 setCompatibilityMode(other.m_compatibilityMode); 3218 3238 setSecurityOrigin(other.securityOrigin()); 3239 overrideMIMEType(other.contentType()); 3219 3240 setDecoder(other.decoder()); 3220 3241 } -
trunk/Source/WebCore/dom/Document.h
r177314 r177366 466 466 String suggestedMIMEType() const; 467 467 468 void overrideMIMEType(const String&); 469 String contentType() const; 470 468 471 String contentLanguage() const { return m_contentLanguage; } 469 472 void setContentLanguage(const String&); … … 1409 1412 String m_baseTarget; 1410 1413 1414 // MIME type of the document in case it was cloned or created by XHR. 1415 String m_overriddenMIMEType; 1416 1411 1417 std::unique_ptr<DOMImplementation> m_implementation; 1412 1418 -
trunk/Source/WebCore/dom/Document.idl
r172865 r177366 105 105 [ObjCLegacyUnnamedParameters] CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element element, 106 106 [Default=Undefined] optional DOMString pseudoElement); 107 108 readonly attribute DOMString contentType; 107 109 108 110 // DOM Level 3 XPath (XPathEvaluator interface) -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r176459 r177366 1284 1284 } 1285 1285 1286 const String& DocumentLoader::currentContentType() const 1287 { 1288 return m_writer.mimeType(); 1289 } 1290 1286 1291 #if PLATFORM(IOS) 1287 1292 // FIXME: This method seems to violate the encapsulation of this class. -
trunk/Source/WebCore/loader/DocumentLoader.h
r176459 r177366 119 119 WEBCORE_EXPORT void setResponseMIMEType(const String&); 120 120 #endif 121 121 const String& currentContentType() const; 122 122 void replaceRequestURLForSameDocumentNavigation(const URL&); 123 123 bool isStopping() const { return m_isStopping; } -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r175053 r177366 207 207 208 208 if (!m_createdDocument) { 209 bool isHTML = equalIgnoringCase(responseMIMEType(), "text/html"); 209 String mimeType = responseMIMEType(); 210 bool isHTML = equalIgnoringCase(mimeType, "text/html"); 210 211 211 212 // The W3C spec requires the final MIME type to be some valid XML type, or text/html. … … 223 224 m_responseDocument->setContent(m_responseBuilder.toStringPreserveCapacity()); 224 225 m_responseDocument->setSecurityOrigin(securityOrigin()); 226 m_responseDocument->overrideMIMEType(mimeType); 227 225 228 if (!m_responseDocument->wellFormed()) 226 229 m_responseDocument = 0; -
trunk/Source/WebCore/xml/XSLTProcessor.cpp
r164254 r177366 77 77 RefPtr<Document> result; 78 78 if (sourceMIMEType == "text/plain") { 79 result = Document::create (frame, sourceIsDocument ? ownerDocument->url() : URL());79 result = Document::createXHTML(frame, sourceIsDocument ? ownerDocument->url() : URL()); 80 80 transformTextStringToXHTMLDocumentString(documentSource); 81 81 } else
Note: See TracChangeset
for help on using the changeset viewer.