This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
"Return a no such element error." I believe this is just missing an 'else' but didn't want to make that change myself. CURRENT: To get a known web element with a UUID reference: For each web element in the current browsing context’s set of known web elements: If web element’s web element reference matches reference, return web element. Return a no such element error. PROPOSED: To get a known web element with a UUID reference: For each web element in the current browsing context’s set of known web elements: If web element’s web element reference matches reference, return web element. Else, return a no such element error.
I think this is just an early return. I agree it might be clearer without (I think it would be much much better to use the success/error machinery here, as in: To get a known web element with a UUID reference: If there is an element in the browsing current context's set of known elements whose web element reference is reference, return success with data element. Otherwise, return error with status no such element.
Oh, ato pointed out that this text is the subject of PR #76 anyway.
This is just an early return, in pseudo code: for el of els { if el == expected { return el } } return error That is a simplistic version of how I would implement it. In reality I would use a more performant search algorithm. What we’re trying to say is that “find the entry on list that matches this other element I have”. I find it weird to use an else clause because I’ve never encountered a for loop construct that has one. I should also add that there’s an open PR to improve the web element lookup: https://github.com/w3c/webdriver/pull/76