Closed
Bug 875902
Opened 11 years ago
Closed 11 years ago
[toolbox] Simplify selectTool and test for panel readiness
Categories
(DevTools :: Framework, defect)
DevTools
Framework
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 24
People
(Reporter: dcrewi, Assigned: dcrewi)
Details
(Whiteboard: [fixed-in-fx-team])
Attachments
(1 file, 4 obsolete files)
6.31 KB,
patch
|
Details | Diff | Splinter Review |
When waiting for panels to load, the toolbox listens for the DOMContentLoaded event, but it should listen for the load event instead. This results in, at the very least, the promise returned by gDevTools.showToolbox(...) resolving before the panel is completely initialized, though only for some tools. This has caused me some problems when writing tests for other bugs. The difference between the two events is defined here: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → dcrewi
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #753918 -
Flags: review?(dcamp)
Comment 2•11 years ago
|
||
I think I remember Paul mentioned that he used DOMContentLoaded on purpose, instead of the load event. I can't seem to recall the exact reason though...
Comment 3•11 years ago
|
||
Comment on attachment 753918 [details] [diff] [review] patch v1 I think Joe is a better reviewer here.
Attachment #753918 -
Flags: review?(dcamp) → review?(jwalker)
Comment 4•11 years ago
|
||
Comment on attachment 753918 [details] [diff] [review] patch v1 Review of attachment 753918 [details] [diff] [review]: ----------------------------------------------------------------- Hmmm. I've not heard Paul say we should be using DOMContentLoaded, and it seems to me as though 'load' makes more sense here. But Paul is back in a few days time, so I suggest we wait and ask him. Personally, I think I'd rather have a panel.ready() function that returns a promise that's resolved when the panel is ready. That means we don't need to expose the panelWin object everywhere. Does that make sense?
Attachment #753918 -
Flags: review?(jwalker)
Assignee | ||
Comment 6•11 years ago
|
||
Well the other reason to expose panelWin is so that the test has something to test. I suppose that could be moved to an "isReady" property or method.
Assignee | ||
Comment 7•11 years ago
|
||
So what is the call on DOMContentLoaded vs load? Either way, this is a slightly better way to write selectTool and loadTool.
Attachment #756004 -
Attachment is obsolete: true
Attachment #758137 -
Flags: feedback?(paul)
Comment 8•11 years ago
|
||
(In reply to David Creswick from comment #0) > When waiting for panels to load, the toolbox listens for the > DOMContentLoaded event, but it should listen for the load event instead. > This results in, at the very least, the promise returned by > gDevTools.showToolbox(...) resolving before the panel is completely > initialized, though only for some tools. iirc, we use DOMContentLoaded for performance reasons (showing the tools as soon as possible). > This has caused me some problems when writing tests for other bugs. What kind of problems?
Assignee | ||
Comment 9•11 years ago
|
||
(In reply to Paul Rouget [:paul] from comment #8) > (In reply to David Creswick from comment #0) > > iirc, we use DOMContentLoaded for performance reasons (showing the tools as > soon as possible). Oh, I suppose that makes sense. I wasn't thinking about the interactive case. > > This has caused me some problems when writing tests for other bugs. > > What kind of problems? In my test, I wanted access to the CssRuleView object of the inspector tool, but it isn't available until the window of the tab's iframe has loaded. I reviewed that case again this morning and realized I should probably be waiting for the rule view tab to load instead of the inspector panel. It wasn't unreasonable to imagine that tools would defer some initialization until the load event fires, so I wrote the test hoping to fix all cases. The options panel, the inspector panel, and the styleeditor panel all report to be ready before their content document's load event fires. It doesn't look like that is actually the problem I thought it was though.
Assignee | ||
Updated•11 years ago
|
Summary: [toolbox] Ensure a panel's document is completely loaded before resolving promise → [toolbox] Simplify selectTool and test for panel readiness
Assignee | ||
Comment 10•11 years ago
|
||
Hijacking this bug number to simplify selectTool and test for panel readiness.
Attachment #758137 -
Attachment is obsolete: true
Attachment #758137 -
Flags: feedback?(paul)
Attachment #760431 -
Flags: review?(paul)
Updated•11 years ago
|
Attachment #760431 -
Flags: review?(paul) → review+
Assignee | ||
Updated•11 years ago
|
Whiteboard: [land-in-fx-team]
Assignee | ||
Comment 11•11 years ago
|
||
Attachment #760431 -
Attachment is obsolete: true
Comment 12•11 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/1d0d9f1d6321
Whiteboard: [land-in-fx-team]
Comment 13•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/1d0d9f1d6321
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Updated•11 years ago
|
Target Milestone: --- → Firefox 24
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•