[webkit-dev] Widget / Drawing API thoughts
Kevin Ollivier
kevino at theolliviers.com
Wed Jun 29 23:22:00 PDT 2005
Hi Darin and all,
On Jun 28, 2005, at 10:06 AM, Darin Adler wrote:
> On Jun 27, 2005, at 6:14 PM, Timothy Hatcher wrote:
>
>
>> If a CSS file starts requesting specific visual changes (aside
>> from margins, and maybe even padding for some controls) switch
>> over to a non-native, fully styleable control (ala the <button>
>> tag vs <input type="button">). In my web design experience it is
>> typically an all or nothing game, either the designer wants to
>> tweak the control in every direction visually, or no form control
>> selectors at all. (This isn't always the case, but likely the
>> majority.)
>>
>
> Yes, this is what we have in mind. Dave Hyatt and I have been
> talking about this basic approach for at least the last couple of
> years. I also think there should be a CSS property that explicitly
> sets the switch. The "automatic switchover" would be the default,
> but you could override the heuristic with the CSS property.
>
>
>> That mix-and-match middle ground is where it gets shaky. Mac OS X
>> native elements can control text-color and background (color
>> only). So does that mean you would or would-not switch to non-
>> native if the native controls are capable of handling the style
>> request? (This would obviously be platform dependent, with Mac OS
>> X controls being the least styleable of most platforms.)
>>
>
> Also consider that WebKit could easily have Mac OS X styled
> controls that are even more styleable than the native ones. It is
> indeed a complicated issue when to switch over to "more-generic"
> controls. It's not even clear that there's a true concept of "more-
> generic-looking". In practice maximum compatibility probably means
> something more like "make the controls look exactly like Windows".
BTW, while doing a little research on the subject, I came across a
page detailing (with screenshots) what the various browsers do on
different platforms when asked to style form controls:
http://www.456bereastreet.com/archive/200410/
styling_even_more_form_controls/
The interesting thing is that, even for browsers like Firefox, the
result is basically that they don't do much of anything, except
perhaps adjust font face/size - even when they are clearly emulating
the controls (see IE 5 for Mac ;-). So this pretty much confirms
Darin's statement about there being no concept of a "generic looking"
control.
Ideally, as one of the main goals of CSS is to give control of the
interface back to the web site designer, I think when designers apply
any style(s) to a control the entire control should appear the same
on all platforms. I don't think it should 'mix and match' with native
styles. If they're not designing on Mac, for example, they probably
haven't considered how some of their styling might look when mixed
with native Mac control elements, and it could lead to some odd-
looking results. (Believe me, we've experienced this with
wxWidgets. ;-) So I think the browser should show the designer what
they designed, everywhere.
Of course, this brings up the issue Darin mentioned that there
currently isn't a concept of a "generic looking" control, and even
Windows buttons are starting to have different styles, so I'm not
sure emulating them would give the correct results. Perhaps by taking
on this task it's up to Safari to define such a thing as a "CSS-
styled button". ;-) Thoughts? Anyone know if other browsers are
heading in this direction as well?
Of course, the article above also suggests that the correct default
behavior should be to be as native as possible, so I still would
prefer at least a native control override option. I think how it is
implemented internally should ideally be port-specific, so that ports
could use a 'styled' control for the native option if they want, but
I do believe there should be some concept still of native controls,
as for us it's just much less maintenance to use the control rather
than to emulate it. ;-) (in our case, the wxWidgets devs will make
sure they're always looking and functioning as they should on all
platforms. that means a much better possibility that our port stays
sharp looking across platforms even when Longhorn comes out.)
Thanks,
Kevin
>
>> And if one form control is styled, but the rest of the controls
>> aren't, do you use the same control drawing API for all? (I would
>> assume yes, to be semi-consistent. Most designers would style all
>> controls typically.)
>>
>
> At the moment, the style of one element doesn't affect the
> appearance of other elements on the same page. So some page-wide
> heuristic is tricky, but I can see how that would be nice.
>
> -- Darin
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at opendarwin.org
> http://www.opendarwin.org/mailman/listinfo/webkit-dev
>
More information about the webkit-dev
mailing list