//--------------------------------------
//               PowerUI
//
//        For documentation or 
//    if you have any issues, visit
//        powerUI.kulestar.com
//
//    Copyright  2013 Kulestar Ltd
//          www.kulestar.com
//--------------------------------------

using System;

namespace Css{
	
	/// <summary>
	/// Describes if an element is link
	/// <summary>

	sealed class IsLink:CssKeyword{
		
		public override string Name{
			get{
				return "link";
			}
		}
		
		public override SelectorMatcher GetSelectorMatcher(){
			return new LinkMatcher();
		}
		
	}
	
	/// <summary>
	/// Handles the matching process for :link.
	/// </summary>
	
	sealed class LinkMatcher:LocalMatcher{
		
		public override bool TryMatch(Dom.Node node){
			
			if(node==null){
				return false;
			}
			
			return ( node.getAttribute("visited")==null );
			
		}
		
	}
	
}