mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:42:43 +00:00 
			
		
		
		
	LibWeb: Expose the location object via Document.location
Both Window.location and Document.location use the same instance of the Location object. Some sites use it via Window, some via Document.
This commit is contained in:
		
							parent
							
								
									ee5bac0891
								
							
						
					
					
						commit
						678dd2d180
					
				
					 6 changed files with 34 additions and 1 deletions
				
			
		|  | @ -842,6 +842,11 @@ static void generate_return_statement(SourceGenerator& generator, IDL::Type cons | |||
|         return JS::js_null(); | ||||
| 
 | ||||
|     return retval.callback.cell(); | ||||
| )~~~"); | ||||
|     } else if (return_type.name == "Location") { | ||||
|         // Location is special cased as it is already a JS::Object.
 | ||||
|         scoped_generator.append(R"~~~( | ||||
|     return JS::Value(retval); | ||||
| )~~~"); | ||||
|     } else { | ||||
|         scoped_generator.append(R"~~~( | ||||
|  | @ -1440,6 +1445,7 @@ void generate_prototype_implementation(IDL::Interface const& interface) | |||
| #include <LibWeb/Bindings/HTMLTableCaptionElementWrapper.h> | ||||
| #include <LibWeb/Bindings/HTMLTableSectionElementWrapper.h> | ||||
| #include <LibWeb/Bindings/ImageDataWrapper.h> | ||||
| #include <LibWeb/Bindings/LocationObject.h> | ||||
| #include <LibWeb/Bindings/NodeWrapperFactory.h> | ||||
| #include <LibWeb/Bindings/PerformanceTimingWrapper.h> | ||||
| #include <LibWeb/Bindings/RangeWrapper.h> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Luke Wilde
						Luke Wilde