Skip to content

Support clicking links with URL fragments for the current page #1716

Closed

Activity

  1. jdm commented on Feb 20, 2014

    @jdm
    MemberAuthor
  2. kmcallister commented on Mar 3, 2014

    @kmcallister
    Contributor

    We have some support already, added for Acid2, which contains a link to #top.

  3. june0cho commented on Mar 4, 2014

    @june0cho
    Contributor

    In current version, when URL fragment should find an element with id attribute, it is scrolled to the right position. (case of Acid2)
    But, when URL fragment should find a element with name attribute, it does not work.

  4. caitp commented on Apr 27, 2014

    @caitp

    to document this issue, anchors with the "name" attribute work perfectly well for fragment links, provided load_url_from_element() is ever called.

    This will in many cases not be called, because hit tests fail. gfx::DisplayItem seems to report bogus origin coordinates (on osx and linux/x11 using the skia renderer, at any rate). Fixing that should make it "work".

  5. Martiusweb commented on Jun 22, 2014

    @Martiusweb
    Contributor

    I spent some time on this issue, and here are my findings.

    The previous comment is outdated (the symbols load_url_from_element(), etc don't exist anymore).

    I think that it does not work when the element with an id attribute is an inline element, and the result is the same with a <a name="..."> anchor for the same reason.

    In ScriptTask::trigger_fragment, we should check if the element returned by find_fragment_node falls in this case and find its actual position. @jdm suggested that we scroll to the position of the child text node, but I don't know if it would work if the element is empty.

  6. pcwalton commented on Jun 24, 2014

    @pcwalton
    Contributor

    This is basically correct, but we should definitely not be using the display list for this. We should be crawling the render tree, finding the right node, and pulling out its absolute position.

  7. jdm commented on Jun 24, 2014

    @jdm
    MemberAuthor

    @Martiusweb I believe in practice that means you want the top ancestor of the node, and then call get_layout_root on it to obtain the render tree that @pcwalton mentions.

  8. kball commented on Jul 6, 2015

    @kball
    Contributor

    I'd like to take a look at this. Does anyone know if there are existing test cases somewhere in the repo?

  9. jdm commented on Jul 6, 2015

    @jdm
    MemberAuthor

    There are lots of tests that contain anchors to page fragments, but I highly doubt that they end up testing the scrolling behaviour we're looking for here. I suggest writing some yourself!

  10. jdm commented on Jul 6, 2015

    @jdm
    MemberAuthor

    Note: http://mxr.mozilla.org/servo/source/components/script/script_task.rs#1340 is the code that should be triggering the scrolling here. We may have fixed this unintentionally as part of #3790, but thorough testing would be valuable.

  11. kball commented on Jul 6, 2015

    @kball
    Contributor

    @jdm Thanks for the rapid response!

    A very simple (manual) test indicates that not all cases are fixed. I'll set up some more automated tests. Do you have a recommendation as to where in the web-platform-tests they should live?

  12. jdm commented on Jul 6, 2015

    @jdm
    MemberAuthor
  13. KiChjang commented on Dec 1, 2015

    @KiChjang
    Contributor

    @kball what's the status of this?

  14. 53 remaining items

  15. added 6 commits that reference this issue on Feb 14, 2016
  16. added a commit that references this issue on Feb 15, 2016
  17. added 5 commits that reference this issue on Feb 16, 2016
  18. added 2 commits that reference this issue on Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domC-assignedE-more-complex

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions