-
Notifications
You must be signed in to change notification settings - Fork 216
Description
A bug was filed on the Chromium implementation that might indicate some Web Compat issues for the popup IDL (Javascript) attribute. Because we resolved (here and here) that the popup attribute should reflect only valid (string) values, and should return null for invalid values, sites will break that already use popup as a property:
const myElement = document.querySelector('foo');
myElement.popup = myBigComplicatedObject;
myElement.getAttribute('popup'); // "[object Object]"
myElement.popup; // null
myElement.popup.runMethod(); // Breaks, because popup is nullI'm not sure what the best solution is for this problem. The obvious one is to rename popup (the IDL attribute, not the content attribute) to something less common. And the downside of that is that it is confusing for developers that myObject.newPopupAttrribute='auto' results in <div popup="auto">. Another would be to revert to myPopup.popup accepting any value. To feature-detect the values of popup, we'd then need another mechanism, such as a different/new property: myPopup.popupValidated or something like that.
Suggestions?