[webkit-changes] cvs commit: WebCore/layout-tests/fast/dom
createDocumentType-expected.txt createDocumentType.html
Adele
adele at opensource.apple.com
Fri Jul 15 23:45:20 PDT 2005
adele 05/07/15 23:45:19
Modified: . ChangeLog
khtml/xml dom_docimpl.cpp dom_nodeimpl.cpp dom_nodeimpl.h
Added: layout-tests/fast/dom createDocumentType-expected.txt
createDocumentType.html
Log:
Written by Anders Carlsson <andersca at mac.com>
Reviewed by Dave Hyatt.
- Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=3653>
Test cases added:
layout-tests/fast/dom/createDocumentType.html: Added
layout-tests/fast/dom/createDocumentType-expected.txt: Added
* khtml/xml/dom_nodeimpl.cpp: (DocumentPtr::nullDocumentPtr):
* khtml/xml/dom_nodeimpl.h:
Add nullDocumentPtr() function which returns a shared DocumentPtr
object whose document always is 0.
* khtml/xml/dom_docimpl.cpp: (DOMImplementationImpl::createDocumentType):
Pass nullDocumentPtr as the document type's document.
Revision Changes Path
1.4433 +20 -1 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4432
retrieving revision 1.4433
diff -u -r1.4432 -r1.4433
--- ChangeLog 16 Jul 2005 06:17:25 -0000 1.4432
+++ ChangeLog 16 Jul 2005 06:45:15 -0000 1.4433
@@ -1,7 +1,26 @@
2005-07-15 Adele Peterson <adele at apple.com>
Written by Anders Carlsson <andersca at mac.com>
- Reviewed by Maciej.
+ Reviewed by Dave Hyatt.
+
+ - Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=3653>
+
+ Test cases added:
+ layout-tests/fast/dom/createDocumentType.html: Added
+ layout-tests/fast/dom/createDocumentType-expected.txt: Added
+
+ * khtml/xml/dom_nodeimpl.cpp: (DocumentPtr::nullDocumentPtr):
+ * khtml/xml/dom_nodeimpl.h:
+ Add nullDocumentPtr() function which returns a shared DocumentPtr
+ object whose document always is 0.
+
+ * khtml/xml/dom_docimpl.cpp: (DOMImplementationImpl::createDocumentType):
+ Pass nullDocumentPtr as the document type's document.
+
+2005-07-15 Adele Peterson <adele at apple.com>
+
+ Written by Anders Carlsson <andersca at mac.com>
+ Reviewed by Maciej Stachowiak.
- Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=3808>
1.236 +1 -1 WebCore/khtml/xml/dom_docimpl.cpp
Index: dom_docimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_docimpl.cpp,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -r1.235 -r1.236
--- dom_docimpl.cpp 14 Jul 2005 23:53:31 -0000 1.235
+++ dom_docimpl.cpp 16 Jul 2005 06:45:18 -0000 1.236
@@ -157,7 +157,7 @@
}
#endif
- return new DocumentTypeImpl(this,0,qualifiedName,publicId,systemId);
+ return new DocumentTypeImpl(this,DocumentPtr::nullDocumentPtr(),qualifiedName,publicId,systemId);
}
DOMImplementationImpl* DOMImplementationImpl::getInterface(const DOMString& /*feature*/) const
1.158 +8 -0 WebCore/khtml/xml/dom_nodeimpl.cpp
Index: dom_nodeimpl.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.cpp,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -r1.157 -r1.158
--- dom_nodeimpl.cpp 9 Jul 2005 20:19:22 -0000 1.157
+++ dom_nodeimpl.cpp 16 Jul 2005 06:45:18 -0000 1.158
@@ -593,6 +593,14 @@
return !defaultPrevented; // ### what if defaultPrevented was called before dispatchEvent?
}
+DocumentPtr *DocumentPtr::nullDocumentPtr()
+{
+ static DocumentPtr doc;
+
+ doc.ref();
+ return &doc;
+}
+
bool NodeImpl::dispatchHTMLEvent(int _id, bool canBubbleArg, bool cancelableArg)
{
int exceptioncode = 0;
1.89 +2 -0 WebCore/khtml/xml/dom_nodeimpl.h
Index: dom_nodeimpl.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.h,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -r1.88 -r1.89
--- dom_nodeimpl.h 9 Jul 2005 20:19:22 -0000 1.88
+++ dom_nodeimpl.h 16 Jul 2005 06:45:18 -0000 1.89
@@ -81,6 +81,8 @@
{
public:
DocumentImpl *document() const { return doc; }
+ static DocumentPtr *nullDocumentPtr();
+
private:
DocumentPtr() { doc = 0; }
friend class DocumentImpl;
1.1 WebCore/layout-tests/fast/dom/createDocumentType-expected.txt
Index: createDocumentType-expected.txt
===================================================================
layer at (0,0) size 800x600
RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {P} at (0,0) size 784x18
RenderText {TEXT} at (0,0) size 330x18
text run at (0,0) width 330: "The text below should say \"document type created\";"
RenderBlock {DIV} at (0,34) size 784x18
RenderText {TEXT} at (0,0) size 142x18
text run at (0,0) width 142: "document type created"
1.1 WebCore/layout-tests/fast/dom/createDocumentType.html
Index: createDocumentType.html
===================================================================
<html>
<head>
<script>
function runTests() {
var docType = document.implementation.createDocumentType("example",
"http://www.example.com/", "myDoc.dtd");
if (docType)
s = "document type created";
else
s = "document type not created";
text = document.createTextNode(s);
document.getElementById('output').appendChild(text);
}
</script>
</head>
<body onload="runTests()">
<p>
The text below should say "document type created";
</p>
<div id="output">
</div>
</body>
</html>
More information about the webkit-changes
mailing list