mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 09:42:45 +00:00 
			
		
		
		
	LibWeb: Port AbstractBrowsingContext to String
This commit is contained in:
		
							parent
							
								
									03d6cb88ff
								
							
						
					
					
						commit
						1080281e58
					
				
					 4 changed files with 7 additions and 7 deletions
				
			
		|  | @ -22,8 +22,8 @@ public: | ||||||
|     virtual HTML::WindowProxy* window_proxy() = 0; |     virtual HTML::WindowProxy* window_proxy() = 0; | ||||||
|     virtual HTML::WindowProxy const* window_proxy() const = 0; |     virtual HTML::WindowProxy const* window_proxy() const = 0; | ||||||
| 
 | 
 | ||||||
|     DeprecatedString const& name() const { return m_name; } |     String const& name() const { return m_name; } | ||||||
|     void set_name(DeprecatedString const& name) { m_name = name; } |     void set_name(String const& name) { m_name = name; } | ||||||
| 
 | 
 | ||||||
|     JS::GCPtr<BrowsingContext> opener_browsing_context() const { return m_opener_browsing_context; } |     JS::GCPtr<BrowsingContext> opener_browsing_context() const { return m_opener_browsing_context; } | ||||||
|     void set_opener_browsing_context(JS::GCPtr<BrowsingContext> browsing_context) { m_opener_browsing_context = browsing_context; } |     void set_opener_browsing_context(JS::GCPtr<BrowsingContext> browsing_context) { m_opener_browsing_context = browsing_context; } | ||||||
|  | @ -45,7 +45,7 @@ public: | ||||||
|     virtual void set_window_handle(String handle) = 0; |     virtual void set_window_handle(String handle) = 0; | ||||||
| 
 | 
 | ||||||
| protected: | protected: | ||||||
|     DeprecatedString m_name; |     String m_name; | ||||||
| 
 | 
 | ||||||
|     // https://html.spec.whatwg.org/multipage/browsers.html#is-popup
 |     // https://html.spec.whatwg.org/multipage/browsers.html#is-popup
 | ||||||
|     TokenizedFeature::Popup m_is_popup { TokenizedFeature::Popup::No }; |     TokenizedFeature::Popup m_is_popup { TokenizedFeature::Popup::No }; | ||||||
|  |  | ||||||
|  | @ -724,7 +724,7 @@ BrowsingContext::ChosenBrowsingContext BrowsingContext::choose_a_browsing_contex | ||||||
| 
 | 
 | ||||||
|             // 6. If name is not an ASCII case-insensitive match for "_blank", then set chosen's name to name.
 |             // 6. If name is not an ASCII case-insensitive match for "_blank", then set chosen's name to name.
 | ||||||
|             if (!Infra::is_ascii_case_insensitive_match(name, "_blank"sv)) |             if (!Infra::is_ascii_case_insensitive_match(name, "_blank"sv)) | ||||||
|                 chosen->set_name(name); |                 chosen->set_name(String::from_deprecated_string(name).release_value_but_fixme_should_propagate_errors()); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         // --> If the user agent has been configured such that in this instance t will reuse current
 |         // --> If the user agent has been configured such that in this instance t will reuse current
 | ||||||
|  |  | ||||||
|  | @ -58,7 +58,7 @@ void BrowsingContextContainer::create_new_nested_browsing_context() | ||||||
| 
 | 
 | ||||||
|     // 4. If element has a name attribute, then set browsingContext's name to the value of this attribute.
 |     // 4. If element has a name attribute, then set browsingContext's name to the value of this attribute.
 | ||||||
|     if (auto name = attribute(HTML::AttributeNames::name); !name.is_empty()) |     if (auto name = attribute(HTML::AttributeNames::name); !name.is_empty()) | ||||||
|         m_nested_browsing_context->set_name(name); |         m_nested_browsing_context->set_name(String::from_deprecated_string(name).release_value_but_fixme_should_propagate_errors()); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // https://html.spec.whatwg.org/multipage/browsers.html#concept-bcc-content-document
 | // https://html.spec.whatwg.org/multipage/browsers.html#concept-bcc-content-document
 | ||||||
|  |  | ||||||
|  | @ -788,7 +788,7 @@ String Window::name() const | ||||||
|         return String {}; |         return String {}; | ||||||
| 
 | 
 | ||||||
|     // 2. Return this's navigable's target name.
 |     // 2. Return this's navigable's target name.
 | ||||||
|     return String::from_deprecated_string(browsing_context()->name()).release_value_but_fixme_should_propagate_errors(); |     return browsing_context()->name(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // https://html.spec.whatwg.org/multipage/nav-history-apis.html#apis-for-creating-and-navigating-browsing-contexts-by-name:dom-name
 | // https://html.spec.whatwg.org/multipage/nav-history-apis.html#apis-for-creating-and-navigating-browsing-contexts-by-name:dom-name
 | ||||||
|  | @ -799,7 +799,7 @@ void Window::set_name(String const& name) | ||||||
|         return; |         return; | ||||||
| 
 | 
 | ||||||
|     // 2. Set this's navigable's active session history entry's document state's navigable target name to the given value.
 |     // 2. Set this's navigable's active session history entry's document state's navigable target name to the given value.
 | ||||||
|     browsing_context()->set_name(name.to_deprecated_string()); |     browsing_context()->set_name(name); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location
 | // https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kenneth Myhra
						Kenneth Myhra