Closed
Bug 629189
Opened 15 years ago
Closed 15 years ago
Rect.contains should be inclusive
Categories
(Firefox Graveyard :: Panorama, defect, P4)
Firefox Graveyard
Panorama
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 4.0b12
People
(Reporter: iangilman, Assigned: mitcho)
References
Details
(Whiteboard: [qa-])
Attachments
(2 files, 2 obsolete files)
3.35 KB,
patch
|
Details | Diff | Splinter Review | |
1.54 KB,
patch
|
Details | Diff | Splinter Review |
I was reminded today that our Rect.contains looks like so:
contains: function Rect_contains(a) {
return (a.left > this.left &&
a.right < this.right &&
a.top > this.top &&
a.bottom < this.bottom);
},
... whereas it should look like so:
contains: function Rect_contains(a) {
return (a.left >= this.left &&
a.right <= this.right &&
a.top >= this.top &&
a.bottom <= this.bottom);
},
(I believe this is all my fault; a misunderstanding)
It should be an easy enough fix... just have to make sure it doesn't have any unwanted repercussions.
Assignee | ||
Comment 1•15 years ago
|
||
It's possible that this will just barely cause one of the dragging/drop/snapping tests to fail, but tweaking the rect size of whatever group or tab we're creating should fix it.
Assignee | ||
Comment 2•15 years ago
|
||
Ian, I assume Rect_intersects can stay as it is?
Assignee | ||
Comment 3•15 years ago
|
||
Created trivial patch, no changes to tests (all passed locally without tweaking), so sent to try.
Reporter | ||
Comment 4•15 years ago
|
||
(In reply to comment #2)
> Ian, I assume Rect_intersects can stay as it is?
Yes please; it's good how it is.
(In reply to comment #3)
> Created trivial patch, no changes to tests (all passed locally without
> tweaking), so sent to try.
Attach the patch?
Assignee | ||
Comment 5•15 years ago
|
||
Passed try.
Reporter | ||
Comment 6•15 years ago
|
||
Comment on attachment 508957 [details] [diff] [review]
Trivial patch
Thanks!
Attachment #508957 -
Flags: review?(ian) → review+
Assignee | ||
Updated•15 years ago
|
Attachment #508957 -
Flags: approval2.0?
Comment 7•15 years ago
|
||
Comment on attachment 508957 [details] [diff] [review]
Trivial patch
Not going to approve this without a test. The expected behavior was clearly not tested before, so let's get one added.
Attachment #508957 -
Flags: approval2.0? → approval2.0-
Assignee | ||
Comment 8•15 years ago
|
||
The corresponding method in Toolkit's Geometry.jsm (which we hope to move to in the post-fx4-soon future) also lacks tests for this method: filed bug 631757.
Assignee | ||
Comment 9•15 years ago
|
||
Pushed to try: http://tbpl.mozilla.org/?tree=MozillaTry&rev=d462db8c443a
Attachment #508957 -
Attachment is obsolete: true
Attachment #509984 -
Flags: approval2.0?
Assignee | ||
Comment 10•15 years ago
|
||
All passed, modulo two platforms with known intermittent oranges, and one platform whose tests failed prematurely due to a known intermittent orange. Getting that one platform rerun (bug 631867).
Assignee | ||
Comment 11•15 years ago
|
||
Passed try. Here's the log for osx debug whose mochitest was rerun:
http://ftp.mozilla.org/pub/mozilla.org/firefox/tryserver-builds/mmitcho@mozilla.com-d462db8c443a/tryserver-macosx-debug/tryserver_leopard-o-debug_test-mochitest-other-build642.txt.gz
Updated•15 years ago
|
Attachment #509984 -
Flags: approval2.0? → approval2.0+
Assignee | ||
Comment 12•15 years ago
|
||
Attachment #509984 -
Attachment is obsolete: true
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Comment 13•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 4.0b12
Comment 14•15 years ago
|
||
Comment on attachment 510485 [details] [diff] [review]
Patch for checkin
>+ // Returns a boolean denoting if the given <Rect> is contained within
>+ // the this rectangle.
// this rectangle.
>+ let {Rect} = Components.utils.import("resource:///modules/tabview/utils.jsm", {});
>+
>+ let referenceRect = new Rect(50,50,150,150);
>+ let rect = new Rect(100,100,100,100);
>+
>+ ok(referenceRect.contains(referenceRect), "A rect contains itself");
>+ ok(referenceRect.contains(rect), "[50,50,150,150] contains [100,100,99,99]");
Shouldn't this say [100,100,100,100]?
I'm commenting here since neither change is a change in functionality and can hopefully be done as a typo-fix style follow-up checkin.
Reporter | ||
Comment 15•14 years ago
|
||
Mitcho, do you want to address the items highlighted in comment 14?
Assignee | ||
Comment 16•14 years ago
|
||
Thanks jst.
Comment 17•14 years ago
|
||
Pushed the follow-up: http://hg.mozilla.org/mozilla-central/rev/4a6ba480150a
(In reply to comment #16)
> Thanks jst.
s/st/ag/
:-)
Assignee | ||
Comment 18•14 years ago
|
||
(In reply to comment #17)
> (In reply to comment #16)
> > Thanks jst.
>
> s/st/ag/
>
> :-)
Sorry... hope I don't have to file another typo patch for that too.
Comment 19•14 years ago
|
||
LOL. Also, being mistaken for jst is quite the honor!
Updated•14 years ago
|
Whiteboard: [qa-]
Updated•9 years ago
|
Product: Firefox → Firefox Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•