mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:22:43 +00:00 
			
		
		
		
	 4629f2e4ad
			
		
	
	
		4629f2e4ad
		
	
	
	
	
		
			
			This namespace will be used for all interfaces defined in the URL specification, like URL and URLSearchParams. This has the unfortunate side-effect of requiring us to use the fully qualified AK::URL name whenever we want to refer to the AK class, so this commit also fixes all such references.
		
			
				
	
	
		
			39 lines
		
	
	
	
		
			823 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
	
		
			823 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Function.h>
 | |
| #include <LibWeb/CSS/CSSStyleSheet.h>
 | |
| #include <LibWeb/Loader/Resource.h>
 | |
| 
 | |
| namespace Web {
 | |
| 
 | |
| class CSSLoader : public ResourceClient {
 | |
| public:
 | |
|     explicit CSSLoader(DOM::Element& owner_element);
 | |
| 
 | |
|     void load_from_text(const String&);
 | |
|     void load_from_url(const AK::URL&);
 | |
| 
 | |
|     void load_next_import_if_needed();
 | |
| 
 | |
|     RefPtr<CSS::CSSStyleSheet> style_sheet() const { return m_style_sheet; };
 | |
| 
 | |
|     Function<void()> on_load;
 | |
|     Function<void()> on_fail;
 | |
| 
 | |
| private:
 | |
|     // ^ResourceClient
 | |
|     virtual void resource_did_load() override;
 | |
|     virtual void resource_did_fail() override;
 | |
| 
 | |
|     DOM::Element& m_owner_element;
 | |
| 
 | |
|     RefPtr<CSS::CSSStyleSheet> m_style_sheet;
 | |
| };
 | |
| 
 | |
| }
 |