Closed Bug 631934 Opened 13 years ago Closed 13 years ago

Remove childHitResult.shouldZoom switch in TabItem_zoomIn

Categories

(Firefox Graveyard :: Panorama, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 4.0b12

People

(Reporter: mitcho, Assigned: raymondlee)

References

Details

(Whiteboard: [cleanup][qa-][polish])

Attachments

(2 files, 2 obsolete files)

The idea with childHitResult.shouldZoom is that GroupItem_childHit is able to return a false value to block the zoomin, but this actually isn't used, as far as I can see. We should simply remove this bit of logic from TabItem_zoomIn and GroupItem_childHit, instead using GroupItem_childHit to simply be called to return the callback, if necessary.
Assignee: nobody → raymond
Status: NEW → ASSIGNED
Attached patch v1 (obsolete) — Splinter Review
Attachment #510191 - Flags: review?(ian)
Attachment #510191 - Flags: feedback?(mitcho)
Comment on attachment 510191 [details] [diff] [review]
v1

This is what I had in mind but, now that I look at it, I realize I think we could get rid of childHit completely... instead, in TabItem_zoomIn's onZoomDone, add a line that says:

> if (self.parent)
>   self.parent.collapse();
Attachment #510191 - Flags: feedback?(mitcho) → feedback-
Attached patch v1 (obsolete) — Splinter Review
Removed the childHit method.
Attachment #510191 - Attachment is obsolete: true
Attachment #510191 - Flags: review?(ian)
Attachment #510207 - Flags: review?(ian)
Attachment #510207 - Flags: feedback?(mitcho)
Comment on attachment 510207 [details] [diff] [review]
v1

>+      if (!groupItem._isStacked || groupItem.expanded)
>+        shouldGroupCollapse = true;

This actually needs to simply be |if (groupItem.expanded)|. This is bug 631936, but we could just fix it here.

>+      else
>+        GroupItems.setActiveGroupItem(groupItem);

Note: setActiveGroupItem will be removed from this section in bug 597980. I'll leave it up to Ian to decide how separate we want these patches to be, or, because they're all touching the same section of code, if we want to roll them all into one patch.

f+ with the if condition changed.
Attachment #510207 - Flags: feedback?(mitcho) → feedback+
Comment on attachment 510207 [details] [diff] [review]
v1

(In reply to comment #4)
> >+      if (!groupItem._isStacked || groupItem.expanded)
> >+        shouldGroupCollapse = true;
> 
> This actually needs to simply be |if (groupItem.expanded)|. This is bug 631936,
> but we could just fix it here.

Yeah, we should just make the change here and retire that bug. 

> >+      else
> >+        GroupItems.setActiveGroupItem(groupItem);
> 
> Note: setActiveGroupItem will be removed from this section in bug 597980. I'll
> leave it up to Ian to decide how separate we want these patches to be, or,
> because they're all touching the same section of code, if we want to roll them
> all into one patch.

Let's land bug 597980 separately; that one actually fixes a bug, whereas this is just code clean-up.

Speaking of which, while code clean-up is certainly valuable, I think we're past the point where we should be doing it before the Fx4 release. It distracts us from fixing user-visible bugs (which should be our priority at this point), and it has the potential to cause new problems. That said, I'm okay with this patch (once it's been fixed up), as long as the drivers are, but please no more purely code clean-up patches before Fx4. Please do keep filing code clean-up bugs, but let's actually fix them after Fx4.

>+    let shouldGroupCollapse = false;
>+    let groupItem;
>+
>+    if (this.parent) {
>+      groupItem = this.parent;
>+
>+      if (!groupItem._isStacked || groupItem.expanded)
>+        shouldGroupCollapse = true;
>+      else
>+        GroupItems.setActiveGroupItem(groupItem);
>+    }

Once bug 597980 lands, we can get rid of all of this, in favor of modifying this:

>+      if (shouldGroupCollapse)
>+        groupItem.collapse();

... to this: 

  if (self.parent && self.parent.expanded)
    self.parent.collapse();
    
Don't forget to add the self = this declaration back in, of course.
Attachment #510207 - Flags: review?(ian) → review-
Depends on: 597980
Attached patch v1Splinter Review
Only land this after bug 597980 has landed.
Attachment #510207 - Attachment is obsolete: true
Attachment #510508 - Flags: review?(ian)
Comment on attachment 510508 [details] [diff] [review]
v1

Not sure why this is called v1, but f+.

+ Gavin for quick review while Ian is out.
Attachment #510508 - Flags: review?(gavin.sharp)
Attachment #510508 - Flags: feedback+
Comment on attachment 510508 [details] [diff] [review]
v1

Looks good
Attachment #510508 - Flags: review?(ian)
Attachment #510508 - Flags: review?(gavin.sharp)
Attachment #510508 - Flags: review+
Attachment #510508 - Flags: approval2.0?
What's the change in behavior with this patch? Any? Or is it just code cleanup?

Did it pass try?

Does the change need a new test, or does an existing test flex this codepath?
(In reply to comment #9)
> What's the change in behavior with this patch? Any? Or is it just code cleanup?

None. Just cleanup.

> Did it pass try?

Looks like it hasn't been sent. I'll send it now.

> Does the change need a new test, or does an existing test flex this codepath?

It's hit by multiple tests.
Pushed to try: http://tbpl.mozilla.org/?tree=MozillaTry&rev=f2fa22612d4d
Whiteboard: [cleanup][qa-][polish] → [cleanup][qa-][polish][must land 597980 first]
(In reply to comment #11)
> Pushed to try: http://tbpl.mozilla.org/?tree=MozillaTry&rev=f2fa22612d4d

Passed try, modulo two known intermittent oranges.
Attachment #510508 - Flags: approval2.0? → approval2.0+
Please check in the patch for bug 597980 before this one.
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/cc7de25eaf70
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [cleanup][qa-][polish][must land 597980 first] → [cleanup][qa-][polish]
Target Milestone: --- → Firefox 4.0b12
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: