Opened 10 years ago

Closed 6 years ago

#8938 closed defect (wontfix)

dojo.query unit test failures on opera

Reported by: bill Owned by: Kris Zyp
Priority: low Milestone: 1.9
Component: Query Version: 1.3.0b3
Keywords: dohfail Cc:
Blocked By: Blocking:

Description

Getting failures on Opera 9.64 (windows) via runTests.html. The first one in the dojo.query tests is:

:

      _AssertFailure: [Object:

 name: doh._AssertFailure
]: assertEqual() failed:
	expected
		2
	but got
		1

  [Object:

 name: doh._AssertFailure
]
      ERROR IN:
 		 function (t
){doh.is(2, (dojo.query('.foo, .bar')).length);
}
  FAILED test: ../../dojo/tests/_base/query.html::t::doh.is(2, (dojo.query('.foo, .bar')).length); 16 ms
      _AssertFailure: [Object:

 name: doh._AssertFailure
]: assertEqual() failed:
	expected
		2
	but got
		1

  [Object:

 name: doh._AssertFailure
]
      ERROR IN:
 		 function (t
){doh.is(2, (dojo.query('.foo,.bar')).length);
}
  FAILED test: ../../dojo/tests/_base/query.html::t::doh.is(2, (dojo.query('.foo,.bar')).length); 0 ms
  PASSED test: ../../dojo/tests/_base/query.html::t::doh.is(1, (dojo.query('.foo.bar')).length); 0 ms
      _AssertFailure: [Object:

 name: doh._AssertFailure
]: assertEqual() failed:
	expected
		2
	but got
		1

  [Object:

 name: doh._AssertFailure
]
      ERROR IN:
 		 function (t
){doh.is(2, (dojo.query('.foo')).length);
}
  FAILED test: ../../dojo/tests/_base/query.html::t::doh.is(2, (dojo.query('.foo')).length); 0 ms

Change History (20)

comment:1 Changed 10 years ago by Adam Peller

Owner: changed from anonymous to alex

comment:2 Changed 10 years ago by bill

Priority: normalhigh

comment:3 Changed 10 years ago by James Burke

This seems weird, using the query.html page, just trying to do:

{{ document.getElementsByClassName("foo"); }}

only returns one element under Opera 9.64 on Windows (instead of expected 2). Our test page is perhaps a little unusual in that there is an element with "foo" class inside another element with "foo" class, but still, seems like a core issue with Opera's document.getElementsByClassName function.

Most of the query test errors stem from this issue (all have foo in their selectors) except for one or two at the end with the XML document tests, maybe a casing issue? Have not looked closely at that.

comment:4 Changed 10 years ago by James Burke

