mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 21:12:26 +00:00
LibWeb: Use double type in ProgressEvent
loaded and total should be double as per spec https://xhr.spec.whatwg.org/#progressevent
This commit is contained in:
parent
d56f6805d3
commit
eb165554e1
Notes:
github-actions[bot]
2025-04-17 12:29:50 +00:00
Author: https://github.com/vishalbiswas
Commit: eb165554e1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4382
Reviewed-by: https://github.com/trflynn89 ✅
4 changed files with 102 additions and 10 deletions
|
@ -14,8 +14,8 @@ namespace Web::XHR {
|
|||
|
||||
struct ProgressEventInit : public DOM::EventInit {
|
||||
bool length_computable { false };
|
||||
WebIDL::UnsignedLongLong loaded { 0 };
|
||||
WebIDL::UnsignedLongLong total { 0 };
|
||||
WebIDL::Double loaded { 0 };
|
||||
WebIDL::Double total { 0 };
|
||||
};
|
||||
|
||||
class ProgressEvent final : public DOM::Event {
|
||||
|
@ -29,8 +29,8 @@ public:
|
|||
virtual ~ProgressEvent() override;
|
||||
|
||||
bool length_computable() const { return m_length_computable; }
|
||||
WebIDL::UnsignedLongLong loaded() const { return m_loaded; }
|
||||
WebIDL::UnsignedLongLong total() const { return m_total; }
|
||||
WebIDL::Double loaded() const { return m_loaded; }
|
||||
WebIDL::Double total() const { return m_total; }
|
||||
|
||||
private:
|
||||
ProgressEvent(JS::Realm&, FlyString const& event_name, ProgressEventInit const& event_init);
|
||||
|
@ -38,8 +38,8 @@ private:
|
|||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
bool m_length_computable { false };
|
||||
WebIDL::UnsignedLongLong m_loaded { 0 };
|
||||
WebIDL::UnsignedLongLong m_total { 0 };
|
||||
WebIDL::Double m_loaded { 0 };
|
||||
WebIDL::Double m_total { 0 };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -6,12 +6,12 @@ interface ProgressEvent : Event {
|
|||
constructor(DOMString type, optional ProgressEventInit eventInitDict = {});
|
||||
|
||||
readonly attribute boolean lengthComputable;
|
||||
readonly attribute unsigned long long loaded;
|
||||
readonly attribute unsigned long long total;
|
||||
readonly attribute double loaded;
|
||||
readonly attribute double total;
|
||||
};
|
||||
|
||||
dictionary ProgressEventInit : EventInit {
|
||||
boolean lengthComputable = false;
|
||||
unsigned long long loaded = 0;
|
||||
unsigned long long total = 0;
|
||||
double loaded = 0;
|
||||
double total = 0;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue