Hi!

I was just checking the Wiki page on Conditional Properties, and I think an 
example is off by one.

Given:

<define-property name="mobile.user.agent" values="android, iphone, 
not_mobile" />

<property-provider name="mobile.user.agent"><![CDATA[
  {
    var ua = window.navigator.userAgent.toLowerCase();
    if (ua.indexOf('android') != -1) { return 'android'; }
    if (ua.indexOf('iphone') != -1) { return 'iphone'; }
    return 'not_mobile';
  }
]]></property-provider>

<!-- Constrain the value for non-webkit browsers -->
<set-property name="mobile.user.agent" value="not_mobile" >
  <none> <!-- Actually means NOR, in this case "not safari" -->
    <when-property-is name="user.agent" value="safari" />
  </none>
</set-property>


the text says "instead of having [user.agent] * [mobile.user.agent] = 6 * 3 
= 18 permutations, this will produce [user.agent] + [mobile.user.agent] = 
9permutations."

As I see it, five of the possible user.agent values (i.e., everything but 
Safari) will each produce a combination (for 
mobile.user.agent="not_mobile"), and when user.agent *is* Safari, it will 
produce three combinations, for each mobile.user.agent value -- and that 
comes out to 8, not 9. Am I missing anything?


-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/feb9XbXxfvgJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to