Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

test: fix ms edge failures #13686

Closed
wants to merge 6 commits into from

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Jan 6, 2016

No description provided.

@gkalpak gkalpak added this to the 1.5.x - migration-facilitation milestone Jan 6, 2016
expect(box.width === 0 && box.height === 0).toBe(false);
var hasWidthOrHeight = (box.width !== 0) || (box.height !== 0);

if (possiblyUnsizedParent && !hasWidthOrHeight) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change defeats the porpoise of the test itself

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not sure what the purpose of the test was (not to mention it has a comment that says it might be redundant), so I am open to alternative suggestions.

TBH, I am not too familiar with SVG, so I don't really know why MS Edge behaves differently than other browsers (although it theoretically supports foreignObject). It isn't Angular-related, btw, because the same behavior can be reproduced with "raw" HTML.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to put an if (isEdge) condition on the test and do not run the test there at all than this change. I understand that this is an issue with Edge, but we should not try to test something else because of a browser

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I am with @lgalfaso on this unless we can explain better why it is happening this way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrapped the test in if (!isEdge) in gkalpak@f7f4417.

@lgalfaso
Copy link
Contributor

lgalfaso commented Jan 6, 2016

I know that this touches several tests, but can you please squash this into one commit?

@gkalpak
Copy link
Member Author

gkalpak commented Jan 6, 2016

@lgalfaso, thx for the review. I prefer leaving it as separate commits for now (so it's easier to review related changes in the proper context) and squash upon merging.

@mgol
Copy link
Member

mgol commented Jan 6, 2016

Good job! LGTM.

For whatever reason, MS Edge throws during testing, when trying to set the view value to
`9999-12-31T23.59.59`.

Other values I tried (including later dates) didn't throw. I also couldn't reproduce it outside of
the test.
@gkalpak gkalpak force-pushed the test-fix-ms-edge-failures branch from c7b29e5 to f7f4417 Compare January 11, 2016 11:05
@petebacondarwin
Copy link
Contributor

LGTM - @lgalfaso any further comments? If there are no more comments then let's land this before RC1

@lgalfaso
Copy link
Contributor

LGTM

@petebacondarwin
Copy link
Contributor

Please merge

Although the detected `vendorPrefix` for MS Edge is "ms", it doesn't seem to recognize some
vendor-prefixed CSS rules (e.g. `-ms-animation-*`). Other browsers (currently) recognize either
vendor-prefixed rules only or both.
This commit fixes this issue by adding and retrieving styles using both prefixed and un-prefixed
names.
For unknown reasons, an `<svg>` element inside a `<foreignObject>` element on MS Edge seems to have
no size, causing the included `<circle>` element to have no size as well and thus fails an
assertion (relying on the element having a non-zero size).

This seems to be an MS Edge issue; i.e. it is also reproducible without Angular.
(Tested with MS Edge version 25.10586.0.0 on Windows 10.)
@gkalpak gkalpak force-pushed the test-fix-ms-edge-failures branch from f7f4417 to ff44c1c Compare January 11, 2016 12:55
gkalpak added a commit to gkalpak/angular.js that referenced this pull request Jan 11, 2016
Includes the following fixes (per component):

* `$sniffer`: Properly determine the expected `vendorPrefix` for MS Edge
* `input`: MS Edge does not support dates with years with more than 4 digits.
      Trying to set the value of an `input[datetime-local]` to `9999-12-31T23.59.59.999` throws an
      error (probably related to converting the date to one with a year with more than 4 digits,
      due to timezone offset).
* `$sanitize`: Fix failing tests on MS Edge
* `$animateCss`: Although the detected `vendorPrefix` for MS Edge is "ms", it doesn't seem to
      recognize some vendor-prefixed CSS rules (e.g. `-ms-animation-*`). Other browsers (currently)
      recognize either vendor-prefixed rules only or both.
      Fixed by adding and retrieving styles using both prefixed and un-prefixed names.
* `$compile`: Skip failing `foreignObject` test on MS Edge.
      For unknown reasons, an `<svg>` element inside a `<foreignObject>` element on MS Edge has no
      size, causing the included `<circle>` element to also have no size and thus fails an
      assertion (relying on the element having a non-zero size).
      This seems to be an MS Edge issue; i.e. it is also reproducible without Angular.
      (Tested with MS Edge version 25.10586.0.0 on Windows 10.)

Closes angular#13686
@gkalpak gkalpak closed this in cb74999 Jan 11, 2016
@gkalpak gkalpak deleted the test-fix-ms-edge-failures branch January 11, 2016 14:40
gkalpak added a commit to gkalpak/angular.js that referenced this pull request Jan 11, 2016
Includes the following fixes (per component):

* `$sniffer`: Properly determine the expected `vendorPrefix` for MS Edge
* `input`: MS Edge does not support dates with years with more than 4 digits.
      Trying to set the value of an `input[datetime-local]` to `9999-12-31T23.59.59.999` throws an
      error (probably related to converting the date to one with a year with more than 4 digits,
      due to timezone offset).
* `$animateCss`: Although the detected `vendorPrefix` for MS Edge is "ms", it doesn't seem to
      recognize some vendor-prefixed CSS rules (e.g. `-ms-animation-*`). Other browsers (currently)
      recognize either vendor-prefixed rules only or both.
      Fixed by adding and retrieving styles using both prefixed and un-prefixed names.
* `$compile`: Skip failing `foreignObject` test on MS Edge.
      For unknown reasons, an `<svg>` element inside a `<foreignObject>` element on MS Edge has no
      size, causing the included `<circle>` element to also have no size and thus fails an
      assertion (relying on the element having a non-zero size).
      This seems to be an MS Edge issue; i.e. it is also reproducible without Angular.
      (Tested with MS Edge version 25.10586.0.0 on Windows 10.)

Closes angular#13686
gkalpak added a commit that referenced this pull request Jan 11, 2016
Includes the following fixes (per component):

* `$sniffer`: Properly determine the expected `vendorPrefix` for MS Edge
* `input`: MS Edge does not support dates with years with more than 4 digits.
      Trying to set the value of an `input[datetime-local]` to `9999-12-31T23.59.59.999` throws an
      error (probably related to converting the date to one with a year with more than 4 digits,
      due to timezone offset).
* `$animateCss`: Although the detected `vendorPrefix` for MS Edge is "ms", it doesn't seem to
      recognize some vendor-prefixed CSS rules (e.g. `-ms-animation-*`). Other browsers (currently)
      recognize either vendor-prefixed rules only or both.
      Fixed by adding and retrieving styles using both prefixed and un-prefixed names.
* `$compile`: Skip failing `foreignObject` test on MS Edge.
      For unknown reasons, an `<svg>` element inside a `<foreignObject>` element on MS Edge has no
      size, causing the included `<circle>` element to also have no size and thus fails an
      assertion (relying on the element having a non-zero size).
      This seems to be an MS Edge issue; i.e. it is also reproducible without Angular.
      (Tested with MS Edge version 25.10586.0.0 on Windows 10.)

Closes #13686
@gkalpak
Copy link
Member Author

gkalpak commented Jan 11, 2016

Backported to v1.4.x as da04571 and 0a641c0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants