You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					17 lines
				
				465 B
			
		
		
			
		
	
	
					17 lines
				
				465 B
			| 
								 
											3 years ago
										 
									 | 
							
								import css from './css';
							 | 
						||
| 
								 | 
							
								import ownerDocument from './ownerDocument';
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								var isHTMLElement = function isHTMLElement(e) {
							 | 
						||
| 
								 | 
							
								  return !!e && 'offsetParent' in e;
							 | 
						||
| 
								 | 
							
								};
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								export default function offsetParent(node) {
							 | 
						||
| 
								 | 
							
								  var doc = ownerDocument(node);
							 | 
						||
| 
								 | 
							
								  var parent = node && node.offsetParent;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  while (isHTMLElement(parent) && parent.nodeName !== 'HTML' && css(parent, 'position') === 'static') {
							 | 
						||
| 
								 | 
							
								    parent = parent.offsetParent;
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  return parent || doc.documentElement;
							 | 
						||
| 
								 | 
							
								}
							 |