Closed Bug 622631 Opened 15 years ago Closed 15 years ago

JavaScript Warning: "Error in parsing value for 'width'/'height'. Declaration dropped." {file: "chrome://browser/content/tabview.html" line: 0}

Categories

(Firefox Graveyard :: Panorama, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mitcho, Assigned: mitcho)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 3 obsolete files)

We see warnings like this throughout our tests, and while using Panorama. It looks like some functions, mostly zoom-related, are giving bad rects to setBounds and animate, with negative widths or heights. Most likely this means we are doing something wrong.
Turns out most of these issues seem to be stemming from a problem with pushAway... investigating...
pushAway is the main source of errors; the other is stackArrange. Working on fixes...
Attached patch Patch v1 (obsolete) — — Splinter Review
The fix for this involved creating a general Items_enforceMinimumItemSize function and using it in a few strategic places where we were apt to creating too-small-bounds, in which case our current codebase was recording that as the item's bounds but then ignoring the CSS call: i.e., the real CSS and the bounds were not in sync. Bad news. This patch fixes all such syncing issues. Ran tabview tests locally and produced no such warnings any more. Pushed to try as well.
Assignee: nobody → mitcho
Status: NEW → ASSIGNED
Attachment #501265 - Flags: review?(ian)
Blocks: 609388
Comment on attachment 501265 [details] [diff] [review] Patch v1 Thanks for tracking this down! Comments: * Instead of an Items.enforceMinimumItemSize with switches for tab or group, it would be cleaner if .enforceMinimumSize (or even .enforceMinSize) was a method on the individual concrete classes (TabItem and GroupItem). Actually, "enforce" kind of sounds like it's going to go ahead and change the item's bounds, whereas it's just modifying its input... maybe .clampToMinSize(rect) is better. * Looks like this patch fixes bug 609388 (which was already half fixed: the numbers are now the same, but they're duplicated as literals); we should resolve it when this lands. >+ // Function: enforceMinimumItemSize >+ // Takes a <Rect> and returns that <Rect>, possibly modified in case it is too small to be >+ // the bounds of an <Item>. Not only does it return the rect, but it modifies the original; it's worth making that clear in the comments. >+ bounds.width = Math.max(bounds.width, TabItems.minTabWidth); >+ bounds.height = Math.max(bounds.height, >+ TabItems.minTabWidth * (TabItems.tabHeight / TabItems.tabWidth)); We should pre-calculate the minTabHeight in TabItems so we don't have to do this math every time; this code is called from high-performance areas, such as dragging, and every bit counts.
Attachment #501265 - Flags: review?(ian) → review-
(In reply to comment #4) > Comment on attachment 501265 [details] [diff] [review] > Patch v1 > > Thanks for tracking this down! Comments: > > * Instead of an Items.enforceMinimumItemSize with switches for tab or group, it > would be cleaner if .enforceMinimumSize (or even .enforceMinSize) was a method > on the individual concrete classes (TabItem and GroupItem). Actually, "enforce" > kind of sounds like it's going to go ahead and change the item's bounds, > whereas it's just modifying its input... maybe .clampToMinSize(rect) is better. Given that this doesn't actually do something particular to that Item, I'd prefer to put it in TabItems and GroupItems. Not sure about the name .clampToMinSize, though... > * Looks like this patch fixes bug 609388 (which was already half fixed: the > numbers are now the same, but they're duplicated as literals); we should > resolve it when this lands. Yes indeed. Cool. :) > >+ // Function: enforceMinimumItemSize > >+ // Takes a <Rect> and returns that <Rect>, possibly modified in case it is too small to be > >+ // the bounds of an <Item>. > > Not only does it return the rect, but it modifies the original; it's worth > making that clear in the comments. Indeed. Updated usage appropriately as well. Do you think keeping the return value is good? > >+ bounds.width = Math.max(bounds.width, TabItems.minTabWidth); > >+ bounds.height = Math.max(bounds.height, > >+ TabItems.minTabWidth * (TabItems.tabHeight / TabItems.tabWidth)); > > We should pre-calculate the minTabHeight in TabItems so we don't have to do > this math every time; this code is called from high-performance areas, such as > dragging, and every bit counts. Done.
Attached patch Patch v1.1 (obsolete) — — Splinter Review
Attachment #501265 - Attachment is obsolete: true
Attachment #501562 - Flags: review?(ian)
Comment on attachment 501562 [details] [diff] [review] Patch v1.1 (In reply to comment #5) > Given that this doesn't actually do something particular to that Item, I'd > prefer to put it in TabItems and GroupItems. Not sure about the name > .clampToMinSize, though... Good point. I was just thinking that that would save you from having to check whether it's a group or a tab in Items.arrange. I see you solved that by just assuming it's a tab, which I suppose is always true now, though it makes me a little uncomfortable, like maybe it needs an assert or a comment, or to do the test and handle both cases. > Indeed. Updated usage appropriately as well. Do you think keeping the return > value is good? Actually, now that you mention it, let's kill the return; having the single usage pattern clears up confusion. > > We should pre-calculate the minTabHeight in TabItems so we don't have to do > > this math every time; this code is called from high-performance areas, such as > > dragging, and every bit counts. > > let TabItems = { > minTabWidth: 40, >+ minTabHeight: 30, > tabWidth: 160, > tabHeight: 120, This is a minor point, I suppose, but writing the minTabHeight explicitly isn't DRY; it doesn't show the relationship. Better to do the math here (or in the init routine). R+ with the above addressed.
Attachment #501562 - Flags: review?(ian) → review+
Attached patch Patch v1.2 (obsolete) — — Splinter Review
Fixed those points.
Attachment #501562 - Attachment is obsolete: true
Attachment #502055 - Flags: approval2.0?
Comment on attachment 502055 [details] [diff] [review] Patch v1.2 a=beltzner
Attachment #502055 - Flags: approval2.0? → approval2.0+
Attachment #502055 - Attachment is obsolete: true
Does this need a try run?
Try run of this today was botched as it was applied on an orange rev of m-c. Sending again.
Passed, modulo two known intermittent oranges.
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [qa-]
See Also: → 837136
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: