This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 7743 - The effect of refNodes on the result set is non-locally defined making it hard to follow
Summary: The effect of refNodes on the result set is non-locally defined making it har...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Selectors API (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Lachlan Hunt
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords: NE
Depends on:
Blocks:
 
Reported: 2009-09-28 15:47 UTC by James Graham
Modified: 2009-09-29 13:26 UTC (History)
2 users (show)

See Also:


Attachments

Description James Graham 2009-09-28 15:47:32 UTC
The selectors level 2 spec is rather hard to follow around the behaviour of the refNodes parameter. In loose terms, it seems as if the instruction "the implementation must process this argument according to the steps for determining reference nodes" and the linked algorithm are supposed to set a global variable that is lated accessed to determine the nodes that match :reference in the matcher. It would be nice (especially for the first-time reader) if this implicit behaviour was made explicit. One way to do this would be to use some sort of pseudo-code instead of prose e.g.

1. let /reference_nodes/ be the result of calling the algorithm for determining reference nodes with parameter /refNodes/

2. Let /final_selector/ be the result of calling the algoritm for processing selectors with parameter /selectors/

3. If /selectors/ is a selector string or a scoped selector string, return the first Element node matching /final_selector/ with contextual reference nodes /reference_nodes/ that lies within the subtrees of the context node

Otherwise if...


And so on. Obviously there are other approaches that would work. However the general idea is to make it explicit how the function arguments are used to affect the nodes returned.
Comment 1 Lachlan Hunt 2009-09-29 13:26:16 UTC
Fixed in current editor's draft as of revision 1.13.