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

QualName should have a prefix member #26

Closed
Ms2ger opened this issue Oct 18, 2014 · 6 comments
Closed

QualName should have a prefix member #26

Ms2ger opened this issue Oct 18, 2014 · 6 comments

Comments

@Ms2ger
Copy link
Contributor

Ms2ger commented Oct 18, 2014

There doesn't seem to be a good reason to omit that.

@kmcallister
Copy link
Contributor

The main drawback is that it will make QualName 50% bigger. We usually don't care about prefixes and don't use them in comparison, although I guess we have to thread them through everywhere.

I'd actually like to intern common triples of (local name, namespace, prefix) as a single 64-bit word. The problem then is how to efficiently compare these while ignoring the prefix.

Is it possible for a name in the HTML namespace to have a non-empty prefix? I don't think there's any way to express those in the HTML syntax, but I suppose it can be done in XHTML.

@SimonSapin
Copy link
Member

Indeed not with HTML syntax, but anything is possible in XML syntax (XHTML) or through DOM manipulation.

@SimonSapin
Copy link
Member

That said, such rare case don’t have to be fast as long as they’re correct.

@chotchki
Copy link

@kmcallister would this be considered an easy fix?

@SimonSapin
Copy link
Member

Indeed not with HTML syntax

Correction: the HTML parser does emit non-empty prefixes in some cases: https://html.spec.whatwg.org/multipage/#adjust-foreign-attributes

@nicoburns
Copy link

Closing as string_cache no longer has a QualName type (since the 0.3.0 in Nov 2016). Furthermore, the QualName type in markup5ever which replaced it has a prefix member.

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

5 participants