Get rid of resize event listeners in JSON Viewer

RESOLVED FIXED in Firefox 55

Status

RESOLVED FIXED
2 years ago
4 months ago

People

(Reporter: Oriol, Assigned: Oriol)

Tracking

unspecified
Firefox 55

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
JSON Viewer uses this code:

  let onResize = event => {
    window.document.body.style.height = window.innerHeight + "px";
    window.document.body.style.width = window.innerWidth + "px";
  };
  window.addEventListener("resize", onResize);

It's well-known that resize event listeners are called too frequently and harm performance.

And anyways that code looks useless. It seems viewport units could be used in CSS. Or even remove that code entirely.
(Assignee)

Comment 1

2 years ago
Created attachment 8865699 [details] [diff] [review]
json-remove-resize.patch
Assignee: nobody → oriol-bugzilla
Status: NEW → ASSIGNED
Attachment #8865699 - Flags: review?(odvarko)
Comment on attachment 8865699 [details] [diff] [review]
json-remove-resize.patch

Review of attachment 8865699 [details] [diff] [review]:
-----------------------------------------------------------------

Looks reasonable!

R+

Thanks,
Honza
Attachment #8865699 - Flags: review?(odvarko) → review+
(Assignee)

Updated

2 years ago
Keywords: checkin-needed

Comment 3

2 years ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/751a52708ddf
Remove resize event listeners in JSON Viewer and use CSS instead. r=Honza
Keywords: checkin-needed

Comment 4

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/751a52708ddf
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55

Updated

4 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.