# File lib/html5/filters/validator.rb, line 713
  def validate_attribute_value_id(token, tag_name, attr_name, attr_value)
    # This method has side effects.  It adds 'token' to the list of
    # things that define an ID (@things_that_define_an_id) so that we can
    # later check 1) whether an ID is duplicated, and 2) whether all the
    # things that point to something else by ID (like <label for> or
    # <span contextmenu>) point to an ID that actually exists somewhere.
    check_id(token, tag_name, attr_name, attr_value) do |t|
      yield t
    end
    return if not attr_value
    if @ids_we_have_known_and_loved.include?(attr_value)
      yield( {:type => "ParseError",
           :data => "duplicate-id",
           :datavars => {"tagName" => tag_name}})
    end
    @ids_we_have_known_and_loved << attr_value
    @things_that_define_an_id << token
  end