mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 04:52:45 +00:00 
			
		
		
		
	LibWeb: Delete BrowsingContext::set_active_document()
Superseded by Document::make_active()
This commit is contained in:
		
							parent
							
								
									2fbb6ae520
								
							
						
					
					
						commit
						fda420875d
					
				
					 3 changed files with 2 additions and 34 deletions
				
			
		|  | @ -357,36 +357,6 @@ bool BrowsingContext::is_focused_context() const | |||
|     return m_page && &m_page->focused_context() == this; | ||||
| } | ||||
| 
 | ||||
| // https://html.spec.whatwg.org/multipage/browsers.html#set-the-active-document
 | ||||
| void BrowsingContext::set_active_document(JS::NonnullGCPtr<DOM::Document> document) | ||||
| { | ||||
|     auto previously_active_document = active_document(); | ||||
| 
 | ||||
|     // 1. Let window be document's relevant global object.
 | ||||
|     auto& window = verify_cast<HTML::Window>(relevant_global_object(document)); | ||||
| 
 | ||||
|     // 2. Set document's visibility state to browsingContext's top-level browsing context's system visibility state.
 | ||||
|     document->set_visibility_state({}, top_level_browsing_context().system_visibility_state()); | ||||
| 
 | ||||
|     // 3. Set browsingContext's active window to window.
 | ||||
|     m_window_proxy->set_window(window); | ||||
| 
 | ||||
|     // 4. Set window's associated Document to document.
 | ||||
|     window.set_associated_document(document); | ||||
| 
 | ||||
|     // 5. Set window's relevant settings object's execution ready flag.
 | ||||
|     relevant_settings_object(window).execution_ready = true; | ||||
| 
 | ||||
|     // AD-HOC:
 | ||||
|     document->set_browsing_context(this); | ||||
| 
 | ||||
|     if (m_page && m_page->top_level_traversable_is_initialized() && this == &m_page->top_level_browsing_context()) | ||||
|         m_page->client().page_did_change_title(document->title()); | ||||
| 
 | ||||
|     if (previously_active_document && previously_active_document != document.ptr()) | ||||
|         previously_active_document->did_stop_being_active_document_in_browsing_context({}); | ||||
| } | ||||
| 
 | ||||
| void BrowsingContext::scroll_to(CSSPixelPoint position) | ||||
| { | ||||
|     // NOTE: Scrolling to a position requires up-to-date layout *unless* we're scrolling to (0, 0)
 | ||||
|  |  | |||
|  | @ -122,8 +122,6 @@ public: | |||
|     DOM::Document const* active_document() const; | ||||
|     DOM::Document* active_document(); | ||||
| 
 | ||||
|     void set_active_document(JS::NonnullGCPtr<DOM::Document>); | ||||
| 
 | ||||
|     virtual HTML::WindowProxy* window_proxy() override; | ||||
|     virtual HTML::WindowProxy const* window_proxy() const override; | ||||
| 
 | ||||
|  |  | |||
|  | @ -166,7 +166,7 @@ void FrameLoader::load_html(StringView html, const AK::URL& url) | |||
|         .navigable = nullptr, | ||||
|     }; | ||||
|     auto document = DOM::Document::create_and_initialize(DOM::Document::Type::HTML, "text/html", navigation_params).release_value_but_fixme_should_propagate_errors(); | ||||
|     browsing_context().set_active_document(document); | ||||
|     // browsing_context().set_active_document(document);
 | ||||
| 
 | ||||
|     auto parser = HTML::HTMLParser::create(document, html, "utf-8"); | ||||
|     parser->run(url); | ||||
|  | @ -334,7 +334,7 @@ void FrameLoader::resource_did_load() | |||
| 
 | ||||
|     document->set_content_type(MUST(String::from_deprecated_string(resource()->mime_type()))); | ||||
| 
 | ||||
|     browsing_context().set_active_document(document); | ||||
|     // browsing_context().set_active_document(document);
 | ||||
|     if (auto* page = browsing_context().page()) | ||||
|         page->client().page_did_create_new_document(*document); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Aliaksandr Kalenik
						Aliaksandr Kalenik