mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibWeb: Bring parse_as_sizes_attribute() up to date with the spec
The following spec algorithms had changed since we implemented them: - "parse a sizes attribute" - "update the source set" - "create a source set" This commit brings them up to date, as well as adding some additional logging when parsing the sizes attribute fails in some way.
This commit is contained in:
parent
99718653e2
commit
2a0f6fd23e
Notes:
github-actions[bot]
2024-09-12 05:40:06 +00:00
Author: https://github.com/AtkinsSJ
Commit: 2a0f6fd23e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1374
5 changed files with 80 additions and 33 deletions
|
@ -33,7 +33,7 @@ struct ImageSourceAndPixelDensity {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/images.html#source-set
|
||||
struct SourceSet {
|
||||
static SourceSet create(DOM::Element const&, String default_source, String srcset, String sizes);
|
||||
static SourceSet create(DOM::Element const& element, String const& default_source, String const& srcset, String const& sizes, HTML::HTMLImageElement const* img = nullptr);
|
||||
|
||||
[[nodiscard]] bool is_empty() const;
|
||||
|
||||
|
@ -50,6 +50,6 @@ struct SourceSet {
|
|||
};
|
||||
|
||||
SourceSet parse_a_srcset_attribute(StringView);
|
||||
[[nodiscard]] CSS::LengthOrCalculated parse_a_sizes_attribute(DOM::Document const&, StringView);
|
||||
[[nodiscard]] CSS::LengthOrCalculated parse_a_sizes_attribute(DOM::Element const& element, StringView sizes, HTML::HTMLImageElement const* img = nullptr);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue