Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions scalatags/src/scalatags/generic/Attrs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,22 @@ trait InputAttrs[Builder, Output <: FragT, FragT] extends GlobalAttrs[Builder, O
lazy val widthA = attr("width") // TODO: Conflicts with "width" in Styles
}

trait AnchorElementAttrs[Builder, Output<:FragT, FragT] extends Util[Builder, Output, FragT] {
/**
* Prompts the user to save the linked URL instead of navigating to it. Can be used with or without a value:
* - Without a value, the browser will suggest a filename/extension, generated from various sources:
* * The Content-Disposition HTTP header
* * The final segment in the URL path
* * The media type (from the (Content-Type header, the start of a data: URL, or Blob.type for a blob: URL)
* - Defining a value suggests it as the filename. / and \ characters are converted to underscores _.
* Filesystems may forbid other characters in filenames, so browsers will adjust the suggested name if necessary.
*
* MDN
*/
lazy val download = attr("download")
}


/**
* Trait containing the contents of the [[Attrs]] module, so they can be
* mixed in to other objects if needed. This should contain "all" attributes
Expand All @@ -826,6 +842,7 @@ trait Attrs[Builder, Output <: FragT, FragT] extends InputAttrs[Builder, Output,
with MouseEventAttrs[Builder, Output, FragT]
with WindowEventAttrs[Builder, Output, FragT]
with FormEventAttrs[Builder, Output, FragT]
with AnchorElementAttrs[Builder, Output, FragT]
{
/**
* This is the single required attribute for anchors defining a hypertext
Expand Down