BoxModelMetrics.h 565 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGfx/Size.h>
  8. #include <LibWeb/PixelUnits.h>
  9. namespace Web::Layout {
  10. struct PixelBox {
  11. CSSPixels top { 0 };
  12. CSSPixels right { 0 };
  13. CSSPixels bottom { 0 };
  14. CSSPixels left { 0 };
  15. };
  16. struct BoxModelMetrics {
  17. public:
  18. PixelBox margin;
  19. PixelBox padding;
  20. PixelBox border;
  21. PixelBox inset;
  22. PixelBox margin_box() const;
  23. PixelBox padding_box() const;
  24. PixelBox border_box() const;
  25. };
  26. }