struct
Components::SafeSrcSet
- Components::SafeSrcSet
- Struct
- Value
- Object
Overview
srcset is a comma-separated list of "<url> <descriptor>?" candidates
โ a URL list with descriptors, not a single URL โ so SafeURL alone
cannot validate it (proposal ยง3.3 external-examiner caveat: "srcset ...
needs its own parser, not plain SafeURL").
This parses each candidate, validates its URL component through
SafeURL, and validates its descriptor against the width (NNNw) or
pixel-density (N.Nx) grammar. The whole value is rejected if ANY
candidate is unsafe or malformed โ fail closed, not "escape what we can."
Defined in:
components/safe/safe_srcset.crConstant Summary
-
DESCRIPTOR_PATTERN =
/\A\d+(\.\d+)?[wx]\z/
Constructors
Class Method Summary
Instance Method Summary
-
#to_s(io : IO) : Nil
Same as
#inspect(io). -
#to_s : String
Returns a nicely readable and concise string representation of this object, typically intended for users.
Constructor Detail
Class Method Detail
Instance Method Detail
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO) which can be overridden for custom implementations.
Also see #inspect.