mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-18 23:12:02 +00:00
LibWeb/HTML: Only update the image data on fully loaded document
Documents created by DOMParser and fragment documents do not have an origin set on the document by the spec. These documents also happen to never become fully active. By properly implementing the steps for the <img> element to only update the image data for documents which are fully active, this fixes a crash for img elements in these types of documents. Unfortunately, this is not a full fix for the microtask queue case. This is because it seems possible for node document for an <img> element to be changed during the microtask queue for that document. It is not clear to me how this can be fixed in a nice way.
This commit is contained in:
parent
bc85a9bace
commit
0bdcaf02d3
Notes:
github-actions[bot]
2025-06-24 07:57:31 +00:00
Author: https://github.com/shannonbooth
Commit: 0bdcaf02d3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5153
Reviewed-by: https://github.com/gmta ✅
7 changed files with 684 additions and 5 deletions
|
@ -114,6 +114,8 @@ public:
|
|||
private:
|
||||
HTMLImageElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
void update_the_image_data_impl(bool restart_the_animations = false, bool maybe_omit_events = false);
|
||||
|
||||
virtual bool is_html_image_element() const override { return true; }
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
@ -144,6 +146,8 @@ private:
|
|||
|
||||
Optional<DOM::DocumentLoadEventDelayer> m_load_event_delayer;
|
||||
|
||||
GC::Ptr<DOM::DocumentObserver> m_document_observer;
|
||||
|
||||
CORSSettingAttribute m_cors_setting { CORSSettingAttribute::NoCORS };
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/images.html#last-selected-source
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue