Closed
Bug 740543
Opened 13 years ago
Closed 13 years ago
Rule view does not update when window is resized
Categories
(DevTools :: Inspector, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 15
People
(Reporter: dangoor, Assigned: dcamp)
References
Details
Attachments
(1 file, 3 obsolete files)
22.65 KB,
patch
|
Details | Diff | Splinter Review |
STR:
1. Open this test case: https://bug722196.bugzilla.mozilla.org/attachment.cgi?id=601603
2. open the page inspector
3. make sure the content area is fairly narrow (so that the media query kicks in)
4. lock on the red box and look at the rule view values
5. expand the window
6. the red box expands, but the rule view still says "width: 200px" and lists the media query
expected result: the rule view updates to reflect the new styles
(note that the property view is quite possibly doing the same thing, I just didn't look at this time)
Assignee | ||
Comment 1•13 years ago
|
||
Doesn't have a good test yet, and I want to revisit one or two of the choices.
Assignee | ||
Comment 2•13 years ago
|
||
I'm not a huge fan of this patch, but it makes the responsive design view much more useful.
Attachment #628457 -
Attachment is obsolete: true
Attachment #629391 -
Flags: review?(paul)
Comment 3•13 years ago
|
||
Comment on attachment 629391 [details] [diff] [review]
v1
Review of attachment 629391 [details] [diff] [review]:
-----------------------------------------------------------------
So the inspector listens to the "resize" event of the page, then, emit a "resize" event. The ruleview listen to this event, and call a specific function (onResize).
I am not against this path, but this feels a lot "resize" specific.
What about that:
The inspector emits an event: "page_layout_update" on resize. Then the ruleview call scheduleRefresh when it gets this event.
In the future, we would use this event when we detect a layout update (on DOM updates, or if the JS code plays with the CSSOM).
And we could use this event in the layoutview as well.
(basically, just rename the event, and remove the onResize function).
Some other ideas:
Maybe it's better to listen the the MozAfterPaint events instead of "resize" (this is what I do for the layoutview).
And maybe it's better to do the "delaying" (250ms timer) on the inspector side.
What do you think?
::: browser/devtools/styleinspector/StyleInspector.jsm
@@ +119,5 @@
> this.inspector.on("change", this._onChange);
>
> + this.inspector.on("sidebaractivated-ruleview", this._onChange);
> +
> + this._onResize = this.onResize.bind(this);
_onResizeBound?
Attachment #629391 -
Flags: review?(paul)
Assignee | ||
Comment 4•13 years ago
|
||
This version moves the timeout management into Inspector. It uses a change event with a 'layout' detail.
As discussed on irc, for now we're only responding to resize events.
Attachment #629391 -
Attachment is obsolete: true
Attachment #629497 -
Flags: review?
Assignee | ||
Comment 5•13 years ago
|
||
Assignee | ||
Updated•13 years ago
|
Attachment #629497 -
Flags: review? → review?(paul)
Comment 6•13 years ago
|
||
Comment on attachment 629497 [details] [diff] [review]
v2
+ _scheduleLayoutChange: function Inspector_scheduleLayoutChange()
+ {
+ if (this._timer) {
+ return null;
+ }
+ this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
+ this._timer.init(
+ function() {
+ this.change("layout");
+ }.bind(this),
+ LAYOUT_CHANGE_TIMER, Ci.nsITimer.TYPE_ONE_SHOT);
+ },
Is this any different than just using setTimeout, other than looking cool?
13:25 < robcee> also, I'm not sure if we've gotten away from using isFunctionName for testing
functions that return booleans or not in inspector code
13:26 < robcee> panelVisible vs. isPanelVisible?
13:27 < robcee> yeah, I think we do
13:28 < robcee> isInspectorOpen, isDirty
13:30 < robcee> extra indents in your _thaw: function
13:31 < robcee> in _emit, there's a for each in loop you can switch to for .. of since you're in
there
13:31 <@dcamp> oh right
(in CssRuleView)
+ get editing() {
+ return this.element.querySelectorAll(".styleinspector-propertyeditor").length > 0;
+ },
isEditing?
r+ with those.
Attachment #629497 -
Flags: review?(paul) → review+
Assignee | ||
Comment 7•13 years ago
|
||
Fixed everything mentioned above, and added a few method comments because I want to be popular.
Attachment #629497 -
Attachment is obsolete: true
Assignee | ||
Comment 8•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Priority: -- → P2
Resolution: --- → FIXED
Target Milestone: --- → Firefox 15
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•