jalexiscv / base2

Automatically exported from code.google.com/p/base2
0 stars 0 forks source link

Selector queries return wrong nodes #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
build html with body contents as follows:
<div>
<p>outer paragraph</p>
</div>
<div id="test"><div><p>inner paragraph</p></div></div>

and run js:
alert(base2.DOM.bind(document.getElementById("test")).matchSingle("div
p").textContent);

It should return "inner paragraph" but returns "outer paragraph"

It happens when we query element contents and query has more than one
simple selector sequence. (the query for "div" will return expected value)

Tested on
Win XP, FF 2.0.0.5

I'm using latest base2: Fri, 13 Jul 2007 17:39:33

Above test can be run at: http://mariuszn3.com/base2/selectors.html

This bug is related to one of last updates as on older base2 selector
queries run ok

Original issue reported on code.google.com by marius...@gmail.com on 19 Jul 2007 at 1:40

GoogleCodeExporter commented 9 years ago
It looks that selector queries are broken and unusable in current version.. only
simpliest queries return expected values.

Original comment by marius...@gmail.com on 20 Jul 2007 at 7:18

GoogleCodeExporter commented 9 years ago
> only simpliest queries return expected values.

Can you provide some more examples? I've fixed the submitted issue before I 
check it
in I'd like to know I've fixed the other issues.

Original comment by dean.edw...@gmail.com on 21 Jul 2007 at 7:46

GoogleCodeExporter commented 9 years ago
What I see is that all queries that:
- consist of more than one simple sequence
- should return elements within given scope and not document scope
return elements within document scope.
And that's all issues that I see at the moment.

Original comment by marius...@gmail.com on 23 Jul 2007 at 7:14

GoogleCodeExporter commented 9 years ago
What do you mean by "consist of more than one simple sequence"? Can you provide 
an
example? I'd like to close this bug otherwise as I've fixed the scoping issue in
Firefox/Opera.

Original comment by dean.edw...@gmail.com on 23 Jul 2007 at 8:51

GoogleCodeExporter commented 9 years ago
By simple selector sequence I understand e.g. 'div[attr="value"]' by two simple
selector sequences I understand e.g. 'div[attr="value"] div[attr="value"]'

So - el.matchSingle("div") returned right element but el.matchSingle("div div") 
not

I took this naming from Selectors W3C recommendation and quite old proposal to 
CSSOM
by Daniel Glazman - probably I should revise my naming convention ;-)

I saw that you've started updating library builds (base and DOM are available 
while
BOM returns 404 at the moment) - after I've updated base and DOM files, 
selectors
like "div div" works ok but now I have problem with multiple selector - check
http://mariuszn3.com/base2/selectors.html matchAll returns two elements while 
should
return just one (input is outside of scope but it's returned)

Original comment by marius...@gmail.com on 23 Jul 2007 at 10:05

GoogleCodeExporter commented 9 years ago
Bah! I still haven't fixed the scoping issue for comma separated selectors. 
I'll do
that now.

PS. The BOM package has been removed.

Original comment by dean.edw...@gmail.com on 23 Jul 2007 at 1:06

GoogleCodeExporter commented 9 years ago
OK. I think I've fixed the scoping issues for real now. I'm marking this bug 
fixed.
Can you verify?

Original comment by dean.edw...@gmail.com on 23 Jul 2007 at 2:26

GoogleCodeExporter commented 9 years ago
It works great - I don't see any issues right now.
I let you know if I'll find any other problem. Thanks!

Original comment by marius...@gmail.com on 23 Jul 2007 at 4:53

GoogleCodeExporter commented 9 years ago

Original comment by dean.edw...@gmail.com on 23 Jul 2007 at 5:34