Fix #4114 - "black" being ignored as a color in some contexts.
[potlatch2.git] / net / systemeD / halcyon / styleparser / CSSTransform.as
1 package net.systemeD.halcyon.styleparser {
2
3         import flash.net.*;
4     import flash.events.*;
5         import net.systemeD.halcyon.connection.Entity;
6
7     public class CSSTransform {
8
9                 private static const GLOBAL_INSTANCE:CSSTransform = new CSSTransform();
10                 public static function getInstance():CSSTransform { return GLOBAL_INSTANCE; }
11
12                 [Bindable] public var url:String='';
13                 private var ruleset:RuleSet;
14                 
15                 public function loadFromUrl(filename:String):void {
16                         url=filename;
17                         ruleset=new RuleSet(0,30,cssReady);
18                         ruleset.loadFromCSS(url);
19                 }
20
21                 public function clear():void {
22                         ruleset=null;
23                         url='';
24                 }
25
26                 private function cssReady():void {
27                 }
28                 
29                 public function run(entity:Entity,tags:Object):Object {
30                         if (ruleset) return ruleset.runInstructions(entity,tags);
31                         return tags;
32                 }
33
34         }
35 }