Document.contentType implementation
https://bugs.webkit.org/show_bug.cgi?id=132269
Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-12-16
Reviewed by Darin Adler.
Chromium merge from https://codereview.chromium.org/151653004
Source/WebCore:
Tests: fast/dom/document-contentType-DOMParser.html
fast/dom/document-contentType-createDocument.html
fast/dom/document-contentType-data-uri.html
fast/xsl/xslt-contentType.html
http/tests/dom/document-contentType-meta.html
http/tests/dom/document-contentType-xhr.html
http/tests/dom/document-contentType.html
* dom/Document.cpp:
(WebCore::Document::overrideMIMEType):
(WebCore::Document::contentType):
(WebCore::Document::cloneDataFromDocument):
* dom/Document.h:
* dom/Document.idl:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::currentContentType):
* loader/DocumentLoader.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseXML):
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource):
LayoutTests:
* fast/dom/Document/clone-node-expected.txt:
* fast/dom/Document/clone-node.html:
* fast/dom/HTMLDocument/clone-node-quirks-mode-expected.txt:
* fast/dom/HTMLDocument/clone-node-quirks-mode.html:
* fast/dom/document-contentType-DOMParser-expected.txt: Added.
* fast/dom/document-contentType-DOMParser.html: Added.
* fast/dom/document-contentType-createDocument-expected.txt: Added.
* fast/dom/document-contentType-createDocument.html: Added.
* fast/dom/document-contentType-data-uri-expected.txt: Added.
* fast/dom/document-contentType-data-uri.html: Added.
* fast/xsl/xslt-contentType-expected.txt: Added.
* fast/xsl/xslt-contentType.html: Added.
* http/tests/dom/document-contentType-expected.txt: Added.
* http/tests/dom/document-contentType-meta-expected.txt: Added.
* http/tests/dom/document-contentType-meta.html: Added.
* http/tests/dom/document-contentType-xhr-expected.txt: Added.
* http/tests/dom/document-contentType-xhr.html: Added.
* http/tests/dom/document-contentType.html: Added.
* http/tests/dom/resources/dummy.css: Added.
(body):
* http/tests/dom/resources/dummy.html: Added.
* http/tests/dom/resources/dummy.js: Added.
* http/tests/dom/resources/dummy.txt: Added.
* http/tests/dom/resources/dummy.xml: Added.
* http/tests/dom/resources/send-mime-type.php: Added.
* http/tests/dom/resources/square20.bmp: Added.
* http/tests/dom/resources/square20.gif: Added.
* http/tests/dom/resources/square20.jpg: Added.
* http/tests/dom/resources/square20.png: Added.
* resources/js-test.js:
(shouldBeEqualToNumber):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/resources/js-test.js b/LayoutTests/resources/js-test.js
index 787f31d..76f8816 100644
--- a/LayoutTests/resources/js-test.js
+++ b/LayoutTests/resources/js-test.js
@@ -424,6 +424,14 @@
shouldBe(a, unevaledString);
}
+function shouldBeEqualToNumber(a, b)
+{
+ if (typeof a !== "string" || typeof b !== "number")
+ debug("WARN: shouldBeEqualToNumber() expects a string and a number arguments");
+ var unevaledString = JSON.stringify(b);
+ shouldBe(a, unevaledString);
+}
+
function shouldBeEmptyString(a) { shouldBeEqualToString(a, ""); }
function shouldEvaluateTo(actual, expected) {