Skip to content

Commit

Permalink
Bug 1768686 [wpt PR 34021] - Only reflect valid popup values, a=testonly
Browse files Browse the repository at this point in the history
Automatic update from web-platform-tests
Only reflect valid popup values

This was resolved in [1] - only valid values for the `popup` attribute
should be reflected, so that feature detection can be used on the values.

[1] openui/open-ui#491 (comment)

Bug: 1307772
Change-Id: I932a28bd48e336cf01253a971804dc00dcd099fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3639122
Auto-Submit: Mason Freed <[email protected]>
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1001641}

--

wpt-commits: 1edef0f70fd0b8480c1c7af45307ecfaf3611414
wpt-pr: 34021
  • Loading branch information
mfreed7 authored and moz-wptsync-bot committed May 17, 2022
1 parent a6340be commit f8333eb
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,27 @@
popup.setAttribute('popup','hint');
assert_equals(popup.popup,'hint');
popup.setAttribute('popup','invalid');
assert_equals(popup.popup,'invalid');
assert_equals(popup.popup,'','Invalid values should reflect as empty string');
popup.setAttribute('popup','HiNt');
assert_equals(popup.popup,'HiNt');
assert_equals(popup.popup,'hint','Case is normalized');
popup.removeAttribute('popup');
assert_equals(popup.popup,'');
assert_equals(popup.popup,'','No value should reflect as empty string');
popup.popup='hint';
assert_equals(popup.getAttribute('popup'),'hint');
popup.popup='popup';
assert_equals(popup.getAttribute('popup'),'popup');
popup.popup='invalid';
assert_equals(popup.getAttribute('popup'),'invalid');
assert_equals(popup.getAttribute('popup'),'invalid','IDL setter allows any value');
assert_equals(popup.popup,'','but IDL getter does not re-reflect invalid values');
popup.popup='';
assert_equals(popup.getAttribute('popup'),'');
assert_equals(popup.getAttribute('popup'),'','Empty should map to empty');
assert_equals(popup.popup,'','Empty should map to empty in IDL');
popup.popup=null;
assert_equals(popup.getAttribute('popup'),'null','Attribute for "null" should still get set');
assert_equals(popup.popup,'','Null should map to empty in IDL');
popup.popup=undefined;
assert_equals(popup.getAttribute('popup'),'undefined','Attribute for "undefined" should still get set');
assert_equals(popup.popup,'','undefined should map to empty in IDL');
},'IDL attribute reflection');

test(() => {
Expand All @@ -110,6 +118,8 @@
assertIsFunctionalPopup(popup);
popup.popup = 'PoPuP';
assertIsFunctionalPopup(popup);
popup.popup = 'invalid';
assertNotAPopup(popup);
},'Popup attribute value should be case insensitive');

test(() => {
Expand Down

0 comments on commit f8333eb

Please sign in to comment.