forked from SVGKit/SVGKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSSValueList.m
More file actions
52 lines (38 loc) · 1.08 KB
/
Copy pathCSSValueList.m
File metadata and controls
52 lines (38 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#import "CSSValueList.h"
#import "CSSValue_ForSubclasses.h"
@interface CSSValueList()
@property(nonatomic,retain) NSArray* internalArray;
@end
@implementation CSSValueList
@synthesize internalArray;
- (void)dealloc {
self.internalArray = nil;
[super dealloc];
}
- (id)init
{
self = [super initWithUnitType:CSS_VALUE_LIST];
if (self) {
self.internalArray = [NSArray array];
}
return self;
}
-(unsigned long)length
{
return self.internalArray.count;
}
-(CSSValue*) item:(unsigned long) index
{
return [self.internalArray objectAtIndex:index];
}
#pragma mark - non DOM spec methods needed to implement Objective-C code for this class
-(void)setCssText:(NSString *)newCssText
{
[_cssText release];
_cssText = newCssText;
[_cssText retain];
/** the css text value has been set, so we need to split the elements up and save them in the internal array */
SVGKitLogVerbose(@"[%@] received new CSS Text, need to split this and save as CSSValue instances: %@", [self class], _cssText);
self.internalArray = [_cssText componentsSeparatedByString:@" "];
}
@end