https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes
If a reflecting IDL attribute is a DOMString attribute whose content attribute is defined to contain a URL, then on getting, the IDL attribute must parse the value of the content attribute relative to the element's node document and return the resulting URL string if that was successful, or the empty string otherwise; and on setting, must set the content attribute to the specified literal value. If the content attribute is absent, the IDL attribute must return the default value, if the content attribute has one, or else the empty string.
From web-platform-tests/wpt#2663 (comment)
A number of attributes are defined to take a non-empty URL, and they do nothing when the value is empty; e.g. <img src>, <track src> (but not e.g. <a href>). But when getting the IDL attribute it still resolves the empty string into a URL, which doesn't make any sense. I think we should fix reflecting to have different behavior between <img src="">.src and <a href="">.href such that the former returns the empty string.
https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes
From web-platform-tests/wpt#2663 (comment)
A number of attributes are defined to take a non-empty URL, and they do nothing when the value is empty; e.g.
<img src>,<track src>(but not e.g.<a href>). But when getting the IDL attribute it still resolves the empty string into a URL, which doesn't make any sense. I think we should fix reflecting to have different behavior between<img src="">.srcand<a href="">.hrefsuch that the former returns the empty string.