mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
The following command was used to clang-format these files:
clang-format-21 -i $(find . \
-not \( -path "./\.*" -prune \) \
-not \( -path "./Build/*" -prune \) \
-not \( -path "./Toolchain/*" -prune \) \
-type f -name "*.cpp" -o -name "*.mm" -o -name "*.h")
29 lines
762 B
C++
29 lines
762 B
C++
/*
|
|
* Copyright (c) 2024, Sam Atkins <sam@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/PixelUnits.h>
|
|
|
|
namespace Web::CSS {
|
|
|
|
struct SizeWithAspectRatio {
|
|
Optional<CSSPixels> width;
|
|
Optional<CSSPixels> height;
|
|
Optional<CSSPixelFraction> aspect_ratio;
|
|
bool has_width() const { return width.has_value(); }
|
|
bool has_height() const { return height.has_value(); }
|
|
bool has_aspect_ratio() const { return aspect_ratio.has_value(); }
|
|
};
|
|
|
|
// https://drafts.csswg.org/css-images/#default-sizing
|
|
CSSPixelSize run_default_sizing_algorithm(
|
|
Optional<CSSPixels> specified_width,
|
|
Optional<CSSPixels> specified_height,
|
|
SizeWithAspectRatio const& natural_size,
|
|
CSSPixelSize default_size);
|
|
|
|
}
|