Reviewed by Ken.
authorkdecker <kdecker@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Dec 2004 16:29:28 +0000 (16:29 +0000)
committerkdecker <kdecker@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Dec 2004 16:29:28 +0000 (16:29 +0000)
Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs

        * khtml/xml/xml_tokenizer.cpp:
        (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/xml/xml_tokenizer.cpp

index aacb19f76d9e3aa3b39b7e833d8630fe6fa23bfa..2c8ee923b1a06f06036373be16527acbbf853b1d 100644 (file)
@@ -1,3 +1,12 @@
+2004-12-17  Kevin Decker  <kdecker@apple.com>
+
+        Reviewed by Ken.
+
+       Fixed <rdar://problem/3824438> Need a clean way for Dashboard to detect when an XML parsing error occurs
+
+        * khtml/xml/xml_tokenizer.cpp:
+        (khtml::XMLTokenizer::insertErrorMessageBlock): In the xml error report, instead of a generic <div>, use <parsererror> to match Mozilla.
+
 2004-12-16  Ken Kocienda  <kocienda@apple.com>
 
         Reviewed by Chris
index f16d528785c284eec0a0a0d02bdc89d7a969387c..199a790806f6028788499be88549e23fc452cfe0 100644 (file)
@@ -611,29 +611,29 @@ void XMLTokenizer::insertErrorMessageBlock()
         root = body;
     }
 
-    ElementImpl* reportDiv = doc->createElementNS(XHTML_NAMESPACE, "div", exceptioncode);
-    reportDiv->setAttribute(ATTR_STYLE, "white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black");
+    ElementImpl* reportElement = doc->createElementNS(XHTML_NAMESPACE, "parsererror", exceptioncode);
+    reportElement->setAttribute(ATTR_STYLE, "white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black");
     ElementImpl* h3 = doc->createElementNS(XHTML_NAMESPACE, "h3", exceptioncode);
     h3->appendChild(doc->createTextNode("This page contains the following errors:"), exceptioncode);
-    reportDiv->appendChild(h3, exceptioncode);
+    reportElement->appendChild(h3, exceptioncode);
     ElementImpl* fixed = doc->createElementNS(XHTML_NAMESPACE, "div", exceptioncode);
     fixed->setAttribute(ATTR_STYLE, "font-family:monospace;font-size:12px");
     NodeImpl* textNode = doc->createTextNode(m_errorMessages);
     fixed->appendChild(textNode, exceptioncode);
-    reportDiv->appendChild(fixed, exceptioncode);
+    reportElement->appendChild(fixed, exceptioncode);
     h3 = doc->createElementNS(XHTML_NAMESPACE, "h3", exceptioncode);
-    reportDiv->appendChild(h3, exceptioncode);
+    reportElement->appendChild(h3, exceptioncode);
     
     h3->appendChild(doc->createTextNode("Below is a rendering of the page up to the first error."), exceptioncode);
 #ifdef KHTML_XSLT
     if (doc->transformSourceDocument()) {
         ElementImpl* par = doc->createElementNS(XHTML_NAMESPACE, "p", exceptioncode);
-        reportDiv->appendChild(par, exceptioncode);
+        reportElement->appendChild(par, exceptioncode);
         par->setAttribute(ATTR_STYLE, "white-space: normal");
         par->appendChild(doc->createTextNode("This document was created as the result of an XSL transformation. The line and column numbers given are from the transformed result."), exceptioncode);
     }
 #endif
-    root->insertBefore(reportDiv, root->firstChild(), exceptioncode);
+    root->insertBefore(reportElement, root->firstChild(), exceptioncode);
 
     doc->updateRendering();
 }