Closed Bug 1486486 Opened 6 years ago Closed 6 years ago

Jumping between processes in about:memory still changes the URL bar

Categories

(Toolkit :: about:memory, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: bzbarsky, Assigned: n.nethercote)

Details

Attachments

(1 file)

The bits added in bug 929826 to override normal link behavior look like this:

    link.addEventListener("click", function(event) {
      document.documentElement.scrollTop =
        document.querySelector(event.target.href).offsetTop;
      event.preventDefault();
    });

This doesn't work, because event.target.href is an absolute URI if event.target is an <a>.  So this is passing strings like "about:memory#end0" to querySelector, which throws because that's not a valid selector.  As a result, the default action happens.

That said, fixing this to use getAttribute("href") causes scrolling to happen to not-quite-the-right-place, because the offsetTop of the element doesn't actually correspond to its viewport position, since the offsetParent's rect is not at the top-left of the viewport.  So maybe this whole chunk should just be removed.
Flags: needinfo?(n.nethercote)
It's throwing because things like `about:memory#end0` aren't valid selectors.
Attachment #9005535 - Flags: review?(bzbarsky)
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Thanks for identifying this. I agree that the behaviour obtained with this code gone is reasonable... given that it's the same behaviour as we currently get, minus the thrown exception :)
Flags: needinfo?(n.nethercote)
Comment on attachment 9005535 [details] [diff] [review]
Remove bogus link override code in about:memory

r=me
Attachment #9005535 - Flags: review?(bzbarsky) → review+
Pushed by nnethercote@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d929a08b7cce
Remove bogus link override code in about:memory. r=bz
https://hg.mozilla.org/mozilla-central/rev/d929a08b7cce
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: