Skip to content

feat: getElementsByName #45

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

Merged
merged 6 commits into from
Sep 29, 2020
Merged

Conversation

tedconn
Copy link
Contributor

@tedconn tedconn commented Sep 29, 2020

Adds support for Document.getElementsByName

@@ -281,6 +295,12 @@ function attachSourceIfNecessary ({ nodes }, selector) {
}
}

function assertIsDocumentOrShadowRoot (context) {
if (context.nodeType !== 11 && context.nodeType !== 9) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized duck typing this will be a cleaner approach and work across windows.

Copy link
Contributor

@nolanlawson nolanlawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a small nit about tests

]
assertResultEqual(name, getElementsByName(name, context), expected, true)

name = 'test'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a sanity check, can we test for names like tEsT and ensure that it doesn't match? (Looks like getElementsByName is case-sensitive.)

Verified

This commit was signed with the committer’s verified signature.
tedconn Ted Conn

Verified

This commit was signed with the committer’s verified signature.
tedconn Ted Conn
fix: fixed wrong type

Verified

This commit was signed with the committer’s verified signature.
tedconn Ted Conn

Verified

This commit was signed with the committer’s verified signature.
tedconn Ted Conn

Verified

This commit was signed with the committer’s verified signature.
tedconn Ted Conn
@tedconn tedconn changed the title Get elements by name feat: getElementsByName Sep 29, 2020
@tedconn tedconn force-pushed the get-elements-by-name branch from 3e4341e to 70e6598 Compare September 29, 2020 16:59

Verified

This commit was signed with the committer’s verified signature.
tedconn Ted Conn
@tedconn tedconn requested a review from nolanlawson September 29, 2020 17:02
@nolanlawson nolanlawson merged commit 0dccb2e into salesforce:master Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants