Closed Bug 231313 Opened 21 years ago Closed 16 years ago

XUL tabs on Mac OS X render as 10.2-style tabs

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1b3

People

(Reporter: sgarrity, Assigned: mstange)

References

(Blocks 2 open bugs)

Details

(Keywords: fixed1.9.1)

Attachments

(8 files, 4 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7a) Gecko/20040105 Firebird/0.7+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7a) Gecko/20040105 Firebird/0.7+

The Page Info window, and any other place that uses OS X tabs, should use the
new OS X tabs that were introduced in OS X 10.3 (Panther).

Here's a screenshot of a window that uses the correct new tabs:
http://www.diveintoosx.org/images/2003/10/directory_access_main.jpg

This does NOT apply to the tab-browsing tabs - they aren't native and probably
won't be.

Reproducible: Always

Steps to Reproduce:
1. Right click in a page
2. Choose View Page Info

Actual Results:  
See old-style OS X tabs

Expected Results:  
You should see the new style Panther tabs
Severity: trivial → enhancement
confirmed Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7b)
Gecko/20040308 Firefox/0.8.0+
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Firebird should use new OS X 10.3 Panther tabs in Page Info window → Firefox should use new OS X 10.3 Panther tabs in Page Info window
Blocks: 73812
Assignee: firefox → bugs
Component: General → Page Info
QA Contact: firefox.page-info
Component: Page Info → XP Toolkit/Widgets: XUL
Product: Firefox → Core
Version: unspecified → Trunk
Assignee: bugs → nobody
Severity: enhancement → normal
QA Contact: firefox.page-info
Summary: Firefox should use new OS X 10.3 Panther tabs in Page Info window → native tabs look is wrong on os x 10.3
*** Bug 243044 has been marked as a duplicate of this bug. ***
Assignee: nobody → sfraser_bugs
Severity: normal → enhancement
Component: XP Toolkit/Widgets: XUL → Widget: Mac
We can't implement it using the Appearance Manager.
Depends on: 275808
I just tested it. Switching to HITheme doesn't help on Panther as of 10.3.7. It still draws the old tabs.

See http://lists.apple.com/archives/carbon-development/2003/Oct/msg01404.html
Native tabs are going away; they've already been replaced in trunk builds.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → WONTFIX
Simon, this is not a Camino bug, and we're not reffering to browser-tabs.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Summary: native tabs look is wrong on os x 10.3 → native tabs look is wrong on os x 10.3 (Panther)
From http://lists.trolltech.com/qt4-preview-feedback/2004-12/thread00239-0.html :

"This is a long story. But basically it boils down to we use Appearance 
Manager to draw tabs (and  HIThemes on 10.3). Neither of these APIs 
provide anything for "Panther-Style" tabs. We will support them 
natively in 10.4 (where an API actually exists) and we will probably 
emulate before the next beta is out. Choosing to use the built-in style 
or write it yourself is a tough balance. Having the System draw your 
stuff offers much more insulation. However, when you can't get what 
people expect, you start looing out-dated.

So, yes, we are aware of it and it will get fixed."
Summary: native tabs look is wrong on os x 10.3 (Panther) → XUL native tabs look is wrong on os x 10.3 (Panther)
*** Bug 294657 has been marked as a duplicate of this bug. ***
*** Bug 290484 has been marked as a duplicate of this bug. ***
Assignee: sfraser_bugs → joshmoz
Severity: enhancement → normal
Status: REOPENED → NEW
QA Contact: mac
*** Bug 295496 has been marked as a duplicate of this bug. ***
*** Bug 296164 has been marked as a duplicate of this bug. ***
*** Bug 305320 has been marked as a duplicate of this bug. ***
*** Bug 327915 has been marked as a duplicate of this bug. ***
Blocks: 333508
From http://lists.apple.com/archives/carbon-development/2003/Oct/msg01404.html:

"There won't be any way to use DrawThemeTab to draw the new tabs. You will have to use HIThemeDrawTab. This shouldn't be too difficult; you'll just need to create a CG context from your QD port, and then substitute HIThemeDrawTab for DrawThemeTab."

He then goes on to say that event HIThemeDrawTab didn't draw the right tabs, but that was going to be fixed.   That message was almost 3 years ago though, so with a little luck, this approach could work now.

