Also, Bob raised the question of generators and their sensitivity to user.agent values (or other properties, perhaps), and whether we would need GeneratorContext.propertyValueMatches(String actual, String possiblyInherited) or the like.
I was focused on rule selection, so I hadn't thought about it, but I'm not sure it would be needed: the generator is, after all, still generating for safari, and not doing anything special for iphone or android; the inheritance is just asserting that the generated code is also applicable for iphone. When we do an <any><when-property-is.../></any> today, as I understand it, the generator does get a chance to do different work for each user agent, but may also return the same classname to do the same job once for all... my value-inheritance would effectively force the second case. If you want something different, you want a specific rule, not the implicit inheritance. No? On Tue, May 5, 2009 at 10:16 AM, Freeland Abbott <[email protected]> wrote: > Before I started working up a patch for this, I thought it was worth > floating the basic idea for comment: > > I recently wanted an app with special interfaces for mobile browsers > (specificially, iphone and android). No problem; we redefined user.agent to > allow those values, and to provide a property provider for them. However, > it turns out that both are WebKit, like Safari, and in a lot of cases, all > the Safari rebindings were correct for the mobile ones, too. So I wanted a > way to express that iphone was "just like Safari, unless explicitly noted > otherwise." > > What would people think about a GWT XML directive like: > > <property-value-inherits property="user.agent" value="iphone" > inherits="safari"/> > > ...with all of the field names up for debate, as well as the basic > concept. The same mechanism could be used to specialize user agents by > version, i.e. ie-base could be inherited by ie6 and ie8. > > Other, similar concepts I've heard discussed include a > <when-property-begins-with .../> or <when-property-matches .../> > formulation, but I'm not sure either of them let me do the notion of > "inheritance" that I wanted. (They do cover the version number problem, > however.) > > --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
