[webkit-changes] cvs commit:
WebCore/layout-tests/dom/html/level2/core
createDocument08-expected.txt createDocumentType04-expected.txt
Darin
darin at opensource.apple.com
Mon Sep 5 15:41:37 PDT 2005
darin 05/09/05 15:41:37
Modified: . ChangeLog
khtml/xml dom_docimpl.cpp
layout-tests/dom/html/level2/core
createDocument08-expected.txt
createDocumentType04-expected.txt
Log:
Reviewed by John Sullivan.
- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4493
add qualifiedName checking for empty string
* khtml/xml/dom_docimpl.cpp:
(qualifiedNameIsValid): Added.
(qualifiedNameIsMalformed): Added.
(DOMImplementationImpl::createDocumentType): Added checks and exceptions using above functions.
(DOMImplementationImpl::createDocument): Ditto.
* layout-tests/dom/html/level2/core/createDocument08-expected.txt: Updated to expect success.
* layout-tests/dom/html/level2/core/createDocumentType04-expected.txt: Ditto.
Revision Changes Path
1.95 +16 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -r1.94 -r1.95
--- ChangeLog 5 Sep 2005 22:26:06 -0000 1.94
+++ ChangeLog 5 Sep 2005 22:41:36 -0000 1.95
@@ -1,3 +1,19 @@
+2005-09-05 Darin Adler <darin at apple.com>
+
+ Reviewed by John Sullivan.
+
+ - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4493
+ add qualifiedName checking for empty string
+
+ * khtml/xml/dom_docimpl.cpp:
+ (qualifiedNameIsValid): Added.
+ (qualifiedNameIsMalformed): Added.
+ (DOMImplementationImpl::createDocumentType): Added checks and exceptions using above functions.
+ (DOMImplementationImpl::createDocument): Ditto.
+
+ * layout-tests/dom/html/level2/core/createDocument08-expected.txt: Updated to expect success.
+ * layout-tests/dom/html/level2/core/createDocumentType04-expected.txt: Ditto.
+
2005-09-05 John Sullivan <sullivan at apple.com>
Reviewed by Dave Hyatt.
1.252 +21 -15 WebCore/khtml/xml/dom_docimpl.cpp
Index: dom_docimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_docimpl.cpp,v
retrieving revision 1.251
retrieving revision 1.252
diff -u -r1.251 -r1.252
--- dom_docimpl.cpp 2 Sep 2005 00:19:29 -0000 1.251
+++ dom_docimpl.cpp 5 Sep 2005 22:41:36 -0000 1.252
@@ -106,6 +106,23 @@
DOMImplementationImpl *DOMImplementationImpl::m_instance = 0;
+static bool qualifiedNameIsValid(const DOMString &qualifiedName)
+{
+ // Not mentioned in spec: empty qualified names are not valid.
+ if (qualifiedName.isEmpty())
+ return false;
+ // FIXME: Check for illegal characters.
+ // FIXME: Merge/reconcile with DocumentImpl::isValidName.
+ return true;
+}
+
+static bool qualifiedNameIsMalformed(const DOMString &qualifiedName)
+{
+ assert(qualifiedNameIsValid(qualifiedName));
+ // FIXME: Implement this check.
+ return false;
+}
+
DOMImplementationImpl::DOMImplementationImpl()
{
}
@@ -143,21 +160,17 @@
return 0;
}
-#if 0
- // FIXME: Add these checks (but not in a way that depends on the C++ DOM!)
-
// INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character.
- if (!Element::khtmlValidQualifiedName(qualifiedName)) {
+ if (!qualifiedNameIsValid(qualifiedName)) {
exceptioncode = DOMException::INVALID_CHARACTER_ERR;
return 0;
}
// NAMESPACE_ERR: Raised if the qualifiedName is malformed.
- if (Element::khtmlMalformedQualifiedName(qualifiedName)) {
+ if (qualifiedNameIsMalformed(qualifiedName)) {
exceptioncode = DOMException::NAMESPACE_ERR;
return 0;
}
-#endif
return new DocumentTypeImpl(this,DocumentPtr::nullDocumentPtr(),qualifiedName,publicId,systemId);
}
@@ -179,14 +192,11 @@
return 0;
}
-#if 0
- // FIXME: Add this check (but not in a way that depends on the C++ DOM!)
// INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character.
- if (!Element::khtmlValidQualifiedName(qualifiedName)) {
+ if (!qualifiedNameIsValid(qualifiedName)) {
exceptioncode = DOMException::INVALID_CHARACTER_ERR;
return 0;
}
-#endif
// NAMESPACE_ERR:
// - Raised if the qualifiedName is malformed,
@@ -201,11 +211,7 @@
colonpos = i;
}
- if (
-#if 0
- // FIXME: Add this check (but not in a way that depends on the C++ DOM!)
- Element::khtmlMalformedQualifiedName(qualifiedName) ||
-#endif
+ if (qualifiedNameIsMalformed(qualifiedName) ||
(colonpos >= 0 && namespaceURI.isNull()) ||
(colonpos == 3 && qualifiedName[0] == 'x' && qualifiedName[1] == 'm' && qualifiedName[2] == 'l' &&
namespaceURI != "http://www.w3.org/XML/1998/namespace")) {
1.2 +2 -3 WebCore/layout-tests/dom/html/level2/core/createDocument08-expected.txt
Index: createDocument08-expected.txt
===================================================================
RCS file: /cvs/root/WebCore/layout-tests/dom/html/level2/core/createDocument08-expected.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- createDocument08-expected.txt 26 Jul 2005 08:35:06 -0000 1.1
+++ createDocument08-expected.txt 5 Sep 2005 22:41:37 -0000 1.2
@@ -1,3 +1,2 @@
-Test: http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument08
-Status: failure
-Detail: throw_INVALID_CHARACTER_ERR: assertTrue failed
+Test: http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument08
+Status: Success
1.2 +2 -3 WebCore/layout-tests/dom/html/level2/core/createDocumentType04-expected.txt
Index: createDocumentType04-expected.txt
===================================================================
RCS file: /cvs/root/WebCore/layout-tests/dom/html/level2/core/createDocumentType04-expected.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- createDocumentType04-expected.txt 26 Jul 2005 08:35:06 -0000 1.1
+++ createDocumentType04-expected.txt 5 Sep 2005 22:41:37 -0000 1.2
@@ -1,3 +1,2 @@
-Test: http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocumentType04
-Status: failure
-Detail: throw_INVALID_CHARACTER_ERR: assertTrue failed
+Test: http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocumentType04
+Status: Success
More information about the webkit-changes
mailing list