TimeRanges.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibJS/Runtime/Realm.h>
  7. #include <LibWeb/Bindings/Intrinsics.h>
  8. #include <LibWeb/Bindings/TimeRangesPrototype.h>
  9. #include <LibWeb/HTML/TimeRanges.h>
  10. namespace Web::HTML {
  11. TimeRanges::TimeRanges(JS::Realm& realm)
  12. : Base(realm)
  13. {
  14. }
  15. void TimeRanges::initialize(JS::Realm& realm)
  16. {
  17. Base::initialize(realm);
  18. set_prototype(&Bindings::ensure_web_prototype<Bindings::TimeRangesPrototype>(realm, "TimeRanges"));
  19. }
  20. // https://html.spec.whatwg.org/multipage/media.html#dom-timeranges-length
  21. size_t TimeRanges::length() const
  22. {
  23. // FIXME: The length IDL attribute must return the number of ranges represented by the object.
  24. return 0;
  25. }
  26. // https://html.spec.whatwg.org/multipage/media.html#dom-timeranges-start
  27. double TimeRanges::start(u32) const
  28. {
  29. // FIXME: The start(index) method must return the position of the start of the indexth range represented by the object,
  30. // in seconds measured from the start of the timeline that the object covers.
  31. return 0.0;
  32. }
  33. // https://html.spec.whatwg.org/multipage/media.html#dom-timeranges-end
  34. double TimeRanges::end(u32) const
  35. {
  36. // FIXME: The end(index) method must return the position of the end of the indexth range represented by the object,
  37. // in seconds measured from the start of the timeline that the object covers.
  38. return 0.0;
  39. }
  40. }