Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That should be fine. If they make selectors that have an a:visited (and whatever else) take the special code paths it should work fine. The style test in your example is going to be uniform across visited and unvisited unless it's something like:

a:visited .test { /* sneaky style */ }



That's exactly my point. If I define:

  a .test {
    color: red;
  }
  
  a:visited .test {
    color: green;
  }
Then I could for example using jQuery do:

  $('a .test').each(function() {
    if ( $(this).css('color') == 'green' ) {
      console.log( $(this).parent().attr('href') );
    }
  });
Is that incorrect?


| When a web page tries to get the computed style of a link (or any of its sub-elements), Firefox will give it unvisited style values.


They've probably thought about this, but what about siblings?

a:visited + .sneakydiv { /* ... */ }


Ah, there it is.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: