Skip to content

Popover example nitpick #4

Description

@PaulKiddle

The following statement is ambiguous and could be read as incorrect:

Many native features add methods etc to the element. E.g. the popover attribute also adds showPopover().

showPopover is always a property of the HTMLElement, it just doesn't do anything unless the popover attribute is also present.

It's minor but I think important to note that the presence of the attribute is not monkey-patching the prototype.

Not to say custom attributes couldn't add methods to a prototype - just that those methods would likely be added to the element prototype when the attribute is initially defined, not just when the attribute is appended to an element instance (assuming custom attributes wants to follow existing behaviour).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions