[CSS Anchored Positioning] Does the `anchor` IDL attribute reflect to the content attribute?
The anchor positioning proposal contains this proposed syntax:
document.getElementById('myPopup').anchor = document.getElementById('myButton');
Quick question: when you execute that line on <popup id=myPopup>, do you get <popup id=myPopup anchor=myButton>? What if you instead assign anchor to document.createElement('button'), which doesn't have an id?
Hmm, maybe we should just change the syntax to Element.setAttribute('anchor', 'someIdHere'); and the usual behavior + processing of IDREFs occurs. WDYT, @BoCupp-Microsoft?
Hmm, maybe we should just change the syntax to
Element.setAttribute('anchor', 'someIdHere');and the usual behavior + processing of IDREFs occurs. WDYT, @BoCupp-Microsoft?
I like that approach. It cuts off a number of potential issues. Like another one I just thought of:
const myButton = document.getElementById('myButton');
const myPopup = document.getElementById('myPopup');
myPopup.anchor = myButton;
myButton.id = 'something-else';
myPopup.getAttribute('anchor'); // myButton? something-else?
myPopup.anchor; // null? still myButton?