mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1236329. Back out the patch for bug 492933 (revision d8012b35413b) because it's not web-compatible in practice. r=smaug
This commit is contained in:
parent
62802f2dd0
commit
4229aa8e05
@ -37,7 +37,6 @@
|
||||
#include "mozilla/dom/WindowBinding.h"
|
||||
#include "mozilla/dom/ElementBinding.h"
|
||||
#include "Units.h"
|
||||
#include "nsContentListDeclarations.h"
|
||||
|
||||
class nsIFrame;
|
||||
class nsIDOMMozNamedAttrMap;
|
||||
@ -62,6 +61,11 @@ namespace dom {
|
||||
} // namespace mozilla
|
||||
|
||||
|
||||
already_AddRefed<nsContentList>
|
||||
NS_GetContentList(nsINode* aRootNode,
|
||||
int32_t aMatchNameSpaceId,
|
||||
const nsAString& aTagname);
|
||||
|
||||
#define ELEMENT_FLAG_BIT(n_) NODE_FLAG_BIT(NODE_TYPE_SPECIFIC_BITS_OFFSET + (n_))
|
||||
|
||||
// Element-specific flags
|
||||
|
@ -845,11 +845,11 @@ nsContentList::Match(Element *aElement)
|
||||
return false;
|
||||
|
||||
NodeInfo *ni = aElement->NodeInfo();
|
||||
|
||||
bool wildcard = mMatchNameSpaceId == kNameSpaceID_Wildcard ||
|
||||
mMatchNameSpaceId == kNameSpaceID_Unknown;
|
||||
|
||||
bool unknown = mMatchNameSpaceId == kNameSpaceID_Unknown;
|
||||
bool wildcard = mMatchNameSpaceId == kNameSpaceID_Wildcard;
|
||||
bool toReturn = mMatchAll;
|
||||
if (!wildcard)
|
||||
if (!unknown && !wildcard)
|
||||
toReturn &= ni->NamespaceEquals(mMatchNameSpaceId);
|
||||
|
||||
if (toReturn)
|
||||
@ -858,6 +858,11 @@ nsContentList::Match(Element *aElement)
|
||||
bool matchHTML =
|
||||
mIsHTMLDocument && aElement->GetNameSpaceID() == kNameSpaceID_XHTML;
|
||||
|
||||
if (unknown) {
|
||||
return matchHTML ? ni->QualifiedNameEquals(mHTMLMatchAtom) :
|
||||
ni->QualifiedNameEquals(mXMLMatchAtom);
|
||||
}
|
||||
|
||||
if (wildcard) {
|
||||
return matchHTML ? ni->Equals(mHTMLMatchAtom) :
|
||||
ni->Equals(mXMLMatchAtom);
|
||||
|
@ -218,7 +218,7 @@ public:
|
||||
* The special value "*" always matches whatever aMatchAtom
|
||||
* is matched against.
|
||||
* @param aMatchNameSpaceId If kNameSpaceID_Unknown, then aMatchAtom is the
|
||||
* localName to match.
|
||||
* tagName to match.
|
||||
* If kNameSpaceID_Wildcard, then aMatchAtom is the
|
||||
* localName to match.
|
||||
* Otherwise we match nodes whose namespace is
|
||||
@ -246,8 +246,7 @@ public:
|
||||
* deeper. If true, then look at the whole subtree rooted at
|
||||
* our root.
|
||||
* @param aMatchAtom an atom to be passed back to aFunc
|
||||
* @param aMatchNameSpaceId a namespace id to be passed back to aFunc. Is
|
||||
allowed to be kNameSpaceID_Unknown.
|
||||
* @param aMatchNameSpaceId a namespace id to be passed back to aFunc
|
||||
* @param aFuncMayDependOnAttr a boolean that indicates whether this list is
|
||||
* sensitive to attribute changes.
|
||||
*/
|
||||
|
@ -44,9 +44,8 @@ typedef void* (*nsFuncStringContentListDataAllocator)(nsINode* aRootNode,
|
||||
// If aMatchNameSpaceId is kNameSpaceID_Unknown, this will return a
|
||||
// content list which matches ASCIIToLower(aTagname) against HTML
|
||||
// elements in HTML documents and aTagname against everything else.
|
||||
// The comparison is done to the element's localName. For any
|
||||
// other value of aMatchNameSpaceId, the list will match aTagname
|
||||
// against all elements, again comparing to the localName.
|
||||
// For any other value of aMatchNameSpaceId, the list will match
|
||||
// aTagname against all elements.
|
||||
already_AddRefed<nsContentList>
|
||||
NS_GetContentList(nsINode* aRootNode,
|
||||
int32_t aMatchNameSpaceId,
|
||||
|
@ -32,7 +32,7 @@ function test_getElementsByTagName()
|
||||
do_check_eq(doc.getElementById("test2").getElementsByTagName("*").length,
|
||||
8);
|
||||
do_check_eq(doc.getElementById("test2").getElementsByTagName("test").length,
|
||||
7);
|
||||
3);
|
||||
|
||||
// Check that the first element of getElementsByTagName on the document is
|
||||
// the right thing.
|
||||
@ -40,7 +40,7 @@ function test_getElementsByTagName()
|
||||
|
||||
// Check that we get the right things in the right order
|
||||
var numTests = doc.getElementsByTagName("test").length;
|
||||
do_check_eq(numTests, 14);
|
||||
do_check_eq(numTests, 5);
|
||||
|
||||
for (var i = 1; i <= numTests; ++i) {
|
||||
do_check_true(doc.getElementById("test" + i) instanceof nsIDOMElement);
|
||||
@ -51,15 +51,15 @@ function test_getElementsByTagName()
|
||||
// Check that we handle tagnames containing ':' correctly
|
||||
do_check_true(doc.getElementsByTagName("foo:test")
|
||||
instanceof nsIDOMNodeList);
|
||||
do_check_eq(doc.getElementsByTagName("foo:test").length, 0);
|
||||
do_check_eq(doc.getElementsByTagName("foo:test").length, 2);
|
||||
|
||||
do_check_true(doc.getElementsByTagName("foo2:test")
|
||||
instanceof nsIDOMNodeList);
|
||||
do_check_eq(doc.getElementsByTagName("foo2:test").length, 0);
|
||||
do_check_eq(doc.getElementsByTagName("foo2:test").length, 3);
|
||||
|
||||
do_check_true(doc.getElementsByTagName("bar:test")
|
||||
instanceof nsIDOMNodeList);
|
||||
do_check_eq(doc.getElementsByTagName("bar:test").length, 0);
|
||||
do_check_eq(doc.getElementsByTagName("bar:test").length, 4);
|
||||
}
|
||||
|
||||
function test_getElementsByTagNameNS()
|
||||
|
@ -5,7 +5,9 @@ support-files =
|
||||
|
||||
[test_Document-createElement-namespace.html.json]
|
||||
[test_Document-createElementNS.html.json]
|
||||
[test_Document-getElementsByTagName.html.json]
|
||||
[test_Node-properties.html.json]
|
||||
[test_attributes.html.json]
|
||||
[test_case.html.json]
|
||||
[test_getElementsByClassName-10.xml.json]
|
||||
[test_getElementsByClassName-11.xml.json]
|
||||
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"Document.getElementsByTagName 1": true,
|
||||
"Document.getElementsByTagName 2": true
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
{
|
||||
"getElementsByTagName abc": true,
|
||||
"getElementsByTagName Abc": true,
|
||||
"getElementsByTagName ABC": true
|
||||
"getElementsByTagName ABC": true,
|
||||
"getElementsByTagName \u00e4": true,
|
||||
"getElementsByTagName \u00c4": true
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"document.getElementsByClassName(): compound": true
|
||||
}
|
@ -100,8 +100,7 @@ function elementsetattributens03() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("employee");
|
||||
elementList = doc.getElementsByTagName("emp:employee");
|
||||
element = elementList.item(0);
|
||||
assertNotNull("empEmployeeNotNull",element);
|
||||
element.setAttributeNS("http://www.w3.org/DOM/Test/1","defaultAttr","default1");
|
||||
|
@ -105,13 +105,11 @@ function getAttributeNS02() {
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
newAttribute = doc.createAttributeNS(namespaceURI,qualifiedName);
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
districtAttr = testAddr.setAttributeNodeNS(newAttribute);
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
attrValue = testAddr.getAttributeNS(namespaceURI,localName);
|
||||
assertEquals("throw_Equals","",attrValue);
|
||||
|
@ -100,8 +100,7 @@ function getAttributeNS03() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
testAddr.removeAttributeNS(namespaceURI,localName);
|
||||
|
@ -105,8 +105,7 @@ function getAttributeNS04() {
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
newAttribute = doc.createAttributeNS(namespaceURI,qualifiedName);
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
testAddr.setAttributeNS(namespaceURI,qualifiedName,"NewValue");
|
||||
|
@ -99,9 +99,8 @@ function getAttributeNS05() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
testAddr = elementList.item(3);
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
attrValue = testAddr.getAttributeNS("http://www.nist.gov","domestic");
|
||||
assertEquals("attrValue","Yes",attrValue);
|
||||
|
@ -101,8 +101,7 @@ function getAttributeNodeNS01() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
attribute = testAddr.getAttributeNodeNS(namespaceURI,localName);
|
||||
|
@ -100,9 +100,8 @@ function getAttributeNodeNS02() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
testAddr = elementList.item(3);
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
attribute = testAddr.getAttributeNodeNS("http://www.nist.gov","domestic");
|
||||
attrName = attribute.nodeName;
|
||||
|
@ -100,8 +100,7 @@ function hasAttributeNS03() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testNode = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testNode);
|
||||
state = testNode.hasAttributeNS(namespaceURI,localName);
|
||||
|
@ -102,8 +102,7 @@ function hasAttributeNS04() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testNode = elementList.item(0);
|
||||
assertNotNull("empAddressNotNull",testNode);
|
||||
state = testNode.hasAttributeNS(namespaceURI,localName);
|
||||
|
@ -119,9 +119,8 @@ function importNode05() {
|
||||
aNewDocRef = this.aNewDoc;
|
||||
}
|
||||
aNewDoc = load(aNewDocRef, "aNewDoc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
addresses = aNewDoc.getElementsByTagName("address");
|
||||
element = addresses.item(3);
|
||||
addresses = aNewDoc.getElementsByTagName("emp:address");
|
||||
element = addresses.item(0);
|
||||
assertNotNull("empAddressNotNull",element);
|
||||
aNode = doc.importNode(element,false);
|
||||
hasChild = aNode.hasChildNodes();
|
||||
|
@ -117,9 +117,8 @@ function importNode06() {
|
||||
aNewDocRef = this.aNewDoc;
|
||||
}
|
||||
aNewDoc = load(aNewDocRef, "aNewDoc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
addresses = aNewDoc.getElementsByTagName("address");
|
||||
element = addresses.item(3);
|
||||
addresses = aNewDoc.getElementsByTagName("emp:address");
|
||||
element = addresses.item(0);
|
||||
assertNotNull("empAddressNotNull",element);
|
||||
aNode = doc.importNode(element,true);
|
||||
hasChild = aNode.hasChildNodes();
|
||||
|
@ -101,9 +101,8 @@ function localName01() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
testAddr = elementList.item(3);
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
addrAttr = testAddr.getAttributeNode("emp:domestic");
|
||||
localName = addrAttr.localName;
|
||||
|
@ -99,9 +99,8 @@ function namespaceURI02() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
testAddr = elementList.item(3);
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddressNotNull",testAddr);
|
||||
addrAttr = testAddr.getAttributeNodeNS("http://www.nist.gov","domestic");
|
||||
attrNamespaceURI = addrAttr.namespaceURI;
|
||||
|
@ -94,8 +94,7 @@ function nodehasattributes03() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("employee");
|
||||
elementList = doc.getElementsByTagName("emp:employee");
|
||||
element = elementList.item(0);
|
||||
assertNotNull("empEmployeeNotNull",element);
|
||||
hasAttributes = element.hasAttributes();
|
||||
|
@ -100,8 +100,7 @@ function prefix02() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("employeeId");
|
||||
elementList = doc.getElementsByTagName("emp:employeeId");
|
||||
testEmployee = elementList.item(0);
|
||||
assertNotNull("empEmployeeNotNull",testEmployee);
|
||||
textNode = testEmployee.firstChild;
|
||||
|
@ -97,9 +97,8 @@ function prefix03() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("employee");
|
||||
testEmployee = elementList.item(3);
|
||||
elementList = doc.getElementsByTagName("emp:employee");
|
||||
testEmployee = elementList.item(0);
|
||||
assertNotNull("empEmployeeNotNull",testEmployee);
|
||||
prefix = testEmployee.prefix;
|
||||
|
||||
|
@ -100,8 +100,7 @@ function setAttributeNS02() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("employee");
|
||||
elementList = doc.getElementsByTagName("emp:employee");
|
||||
testAddr = elementList.item(0);
|
||||
|
||||
{
|
||||
|
@ -108,8 +108,7 @@ function setAttributeNS04() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
testAddr.setAttributeNS("http://www.nist.gov","newprefix:zone","newValue");
|
||||
|
@ -106,8 +106,7 @@ function setAttributeNS05() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
testAddr.setAttributeNS(namespaceURI,qualifiedName,"<newValue>");
|
||||
|
@ -108,8 +108,7 @@ function setAttributeNS09() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
testAddr.setAttributeNS(namespaceURI,qualifiedName,"newValue");
|
||||
|
@ -111,8 +111,7 @@ function setAttributeNodeNS01() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
newElement = doc.createElement("newElement");
|
||||
|
@ -104,8 +104,7 @@ function setAttributeNodeNS03() {
|
||||
docRef = this.doc;
|
||||
}
|
||||
doc = load(docRef, "doc", "staffNS");
|
||||
// Changed for bug 492933.
|
||||
elementList = doc.getElementsByTagName("address");
|
||||
elementList = doc.getElementsByTagName("emp:address");
|
||||
testAddr = elementList.item(0);
|
||||
assertNotNull("empAddrNotNull",testAddr);
|
||||
newAttr = doc.createAttributeNS(namespaceURI,qualifiedName);
|
||||
|
@ -18,7 +18,7 @@
|
||||
document.head.appendChild(newSheet);
|
||||
|
||||
/* Now, append a frame to our children element, causing the pending restyle to descend into it. */
|
||||
var children = document.getElementsByTagName("children")[0];
|
||||
var children = document.getElementsByTagName("xbl:children")[0];
|
||||
var span = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
|
||||
span.appendChild(document.createTextNode("PASS"));
|
||||
children.appendChild(span);
|
||||
|
@ -0,0 +1,14 @@
|
||||
[Document-getElementsByTagName-xhtml.xhtml]
|
||||
type: testharness
|
||||
[Element in non-HTML namespace, prefix, lowercase name]
|
||||
expected: FAIL
|
||||
|
||||
[Element in non-HTML namespace, prefix, uppercase name]
|
||||
expected: FAIL
|
||||
|
||||
[Element in HTML namespace, prefix, non-ascii characters in name]
|
||||
expected: FAIL
|
||||
|
||||
[Element in non-HTML namespace, prefix, non-ascii characters in name]
|
||||
expected: FAIL
|
||||
|
@ -0,0 +1,14 @@
|
||||
[Document-getElementsByTagName.html]
|
||||
type: testharness
|
||||
[Element in non-HTML namespace, prefix, lowercase name]
|
||||
expected: FAIL
|
||||
|
||||
[Element in non-HTML namespace, prefix, uppercase name]
|
||||
expected: FAIL
|
||||
|
||||
[Element in HTML namespace, prefix, non-ascii characters in name]
|
||||
expected: FAIL
|
||||
|
||||
[Element in non-HTML namespace, prefix, non-ascii characters in name]
|
||||
expected: FAIL
|
||||
|
@ -0,0 +1,14 @@
|
||||
[Element-getElementsByTagName.html]
|
||||
type: testharness
|
||||
[Element in non-HTML namespace, prefix, lowercase name]
|
||||
expected: FAIL
|
||||
|
||||
[Element in non-HTML namespace, prefix, uppercase name]
|
||||
expected: FAIL
|
||||
|
||||
[Element in HTML namespace, prefix, non-ascii characters in name]
|
||||
expected: FAIL
|
||||
|
||||
[Element in non-HTML namespace, prefix, non-ascii characters in name]
|
||||
expected: FAIL
|
||||
|
17
testing/web-platform/meta/dom/nodes/case.html.ini
Normal file
17
testing/web-platform/meta/dom/nodes/case.html.ini
Normal file
@ -0,0 +1,17 @@
|
||||
[case.html]
|
||||
type: testharness
|
||||
[getElementsByTagName a:abc]
|
||||
expected: FAIL
|
||||
|
||||
[getElementsByTagName a:Abc]
|
||||
expected: FAIL
|
||||
|
||||
[getElementsByTagName a:ABC]
|
||||
expected: FAIL
|
||||
|
||||
[getElementsByTagName a:ä]
|
||||
expected: FAIL
|
||||
|
||||
[getElementsByTagName a:Ä]
|
||||
expected: FAIL
|
||||
|
Loading…
Reference in New Issue
Block a user