-
Notifications
You must be signed in to change notification settings - Fork 973
do not rely on classList for event target checks #10165
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10165 +/- ##
==========================================
+ Coverage 52.93% 52.95% +0.02%
==========================================
Files 228 228
Lines 20295 20306 +11
Branches 3251 3253 +2
==========================================
+ Hits 10744 10754 +10
- Misses 9551 9552 +1
|
@cezaraugusto to test the effectiveness of this PR, Aphrodite should be updated to |
js/lib/eventUtil.js
Outdated
@@ -10,6 +10,11 @@ module.exports.isForSecondaryAction = (e) => | |||
e.button === 1 | |||
|
|||
module.exports.eventElHasAncestorWithClasses = (e, classesToCheck) => { | |||
// DO NOT ADD NEW CHECKS USING THIS METHOD | |||
// classNames are changed from dev to prod by Aphrodite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cezaraugusto mind specifying Aphrodite version (1.2.3
) and adding the number of the issue (#10029)?
this should fix #10104 as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes work great 😄
Tests I tried
- Enabling LastPass and making sure the popup menu works
- Adding bookmark using star icon and dismissing by clicking outside modal
- Editing bookmark (opens hanger) and dismissing by clicking outside modal
- Launching on Windows and using alt to select a menu, then dismiss by clicking outside menu
- Launching on Windows and using alt to open a menu, then dismiss by clicking outside menu
++
|
||
require('../../braveUnit') | ||
|
||
describe('eventUtil', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cezaraugusto can you add a test for a partial match? like nespressoPods
and/or love_nespresso
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added can not accept partial string match
@luixxiul @cezaraugusto can you confirm this also closes #10104? |
could I know how to test the binary build with |
@luixxiul pls run |
@cezaraugusto I tried |
|
do not rely on classList for event target checks
do not rely on classList for event target checks
do not rely on classList for event target checks
Submitter Checklist:
git rebase -i
to squash commits (if needed).Auditors: @bsclifton, @jonathansampson
Close #10133
Test Plan:
Related: #10062
Manual test plan (cc @luixxiul):
1.2.3
in package.jsonReviewer Checklist:
Tests