yui/yui3 — pull request #353 by Satyam (2012-12-01 19:38:52+00:00)
Title: Fixes #2532810

The third argument to set (or _set) is not just for events.
Its purpose is to establish the reason for setting the attribute.
In Widgets, this usually means the source of the change by
indicating {src: 'UI'} (or its pre-defined constant).
Though it is usually used to avoid reflecting into the UI
what came from the UI, and is something done through events,
it is still useful even if you don't have a UI or events.

There are lots of reasons to change an attribute and,
even without events, there is still a reason for this
argument to exist. If it is passed to the setter or validator,
they can decide whether to accept or not a value.

It is like using _set for changes to read-only attributes,
using _set instead of set allows you to override the read-only.
In this case, passing the options argument to setter and
validator, allows you a conditional setting based
in the value and the origin of it.

I have added those opts to both the setter and the validator
so they can decide on accepting or rejecting the value
based on the origin of the data.

Provided an extra test to try the setter with the extra argument
This change should be fully backward compatible.

Inadvertently stripped trailing spaces on the changed sources.