Skip to content

[popup] The popup IDL attribute might not be web compatible #546

@mfreed7

Description

@mfreed7

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 null

I'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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    popoverThe Popover API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions