docs($injector): fix syntax error

There was a missing parenthesis in $injector test example

Closes #9469
fix($browser): Cache `location.href` only during page reload phase

Adds caching for url changes while a reload is happening,
as browsers do not allow to read out the new location the browser
is navigating to.

Removes unnecessary caching from $browser, as IE7-IE9 all
have the new hash value in `location.href` after changing it.
There was a wrong assumption in the previous version of this code
introduced by dca23173e25a32cb740245ca7f7b01a84805f43f and d70711481e6311c9cd283d650f07ca0cca72ecc2.

Adds more tests for #6976
Fixes #9235
Closes #9455
feat($location): add support for History API state handling

Adds $location state method allowing to get/set a History API state via
pushState & replaceState methods.

Note that:
- Angular treats states undefined and null as the same; trying to change
one to the other without touching the URL won't do anything. This is necessary
to prevent infinite digest loops when setting the URL to itself in IE<10 in
the HTML5 hash fallback mode.
- The state() method is not compatible with browsers not supporting
the HTML5 History API, e.g. IE 9 or Android < 4.0.

Closes #9027
refactor: use document.documentMode to determine msie version

Closes #9398
fix($animate): ensure that class-based animations only consider the most recent DOM operations

Prior to this fix $animate would maintain a count of each time a class was
added and removed within $animate. With this fix, $animate instead only cares
about the most recent addClass or removeClass operation and will only perform
that operation (depending on what was last called).

```
// before
addClass    => +1
removeClass => 0
addClass    => +1
addClass    => +2
removeClass => +1
// this will cause an addClass animation

// now
addClass    => add
removeClass => remove
addClass    => add
addClass    => add
removeClass => remove
// this will cause a removeClass animation
```

Closes #8946
Closes #9458
chore(ngScenario): make jshint happy

Someone accidentally removed an important keyword which prevented a variable from being added to the global object

Closes #9484
chore($sniffer): Remove $sniffer.hashchange

The hashchange event is not supported only in ancient browsers like Android<2.2
and IE<8. Angular never really supported IE7 and in 1.3 where support for IE8
is dropped it makes even less sense to check for hashchange support.
docs(ngIf): update out-of-date link
docs(content): update Angular 1.2 mentions to Angular 1.3

Angular 1.3 docs now describe the process of using this version instead of
the older 1.2 that is the latest stable version.

Also, update jQuery 1.10.x mentions to 2.1.x.
docs($compile): note template is ignored with element transclusion
test(matchers.js): make toHaveClass matcher work better for SVG+jQuery
fix(ngAnimate): defer DOM operations for changing classes to postDigest

When ngAnimate is used, it will defer changes to classes until postDigest. Previously,
AngularJS (when ngAnimate is not loaded) would always immediately perform these DOM
operations.

Now, even when the ngAnimate module is not used, if $rootScope is in the midst of a
digest, class manipulation is deferred. This helps reduce jank in browsers such as
IE11.

BREAKING CHANGE:

The $animate class API will always defer changes until the end of the next digest. This allows ngAnimate
to coalesce class changes which occur over a short period of time into 1 or 2 DOM writes, rather than
many. This prevents jank in browsers such as IE, and is generally a good thing.

If you're finding that your classes are not being immediately applied, be sure to invoke $digest().

Closes #8234
Closes #9263
refactor($compile): use labaled variables to represent nodeType values

This also does some cleanup in $animate
chore(ngAnimate): add TODO messages indicating desire to remove hack
perf($animate): don't join classes before it's necessary in resolveElementClasses

In ngAnimate, we can't do this because the behaviour is exposed via the API. But
in core, we can avoid a bit of work.
perf($animate): access DOM less in resolveElementClasses

Previously we were reading DOM attributes frequently, now we can do it just once.
chore(AngularPublic): remove `$$hasClass` from angular exports

It was previously used for ngAnimate, but is no longer needed
fix(select): make ngOptions support selectAs and trackBy together

This commit implements two functions, "isSelected()" and "getViewValue()"
to properly compute an option's selected state and the model controller's
viewValue respectively. These functions give proper precedence to "track by"
and "select as" parts of the ngOptions comprehension expression, which were
previously inconsistent and incompatible.

Fixes #6564
refactor(select): reduce duplication and reorder functions
fix(select): throw for selectAs and trackBy

trackBy and selectAs have never worked together, and are fundamentally
incompatible since model changes cannot deterministically be
reflected back to the view. This change throws an error to help
developers better understand this scenario.