Source/WebCore: Handle XHTML entities in XHTML Mobile Profile 1.1 and 1.2. We previou...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2013 20:24:51 +0000 (20:24 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2013 20:24:51 +0000 (20:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=112174
RIM PR 309038

Patch by Liam Quinn <lquinn@blackberry.com> on 2013-03-13
Reviewed by Rob Buis.
Internally reviewed by Leo Yang.

Check for the 1.1 and 1.2 doctypes alongside the 1.0 doctype.

Tests: fast/doctypes/xhtml-with-xhtmlmp11-doctype.xhtml
       fast/doctypes/xhtml-with-xhtmlmp12-doctype.xhtml

* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::externalSubsetHandler):
* xml/parser/XMLDocumentParserQt.cpp:
(WebCore::XMLDocumentParser::parseDtd):

LayoutTests: New tests to check that XHTML entities are supported in XHTML Mobile Profile 1.1 and 1.2.
https://bugs.webkit.org/show_bug.cgi?id=112174
RIM PR 309038

Patch by Liam Quinn <lquinn@blackberry.com> on 2013-03-13
Reviewed by Rob Buis.
Internally reviewed by Leo Yang.

* fast/doctypes/xhtml-with-xhtmlmp11-doctype-expected.txt: Added.
* fast/doctypes/xhtml-with-xhtmlmp11-doctype.xhtml: Added.
* fast/doctypes/xhtml-with-xhtmlmp12-doctype-expected.txt: Added.
* fast/doctypes/xhtml-with-xhtmlmp12-doctype.xhtml: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145744 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/doctypes/xhtml-with-xhtmlmp11-doctype-expected.txt [new file with mode: 0644]
LayoutTests/fast/doctypes/xhtml-with-xhtmlmp11-doctype.xhtml [new file with mode: 0644]
LayoutTests/fast/doctypes/xhtml-with-xhtmlmp12-doctype-expected.txt [new file with mode: 0644]
LayoutTests/fast/doctypes/xhtml-with-xhtmlmp12-doctype.xhtml [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
Source/WebCore/xml/parser/XMLDocumentParserQt.cpp

index c7fc7e4..a3da6dc 100644 (file)
@@ -1,3 +1,17 @@
+2013-03-13  Liam Quinn  <lquinn@blackberry.com>
+
+        New tests to check that XHTML entities are supported in XHTML Mobile Profile 1.1 and 1.2.
+        https://bugs.webkit.org/show_bug.cgi?id=112174
+        RIM PR 309038
+
+        Reviewed by Rob Buis.
+        Internally reviewed by Leo Yang.
+
+        * fast/doctypes/xhtml-with-xhtmlmp11-doctype-expected.txt: Added.
+        * fast/doctypes/xhtml-with-xhtmlmp11-doctype.xhtml: Added.
+        * fast/doctypes/xhtml-with-xhtmlmp12-doctype-expected.txt: Added.
+        * fast/doctypes/xhtml-with-xhtmlmp12-doctype.xhtml: Added.
+
 2013-03-13  Tim Horton  <timothy_horton@apple.com>
 
         Unreviewed, fix a path in TestExpectations.
diff --git a/LayoutTests/fast/doctypes/xhtml-with-xhtmlmp11-doctype-expected.txt b/LayoutTests/fast/doctypes/xhtml-with-xhtmlmp11-doctype-expected.txt
new file mode 100644 (file)
index 0000000..f63d75c
--- /dev/null
@@ -0,0 +1,3 @@
+Test that XHTML entities are recognized in documents with xhtml-mobile11 DTD.
+
+SUCCESS (unless there is clear sign of failure nearby, like a big red error box). 
diff --git a/LayoutTests/fast/doctypes/xhtml-with-xhtmlmp11-doctype.xhtml b/LayoutTests/fast/doctypes/xhtml-with-xhtmlmp11-doctype.xhtml
new file mode 100644 (file)
index 0000000..b0b2103
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.1//EN"
+"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title/>
+</head>
+<body>
+<p>Test that XHTML entities are recognized in documents with xhtml-mobile11 DTD.</p>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<p style="display:none">FAIL - not treated as XHTML.</p>
+<p>SUCCESS (unless there is clear sign of failure nearby, like a big red error box).&nbsp;</p>
+</body>
+</html>
diff --git a/LayoutTests/fast/doctypes/xhtml-with-xhtmlmp12-doctype-expected.txt b/LayoutTests/fast/doctypes/xhtml-with-xhtmlmp12-doctype-expected.txt
new file mode 100644 (file)
index 0000000..8cd8a3f
--- /dev/null
@@ -0,0 +1,3 @@
+Test that XHTML entities are recognized in documents with xhtml-mobile12 DTD.
+
+SUCCESS (unless there is clear sign of failure nearby, like a big red error box). 
diff --git a/LayoutTests/fast/doctypes/xhtml-with-xhtmlmp12-doctype.xhtml b/LayoutTests/fast/doctypes/xhtml-with-xhtmlmp12-doctype.xhtml
new file mode 100644 (file)
index 0000000..f75d603
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
+"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title/>
+</head>
+<body>
+<p>Test that XHTML entities are recognized in documents with xhtml-mobile12 DTD.</p>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<p style="display:none">FAIL - not treated as XHTML.</p>
+<p>SUCCESS (unless there is clear sign of failure nearby, like a big red error box).&nbsp;</p>
+</body>
+</html>
index ab34d00..57f58a2 100644 (file)
@@ -1,3 +1,22 @@
+2013-03-13  Liam Quinn  <lquinn@blackberry.com>
+
+        Handle XHTML entities in XHTML Mobile Profile 1.1 and 1.2. We previously only handled them in XHTML Mobile Profile 1.0.
+        https://bugs.webkit.org/show_bug.cgi?id=112174
+        RIM PR 309038
+
+        Reviewed by Rob Buis.
+        Internally reviewed by Leo Yang.
+
+        Check for the 1.1 and 1.2 doctypes alongside the 1.0 doctype.
+
+        Tests: fast/doctypes/xhtml-with-xhtmlmp11-doctype.xhtml
+               fast/doctypes/xhtml-with-xhtmlmp12-doctype.xhtml
+
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::externalSubsetHandler):
+        * xml/parser/XMLDocumentParserQt.cpp:
+        (WebCore::XMLDocumentParser::parseDtd):
+
 2013-03-13  Christophe Dumez  <ch.dumez@sisa.samsung.com>
 
         [EFL] Better error handling in NetworkStateNotifierEfl
index e5bd223..bba0c0e 100644 (file)
@@ -1291,7 +1291,9 @@ static void externalSubsetHandler(void* closure, const xmlChar*, const xmlChar*
         || (extId == "-//W3C//DTD XHTML Basic 1.0//EN")
         || (extId == "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN")
         || (extId == "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN")
-        || (extId == "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"))
+        || (extId == "-//WAPFORUM//DTD XHTML Mobile 1.0//EN")
+        || (extId == "-//WAPFORUM//DTD XHTML Mobile 1.1//EN")
+        || (extId == "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"))
         getParser(closure)->setIsXHTMLDocument(true); // controls if we replace entities or not.
 }
 
index bf8cfb9..fdd6683 100644 (file)
@@ -640,7 +640,9 @@ void XMLDocumentParser::parseDtd()
         || (publicId == QLatin1String("-//W3C//DTD XHTML Basic 1.0//EN"))
         || (publicId == QLatin1String("-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"))
         || (publicId == QLatin1String("-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"))
-        || (publicId == QLatin1String("-//WAPFORUM//DTD XHTML Mobile 1.0//EN"))
+        || (publicId == QLatin1String("-//WAPFORUM//DTD XHTML Mobile 1.0//EN")
+        || (publicId == QLatin1String("-//WAPFORUM//DTD XHTML Mobile 1.1//EN")
+        || (publicId == QLatin1String("-//WAPFORUM//DTD XHTML Mobile 1.2//EN"))
        )
         setIsXHTMLDocument(true); // controls if we replace entities or not.
     if (!m_parsingFragment)