Title: [195336] trunk
Revision
195336
Author
[email protected]
Date
2016-01-19 20:06:27 -0800 (Tue, 19 Jan 2016)

Log Message

DocumentType.publicId / systemId should never return null
https://bugs.webkit.org/show_bug.cgi?id=153264

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C DOM tests now that more checks are passing.

* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/nodes/DOMImplementation-createHTMLDocument-expected.txt:
* web-platform-tests/dom/nodes/Node-properties-expected.txt:

Source/WebCore:

DocumentType.publicId / systemId should never return null as these
attributes are not nullable in the IDL:
https://dom.spec.whatwg.org/#interface-documenttype

Instead we should return the empty string. Firefox and Chrome match the
specification.

No new tests, already covered by existing tests.

* dom/DocumentType.idl:

LayoutTests:

Drop outdated DOM test.

* dom/xhtml/level3/core/documentgetdoctype01-expected.txt: Removed.
* dom/xhtml/level3/core/documentgetdoctype01.js: Removed.
* dom/xhtml/level3/core/documentgetdoctype01.xhtml: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195335 => 195336)


--- trunk/LayoutTests/ChangeLog	2016-01-20 03:50:50 UTC (rev 195335)
+++ trunk/LayoutTests/ChangeLog	2016-01-20 04:06:27 UTC (rev 195336)
@@ -1,3 +1,16 @@
+2016-01-19  Chris Dumez  <[email protected]>
+
+        DocumentType.publicId / systemId should never return null
+        https://bugs.webkit.org/show_bug.cgi?id=153264
+
+        Reviewed by Ryosuke Niwa.
+
+        Drop outdated DOM test.
+
+        * dom/xhtml/level3/core/documentgetdoctype01-expected.txt: Removed.
+        * dom/xhtml/level3/core/documentgetdoctype01.js: Removed.
+        * dom/xhtml/level3/core/documentgetdoctype01.xhtml: Removed.
+
 2016-01-19  Brady Eidson  <[email protected]>
 
         Modern IDB: Remove unneeded "Alert: " string from storage/indexeddb/modern tests.

Deleted: trunk/LayoutTests/dom/xhtml/level3/core/documentgetdoctype01-expected.txt (195335 => 195336)


--- trunk/LayoutTests/dom/xhtml/level3/core/documentgetdoctype01-expected.txt	2016-01-20 03:50:50 UTC (rev 195335)
+++ trunk/LayoutTests/dom/xhtml/level3/core/documentgetdoctype01-expected.txt	2016-01-20 04:06:27 UTC (rev 195336)
@@ -1,2 +0,0 @@
-Test	http://www.w3.org/2001/DOM-Test-Suite/level3/core/documentgetdoctype01
-Status	Success

Deleted: trunk/LayoutTests/dom/xhtml/level3/core/documentgetdoctype01.js (195335 => 195336)


