Opened 12 years ago
Closed 8 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 12 years ago by
Owner: | changed from anonymous to alex |
---|
comment:2 Changed 12 years ago by
Priority: | normal → high |
---|
comment:3 Changed 12 years ago by
comment:4 Changed 12 years ago by
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 12 years ago by
Milestone: | 1.3 → 1.4 |
---|---|
Priority: | high → normal |
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 12 years ago by
getElementsByClassName reported to Opera, got back this email identifier for further correspondences: DSK-249577 at bugs.opera.com
comment:7 Changed 12 years ago by
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 12 years ago by
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 11 years ago by
Component: | Core → Query |
---|
comment:10 Changed 11 years ago by
Milestone: | 1.4 → 1.5 |
---|
comment:11 Changed 11 years ago by
Milestone: | 1.5 → 1.6 |
---|
comment:12 Changed 10 years ago by
Milestone: | 1.6 → future |
---|
(sadly) punting seemingly abandoned ticket and meta tickets to future
comment:14 Changed 10 years ago by
Keywords: | dohfail added |
---|
comment:16 Changed 9 years ago by
Keywords: | needsreview added |
---|---|
Priority: | high → low |
comment:17 Changed 9 years ago by
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 9 years ago by
Owner: | changed from dylan to Kris Zyp |
---|---|
Status: | new → assigned |
comment:19 Changed 9 years ago by
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 8 years ago by
Milestone: | future → 1.9 |
---|---|
Resolution: | → wontfix |
Status: | assigned → closed |
Given that opera is dropping their engine for WebKit?, marking as wontfix.
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.