Closed Bug 1348005 Opened 7 years ago Closed 7 years ago

Grid outline needs to update on reflow

Categories

(DevTools :: Inspector, defect, P3)

defect

Tracking

(firefox55 fixed)

RESOLVED FIXED
Firefox 55
Tracking Status
firefox55 --- fixed

People

(Reporter: gl, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

      No description provided.
Gabriel, could you elaborate a bit this bug?
Assignee: nobody → zer0
Status: NEW → ASSIGNED
Flags: needinfo?(gl)
Assignee: zer0 → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(gl)
Can we have a scenario or test page that highlights the issue here?
Flags: needinfo?(gl)
STR.
1. Enable grid outline - search for gridoutline in about:config
2. Go to http://labs.jensimmons.com/2016/examples/grid-content-1.html
3. Observe grid outline when resizing the page
Flags: needinfo?(gl)
Attached image grid_outline_resize.gif
I still don't get what is wrong here :/

The layout seems to update when resizing the window (you can check the attached GIF). What needs to be changed here?
Flags: needinfo?(gl)
Flags: needinfo?(gl)
Comment on attachment 8852618 [details]
Bug 1348005 - update grid panel on reflows;

https://reviewboard.mozilla.org/r/124808/#review127350

::: devtools/client/inspector/boxmodel/box-model.js:49
(Diff revision 1)
>    this.onShowBoxModelEditor = this.onShowBoxModelEditor.bind(this);
>    this.onShowBoxModelHighlighter = this.onShowBoxModelHighlighter.bind(this);
>    this.onSidebarSelect = this.onSidebarSelect.bind(this);
>    this.onToggleGeometryEditor = this.onToggleGeometryEditor.bind(this);
>  
> +  this.inspector.reflowTracker.on("reflow", this.updateBoxModel);

This should only be on when the sidebar is selected.

::: devtools/client/inspector/grids/grid-inspector.js:89
(Diff revision 1)
>      );
>  
>      this.highlighters.on("grid-highlighter-hidden", this.onHighlighterChange);
>      this.highlighters.on("grid-highlighter-shown", this.onHighlighterChange);
>      this.inspector.on("markupmutation", this.onMarkupMutation);
> +    this.inspector.reflowTracker.on("reflow", this.onReflow);

This should only be on when the sidebar is selecte.d

::: devtools/client/inspector/grids/grid-inspector.js:105
(Diff revision 1)
>      this.highlighters.off("grid-highlighter-hidden", this.onHighlighterChange);
>      this.highlighters.off("grid-highlighter-shown", this.onHighlighterChange);
>      this.inspector.off("markupmutation", this.onMarkupMutation);
> +    this.inspector.reflowTracker.off("reflow", this.onReflow);
>      this.inspector.sidebar.off("select", this.onSidebarSelect);
> +

I dont think we need this new line

::: devtools/client/inspector/inspector.js:99
(Diff revision 1)
>    this.panelDoc = window.document;
>    this.panelWin = window;
>    this.panelWin.inspector = this;
>  
>    this.highlighters = new HighlightersOverlay(this);
> +  this.reflowTracker = new ReflowTracker(this._target);

We need to make sure we destroy this (this.reflowTracker = null) and have a destroy method inside ReflowTracker to prevent leaks.

::: devtools/client/inspector/shared/reflow-tracker.js:58
(Diff revision 1)
> +    if (this.listeners.has(listener)) {
> +      return;
> +    }
> +
> +    // No listener interested in reflows yet, start tracking.
> +    if (this.count === 0) {

This can simply be if (this.count === 0 && this.reflowFront)
Attachment #8852618 - Flags: review?(gl)
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Comment on attachment 8852618 [details]
Bug 1348005 - update grid panel on reflows;

https://reviewboard.mozilla.org/r/124808/#review127684
Attachment #8852618 - Flags: review?(gl) → review+
https://hg.mozilla.org/mozilla-central/rev/d7947c28ab4f
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: