-
Notifications
You must be signed in to change notification settings - Fork 246
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
Case sensivity for attribute selectors #507
Comments
which would you prefer? Do we want to adjust our xpath selector to make this case independent? |
I think I'd like to make it case insensitive, but I'm afraid that might break many tests, so maybe we should keep that until Watir 7. |
Please note that in CSS only some attribute values are case insensitive. |
So, according to the spec All attribute values are case-sensitive, except for the following:
These aren't parseable by IDL from that page, so we could hard-code this list and treat them differently. @p0deje do you think this is worth doing? |
@titusfortner Oh, how did you find that?! Yes, I think it should be straightforward to just hardcode that list (or actually parse it from spec directly - we are not limited to IDL only) and make everything these case insensitive. Do you feel like you want to do that or me? |
Note, those are only case insensitive on the elements they are defined for - on elements they are not defined on, or on custom elements they are case sensitive. Also most (if not all) are enumerated types so if you’re going to fix the case sensitivity, letting search for random strings doesn’t make much sense |
@p0dege if you could do it, it would be awesome. Especially if we can somehow use it from the html_elements file. But this is lower on my list for right now. I need to get capabilities issues fixed. |
@titusfortner I'll do my best but time is pretty limited now :) @twalpole I don't get what you mean by "enumerated types". Can you elaborate? |
@p0deje https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#keywords-and-enumerated-attributes - case insensitivity is for the attributes defined to be allowed a specific set of values (enumerated attributes) on specific elements - If those same attributes were used on elements they are not defined for then they should be case sensitive. Whether that's worth worrying about is debatable though. |
I've prepared #856 to implement the solution, please have a look when you have time. For now, I've just hardcoded case-insensitive attributes as I don't think it's going to change much. Otherwise, we can still add it to spec generator. I hope I understood when attribute should be case-insensitive right 😄 |
Per https://www.w3.org/TR/html52/single-page.html#casesensitivity This commit additionally ensures that Watir ignores case of passed selector string for attribute which case is expected to be ignored. Closes #507
Per https://www.w3.org/TR/html52/single-page.html#casesensitivity This commit additionally ensures that Watir ignores case of passed selector string for attribute which case is expected to be ignored. Closes #507
There is a difference between CSS and XPath in case sensivity of attributes.
Having these elements on the page:
you can query them in browser:
This comes from the fact that XPath considers attributes case sensitive while CSS does not.
Since now Watir only uses XPath selectors, using
method: 'post'
selector would return only one element. But when Watir is used with watir_css or watizzle gems, same selector would return two elements.Also compare plain Selenium:
Since two behaviours cannot co-exist, I'm not sure what to do about it.
Related links:
The text was updated successfully, but these errors were encountered: