1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/lib/capybara/driver
Jason Petersen 2fef844031 Fix destructive methods for selecting options
Both `select_option` and `unselect_option` were modifying the
`selected` attribute of their target `<option>` element. This attribute
is meant to be used solely as the marker for which `<option>`(s) is
(are) the default selection(s) in a (multi-)`<select>` element. The
actual _selectedness_ of an `<option>` should be tracked using its
`selected` **property**. Read [the spec][] for more info.

This change removes any code which modified the `selected` attribute of
`<option>` elements, which leaves only the code that modifies the
`selected` property. In addition, `Node#value` needed to be changed to
return `<option>` elements whose selectedness is true rather than just
those with a `selected` attribute.

The tests introduced in the previous commit now pass.

[the spec]: http://dev.w3.org/html5/spec/Overview.html#the-option-element
2012-02-12 10:08:57 -06:00
..
webkit Fix destructive methods for selecting options 2012-02-12 10:08:57 -06:00
webkit.rb Add command to retrieve URL modified by Javascript 2012-01-13 11:02:09 -05:00