--- trunk/LayoutTests/dom/xhtml/level3/core/documentgetdoctype01.js	2016-01-20 03:50:50 UTC (rev 195335)
+++ trunk/LayoutTests/dom/xhtml/level3/core/documentgetdoctype01.js	2016-01-20 04:06:27 UTC (rev 195336)
@@ -1,143 +0,0 @@
-
-/*
-Copyright © 2001-2004 World Wide Web Consortium, 
-(Massachusetts Institute of Technology, European Research Consortium 
-for Informatics and Mathematics, Keio University). All 
-Rights Reserved. This work is distributed under the W3C® Software License [1] in the 
-hope that it will be useful, but WITHOUT ANY WARRANTY; without even 
-the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
-
-[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-*/
-
-
-
-   /**
-    *  Gets URI that identifies the test.
-    *  @return uri identifier of test
-    */
-function getTargetURI() {
-      return "http://www.w3.org/2001/DOM-Test-Suite/level3/core/documentgetdoctype01";
-   }
-
-var docsLoaded = -1000000;
-var builder = null;
-
-//
-//   This function is called by the testing framework before
-//      running the test suite.
-//
-//   If there are no configuration exceptions, asynchronous
-//        document loading is started.  Otherwise, the status
-//        is set to complete and the exception is immediately
-//        raised when entering the body of the test.
-//
-function setUpPage() {
-   setUpPageStatus = 'running';
-   try {
-     //
-     //   creates test document builder, may throw exception
-     //
-     builder = createConfiguredBuilder();
-
-      docsLoaded = 0;
-      
-      var docRef = null;
-      if (typeof(this.doc) != 'undefined') {
-        docRef = this.doc;
-      }
-      docsLoaded += preload(docRef, "doc", "hc_staff");
-        
-       if (docsLoaded == 1) {
-          setUpPageStatus = 'complete';
-       }
-    } catch(ex) {
-    	catchInitializationError(builder, ex);
-        setUpPageStatus = 'complete';
-    }
-}
-
-
-
-//
-//   This method is called on the completion of 
-//      each asychronous load started in setUpTests.
-//
-//   When every synchronous loaded document has completed,
-//      the page status is changed which allows the
-//      body of the test to be executed.
-function loadComplete() {
-    if (++docsLoaded == 1) {
-        setUpPageStatus = 'complete';
-    }
-}
-
-
-/**
-* 
-	Retreive the doctype node, create a new Doctype node, call replaceChild and try replacing the
-	docType node with a new docType node.  Check if the docType node was correctly replaced with
-	the new one.
-
-* @author IBM
-* @author Neil Delima
-* @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#ID-B63ED1A31
-* @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#ID-785887307
-*/
-function documentgetdoctype01() {
-   var success;
-    if(checkInitialization(builder, "documentgetdoctype01") != null) return;
-    var doc;
-      var docType;
-      var newDocType;
-      var replacedDocType;
-      var domImpl;
-      var newSysID;
-      var nullPubID = null;
-
-      var nullSysID = null;
-
-      var replaced;
-      var rootName;
-      
-      var docRef = null;
-      if (typeof(this.doc) != 'undefined') {
-        docRef = this.doc;
-      }
-      doc = load(docRef, "doc", "hc_staff");
-      docType = doc.doctype;
-
-      rootName = docType.name;
-
-      domImpl = doc.implementation;
-newDocType = domImpl.createDocumentType(rootName,nullPubID,nullSysID);
-      
-      try {
-      replaced = doc.replaceChild(newDocType,docType);
-      
-      } catch (ex) {
-		  if (typeof(ex.code) != 'undefined') {      
-       switch(ex.code) {
-       case /* NOT_SUPPORTED_ERR */ 9 :
-               return ;
-    default:
-          throw ex;
-          }
-       } else { 
-       throw ex;
-        }
-         }
-        replacedDocType = doc.doctype;
-
-      newSysID = replacedDocType.systemId;
-
-      assertNull("newSysIdNull",newSysID);
-    
-}
-
-
-
-
-function runTest() {
-   documentgetdoctype01();
-}

Deleted: trunk/LayoutTests/dom/xhtml/level3/core/documentgetdoctype01.xhtml (195335 => 195336)


--- trunk/LayoutTests/dom/xhtml/level3/core/documentgetdoctype01.xhtml	2016-01-20 03:50:50 UTC (rev 195335)
+++ trunk/LayoutTests/dom/xhtml/level3/core/documentgetdoctype01.xhtml	2016-01-20 04:06:27 UTC (rev 195336)
@@ -1,73 +0,0 @@
-<?xml version="1.0"?><?TEST-STYLE PIDATA?>
-<!DOCTYPE html
-   PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-   "xhtml1-strict.dtd" [
-   <!ENTITY alpha "&#945;">
-   <!ENTITY beta "&#946;">
-   <!ENTITY gamma "&#947;">
-   <!ENTITY delta "&#948;">
-   <!ENTITY epsilon "&#949;">
-   <!ENTITY alpha "&#950;">
-   <!NOTATION notation1 PUBLIC "notation1File">
-   <!NOTATION notation2 SYSTEM "notation2File">
-   <!ATTLIST p
-        dir CDATA 'rtl'
-        xmlns:dmstc CDATA #IMPLIED
-        xmlns:nm CDATA #IMPLIED
-        xmlns:emp2 CDATA #IMPLIED>
-   <!ATTLIST html
-                   xmlns:xsi CDATA #IMPLIED
-                   xsi:schemaLocation CDATA #IMPLIED>
-   <!ATTLIST acronym xsi:noNamespaceSchemaLocation CDATA #IMPLIED>
-   <!ENTITY ent4 "<span xmlns='http://www.w3.org/1999/xhtml'>Element data</span><?PItarget PIdata?>">
-   <!ATTLIST span xmlns CDATA #IMPLIED>
-]>
-<!-- This is comment number 1.-->
-<html xmlns='http://www.w3.org/1999/xhtml'
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://www.w3.org/1999/xhtml hc_staff.xsd"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>hc_staff</title><script type="text/_javascript_" src="" charset="UTF-8" type="text/_javascript_" src="" type='text/_javascript_'>function loadComplete() { startTest(); }</script></head><body _onload_="loadComplete()">
- <p xmlns:dmstc="http://www.usa.com">
-  <em>EMP0001</em>
-  <strong>Margaret Martin</strong>
-  <code>Accountant</code>
-  <sup>56,000</sup>
-  <var>Female</var>
-  <acronym title="Yes" xsi:noNamespaceSchemaLocation="Yes">1230 North Ave. Dallas, Texas 98551</acronym>
- </p>
- <p xmlns:dmstc="http://www.usa.com">
-  <em>EMP0002</em>
-  <strong>Martha Raynolds
-<![CDATA[This is a CDATASection with EntityReference number 2 &ent2;]]>
-<![CDATA[This is an adjacent CDATASection with a reference to a tab &tab;]]></strong>
-  <code>Secretary</code>
-  <sup>35,000</sup>
-  <var>Female</var>
-  <acronym title="Yes" class="Yes" xsi:noNamespaceSchemaLocation="Yes">&beta; Dallas, &gamma;
- 98554</acronym>
- </p>
- <p xmlns:dmstc="http://www.netzero.com">
-  <em>EMP0003</em>
-  <strong>Roger
- Jones</strong>
-  <code>Department Manager</code>
-  <sup>100,000</sup>
-  <var>&ent4;</var>
-  <acronym title="Yes" class="No" id="_98553" xsi:noNamespaceSchemaLocation="Yes">PO Box 27 Irving, texas 98553</acronym>
- </p>
- <p xmlns:nm="http://www.altavista.com">
-  <em>EMP0004</em>
-  <strong>Jeny Oconnor</strong>
-  <code>Personnel Director</code>
-  <sup>95,000</sup>
-  <var>Female</var>
-  <acronym title="Yes" class="Y&alpha;" id="_98556" xsi:noNamespaceSchemaLocation="Yes">27 South Road. Dallas, Texas 98556</acronym>
- </p>
- <p xmlns:emp2="http://www.nist.gov">
-  <em>EMP0005</em>
-  <strong>Robert Myers</strong>
-  <code>Computer Specialist</code>
-  <sup>90,000</sup>
-  <var>male</var>
-  <acronym title="Yes" class="Yes" xsi:noNamespaceSchemaLocation="Yes">1821 Nordic. Road, Irving Texas 98558</acronym>
- </p>
-</body></html>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (195335 => 195336)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-01-20 03:50:50 UTC (rev 195335)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-01-20 04:06:27 UTC (rev 195336)
@@ -1,5 +1,18 @@
 2016-01-19  Chris Dumez  <[email protected]>
 