Ignore my previous comment about nested .foo elements, I read the code wrong (the nested element had id="foo".

So it does seems like an issue with the Opera implementation. It can find this:

<span class="foo fooBar baz"></span>

but it cannot find this:

<span class="fooBar foo baz"></span>

The "fooBar" class seems to confuse it. So for those errors, I say we just punt on them, report to Opera. Will look at the XML errors next.

comment:5 Changed 10 years ago by James Burke

Milestone: 1.31.4
Priority: highnormal

The XML fail cases are fixed in [17078]: "Fixes XML unit tests for query in Opera. We were not setting caseSensitive in that case. The doctype and contenType do not give any value, so reverting to old school toString hackery. Should be OK given that it is limited to the opera case, but subject to review from Alex."

So with that fix, I believe this bug should no longer be a blocker for 1.3, but we should keep it open to test if Opera fixes their "fooBar foo" getElementsByClassName bug. Moving it for testing in Dojo 1.4, and I will submit the getElementsByClassName to Opera.

comment:6 Changed 10 years ago by James Burke

getElementsByClassName reported to Opera, got back this email identifier for further correspondences: DSK-249577 at bugs.opera.com

comment:7 Changed 10 years ago by James Burke

To wrap up, the only issue now being tracked in this bug is an issue with Opera's native implementation of document.getElementsByClassName(). If we do document.getElementsByClassName("foo") it cannot find an element that looks like this:

<span class="fooBar foo baz"></span>

but it can when the element has the class names ordered like so:

<span class="foo fooBar baz"></span>

A bug report was submitted to Opera for that issue, email ID: DSK-249577 at bugs.opera.com

comment:8 Changed 10 years ago by bill

Note that the failure is isolated to when one classname is a substring of another class name. For a class="foo bar" node dojo.query(".foo") and dojo.query(".bar") both work.

comment:9 Changed 10 years ago by bill

Component: CoreQuery

comment:10 Changed 10 years ago by James Burke

Milestone: 1.41.5

comment:11 Changed 9 years ago by Adam Peller

Milestone: 1.51.6

comment:12 Changed 8 years ago by bill

Milestone: 1.6future

(sadly) punting seemingly abandoned ticket and meta tickets to future

comment:13 Changed 8 years ago by Chris Mitchell

Owner: changed from alex to dylan

please review/triage

comment:14 Changed 8 years ago by bill

Keywords: dohfail added

comment:15 Changed 8 years ago by Douglas Hays

Using Opera 11.50, still 3 failures in trunk/[26372].

comment:16 Changed 7 years ago by ben hockey

Keywords: needsreview added
Priority: highlow

comment:17 Changed 7 years ago by bill

Keywords: needsreview removed

Not sure what kind of review you wanted, but I took a look on the latest Opera 11.61, and dojo/tests/_base/query.html still gets 3 failures.

comment:18 Changed 7 years ago by bill

Owner: changed from dylan to Kris Zyp
Status: newassigned

comment:19 Changed 7 years ago by bill

Opera 12 gets

     _AssertFailure: assertEqual() failed:
 	expected
		1
	but got
		2

      ERROR IN:
 		 function anonymous(t) {
doh.is(1, dojo.query('.fooBar').length);
}
  FAILED test: ../../dojo/tests/_base/query.html::t::doh.is(1, dojo.query('.fooBar').length); 1 ms

and

    _AssertFailure: assertEqual() failed:
 	expected
		2
	but got
		0

 with hint: 
		result elements with attrs
      ERROR IN:
 		 function xml_attrs(){
						if(!has("ie")){	// remove if() when #14880 is fixed
							var doc = createDocument([
								"<ResultSet>",
								"<RESULT thinger='blah'>ONE</RESULT>",
								"<RESULT thinger='gadzooks'><CHILD>Two</CHILD></RESULT>",
								"</ResultSet>"
							].join(""));
							var de = doc.documentElement;

							doh.is(2, query("RESULT", de).length, "result elements");
							doh.is(0, query("RESULT[THINGER]", de).length, "result elements with attrs (wrong)");
							doh.is(2, query("RESULT[thinger]", de).length, "result elements with attrs");
							doh.is(1, query("RESULT[thinger=blah]", de).length, "result elements with attr value");
							doh.is(1, query("RESULT > CHILD", de).length, "Using child operator");
						} // remove when #14880 is fixed
					}
  FAILED test: ../../dojo/tests/query/query.html?selector=lite::css2::xml_attrs 0 ms

and

     _AssertFailure: assertEqual() failed:
 	expected
		2
	but got
		4

 with hint: 
		all lower
      ERROR IN:
 		 function xml(){
						var doc = createDocument([
							"<ResultSet>",
							"<Result>One</Result>",
							"<RESULT>Two</RESULT>",
							"<result><nested>Three</nested></result>",
							"<result>Four</result>",
							"</ResultSet>"
						].join("")
						);
						var de = doc.documentElement;

						doh.is(2, query("result", de).length, "all lower");

						//doh.is(1, query("result>nested", de).length, "nested XML");
						doh.is(1, query("Result", de).length, "mixed case");
						doh.is(1, query("RESULT", de).length, "all upper");
						doh.is(0, query("resulT", de).length, "no match");
						doh.is(0, query("rEsulT", de).length, "no match");
					}
  FAILED test: ../../dojo/tests/query/query.html?selector=acme::css2::xml 0 ms
      _AssertFailure: assertEqual() failed:
 	expected
		0
	but got
		2

 with hint: 
		result elements with attrs (wrong)
      ERROR IN:
 		 function xml_attrs(){
						if(!has("ie")){	// remove if() when #14880 is fixed
							var doc = createDocument([
								"<ResultSet>",
								"<RESULT thinger='blah'>ONE</RESULT>",
								"<RESULT thinger='gadzooks'><CHILD>Two</CHILD></RESULT>",
								"</ResultSet>"
							].join(""));
							var de = doc.documentElement;

							doh.is(2, query("RESULT", de).length, "result elements");
							doh.is(0, query("RESULT[THINGER]", de).length, "result elements with attrs (wrong)");
							doh.is(2, query("RESULT[thinger]", de).length, "result elements with attrs");
							doh.is(1, query("RESULT[thinger=blah]", de).length, "result elements with attr value");
							doh.is(1, query("RESULT > CHILD", de).length, "Using child operator");
						} // remove when #14880 is fixed
					}
  FAILED test: ../../dojo/tests/query/query.html?selector=acme::css2::xml_attrs 0 ms

Plus similar errors in other query tests. Tested on windows.

comment:20 Changed 6 years ago by dylan

Milestone: future1.9
Resolution: wontfix
Status: assignedclosed

Given that opera is dropping their engine for WebKit?, marking as wontfix.

Note: See TracTickets for help on using tickets.