Closed Bug 1363226 Opened 7 years ago Closed 7 years ago

Get rid of resize event listeners in JSON Viewer

Categories

(DevTools :: JSON Viewer, enhancement)

enhancement
Not set
normal

Tracking

(firefox55 fixed)

RESOLVED FIXED
Firefox 55
Tracking Status
firefox55 --- fixed

People

(Reporter: Oriol, Assigned: Oriol)

Details

Attachments

(1 file)

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: 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+
Keywords: checkin-needed
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
https://hg.mozilla.org/mozilla-central/rev/751a52708ddf
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: