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

Rename non-relative-flag #89

Closed
annevk opened this issue Feb 11, 2016 · 11 comments
Closed

Rename non-relative-flag #89

annevk opened this issue Feb 11, 2016 · 11 comments

Comments

@annevk
Copy link
Member

annevk commented Feb 11, 2016

  • not-a-base-url flag
  • cannot-be-a-base-url flag

Better suggestions welcome.

When we change this at least HTML needs to be updated too.

@SimonSapin
Copy link
Contributor

Maybe call it hierarchical flag and invert the logic? It’s annoying to type and pronounce, but RFC 3986 seems to be using that term for roughly this concept.

@domenic
Copy link
Member

domenic commented Feb 19, 2016

I liked my "cannot-be-a-base-url flag" idea since it clears up my confusion over exactly what the flag is for. In whatwg/html#660 @annevk explained that "The flag indicates whether a relative URL can be parsed against it." Whereas it's not clear to me that "hierarchical" URLs can be used as a base URL.

@SimonSapin
Copy link
Contributor

I’d like a term for URLs with that flag set, for using in rust-url documentation. It’s currently "non-relative URL", e.g. "Non-relative URLs (typical of data: and mailto:) and some file: URLs don’t have a host." for the fn host(&self) -> Option<&str> method.

"URLs that can’t be a base" doesn’t feel like a category of its own but (I think) leaves the reader wondering which URLs can be used as a base or not.

(This is half arguing about this issue and half asking for doc-writing advice :))

@annevk
Copy link
Member Author

annevk commented Feb 20, 2016

I think hierarchical is bad since it will just lead to confusion with RFC 3986 which has slightly different ideas on this that don't match browsers.

URLs that cannot be used as a base URL does seem like a category. I think it's basically all URL strings that do not have a / after the scheme followed by a ":", minus special URLs. Admittedly a little tricky, but that's how it is.

@annevk annevk closed this as completed Feb 20, 2016
@annevk annevk reopened this Feb 20, 2016
@SimonSapin
Copy link
Contributor

I’m ok with something like "can be a base". (Rather than "cannot", to avoid double negations.)

I’d like this to be decided one way or another before I land servo/rust-url#176, since it includes public API named after this flag.

@annevk
Copy link
Member Author

annevk commented Mar 23, 2016

"can be a base" however would have to be set by default, which is highly unusual for flags. So I don't think that's an option.

@SimonSapin
Copy link
Contributor

I don’t understand why flipping the default is a problem. The defaults are just the starting point of the parsing algorithm, then don’t form a "well-formed" URL record in themselves. For example the empty string is not a scheme per https://url.spec.whatwg.org/#syntax-url-scheme

And even with "can be a base" the default can still be unset and the flag be set in another set of cases in the parsing algorithm.

But I can live with double negations if you feel strongly that the alternative is worse.

@annevk
Copy link
Member Author

annevk commented Mar 23, 2016

I think it would be quite weird to unset something and only have checks for it being unset. "cannot-be-a-base-URL flag" is still my favorite.

@SimonSapin
Copy link
Contributor

Ok. Does it help if I send a PR for that?

@annevk
Copy link
Member Author

annevk commented Mar 23, 2016

Yes, please, I'll get to it tomorrow. Been rather busy with HTML and DOM.

@SimonSapin
Copy link
Contributor

FWIW I’ve started to rewrite rust-url docs to use phrases like "cannot-be-a-base URLs" and "If this URL is cannot-be-a-base", with hyphens as-is.

@annevk annevk closed this as completed in 2f4161d Mar 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants