When a <SELECT> was rendered on IE9 (or older) via DomUtils.htmlToFragment, the
hack we used somehow failed to properly set some attributes; they would show up
in innerHTML but not affect property values. eg, SELECTED would show up in an
OPTION's innerHTML but option.selected would not be set (nor would the parent
SELECT's value or selectedIndex). Fix this by replacing a mergeAttributes call
with an explicit attribute copying loop.
Also, add the helpers setElementValue and getElementValue to DomUtils, which are
used both in the test of this fix and will be used in a future change.
Fixes#496.
Meteor will use jQuery for selector matching if it's present on the
client (which at the moment is always), but it now will use bare
querySelectorAll on modern browsers and IE 8+ if there is no jQuery.
There is no other dependence on jQuery in Meteor.
To test whether an element in the event bubbling chain matches a
selector, we now modify the selector to include an ID for the
element in question (which we assign if it doesn't have one),
so we search for one node rather than listing and checking all
nodes that match the selector! This makes a huge speed difference in
the jsparse demo, which binds a global handler over a big DOM tree.
The new domutils are matchesSelector(element, contextNode, selector)
and matchesSelectorClipped(element, contextNode, selector, clipStart,
clipEnd).
Note: Eventually make the args more like this W3C working draft:
http://www.w3.org/TR/selectors-api2/#matches