ladybird/Userland/Libraries/LibWeb/Layout
Daniel Bertalan c6fafd3e90 AK+Userland: Add generic AK::abs() function and use it
Previously, in LibGFX's `Point` class, calculated distances were passed
to the integer `abs` function, even if the stored type was a float. This
caused the value to unexpectedly be truncated. Luckily, this API was not
used with floating point types, but that can change in the future, so
why not fix it now :^)

Since we are in C++, we can use function overloading to make things
easy, and to automatically use the right version.

This is even better than the LibC/LibM functions, as using a bit of
hackery, they are able to be constant-evaluated. They use compiler
intrinsics, so they do not depend on external code and the compiler can
emit the most optimized code by default.

Since we aren't using the C++ standard library's trick of importing
everything into the `AK` namespace, this `abs` function cannot be
exported to the global namespace, as the names would clash.
2021-07-08 10:11:00 +02:00
..
BlockBox.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
BlockBox.h AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
BlockFormattingContext.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
BlockFormattingContext.h LibWeb: Expose size calculation of BlockFormattingContext 2021-06-06 01:46:06 +04:30
Box.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
Box.h LibWeb: Introduce struct to hold border radii and normalize once 2021-05-20 22:08:02 +02:00
BoxModelMetrics.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BoxModelMetrics.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BreakNode.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BreakNode.h AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
ButtonBox.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
ButtonBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CanvasBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CanvasBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CheckBox.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
CheckBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FlexFormattingContext.cpp AK+Userland: Add generic AK::abs() function and use it 2021-07-08 10:11:00 +02:00
FlexFormattingContext.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
FormattingContext.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
FormattingContext.h LibWeb: Fix height computation (again) :^) 2021-04-22 19:17:10 +02:00
FrameBox.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
FrameBox.h AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
ImageBox.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
ImageBox.h LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
InitialContainingBlockBox.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
InitialContainingBlockBox.h LibWeb: Propagate body background properties to root HTML element 2021-05-13 16:16:25 +02:00
InlineFormattingContext.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
InlineFormattingContext.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
InlineNode.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
InlineNode.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Label.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
Label.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LabelableNode.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LayoutPosition.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LayoutPosition.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LineBox.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
LineBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
LineBoxFragment.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
LineBoxFragment.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ListItemBox.cpp LibWeb: Position the ListItemMarkers according to their width 2021-05-12 08:53:18 +01:00
ListItemBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ListItemMarkerBox.cpp LibWeb: Add roman numerals as a list-style for ol's 2021-07-04 22:17:03 +02:00
ListItemMarkerBox.h LibWeb: Position the ListItemMarkers according to their width 2021-05-12 08:53:18 +01:00
Node.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
Node.h AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
RadioButton.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
RadioButton.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ReplacedBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ReplacedBox.h AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
SVGBox.cpp Userland: Use mattco@serenityos.org for my copyright headers 2021-04-23 08:24:53 +02:00
SVGBox.h Userland: Use mattco@serenityos.org for my copyright headers 2021-04-23 08:24:53 +02:00
SVGGraphicsBox.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
SVGGraphicsBox.h Userland: Use mattco@serenityos.org for my copyright headers 2021-04-23 08:24:53 +02:00
SVGPathBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SVGPathBox.h AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
SVGSVGBox.cpp Userland: Use mattco@serenityos.org for my copyright headers 2021-04-23 08:24:53 +02:00
SVGSVGBox.h AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
TableBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableCellBox.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
TableCellBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableFormattingContext.cpp LibWeb: Rename Web::Frame to Web::BrowsingContext 2021-05-30 12:39:53 +02:00
TableFormattingContext.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableRowBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableRowBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableRowGroupBox.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TableRowGroupBox.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TextNode.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
TextNode.h LibWeb: Move Layout::TextNode whitespace collapse to separate function 2021-04-29 10:34:02 +02:00
TreeBuilder.cpp AK: Rename downcast<T> => verify_cast<T> 2021-06-24 19:57:01 +02:00
TreeBuilder.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00