CSSUnitValue.h 564 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2024, Sam Atkins <sam@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/FlyString.h>
  8. #include <LibWeb/CSS/StyleValues/CSSNumericValue.h>
  9. namespace Web::CSS {
  10. // https://drafts.css-houdini.org/css-typed-om-1/#cssunitvalue
  11. class CSSUnitValue : public CSSNumericValue {
  12. public:
  13. virtual ~CSSUnitValue() override = default;
  14. virtual double value() const = 0;
  15. virtual StringView unit() const = 0;
  16. protected:
  17. explicit CSSUnitValue(Type type)
  18. : CSSNumericValue(type)
  19. {
  20. }
  21. };
  22. }