+        DocumentType.publicId / systemId should never return null
+        https://bugs.webkit.org/show_bug.cgi?id=153264
+
+        Reviewed by Ryosuke Niwa.
+
+        Rebaseline several W3C DOM tests now that more checks are passing.
+
+        * web-platform-tests/dom/interfaces-expected.txt:
+        * web-platform-tests/dom/nodes/DOMImplementation-createHTMLDocument-expected.txt:
+        * web-platform-tests/dom/nodes/Node-properties-expected.txt:
+
+2016-01-19  Chris Dumez  <[email protected]>
+
         Document.createDocument() should treat undefined namespace as null
         https://bugs.webkit.org/show_bug.cgi?id=153252
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (195335 => 195336)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-01-20 03:50:50 UTC (rev 195335)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-01-20 04:06:27 UTC (rev 195336)
@@ -814,8 +814,8 @@
 PASS DocumentType must be primary interface of document.doctype 
 PASS Stringification of document.doctype 
 PASS DocumentType interface: document.doctype must inherit property "name" with the proper type (0) 
-FAIL DocumentType interface: document.doctype must inherit property "publicId" with the proper type (1) assert_equals: expected "string" but got "object"
-FAIL DocumentType interface: document.doctype must inherit property "systemId" with the proper type (2) assert_equals: expected "string" but got "object"
+PASS DocumentType interface: document.doctype must inherit property "publicId" with the proper type (1) 
+PASS DocumentType interface: document.doctype must inherit property "systemId" with the proper type (2) 
 PASS DocumentType interface: document.doctype must inherit property "before" with the proper type (3) 
 PASS DocumentType interface: calling before([object Object],[object Object]) on document.doctype with too few arguments must throw TypeError 
 PASS DocumentType interface: document.doctype must inherit property "after" with the proper type (4) 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createHTMLDocument-expected.txt (195335 => 195336)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createHTMLDocument-expected.txt	2016-01-20 03:50:50 UTC (rev 195335)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createHTMLDocument-expected.txt	2016-01-20 04:06:27 UTC (rev 195336)
@@ -1,13 +1,13 @@
 
-FAIL createHTMLDocument test 0: "","","" assert_equals: expected (string) "" but got (object) null
-FAIL createHTMLDocument test 1: null,"null","null" assert_equals: expected (string) "" but got (object) null
-FAIL createHTMLDocument test 2: undefined,undefined,"" assert_equals: expected (string) "" but got (object) null
-FAIL createHTMLDocument test 3: "foo  bar baz","foo  bar baz","foo bar baz" assert_equals: expected (string) "" but got (object) null
-FAIL createHTMLDocument test 4: "foo\t\tbar baz","foo\t\tbar baz","foo bar baz" assert_equals: expected (string) "" but got (object) null
-FAIL createHTMLDocument test 5: "foo\n\nbar baz","foo\n\nbar baz","foo bar baz" assert_equals: expected (string) "" but got (object) null
-FAIL createHTMLDocument test 6: "foo\f\fbar baz","foo\f\fbar baz","foo bar baz" assert_equals: expected (string) "" but got (object) null
-FAIL createHTMLDocument test 7: "foo\r\rbar baz","foo\r\rbar baz","foo bar baz" assert_equals: expected (string) "" but got (object) null
-FAIL Missing title argument assert_equals: expected (string) "" but got (object) null
+FAIL createHTMLDocument test 0: "","","" assert_equals: expected 1 but got 0
+PASS createHTMLDocument test 1: null,"null","null" 
+PASS createHTMLDocument test 2: undefined,undefined,"" 
+PASS createHTMLDocument test 3: "foo  bar baz","foo  bar baz","foo bar baz" 
+PASS createHTMLDocument test 4: "foo\t\tbar baz","foo\t\tbar baz","foo bar baz" 
+PASS createHTMLDocument test 5: "foo\n\nbar baz","foo\n\nbar baz","foo bar baz" 
+PASS createHTMLDocument test 6: "foo\f\fbar baz","foo\f\fbar baz","foo bar baz" 
+PASS createHTMLDocument test 7: "foo\r\rbar baz","foo\r\rbar baz","foo bar baz" 
+PASS Missing title argument 
 FAIL createHTMLDocument(): metadata assert_equals: expected "about:blank" but got ""
 FAIL createHTMLDocument(): characterSet aliases assert_equals: charset expected (string) "UTF-8" but got (undefined) undefined
 PASS createHTMLDocument(): URL parsing 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-properties-expected.txt (195335 => 195336)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-properties-expected.txt	2016-01-20 03:50:50 UTC (rev 195335)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-properties-expected.txt	2016-01-20 04:06:27 UTC (rev 195336)
@@ -531,8 +531,8 @@
 PASS doctype.previousSibling 
 PASS doctype.nextSibling 
 PASS doctype.name 
-FAIL doctype.publicId assert_equals: expected (string) "" but got (object) null
-FAIL doctype.systemId assert_equals: expected (string) "" but got (object) null
+PASS doctype.publicId 
+PASS doctype.systemId 
 PASS doctype.nodeName 
 PASS doctype.childNodes.length 
 PASS doctype.textContent 
@@ -547,8 +547,8 @@
 PASS foreignDoctype.previousSibling 
 PASS foreignDoctype.nextSibling 
 PASS foreignDoctype.name 
-FAIL foreignDoctype.publicId assert_equals: expected (string) "" but got (object) null
-FAIL foreignDoctype.systemId assert_equals: expected (string) "" but got (object) null
+PASS foreignDoctype.publicId 
+PASS foreignDoctype.systemId 
 PASS foreignDoctype.nodeName 
 PASS foreignDoctype.childNodes.length 
 PASS foreignDoctype.textContent 

Modified: trunk/Source/WebCore/ChangeLog (195335 => 195336)


--- trunk/Source/WebCore/ChangeLog	2016-01-20 03:50:50 UTC (rev 195335)
+++ trunk/Source/WebCore/ChangeLog	2016-01-20 04:06:27 UTC (rev 195336)
@@ -1,3 +1,21 @@
+2016-01-19  Chris Dumez  <[email protected]>
+
+        DocumentType.publicId / systemId should never return null
+        https://bugs.webkit.org/show_bug.cgi?id=153264
+
+        Reviewed by Ryosuke Niwa.
+
+        DocumentType.publicId / systemId should never return null as these
+        attributes are not nullable in the IDL:
+        https://dom.spec.whatwg.org/#interface-documenttype
+
+        Instead we should return the empty string. Firefox and Chrome match the
+        specification.
+
+        No new tests, already covered by existing tests.
+
+        * dom/DocumentType.idl:
+
 2016-01-19  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r195302.

Modified: trunk/Source/WebCore/dom/DocumentType.idl (195335 => 195336)


--- trunk/Source/WebCore/dom/DocumentType.idl	2016-01-20 03:50:50 UTC (rev 195335)
+++ trunk/Source/WebCore/dom/DocumentType.idl	2016-01-20 04:06:27 UTC (rev 195336)
@@ -33,9 +33,9 @@
 
     // DOM Level 2
 
-    [TreatReturnedNullStringAs=Null] readonly attribute DOMString publicId;
-    [TreatReturnedNullStringAs=Null] readonly attribute DOMString systemId;
-    [TreatReturnedNullStringAs=Null] readonly attribute DOMString internalSubset;        
+    readonly attribute DOMString publicId;
+    readonly attribute DOMString systemId;
+    [TreatReturnedNullStringAs=Null] readonly attribute DOMString internalSubset;
 };
 
 DocumentType implements ChildNode;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to