-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Implement GH-18550: Implement getElementsByClassName() #19108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine, but I have a few questions as I'm slightly confused by the DOM spec.
ext/dom/tests/modern/common/Element_getElementsByClassName_empty.phpt
Outdated
Show resolved
Hide resolved
ext/dom/tests/modern/common/Element_getElementsByClassName.phpt
Outdated
Show resolved
Hide resolved
dom_node_idx_pair start_point = dom_obj_map_get_start_point(map, nodep, index); | ||
if (start_point.node) { | ||
if (start_point.index > 0) { | ||
/* Only start iteration at next point if we actually have an index to seek to. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I did a correction here because we don't want to immediately skip the current index if the current index is already the one we need.
Spec: https://dom.spec.whatwg.org/#ref-for-dom-element-getelementsbyclassname