Looks like a good suggestion. I've seen this question come up
occasionally on the mailing list and have used it myself to determine
whether a DOM element is displayed or not as well as a few other
times.

-c

On Fri, Dec 31, 2010 at 10:56 PM, Bret Pettichord <[email protected]> wrote:
> I have no objections to this change. I am unsure how popular this feature is
> in the first place.
>
> Bret
>
> On Fri, Dec 31, 2010 at 11:15 PM, Jari Bakken <[email protected]> wrote:
>>
>> On Fri, Dec 31, 2010 at 5:14 PM, Bret Pettichord <[email protected]>
>> wrote:
>> > I want to verify that I understand the proposal.
>> >
>> > Is the suggestion that the Watir-WebDriver API be added to the IE driver
>> > in
>> > addition to the existing API? Or will it replace it, creating backwards
>> > incompatability?
>> >
>>
>> To clarify, currently watir-webdriver does this:
>>
>> 1. If the #style method is passed an argument, return the value of the
>> given property (e.g. 'background-image').
>> 2. If #style is invoked with no argument and the receiving element has
>> a 'style' property, return the string value of that property.
>> 3. If #style is invoked with no argument and the receiving element
>> does not have a 'style' property, return an empty string.
>>
>> Watir returns the COM style object.
>>
>> I think the best solution for Watir would be to do something like this
>> (untested):
>>
>> def style(property = nil)
>>  assert_exists
>>
>>  if property
>>    object.currentStyle.send(camel_case_css(property))
>>  else
>>    object.currentStyle
>>  end
>> end
>>
>> This way the migration path for people switching to watir-webdriver
>> will be easier (i.e. always pass an argument), but it's not a
>> significant break in backwards compatibility (where no one is passing
>> an argument).
>> _______________________________________________
>> Wtr-development mailing list
>> [email protected]
>> http://rubyforge.org/mailman/listinfo/wtr-development
>
>
>
> --
> Bret Pettichord
> Lead Developer, Watir, www.watir.com
>
> Blog, www.io.com/~wazmo/blog
> Twitter, www.twitter.com/bpettichord
>
>
> _______________________________________________
> Wtr-development mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-development
>
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to