Opened 9 years ago

Closed 7 years ago

#12565 closed defect (fixed)

Nodelist.traverse tests (closest and parents) fail on opera 11

Reported by: bill Owned by: Kris Zyp
Priority: high Milestone: 1.8
Component: Core Version: 1.6.0
Keywords: dohfail Cc:
Blocked By: Blocking:

Description

    _AssertFailure: doh._AssertFailure: assertEqual() failed:
 	expected
		1
	but got
		0

 with hint: 
		closest('div') length
: assertEqual() failed:
	expected
		1
	but got
		0

 with hint: 
		closest('div') length
  doh._AssertFailure: assertEqual() failed:
     expected
		1
	but got
		0

 with hint: 
		closest('div') length
      ERROR IN:
 		 function closest(t){
							// test simple selector
							var classy = dojo.query("#classy");
							var closestDiv = classy.closest("div");
							verify(closestDiv, ["third"], "closest('div')");
							verify(closestDiv.end().closest(".classy"), ["classy"], "closestDiv.end().closest('.classy')");

							// test descendant selector
							var bang = dojo.query(".bang");
							var closestFooBar = bang.closest(".foo > .bar");
							verify(closestFooBar, ["level4"], ".foo > .bar");

							// test descendant selector that doesn't match (".foo" alone matches nodes, but not
							// ".bogus .foo")
							var closestBogusFoo = bang.closest(".bogus .foo");
							verify(closestBogusFoo, [], ".bogus .foo");

							// positive test that scope argument works: .foo > .bar should match a scope
							// of "level2" or above
							closestFooBar = bang.closest(".foo > .bar", "level2");
							verify(closestFooBar, ["level4"], ".foo > .bar query relative to level2");

							// > .bar should match a scope of level3 or level1
							var topBar = bang.closest("> .bar", "level3");
							verify(topBar, ["level4"], "> .bar query relative to level3");

							// negative test that scope argument works:  .foo > .bar relative to level3
							// doesn't match since .foo is level3, rather than a child of level3
							closestFooBar = bang.closest(".foo > .bar", "level3");
							verify(closestFooBar, [], ".foo > .bar query relative to level3");

							// complex test of multiple elements in NodeList
							// Only some of the elements in dojo.query("div") have a ".foo" ancestor,
							// and three of those elements have the *same* .foo ancestor, so
							// closest(".foo") should result in list of just two elements
							var closestFoo = dojo.query("div").closest(".foo");
							verify(closestFoo, ["level1", "level3"], ".foo from div");
							
						}
  FAILED test: ../../dojo/tests/NodeList-traverse.html::t::closest 2 ms
  PASSED test: ../../dojo/tests/NodeList-traverse.html::t::parent 0 ms
      _AssertFailure: doh._AssertFailure: assertEqual() failed:
 	expected
		1
	but got
		0

 with hint: 
		verify length
: assertEqual() failed:
	expected
		1
	but got
		0

 with hint: 
		verify length
  doh._AssertFailure: assertEqual() failed:
     expected
		1
	but got
		0

 with hint: 
		verify length
      ERROR IN:
 		 function parents(t){
							var classy = dojo.query("#classy");
							verify(classy.parents(), ["third", "body", "html"]);
							verify(classy.parents(".third"), ["third"]);
							verify(classy.parents("body"), ["body"]);
						}
  FAILED test: ../../dojo/tests/NodeList-traverse.html::t::parents 2 ms

Change History (10)

comment:1 Changed 9 years ago by bill

Keywords: dohfail added

comment:2 Changed 8 years ago by bill

Owner: set to Kris Zyp
Status: newassigned

comment:3 Changed 7 years ago by Kris Zyp

Resolution: worksforme
Status: assignedclosed

Unless there is a more specific version of Opera 11 that this fails on, this appears to be fixed/working in Dojo trunk on Opera 11.

comment:4 Changed 7 years ago by bill

Indeed, it's working for me now too.

comment:5 Changed 7 years ago by Thomas Bachem

Exact same issue still here in Opera 12.0.

comment:6 Changed 7 years ago by bill

What exactly is "here"?

comment:7 Changed 7 years ago by Thomas Bachem

Mac OS X 10.7.4, Opera 12.0 freshly installed. Any dojo.query(...).closest(...)/.parents(...) query returns an empty NodeList?. Seems like the acme selector engine is used.

comment:8 Changed 7 years ago by Thomas Bachem

Oh, using Dojo 1.7.1 by the way.

comment:9 Changed 7 years ago by bill

Resolution: worksforme
Status: closedreopened

OK, well Kris said that it was working on trunk, not that it was working on 1.7.1. I do show a failure on the 1.7 branch, but it's working on trunk (i.e. 1.8).

comment:10 Changed 7 years ago by bill

Milestone: tbd1.8
Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.