-
Notifications
You must be signed in to change notification settings - Fork 60
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
Discourage using "out-of-container" relative URLs #1939
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems I misunderstood our equilibrium point 😅
I believe the algorithm should be normative, and the explanation ("more double-dot segments than needed") informative in a note.
I think we can tweak the algorithm so that it becomes 100% correct, even if not 100% explicit.
Hm. My initial thoughts were that if we include the base element into the determination of the current context then we may get to the right algorithm but then I got the impression that there are some other details that evade me. I am happy to be stand corrected if we can turn the algo 100% with that. However, we indeed seem to have misunderstood one another, though, I believe, what is there mostly reflect the views of @mattgarrish and @bduga... |
Note also that if we take |
@iherman I was thinking something along these lines could work: For any URL string url found in the OCF Abstract Container, the following steps should return true:
To summarize, the idea is to test any URL string (relative or not, it doesn't matter), with two test container root URL, parse it with their host-defined base, and inspect the two resulting strings:
I believe this algorithm fully achieves what we want to test. What do you think? |
Also, note that contrary to what I initially suggested in #1912, the above does not touch the URL standard definitions (of what is a relative-URL string, specifically). It just adds a SHOULD criteria to all URL strings, in addition to the individual syntactic criteria (MUST) that we already define elsewhere. |
@rdeltour yes, that works I believe. That will affect the preceding paragraph that should, probably, disappear or be merged with another note that gives some background of what is to be achieved here. I can figure out something and we can take it from there. it is better than what is currently in the PR; it does look a bit funny to have an algorithm in a note like that. |
Ok, I have made the changes. I know that, from a content point of view, the constraints on the container root URL are not strictly necessary, and we could rely on the Reading System spec only. However, I believe it is better to keep them here; it gives a complete picture for the author and may be an important aspect for someone wanting to add some more complex scripts to the publication. So I kept this for now. I also used a trick that @mattgarrish and I used in the Publication Manifest spec, namely to use the I have, finally, moved the example and also added the example in the original problem setting of @rdeltour to make it clearer what happens with out-of-container cases. |
Sounds good! I’ll review as soon as possible. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
I prefer this version to the previous in-note algorithm 😊. Also, the inline explanations are helpful.
See comment details for some editorial suggestions.
…com/w3c/epub-specs into editorial/out-of-container-url-1912
@mattgarrish @dauwhe I plan to merge this PR this (Monday) evening or tomorrow morning; I have the impression that we have now converged to an acceptable consensus (we can always come back to some details in separate issues, if we want). Any objections? |
Trying to understand the algorithm, using Example 53.
Is this correct? |
yes, exactly 👍 |
This is the translation into a PR of the equilibrium point in the discussion in #1912.
Fixes #1912
Preview | Diff