mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:02:44 +00:00 
			
		
		
		
	LibWeb: Extract the ParentNode IDL mixin
This commit is contained in:
		
							parent
							
								
									79fdc08de9
								
							
						
					
					
						commit
						d4c40e3aad
					
				
					 4 changed files with 27 additions and 46 deletions
				
			
		|  | @ -11,6 +11,7 @@ | |||
| #import <DOM/NodeFilter.idl> | ||||
| #import <DOM/NodeIterator.idl> | ||||
| #import <DOM/NodeList.idl> | ||||
| #import <DOM/ParentNode.idl> | ||||
| #import <DOM/Range.idl> | ||||
| #import <DOM/Text.idl> | ||||
| #import <DOM/TreeWalker.idl> | ||||
|  | @ -18,8 +19,8 @@ | |||
| #import <HTML/HTMLHeadElement.idl> | ||||
| #import <HTML/HTMLScriptElement.idl> | ||||
| 
 | ||||
| // https://dom.spec.whatwg.org/#document | ||||
| interface Document : Node { | ||||
| 
 | ||||
|     constructor(); | ||||
| 
 | ||||
|     boolean hasFocus(); | ||||
|  | @ -92,26 +93,11 @@ interface Document : Node { | |||
| 
 | ||||
|     attribute DOMString title; | ||||
| 
 | ||||
|     // FIXME: These should all come from a ParentNode mixin | ||||
|     readonly attribute Element? firstElementChild; | ||||
|     readonly attribute Element? lastElementChild; | ||||
|     readonly attribute unsigned long childElementCount; | ||||
| 
 | ||||
|     [CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes); | ||||
|     [CEReactions, Unscopable] undefined append((Node or DOMString)... nodes); | ||||
|     [CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes); | ||||
| 
 | ||||
|     Element? querySelector(DOMString selectors); | ||||
|     [NewObject] NodeList querySelectorAll(DOMString selectors); | ||||
| 
 | ||||
|     [SameObject] readonly attribute HTMLCollection children; | ||||
| 
 | ||||
|     readonly boolean hidden; | ||||
|     readonly DOMString visibilityState; | ||||
| 
 | ||||
|     [NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); | ||||
|     [NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null); | ||||
| 
 | ||||
| }; | ||||
| 
 | ||||
| Document includes GlobalEventHandlers; | ||||
|  |  | |||
|  | @ -2,25 +2,11 @@ | |||
| #import <DOM/HTMLCollection.idl> | ||||
| #import <DOM/Node.idl> | ||||
| #import <DOM/NodeList.idl> | ||||
| #import <DOM/ParentNode.idl> | ||||
| 
 | ||||
| // https://dom.spec.whatwg.org/#documentfragment | ||||
| interface DocumentFragment : Node { | ||||
| 
 | ||||
|     constructor(); | ||||
| 
 | ||||
|     Element? getElementById(DOMString id); | ||||
| 
 | ||||
|     // FIXME: These should all come from a ParentNode mixin | ||||
|     readonly attribute Element? firstElementChild; | ||||
|     readonly attribute Element? lastElementChild; | ||||
|     readonly attribute unsigned long childElementCount; | ||||
| 
 | ||||
|     [CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes); | ||||
|     [CEReactions, Unscopable] undefined append((Node or DOMString)... nodes); | ||||
|     [CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes); | ||||
| 
 | ||||
|     Element? querySelector(DOMString selectors); | ||||
|     [NewObject] NodeList querySelectorAll(DOMString selectors); | ||||
| 
 | ||||
|     [SameObject] readonly attribute HTMLCollection children; | ||||
| 
 | ||||
| }; | ||||
|  |  | |||
|  | @ -4,6 +4,7 @@ | |||
| #import <DOM/NamedNodeMap.idl> | ||||
| #import <DOM/Node.idl> | ||||
| #import <DOM/NodeList.idl> | ||||
| #import <DOM/ParentNode.idl> | ||||
| #import <Geometry/DOMRect.idl> | ||||
| #import <Geometry/DOMRectList.idl> | ||||
| 
 | ||||
|  | @ -46,20 +47,6 @@ interface Element : Node { | |||
| 
 | ||||
|     [ImplementedAs=style_for_bindings] readonly attribute CSSStyleDeclaration style; | ||||
| 
 | ||||
|     // FIXME: These should all come from a ParentNode mixin (up to and including children) | ||||
|     readonly attribute Element? firstElementChild; | ||||
|     readonly attribute Element? lastElementChild; | ||||
|     readonly attribute unsigned long childElementCount; | ||||
| 
 | ||||
|     [CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes); | ||||
|     [CEReactions, Unscopable] undefined append((Node or DOMString)... nodes); | ||||
|     [CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes); | ||||
| 
 | ||||
|     Element? querySelector(DOMString selectors); | ||||
|     [NewObject] NodeList querySelectorAll(DOMString selectors); | ||||
| 
 | ||||
|     [SameObject] readonly attribute HTMLCollection children; | ||||
| 
 | ||||
|     DOMRect getBoundingClientRect(); | ||||
|     DOMRectList getClientRects(); | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										22
									
								
								Userland/Libraries/LibWeb/DOM/ParentNode.idl
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								Userland/Libraries/LibWeb/DOM/ParentNode.idl
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | |||
| #import <DOM/Element.idl> | ||||
| #import <DOM/HTMLCollection.idl> | ||||
| #import <DOM/Node.idl> | ||||
| 
 | ||||
| // https://dom.spec.whatwg.org/#parentnode | ||||
| interface mixin ParentNode { | ||||
|     [SameObject] readonly attribute HTMLCollection children; | ||||
|     readonly attribute Element? firstElementChild; | ||||
|     readonly attribute Element? lastElementChild; | ||||
|     readonly attribute unsigned long childElementCount; | ||||
| 
 | ||||
|     [CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes); | ||||
|     [CEReactions, Unscopable] undefined append((Node or DOMString)... nodes); | ||||
|     [CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes); | ||||
| 
 | ||||
|     Element? querySelector(DOMString selectors); | ||||
|     [NewObject] NodeList querySelectorAll(DOMString selectors); | ||||
| }; | ||||
| 
 | ||||
| Document includes ParentNode; | ||||
| DocumentFragment includes ParentNode; | ||||
| Element includes ParentNode; | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Sam Atkins
						Sam Atkins