Opened 7 years ago
Closed 7 years ago
#41852 closed defect (bug) (fixed)
Fix UN flag test by returning the correct value.
Reported by: | peterwilsoncc | Owned by: | pento |
---|---|---|---|
Milestone: | 4.8.2 | Priority: | normal |
Severity: | normal | Version: | 4.8 |
Component: | Emoji | Keywords: | has-patch commit fixed-major |
Focuses: | javascript | Cc: |
Description
In #40616 the method for testing flags was changed to allow for changes to the canvas engines in browsers, the test was reversed.
If the two sets of characters render the same, the flag test has failed and the polyfill should be used. WP is doing the reverse.
Attachments (1)
Change History (8)
#3
in reply to:
↑ 2
@
7 years ago
Replying to ocean90:
I'm not really following. Could you provide some steps to replicate the issue and why it doesn't apply to the England flag?
The tests are considered to fail (return false) if both flags look the same.
The UN test is effectively returning flag === flag2
, ie true if identical.
The English flag returns flag !== flag2
, ie false if identical.
The way the tests are written means the affect is minimal as users are more likely to get a false negative than a false positive.
I've put together a reduced test case at https://jsbin.com/palagay/2/edit?js,output
- Visit the test case to see if your browser supports the UN flag (Chrome 61/MacOS Sierra will not)
- The outcome will display the images.
- To test in core, change the UN flag test to end:
if ( flag !== flag2 ) { console.log( 'fail' ); return false; } console.log( 'pass' );
I'm not really following. Could you provide some steps to replicate the issue and why it doesn't apply to the England flag?