Skip to content
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

Add Rml::Element::Matches function #573

Merged
merged 5 commits into from
Jan 18, 2024
Merged

Conversation

Paril
Copy link
Contributor

@Paril Paril commented Jan 16, 2024

This PR adds a simple function to mirror https://developer.mozilla.org/en-US/docs/Web/API/Element/matches in RmlUi; it was the only missing selector-related function in Element

@mikke89 mikke89 added the enhancement New feature or request label Jan 16, 2024
Copy link
Owner

@mikke89 mikke89 left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request! Looks good, I like it. And a documentation PR already as well, nice.

Could you add some unit tests as well? Please take a look at Selectors.cpp.

Source/Lua/Element.cpp Show resolved Hide resolved
@Paril
Copy link
Contributor Author

Paril commented Jan 16, 2024

Thanks for the pull request! Looks good, I like it. And a documentation PR already as well, nice.

Could you add some unit tests as well? Please take a look at Selectors.cpp.

I added a quick harness and a few tests; I'm not great at unit testing because it tends to just be things that I need that I check for, heh.

@mikke89
Copy link
Owner

mikke89 commented Jan 16, 2024

I think these tests look good. It tests the unique functionality of this function. The specific matching behavior is also shared with the other tests, so we don't need to go into full detail (although it wouldn't hurt either). Just a couple minor comments, and I'm ready to merge this.

@Paril
Copy link
Contributor Author

Paril commented Jan 16, 2024

I think these tests look good. It tests the unique functionality of this function. The specific matching behavior is also shared with the other tests, so we don't need to go into full detail (although it wouldn't hurt either). Just a couple minor comments, and I'm ready to merge this.

Fair enough! I also have :scope support just about ready for another PR. I'll address the comments above first.

@mikke89 mikke89 merged commit 632a3ad into mikke89:master Jan 18, 2024
18 checks passed
@mikke89
Copy link
Owner

mikke89 commented Jan 18, 2024

Nice, this looks good to me!

Thanks for the pull request, very much appreciated :)

alml pushed a commit to alml/RmlUi that referenced this pull request Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants