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

Rewrite :visited rules to match reality, based on dbaron's spec. #2105

Closed
wants to merge 4 commits into from
Closed

Rewrite :visited rules to match reality, based on dbaron's spec. #2105

wants to merge 4 commits into from

Conversation

tabatkins
Copy link
Member

Per #2037, adapts dbaron's spec into more generic language, and adds several examples and some surrounding verbiage.

Copy link
Contributor

@FremyCompany FremyCompany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with suggestion

previously visited ones. Selectors
provides the pseudo-classes <dfn id='link-pseudo'>:link</dfn> and
<dfn id='visited-pseudo'>:visited</dfn> to distinguish them:
User agents commonly display unvisited <a href="#the-any-link-pseudo">hyperlinks</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say "User agents commonly render unvisited hyperlinks" or "Visual user agents commonly display unvisited hyperlinks".

@ionas
Copy link

ionas commented Jan 31, 2018

Now instead of messing with the spec and creating a dirty implementation that works in weird ways (like explained in dbarons blog) why could the standards body not simply remove/deprecate :visited or at least move it into a different security profile (such as trusted or local single page applications only).

Then to enable the use case (notify users of a link that has already been visited) browser vendors could implement a tool-tip that is rendered ontop of the canvas not reachable by getComputedStyle, PointerEvents or anything else as it is a OS-tooltip, which would somehow notify the user about the state of visit.

Now this is not the most convenient for users, but it is the most secure.

Another way around this would be security profiles where :visited would always work on urls of the same domain, maybe even across subdomains of the same domain, but never onto foreign domains.

Foreign domains could then implement something like access control origin where they declare which domains would show the users visiting history, users could then accept those shared history suggestions/lists.

While all these are just bits of ideas, I am pretty sure at some point in future dbarons implementation will bite back because some browser API want's to read what's the pure render color below the mouse pointer or whatnot. :visited security constraints will be forgotten quickly or ignored by "greater needs".

@tabatkins
Copy link
Member Author

:visited already exists and is commonly used; dropping it entirely isn't realistic.

There've been discussions (off-list, I think) about figuring out ways to expose :visited styling "safely" in some contexts: allow it to work normally for same-origin links; or remember what links you actually clicked from a given domain, or visited from with a Referer header (and thus, what history could have been snooped on via JS or server code anyway), and let it work normally for those links, etc.

@dbaron
Copy link
Member

dbaron commented May 4, 2018

Regarding "In full, the behavior is actually that the '':link'' pseudo-class applies to all links, ": I don't think "applies to all links" sounds right here. It might be better to restructure this somehow to say that ::link applies to all links that ::visited doesn't apply to.

(But it seems like this PR is pretty messed up... the "Files changed" view for the PR as a whole doesn't have the first commit in it... and trying to comment on the commit with the actual changes fails with "Start commit oid is not part of the pull request".)

@tabatkins
Copy link
Member Author

Yeah, I have no clue what the PR is doing; I'll have to manually reconstruct it.

@dbaron
Copy link
Member

dbaron commented May 4, 2018

(I was going to continue to review further... but I haven't actually read further yet.)

@astearns
Copy link
Member

It looks like the substantive parts of this PR were merged in some other fashion

@astearns astearns closed this Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants