For example, on Safari3.1, there are functions "querySelector" and
"querySelectorAll" which execute CSS selector queries at native
speeds. Likewise, there is a new getElementsByClassName() function on
the newest versions of Firefox, Opera, and Safari/Webkit. I seem to
have two options:
1) Option 1, add a new single property and provide that does
capability detection for those functions, ugh.
2) extend-property user.agent with Saf3.1/FF3/etc, and then add or
patch bindings in module files for every deferred binding that
references user.agent
Wouldn't it be nicer to have a sort of alias/subclass type
relationship for properties, and let <when-property-is> have a meaning
like 'is assignable", e.g., extend user.agent with properties like
Safari3, Firefox3, iPhone, etc but assert "unless bound otherwise,
Safari3 is the same as Safari, Firefox3 will bind to gecko1.8, iPhone
will bind to Safari, etc" Binding resolution would first look for a
binding to the actual value (like Safari3), if none exists, have it
fallback to Safari2.
I suggest the following simple (rubyish) syntax:
<extend-property name="user.agent"
values="safari3<safari,iphone<safari,firefox3<gecko1_8"/>
"=" could also be used, or ":" (C++)
Property providers would also need the ability to be chained, adding a
provider for "user.agent" in a submodule should result in all
providers being invoked in turn, from the bottom up, until a non-null
value matching the expected values is returned.
In summary, I want to extend browser sniffing, without patching
user.jar or writing additional deferred bindings to map every
reference to user.agent for the new values, when in many cases, the
bindings will be the same for the new values.
-Ray
> What would everyone say to this proposal for 1.5:I think you mean "gecko" is still needed for Linux, not "gecko1_8"
> - gecko, gecko1_8 (still need it for Linux), ie6, opera, safari, safari3
> Adding safari3 will allow us to unsnarl some of the nastier pieces of code,Are your proposing renaming gecko1_8 to gecko, but keeping "safari"
> like RichTextArea, FocusImpl, and History, that have dynamic checks for
> safari2/3 right now.
>
> Moving towards this for the next release (on the assumption that OOPHM will
> allow us to ditch the old Linux gecko engine):
> - gecko, ie6, ie8, opera, safari, safari3
for Safari 2 and adding safari3? Why not renaming safari to safari2
and making safari the "new safari"? What would it break? (given that
"safari" is also taking Safari 3 into account).