Does anyone know if this workaround is possible for us?
Summary: XUL native tabs look is wrong on os x 10.3 (Panther) → XUL native tabs look is wrong on os x 10.3+
I was playing around with this for fun, just to see if it was possible.  This patch implements HITheme tabs that almost match the appearance introduced in 10.3 (Panther).  I say "almost" because the tab pane doesn't run through the tabs as in the native appearance.  This is because the rect that we get for the tab pane from Gecko doesn't overlap with the rects for the tabs, and in any event, the drawing order is wrong so the pane could draw over the tabs.
*** Bug 348409 has been marked as a duplicate of this bug. ***
Are there any plans on fixing this for Firefox 3.0? It really needs to be fixed to be more Mac like.
It is unlikely that we'll fix this for Firefox 3. There are some complicated reasons that the new tab style doesn't mesh well with XUL layout right now, and while I agree it would be nice we have too many other things going on that are of a higher priority.
This bug has been fixed on linux by 265698, perhaps the ideas there can be helpful.
Blocks: 122248
Summary: XUL native tabs look is wrong on os x 10.3+ → XUL tab rendering on Mac Os
Component: Widget: Mac → Widget: Cocoa
QA Contact: mac → cocoa
Hardware: Macintosh → All
Assignee: joshmoz → mstange
Attached image :-)
(In reply to comment #22)
> Created an attachment (id=326916) [details]
> :-)
> 

Excellent! And there will be a patch?
Soon. I still need to figure out what to do about bottom / left / right tabs, different tab sizes, mousedown vs mouseclick, and ChatZilla...
Status: NEW → ASSIGNED
(In reply to comment #24)
> Soon. I still need to figure out what to do about bottom / left / right tabs,
> different tab sizes, mousedown vs mouseclick, and ChatZilla...
> 

Maybe we shouldn't use native styling on bottom tabs?
That would be better than the current Windows theme code, which draws them "upright" and makes it look so broken on bottom-tabs. :)
I'm thinking about including some "predefined packages" into the CSS that allow you to customize the appearance of the tabs by choosing a combination of the following classes:
{ tabs-top, tabs-bottom } x { tabs-regular, tabs-small, tabs-mini } x
{ tabs-native, tabs-nonnative }
(where the first class is always the default styling).

So e.g. James might want to change chatzilla.xul#102 to
class="tabs-bottom tabs-small tabs-nonnative"

Does that sound reasonable?

For the non-native tabs I'd like to use the Adium style (see http://www.tbray.org/ongoing/When/200x/2005/12/16/-big/Adium-Chat-Window.png).
Attached image NSTabViews gone wild
Native tabs do support top/bottom/left/right tabs, though I've never seen a single one of the latter three in the wild ;)

The question is whether Gecko can be made to draw those other three correctly, and then, if so, if the usages in Gecko apps really align with NSTabViews or with some other concept of tab.
Summary: XUL tab rendering on Mac Os → XUL tabs on Mac OS X render as 10.2-style tabs
(In reply to comment #28)
> Created an attachment (id=326963) [details]
> NSTabViews gone wild
> 
> Native tabs do support top/bottom/left/right tabs, though I've never seen a
> single one of the latter three in the wild ;)

http://developer.apple.com/java/images/codeclips1.jpg ;-)
Actually, I can't be sure of that being bottom tabs from the screenshot.
(In reply to comment #28)
Hehe, thanks Smokey, that looks cool.

> The question is whether Gecko can be made to draw those other three correctly,

Bottom tabs for sure, left / right tabs probably not until we support rotating text with CSS (bug 435293 ?).

> and then, if so, if the usages in Gecko apps really align with NSTabViews or
> with some other concept of tab.

Well, it looks like there are two different ways of using tabs in Gecko apps:
1) NSTabView-like usage: small and fixed number of tabs, plenty of space
2) ChatZilla-like usage: unknown and unlimited number of tabs, little space

The new tabs would only fit for style (1). I think the style packages that I proposed in comment 27 would solve the problem quite nicely.
(In reply to comment #27)
> I'm thinking about including some "predefined packages" into the CSS that allow
> you to customize the appearance of the tabs by choosing a combination of the
> following classes:
> { tabs-top, tabs-bottom } x { tabs-regular, tabs-small, tabs-mini } x
> { tabs-native, tabs-nonnative }
> (where the first class is always the default styling).
> 

(I think you mean tab-top, tab-bottom etc?)

The only potential problem I can think of atm is if you'll have a cross-platform xul file with different ui requirements. For example, native-styled regular tabs on mac, but small non-native tabs on win/nix. I'm not really sure if/when that would be the case, though.
(In reply to comment #32)
> (I think you mean tab-top, tab-bottom etc?)

I thought that these classes could be set on the <tabbox> and on the <tabs> element, so I think tabs-* makes more sense. They shouldn't be set on individual tabs (<tab> elements).

> The only potential problem I can think of atm is if you'll have a
> cross-platform xul file with different ui requirements. For example,
> native-styled regular tabs on mac, but small non-native tabs on win/nix. I'm
> not really sure if/when that would be the case, though.

Yeah, that's a problem. You can't choose from these packages via CSS.

That's why I'd like a CSS syntax like this:

@template 'tabs-small' {
  ::elem {
    margin: 0 5px;
  }
  ::elem tab {
    -moz-appearance: tab;
  }
}

#myTabbox {
  apply-template: 'tabs-small';
}

which would be translated to:

#myTabbox {
  margin: 0 5px;
}
#myTabbox tab {
  -moz-appearance: tab;
}

... but that's not something we should discuss in this bug.
This is what I've got now. Still needs a bit of tweaking before I can submit useful patches.
Depends on: 446463
Attached patch part 1 v0.1: Rendering (obsolete) — Splinter Review
Attachment #330836 - Flags: review?(joshmoz)
Comment on attachment 330836 [details] [diff] [review]
part 1 v0.1: Rendering

This patch is on top of that in bug 446463.
Attached patch part 2 v0.1: Tab CSS Styles (obsolete) — Splinter Review
I'm not sure about these class names yet, but I haven't got a better idea.

The height change in browser.css (height: 27px -> 25px) is necessary because 25px is what's actually intended - the additional 2px were a workaround for the |tabs|'s margin-bottom: -2px...
Attachment #330839 - Flags: review?(mano)
This is the basis of the screenshot in attachment 327246 [details]. There are awkward focus and partial redraw bugs when switching tabs, but they're not caused by my patches.
Attachment #330836 - Attachment is obsolete: true
Attachment #330836 - Flags: review?(joshmoz)
Attachment #330839 - Attachment is obsolete: true
Attachment #330839 - Flags: review?(mano)
Attached patch rendering part, v2 (obsolete) — Splinter Review
This patch is on top of that in bug 465402.
Attachment #349198 - Flags: review?(roc)
Attached patch css part, v2 (obsolete) — Splinter Review
I removed all the class-customization stuff from the previous patch. Now the only class that's supported is "tabs-bottom", which will switch to small, left-aligned, Adium-style tabs.

The custom tabpanels padding in the preferences window prevents the "Always check to see if Minefield is the default browser on startup" checkbox label from wrapping. The dynamic preferences window sizing doesn't interact well with wrapping labels... (see bug 345572 and bug 349098).
Attachment #349200 - Flags: review?(dao)
The previous patch resulted in invisible tabpanels on 10.4. We also need to set tpdi.kind = kHIThemeTabKindNormal.
Attachment #349201 - Flags: review?(roc)
Attachment #349198 - Attachment is obsolete: true
Attachment #349198 - Flags: review?(roc)
Comment on attachment 349201 [details] [diff] [review]
rendering part, v2.1

+  void DrawTab(CGContextRef context, HIRect inBoxRect, PRInt32 inState,

const HIRect& inBoxRect?
Attachment #349201 - Flags: review?(roc) → review+
Comment on attachment 349200 [details] [diff] [review]
css part, v2

Any reason against using :first-child / :last-child instead of [first-tab=true] / [last-tab=true]?
Comment on attachment 349200 [details] [diff] [review]
css part, v2

>+tabbox.tabs-bottom > tabs, tabs.tabs-bottom {

line-break after comma, please.
Attached patch css part, v3Splinter Review
(In reply to comment #43)
> (From update of attachment 349200 [details] [diff] [review])
> Any reason against using :first-child / :last-child instead of [first-tab=true]
> / [last-tab=true]?

I don't see any reason against it :)
I probably did it because winstripe's tabbox.css also uses these attributes, but I don't really remember.

(In reply to comment #44)
> line-break after comma, please.

Done.
Attachment #349200 - Attachment is obsolete: true
Attachment #349498 - Flags: review?(dao)
Attachment #349200 - Flags: review?(dao)
Attachment #349498 - Flags: review?(dao) → review+
Comment on attachment 349498 [details] [diff] [review]
css part, v3

> .tabs-left, .tabs-right {

please insert a line break as well

> .tabs-left, .tabs-right {
>+  -moz-box-flex: 1 !important;

>+tabbox.tabs-bottom > tabs,
>+tabs.tabs-bottom {
>+  padding: 0 !important;
>+  margin: 0 !important;

>+tabs.tabs-bottom > .tabs-left {
>+  -moz-box-flex: 0 !important;

>+tabbox.tabs-bottom > tabs > tab[beforeselected=true],
>+tabs.tabs-bottom > tab[beforeselected=true] {
>+  -moz-border-end-color: transparent !important;

all these !important flags seem unnecessary
Attachment #349201 - Flags: approval1.9.1?
Attachment #349498 - Flags: approval1.9.1?
Attachment #349201 - Flags: approval1.9.1? → approval1.9.1+
Attachment #349498 - Flags: approval1.9.1? → approval1.9.1+
Comment on attachment 349498 [details] [diff] [review]
css part, v3

a191=beltzner with dao's nits addressed
http://hg.mozilla.org/mozilla-central/rev/ae7706acc2d2
Status: ASSIGNED → RESOLVED
Closed: 20 years ago16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b3
Depends on: 467091
Depends on: 467261
Depends on: 467294
Depends on: 470711
Depends on: 471325
Keywords: fixed1.9.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: