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

RESOLVED FIXED in Firefox 63

Status

()

enhancement
RESOLVED FIXED
10 months ago
10 months ago

People

(Reporter: bzbarsky, Assigned: njn)

Tracking

unspecified
mozilla63
Points:
---

Firefox Tracking Flags

(firefox63 fixed)

Details

Attachments

(1 attachment)

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)
Assignee

Comment 1

10 months ago
It's throwing because things like `about:memory#end0` aren't valid selectors.
Attachment #9005535 - Flags: review?(bzbarsky)
Assignee

Updated

10 months ago
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Assignee

Comment 2

10 months ago
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+

Comment 5

10 months ago
Pushed by nnethercote@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d929a08b7cce
Remove bogus link override code in about:memory. r=bz

Comment 6

10 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d929a08b7cce
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.