Opened 12 days ago
Closed 4 days ago
#41852 closed defect (bug) (fixed)
Fix UN flag test by returning the correct value.
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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)
#1
@peterwilsoncc
12 days ago
- Keywords has-patch added
- Owner set to pento
- Status changed from new to assigned
#3
in reply to:
↑ 2
@peterwilsoncc
10 days 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' );
#5
@peterwilsoncc
6 days ago
- Resolution set to fixed
- Status changed from assigned to closed
In 41386:
#6
@peterwilsoncc
6 days ago
- Keywords fixed-major added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for backporting to 4.8 branch.
I'm not really following. Could you provide some steps to replicate the issue and why it doesn't apply to the England flag?