//--------------------------------------
//               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 set to 'left' draw direction.
	/// <summary>

	sealed class IsLeft:CssKeyword{
		
		public override string Name{
			get{
				return "left";
			}
		}
		
		public override SelectorMatcher GetSelectorMatcher(){
			return new LeftMatcher();
		}
		
	}
	
	/// <summary>
	/// Handles the matching process for :left.
	/// </summary>
	
	sealed class LeftMatcher:LocalMatcher{
		
		public override bool TryMatch(Dom.Node node){
			
			if(node==null){
				return false;
			}
			
			return ((node as IRenderableNode).ComputedStyle.DrawDirectionX==DirectionMode.LTR);
		}
		
	}
	
}