Closed Bug 1143038 Opened 9 years ago Closed 9 years ago

Use AppConstants in tabbrowser.xml

Categories

(Firefox :: General, defect)

34 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 39
Tracking Status
firefox39 --- fixed

People

(Reporter: billm, Assigned: billm)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
If you're wondering why it's okay to remove clicktoscroll="true" on the arrowscrollbox, it's because it serves no purpose. The arrowscrollbox has a class="tabbrowser-arrowscrollbox" attribute, and that attribute causes it to use the tabbrowser-arrowscrollbox XBL binding, which inherits from scrollbox.xml#arrowscrollbox-clicktoscroll unconditionally. This change appears to have happened in 2007, so we should probably just call it the expected behavior at this point.
Attachment #8577307 - Flags: review?(gavin.sharp)
Comment on attachment 8577307 [details] [diff] [review]
patch

Neil, can you r+ the clicktoscroll change specifically?

>diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml

>+              if (this.AppConstants.platform == "macosx") {
>+                return dt.effectAllowed = event.altKey ? "copy" : "move";
>+              } else {
>+                return dt.effectAllowed = event.ctrlKey ? "copy" : "move";
>+              }

I think this might be clearer as:

let copyModifier = this.AppConstants.platform == "macosx" ? event.altKey : event.ctrlKey;
return dt.effectAllowed = copyModifier ? "copy" : "move";

>+        if (this.AppConstants.platform == "macosx") {
>+          if (!event.metaKey)
>+            return;
>+        } else {
>+          if (!event.ctrlKey || event.metaKey)
>+            return;
>+        }

Similarly:
let wrongModifiers;
if (this.AppConstants.platform == "macosx") {
  wrongModifiers = !event.metaKey;
} else {
  wrongModifiers = !event.ctrlKey || event.metaKey;
}

if (wrongModifiers)
  return;

>+          let props = { screenX: left, screenY: top };
>+          if (this.AppConstants.platform != "win") {
>+            props.outerWidth = winWidth;
>+            props.outerHeight = winHeight;
>+          }
>+          this.tabbrowser.replaceTabWithWindow(draggedTab, prop);

typo here: prop -> props. No test coverage for this I guess? :(
Attachment #8577307 - Flags: review?(gavin.sharp)
Attachment #8577307 - Flags: review+
Attachment #8577307 - Flags: feedback?(enndeakin)
Could you please get to this soon Neil? Every time I have to lookup a line number in preprocessed JS or run make in browser/base, I feel a twinge of pain.
Comment on attachment 8577307 [details] [diff] [review]
patch

This is ok, but I would have removed the special tabbrowser-arrowscrollbox -moz-binding in tabbrowser.css instead so that we consistently use clicktoscroll to get that binding.
Attachment #8577307 - Flags: feedback?(enndeakin) → feedback+
https://hg.mozilla.org/mozilla-central/rev/347dbe653fb3
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 39
Depends on: 1349502
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: