TimeRanges.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. JS_DEFINE_ALLOCATOR(TimeRanges);
  12. TimeRanges::TimeRanges(JS::Realm& realm)
  13. : Base(realm)
  14. {
  15. }
  16. void TimeRanges::initialize(JS::Realm& realm)
  17. {
  18. Base::initialize(realm);
  19. WEB_SET_PROTOTYPE_FOR_INTERFACE(TimeRanges);
  20. }
  21. // https://html.spec.whatwg.org/multipage/media.html#dom-timeranges-length
  22. size_t TimeRanges::length() const
  23. {
  24. // FIXME: The length IDL attribute must return the number of ranges represented by the object.
  25. return 0;
  26. }
  27. // https://html.spec.whatwg.org/multipage/media.html#dom-timeranges-start
  28. double TimeRanges::start(u32) const
  29. {
  30. // FIXME: The start(index) method must return the position of the start of the indexth range represented by the object,
  31. // in seconds measured from the start of the timeline that the object covers.
  32. return 0.0;
  33. }
  34. // https://html.spec.whatwg.org/multipage/media.html#dom-timeranges-end
  35. double TimeRanges::end(u32) const
  36. {
  37. // FIXME: The end(index) method must return the position of the end of the indexth range represented by the object,
  38. // in seconds measured from the start of the timeline that the object covers.
  39. return 0.0;
  40. }
  41. }