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

Attribute priority: first wins #210

Open
bcardarella opened this issue Oct 24, 2024 · 6 comments
Open

Attribute priority: first wins #210

bcardarella opened this issue Oct 24, 2024 · 6 comments

Comments

@bcardarella
Copy link

Accoridng to the HTML spec when it comes to duplicate attributes the first defined attribute is the one that wins. Subsequent attributes of the same name are ignored:

Screenshot 2024-10-24 at 7 32 00 AM

I just want to confirm that we are adhering to this as well in the SwiftUI client.

@carson-katri
Copy link
Collaborator

Core is used to fetch attributes by name with the getAttribute function on Node, so I think this issue should be moved there.

@bcardarella bcardarella transferred this issue from liveview-native/liveview-client-swiftui Oct 24, 2024
@mobile-bungalow
Copy link
Contributor

It seems that get_attribute already returns the first.

There are specific cases where the last one is used. csrf tokens being the most important example. Should we consider taking the first of those?

@bcardarella
Copy link
Author

do you have examples of documents that have multiple csrf tokens inline?

@mobile-bungalow
Copy link
Contributor

I have none. I can dig through the commit history to see if there is a spelled out justification for that, but my intuition tells me that if you have multiple CSRF tokens something has gone terribly wrong.

@bcardarella
Copy link
Author

bcardarella commented Oct 29, 2024

I agree, I cannot think of a scenario where there would be multiple tokens rendered. But let's ask Chris today on our call

@mobile-bungalow
Copy link
Contributor

Yeah, sounds good, if there aren't any concrete instances of attributes showing up with the wrong precedence i'm going to vote to close this issue.

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

No branches or pull requests

3 participants