Diff
Modified: trunk/LayoutTests/ChangeLog (204535 => 204536)
--- trunk/LayoutTests/ChangeLog 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/ChangeLog 2016-08-16 22:56:02 UTC (rev 204536)
@@ -1,3 +1,22 @@
+2016-08-16 Chris Dumez <[email protected]>
+
+ Align isDefaultNamespace() / lookupPrefix() / lookupNamespaceURI() with the specification
+ https://bugs.webkit.org/show_bug.cgi?id=160911
+
+ Reviewed by Ryosuke Niwa.
+
+ Drop several outdated tests.
+
+ * dom/xhtml/level3/core/nodeisdefaultnamespace03-expected.txt: Removed.
+ * dom/xhtml/level3/core/nodeisdefaultnamespace03.js: Removed.
+ * dom/xhtml/level3/core/nodeisdefaultnamespace03.xhtml: Removed.
+ * dom/xhtml/level3/core/nodelookupnamespaceuri08-expected.txt: Removed.
+ * dom/xhtml/level3/core/nodelookupnamespaceuri08.js: Removed.
+ * dom/xhtml/level3/core/nodelookupnamespaceuri08.xhtml: Removed.
+ * dom/xhtml/level3/core/nodelookupnamespaceuri09-expected.txt: Removed.
+ * dom/xhtml/level3/core/nodelookupnamespaceuri09.js: Removed.
+ * dom/xhtml/level3/core/nodelookupnamespaceuri09.xhtml: Removed.
+
2016-08-15 Ada Chan <[email protected]>
Placeholder does not show the first time going into picture-in-picture on video without controls
Deleted: trunk/LayoutTests/dom/xhtml/level3/core/nodeisdefaultnamespace03-expected.txt (204535 => 204536)
--- trunk/LayoutTests/dom/xhtml/level3/core/nodeisdefaultnamespace03-expected.txt 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/dom/xhtml/level3/core/nodeisdefaultnamespace03-expected.txt 2016-08-16 22:56:02 UTC (rev 204536)
@@ -1,2 +0,0 @@
-Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodeisdefaultnamespace03
-Status Success
Deleted: trunk/LayoutTests/dom/xhtml/level3/core/nodeisdefaultnamespace03.js (204535 => 204536)
--- trunk/LayoutTests/dom/xhtml/level3/core/nodeisdefaultnamespace03.js 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/dom/xhtml/level3/core/nodeisdefaultnamespace03.js 2016-08-16 22:56:02 UTC (rev 204536)
@@ -1,115 +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/nodeisdefaultnamespace03";
- }
-
-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();
- setImplementationAttribute("namespaceAware", true);
-
- 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';
- }
-}
-
-
-/**
-*
-
-
-
- Using isDefaultNamespace on this DocumentType node with the value of the namespaceURI parameter
- as null check if the value returned is false.
-
-* @author IBM
-* @author Neil Delima
-* @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-isDefaultNamespace
-*/
-function nodeisdefaultnamespace03() {
- var success;
- if(checkInitialization(builder, "nodeisdefaultnamespace03") != null) return;
- var doc;
- var docType;
- var isDefault;
- var nullNSURI = null;
-
-
- var docRef = null;
- if (typeof(this.doc) != 'undefined') {
- docRef = this.doc;
- }
- doc = load(docRef, "doc", "hc_staff");
- docType = doc.doctype;
-
- isDefault = docType.isDefaultNamespace(nullNSURI);
- assertFalse("nodeisdefaultnamespace03",isDefault);
-
-}
-
-
-
-
-function runTest() {
- nodeisdefaultnamespace03();
-}
Deleted: trunk/LayoutTests/dom/xhtml/level3/core/nodeisdefaultnamespace03.xhtml (204535 => 204536)
--- trunk/LayoutTests/dom/xhtml/level3/core/nodeisdefaultnamespace03.xhtml 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/dom/xhtml/level3/core/nodeisdefaultnamespace03.xhtml 2016-08-16 22:56:02 UTC (rev 204536)
@@ -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 "α">
- <!ENTITY beta "β">
- <!ENTITY gamma "γ">
- <!ENTITY delta "δ">
- <!ENTITY epsilon "ε">
- <!ENTITY alpha "ζ">
- <!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">β Dallas, γ
- 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α" 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>
Deleted: trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri08-expected.txt (204535 => 204536)
--- trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri08-expected.txt 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri08-expected.txt 2016-08-16 22:56:02 UTC (rev 204536)
@@ -1,2 +0,0 @@
-Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodelookupnamespaceuri08
-Status Success
Deleted: trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri08.js (204535 => 204536)
--- trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri08.js 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri08.js 2016-08-16 22:56:02 UTC (rev 204536)
@@ -1,116 +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/nodelookupnamespaceuri08";
- }
-
-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();
- setImplementationAttribute("namespaceAware", true);
-
- 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';
- }
-}
-
-
-/**
-*
- Invoke lookupNamespaceURI on an Element node with no prefix, which has 2 namespace
- attribute declarations with and without namespace prefixes and check if the value of the prefix
- returned by using a valid prefix and an empty prefix as a parameter is a valid
- namespaceURI or null.
-
-* @author IBM
-* @author Neil Delima
-* @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-lookupNamespaceURI
-*/
-function nodelookupnamespaceuri08() {
- var success;
- if(checkInitialization(builder, "nodelookupnamespaceuri08") != null) return;
- var doc;
- var elem;
- var elemList;
- var namespaceURI;
- var namespaceURIEmpty;
-
- var docRef = null;
- if (typeof(this.doc) != 'undefined') {
- docRef = this.doc;
- }
- doc = load(docRef, "doc", "hc_staff");
- elemList = doc.getElementsByTagName("p");
- elem = elemList.item(0);
- namespaceURI = elem.lookupNamespaceURI("dmstc");
- assertEquals("nodelookupnamespaceuri08","http://www.usa.com",namespaceURI);
- namespaceURIEmpty = elem.lookupNamespaceURI("");
- assertNull("nodelookupnamespaceprefixEmpty08",namespaceURIEmpty);
-
-}
-
-
-
-
-function runTest() {
- nodelookupnamespaceuri08();
-}
Deleted: trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri08.xhtml (204535 => 204536)
--- trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri08.xhtml 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri08.xhtml 2016-08-16 22:56:02 UTC (rev 204536)
@@ -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 "α">
- <!ENTITY beta "β">
- <!ENTITY gamma "γ">
- <!ENTITY delta "δ">
- <!ENTITY epsilon "ε">
- <!ENTITY alpha "ζ">
- <!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">β Dallas, γ
- 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α" 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>
Deleted: trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri09-expected.txt (204535 => 204536)
--- trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri09-expected.txt 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri09-expected.txt 2016-08-16 22:56:02 UTC (rev 204536)
@@ -1,2 +0,0 @@
-Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodelookupnamespaceuri09
-Status Success
Deleted: trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri09.js (204535 => 204536)
--- trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri09.js 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri09.js 2016-08-16 22:56:02 UTC (rev 204536)
@@ -1,115 +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/nodelookupnamespaceuri09";
- }
-
-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();
- setImplementationAttribute("namespaceAware", true);
-
- 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';
- }
-}
-
-
-/**
-*
- Invoke lookupNamespaceURI on an Element node with no prefix, whose parent has no prefix and
- 2 namespace attribute declarations with and without namespace prefixes and check if the value of
- the namespaceURI returned by using each prefix as a parameter is valid.
-
-* @author IBM
-* @author Neil Delima
-* @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Node3-lookupNamespaceURI
-*/
-function nodelookupnamespaceuri09() {
- var success;
- if(checkInitialization(builder, "nodelookupnamespaceuri09") != null) return;
- var doc;
- var elem;
- var elemList;
- var namespaceURI;
- var namespaceURIEmpty;
-
- var docRef = null;
- if (typeof(this.doc) != 'undefined') {
- docRef = this.doc;
- }
- doc = load(docRef, "doc", "hc_staff");
- elemList = doc.getElementsByTagName("em");
- elem = elemList.item(0);
- namespaceURI = elem.lookupNamespaceURI("dmstc");
- assertEquals("nodelookupnamespaceuri09","http://www.usa.com",namespaceURI);
- namespaceURIEmpty = elem.lookupNamespaceURI("");
- assertNull("nodelookupnamespaceprefixEmpty09",namespaceURIEmpty);
-
-}
-
-
-
-
-function runTest() {
- nodelookupnamespaceuri09();
-}
Deleted: trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri09.xhtml (204535 => 204536)
--- trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri09.xhtml 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/dom/xhtml/level3/core/nodelookupnamespaceuri09.xhtml 2016-08-16 22:56:02 UTC (rev 204536)
@@ -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 "α">
- <!ENTITY beta "β">
- <!ENTITY gamma "γ">
- <!ENTITY delta "δ">
- <!ENTITY epsilon "ε">
- <!ENTITY alpha "ζ">
- <!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">β Dallas, γ
- 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α" 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 (204535 => 204536)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-08-16 22:56:02 UTC (rev 204536)
@@ -1,5 +1,16 @@
2016-08-16 Chris Dumez <[email protected]>
+ Align isDefaultNamespace() / lookupPrefix() / lookupNamespaceURI() with the specification
+ https://bugs.webkit.org/show_bug.cgi?id=160911
+
+ Reviewed by Ryosuke Niwa.
+
+ Rebaseline W3C test now that more checks are passing.
+
+ * web-platform-tests/dom/nodes/Node-lookupNamespaceURI-expected.txt:
+
+2016-08-16 Chris Dumez <[email protected]>
+
Re-sync imported/w3c/web-platform-tests/dom/ranges/Range-mutations.html with upstream
https://bugs.webkit.org/show_bug.cgi?id=160903
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-lookupNamespaceURI-expected.txt (204535 => 204536)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-lookupNamespaceURI-expected.txt 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-lookupNamespaceURI-expected.txt 2016-08-16 22:56:02 UTC (rev 204536)
@@ -5,8 +5,8 @@
PASS DocumentFragment should have null namespace, prefix ""
PASS DocumentFragment should have null namespace, prefix "foo"
PASS DocumentFragment should have null namespace, prefix "xmlns"
-FAIL DocumentFragment is in default namespace, prefix null assert_equals: expected true but got false
-FAIL DocumentFragment is in default namespace, prefix "" assert_equals: expected true but got false
+PASS DocumentFragment is in default namespace, prefix null
+PASS DocumentFragment is in default namespace, prefix ""
PASS DocumentFragment is in default namespace, prefix "foo"
PASS DocumentFragment is in default namespace, prefix "xmlns"
PASS Element should have null namespace, prefix null
@@ -14,12 +14,12 @@
PASS Element should not have namespace matching prefix with namespaceURI value
PASS Element should not have XMLNS namespace
PASS Element has namespace URI matching prefix
-FAIL Empty namespace is not default, prefix null assert_equals: expected true but got false
-FAIL Empty namespace is not default, prefix "" assert_equals: expected true but got false
+PASS Empty namespace is not default, prefix null
+PASS Empty namespace is not default, prefix ""
PASS fooNamespace is not default
PASS xmlns namespace is not default
PASS Element should have baz namespace, prefix null
-FAIL Element should have baz namespace, prefix "" assert_equals: expected (string) "bazURI" but got (object) null
+PASS Element should have baz namespace, prefix ""
PASS Element does not has namespace with xlmns prefix
PASS Element has bar namespace
PASS Empty namespace is not default on fooElem, prefix null
@@ -27,7 +27,7 @@
PASS bar namespace is not default
PASS baz namespace is default
PASS Comment should inherit baz namespace
-FAIL Comment should inherit baz namespace assert_equals: expected (string) "bazURI" but got (object) null
+PASS Comment should inherit baz namespace
PASS Comment should inherit namespace URI matching prefix
PASS Comment should inherit bar namespace
PASS For comment, empty namespace is not default, prefix null
@@ -37,7 +37,7 @@
PASS For comment, inherited bar namespace is not default
PASS For comment, inherited baz namespace is default
PASS Child element should inherit baz namespace
-FAIL Child element should have null namespace assert_equals: expected (string) "childNamespace" but got (object) null
+PASS Child element should have null namespace
PASS Child element should not have XMLNS namespace
PASS Child element has namespace URI matching prefix
PASS Empty namespace is not default for child, prefix null
@@ -48,7 +48,7 @@
PASS baz namespace is default for child
PASS childNamespace is default for child
PASS Document should have xhtml namespace, prefix null
-FAIL Document should have xhtml namespace, prefix "" assert_equals: expected (string) "http://www.w3.org/1999/xhtml" but got (object) null
+PASS Document should have xhtml namespace, prefix ""
PASS Document has no namespace URI matching prefix
PASS Document has bar namespace
PASS For document, empty namespace is not default, prefix null
Modified: trunk/Source/WebCore/ChangeLog (204535 => 204536)
--- trunk/Source/WebCore/ChangeLog 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/Source/WebCore/ChangeLog 2016-08-16 22:56:02 UTC (rev 204536)
@@ -1,3 +1,37 @@
+2016-08-16 Chris Dumez <[email protected]>
+
+ Align isDefaultNamespace() / lookupPrefix() / lookupNamespaceURI() with the specification
+ https://bugs.webkit.org/show_bug.cgi?id=160911
+
+ Reviewed by Ryosuke Niwa.
+
+ Align isDefaultNamespace() / lookupPrefix() / lookupNamespaceURI() with the specification:
+ - https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace
+ - https://dom.spec.whatwg.org/#dom-node-lookupprefix
+ - https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri
+
+ Our implementation now matches closely the text of the DOM specification
+ and we pass more W3C tests as it fixes the following bug:
+ - isDefaultNamespace(null) / isDefaultNamespace('') was not returning true for in cases
+ where the node's default namespace was null. Our implementation was returning false
+ instead of comparing the node's default namespace (in this case null) with the input
+ namespace (in this case null).
+
+ No new tests, rebaselined existing test.
+
+ * dom/Node.cpp:
+ (WebCore::locateDefaultNamespace):
+ (WebCore::Node::isDefaultNamespace):
+ (WebCore::Node::lookupNamespaceURI):
+ (WebCore::locateNamespacePrefix):
+ (WebCore::Node::lookupPrefix):
+ (WebCore::appendTextContent): Deleted.
+ (WebCore::Node::textContent): Deleted.
+ (WebCore::Node::setTextContent): Deleted.
+ * dom/Node.h:
+ * xml/NativeXPathNSResolver.cpp:
+ (WebCore::NativeXPathNSResolver::lookupNamespaceURI):
+
2016-08-15 Ada Chan <[email protected]>
Placeholder does not show the first time going into picture-in-picture on video without controls
Modified: trunk/Source/WebCore/dom/Node.cpp (204535 => 204536)
--- trunk/Source/WebCore/dom/Node.cpp 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/Source/WebCore/dom/Node.cpp 2016-08-16 22:56:02 UTC (rev 204536)
@@ -70,6 +70,7 @@
#include "TouchEvent.h"
#include "TreeScopeAdopter.h"
#include "WheelEvent.h"
+#include "XMLNSNames.h"
#include "XMLNames.h"
#include <wtf/RefCountedLeakCounter.h>
#include <wtf/SHA1.h>
@@ -1313,159 +1314,103 @@
return true;
}
-bool Node::isDefaultNamespace(const AtomicString& namespaceURIMaybeEmpty) const
+// https://dom.spec.whatwg.org/#locate-a-namespace
+static const AtomicString& locateDefaultNamespace(const Node& node, const AtomicString& prefix)
{
- const AtomicString& namespaceURI = namespaceURIMaybeEmpty.isEmpty() ? nullAtom : namespaceURIMaybeEmpty;
+ switch (node.nodeType()) {
+ case Node::ELEMENT_NODE: {
+ auto& element = downcast<Element>(node);
+ auto& namespaceURI = element.namespaceURI();
+ if (!namespaceURI.isNull() && element.prefix() == prefix)
+ return namespaceURI;
- switch (nodeType()) {
- case ELEMENT_NODE: {
- const Element& element = downcast<Element>(*this);
-
- if (element.prefix().isNull())
- return element.namespaceURI() == namespaceURI;
+ if (element.hasAttributes()) {
+ for (auto& attribute : element.attributesIterator()) {
+ if (attribute.namespaceURI() != XMLNSNames::xmlnsNamespaceURI)
+ continue;
- if (element.hasAttributes()) {
- for (const Attribute& attribute : element.attributesIterator()) {
- if (attribute.localName() == xmlnsAtom)
- return attribute.value() == namespaceURI;
+ if ((prefix.isNull() && attribute.prefix().isNull() && attribute.localName() == xmlnsAtom) || (attribute.prefix() == xmlnsAtom && attribute.localName() == prefix)) {
+ auto& result = attribute.value();
+ return result.isEmpty() ? nullAtom : result;
}
}
-
- if (auto* parent = parentElement())
- return parent->isDefaultNamespace(namespaceURI);
-
- return false;
}
- case DOCUMENT_NODE:
- if (Element* documentElement = downcast<Document>(*this).documentElement())
- return documentElement->isDefaultNamespace(namespaceURI);
- return false;
- case DOCUMENT_TYPE_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- return false;
- case ATTRIBUTE_NODE: {
- const Attr* attr = static_cast<const Attr*>(this);
- if (attr->ownerElement())
- return attr->ownerElement()->isDefaultNamespace(namespaceURI);
- return false;
- }
- default:
- if (auto* parent = parentElement())
- return parent->isDefaultNamespace(namespaceURI);
- return false;
+ auto* parent = node.parentElement();
+ return parent ? locateDefaultNamespace(*parent, prefix) : nullAtom;
}
+ case Node::DOCUMENT_NODE:
+ if (auto* documentElement = downcast<Document>(node).documentElement())
+ return locateDefaultNamespace(*documentElement, prefix);
+ return nullAtom;
+ case Node::DOCUMENT_TYPE_NODE:
+ case Node::DOCUMENT_FRAGMENT_NODE:
+ return nullAtom;
+ case Node::ATTRIBUTE_NODE:
+ if (auto* ownerElement = downcast<Attr>(node).ownerElement())
+ return locateDefaultNamespace(*ownerElement, prefix);
+ return nullAtom;
+ default:
+ if (auto* parent = node.parentElement())
+ return locateDefaultNamespace(*parent, prefix);
+ return nullAtom;
+ }
}
-String Node::lookupPrefix(const AtomicString &namespaceURI) const
+// https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace
+bool Node::isDefaultNamespace(const AtomicString& potentiallyEmptyNamespace) const
{
- // Implemented according to
- // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algorithms.html#lookupNamespacePrefixAlgo
-
- if (namespaceURI.isEmpty())
- return String();
-
- switch (nodeType()) {
- case ELEMENT_NODE:
- return lookupNamespacePrefix(namespaceURI, static_cast<const Element *>(this));
- case DOCUMENT_NODE:
- if (Element* documentElement = downcast<Document>(*this).documentElement())
- return documentElement->lookupPrefix(namespaceURI);
- return String();
- case DOCUMENT_FRAGMENT_NODE:
- case DOCUMENT_TYPE_NODE:
- return String();
- case ATTRIBUTE_NODE: {
- const Attr *attr = static_cast<const Attr *>(this);
- if (attr->ownerElement())
- return attr->ownerElement()->lookupPrefix(namespaceURI);
- return String();
- }
- default:
- if (auto* parent = parentElement())
- return parent->lookupPrefix(namespaceURI);
- return String();
- }
+ const AtomicString& namespaceURI = potentiallyEmptyNamespace.isEmpty() ? nullAtom : potentiallyEmptyNamespace;
+ return locateDefaultNamespace(*this, nullAtom) == namespaceURI;
}
-String Node::lookupNamespaceURI(const String &prefix) const
+// https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri
+const AtomicString& Node::lookupNamespaceURI(const AtomicString& potentiallyEmptyPrefix) const
{
- // Implemented according to
- // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algorithms.html#lookupNamespaceURIAlgo
-
- if (!prefix.isNull() && prefix.isEmpty())
- return String();
-
- switch (nodeType()) {
- case ELEMENT_NODE: {
- const Element *elem = static_cast<const Element *>(this);
-
- if (!elem->namespaceURI().isNull() && elem->prefix() == prefix)
- return elem->namespaceURI();
-
- if (elem->hasAttributes()) {
- for (const Attribute& attribute : elem->attributesIterator()) {
-
- if (attribute.prefix() == xmlnsAtom && attribute.localName() == prefix) {
- if (!attribute.value().isEmpty())
- return attribute.value();
-
- return String();
- }
- if (attribute.localName() == xmlnsAtom && prefix.isNull()) {
- if (!attribute.value().isEmpty())
- return attribute.value();
-
- return String();
- }
- }
- }
- if (auto* parent = parentElement())
- return parent->lookupNamespaceURI(prefix);
- return String();
+ const AtomicString& prefix = potentiallyEmptyPrefix.isEmpty() ? nullAtom : potentiallyEmptyPrefix;
+ return locateDefaultNamespace(*this, prefix);
+}
+
+// https://dom.spec.whatwg.org/#locate-a-namespace-prefix
+static const AtomicString& locateNamespacePrefix(const Element& element, const AtomicString& namespaceURI)
+{
+ if (element.namespaceURI() == namespaceURI)
+ return element.prefix();
+
+ if (element.hasAttributes()) {
+ for (auto& attribute : element.attributesIterator()) {
+ if (attribute.prefix() == xmlnsAtom && attribute.value() == namespaceURI)
+ return attribute.localName();
}
- case DOCUMENT_NODE:
- if (Element* documentElement = downcast<Document>(*this).documentElement())
- return documentElement->lookupNamespaceURI(prefix);
- return String();
- case DOCUMENT_TYPE_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- return String();
- case ATTRIBUTE_NODE: {
- const Attr *attr = static_cast<const Attr *>(this);
-
- if (attr->ownerElement())
- return attr->ownerElement()->lookupNamespaceURI(prefix);
- else
- return String();
- }
- default:
- if (auto* parent = parentElement())
- return parent->lookupNamespaceURI(prefix);
- return String();
}
+ auto* parent = element.parentElement();
+ return parent ? locateNamespacePrefix(*parent, namespaceURI) : nullAtom;
}
-String Node::lookupNamespacePrefix(const AtomicString &_namespaceURI, const Element *originalElement) const
+// https://dom.spec.whatwg.org/#dom-node-lookupprefix
+const AtomicString& Node::lookupPrefix(const AtomicString& namespaceURI) const
{
- if (_namespaceURI.isNull())
- return String();
-
- if (originalElement->lookupNamespaceURI(prefix()) == _namespaceURI)
- return prefix();
+ if (namespaceURI.isEmpty())
+ return nullAtom;
- ASSERT(is<Element>(*this));
- const Element& thisElement = downcast<Element>(*this);
- if (thisElement.hasAttributes()) {
- for (const Attribute& attribute : thisElement.attributesIterator()) {
- if (attribute.prefix() == xmlnsAtom && attribute.value() == _namespaceURI
- && originalElement->lookupNamespaceURI(attribute.localName()) == _namespaceURI)
- return attribute.localName();
- }
+ switch (nodeType()) {
+ case ELEMENT_NODE:
+ return locateNamespacePrefix(downcast<Element>(*this), namespaceURI);
+ case DOCUMENT_NODE:
+ if (auto* documentElement = downcast<Document>(*this).documentElement())
+ return locateNamespacePrefix(*documentElement, namespaceURI);
+ return nullAtom;
+ case DOCUMENT_FRAGMENT_NODE:
+ case DOCUMENT_TYPE_NODE:
+ return nullAtom;
+ case ATTRIBUTE_NODE:
+ if (auto* ownerElement = downcast<Attr>(*this).ownerElement())
+ return locateNamespacePrefix(*ownerElement, namespaceURI);
+ return nullAtom;
+ default:
+ if (auto* parent = parentElement())
+ return locateNamespacePrefix(*parent, namespaceURI);
+ return nullAtom;
}
-
- if (auto* parent = parentElement())
- return parent->lookupNamespacePrefix(_namespaceURI, originalElement);
- return String();
}
static void appendTextContent(const Node* node, bool convertBRsToNewlines, bool& isNullString, StringBuilder& content)
Modified: trunk/Source/WebCore/dom/Node.h (204535 => 204536)
--- trunk/Source/WebCore/dom/Node.h 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/Source/WebCore/dom/Node.h 2016-08-16 22:56:02 UTC (rev 204536)
@@ -192,9 +192,8 @@
bool isSameNode(Node* other) const { return this == other; }
bool isEqualNode(Node*) const;
bool isDefaultNamespace(const AtomicString& namespaceURI) const;
- String lookupPrefix(const AtomicString& namespaceURI) const;
- String lookupNamespaceURI(const String& prefix) const;
- String lookupNamespacePrefix(const AtomicString& namespaceURI, const Element* originalElement) const;
+ const AtomicString& lookupPrefix(const AtomicString& namespaceURI) const;
+ const AtomicString& lookupNamespaceURI(const AtomicString& prefix) const;
WEBCORE_EXPORT String textContent(bool convertBRsToNewlines = false) const;
WEBCORE_EXPORT void setTextContent(const String&, ExceptionCode&);
Modified: trunk/Source/WebCore/xml/NativeXPathNSResolver.cpp (204535 => 204536)
--- trunk/Source/WebCore/xml/NativeXPathNSResolver.cpp 2016-08-16 22:51:27 UTC (rev 204535)
+++ trunk/Source/WebCore/xml/NativeXPathNSResolver.cpp 2016-08-16 22:56:02 UTC (rev 204536)
@@ -48,7 +48,7 @@
if (prefix == "xml")
return XMLNames::xmlNamespaceURI;
- return m_node ? m_node->lookupNamespaceURI(prefix) : String();
+ return m_node ? m_node->lookupNamespaceURI(prefix).string() : String();
}
} // namespace WebCore