Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since we haven't been running the Ivy tests against IE for a while, we've accumulated some errors and test failures. These changes fix the issues which come from a handful of root causes:
i18n instructions thrown off by sanitizer:
While sanitizing on browsers that don't support the
template
element (pretty much only IE), we create an inert document and we insert content into it viadocument.body.innerHTML = unsafeHTML
. The problem is that IE appears to parse the HTML passed toinnerHTML
differently, depending on whether the element has been inserted into a document or not. In particular, it seems to split some strings into multiple text nodes, which would've otherwise been a single node. This ended up throwing off some of the i18n code down the line and causing a handful of failures. I've worked around it by creating a new inertbody
element into which the HTML would be inserted.Proxies being used in DebugElement.classes:
We're currently using proxies to pick up changes to element classes coming outside of Angular. Proxies aren't supported in IE and error is always thrown. I've reworked the tests where possible and skipped the rest with a TODO to come back and re-enable them once we have som kind of fallback.
Inconsistent
typeof Node
value:We have a couple of cases where we use something like
typeof Node === 'function'
to figure out whether we're in a worker context. This works in most browsers, but IE returnsobject
instead offunction
. I've updated all the usages to account for it.IE saving the attribute case:
In
DebugElement.attributes
we return all of the attributes from the underlying DOM node. Most browsers change the attribute names to lower case, but IE preserves the case and since we use camel-cased attributes, the return value was inconsitent. I've changed it to always lower case the attribute names.Unable to get own function name:
When we log DI errors we get the name of the provider via
SomeClass.name
. In IE functions that inherit from other functions don't have their ownname
, but they take thename
from the lowest parent in the chain, beforeFunction
. I've added some changes to fall back to parsing out the function name from the function's string form.Different attribute order in innerHTML:
We've got some tests that assert that the generate DOM looks correct. The problem is that IE changes the attribute order in
innerHTML
which caused the tests to fail. I've reworked the relevant tests not to assert directly againstinnerHTML
.proto not supported:
IE doesn't support
__proto__
. I've added a fallback based on #34279.