mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 06:12:43 +00:00 
			
		
		
		
	LibWeb: Implement HTMLImageElement.complete according to spec
Now that we use the HTML image loading algorithm from spec, we can implement complete correctly. This (finally) fixes an issue where images were not loading on https://twinings.co.uk/ :^)
This commit is contained in:
		
							parent
							
								
									92bc3d200d
								
							
						
					
					
						commit
						5e24b97275
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		|  | @ -234,9 +234,11 @@ bool HTMLImageElement::complete() const | |||
|         return true; | ||||
| 
 | ||||
|     // - The img element's current request's state is completely available and its pending request is null.
 | ||||
|     if (m_current_request->state() == ImageRequest::State::CompletelyAvailable && !m_pending_request) | ||||
|         return true; | ||||
| 
 | ||||
|     // - The img element's current request's state is broken and its pending request is null.
 | ||||
|     // FIXME: This is ad-hoc and should be updated once we are loading images via the Fetch mechanism.
 | ||||
|     if (auto bitmap = current_image_bitmap()) | ||||
|     if (m_current_request->state() == ImageRequest::State::Broken && !m_pending_request) | ||||
|         return true; | ||||
| 
 | ||||
|     return false; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling