mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 05:42:43 +00:00 
			
		
		
		
	 7eb7396f8b
			
		
	
	
		7eb7396f8b
		
	
	
	
	
		
			
			Since each selector can only have zero or one pseudo-element, we match against it as a separate step, before matching the rest of the selector. This should be faster, but mostly I did this because I could not figure out how else to stop selectors without a pseudo-element from matching the pseudo-element, eg so `.foo` styles don't affect `.foo::before`.
		
			
				
	
	
		
			16 lines
		
	
	
	
		
			335 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
	
		
			335 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibWeb/CSS/Selector.h>
 | |
| #include <LibWeb/DOM/Element.h>
 | |
| 
 | |
| namespace Web::SelectorEngine {
 | |
| 
 | |
| bool matches(CSS::Selector const&, DOM::Element const&, Optional<CSS::Selector::PseudoElement> = {});
 | |
| 
 | |
| }
 |