mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-13 12:07:08 +00:00
DOM protection
This commit is contained in:
1 parent
92f471c476
commit
6646a20a5d
1 file changed
+4
@@ -70,6 +70,7 @@ CPStringSizeCachingEnabled = YES;
|
||||
if (size !== undefined)
|
||||
return CGSizeMakeCopy(size);
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
if (!CPStringSizeMeasuringContext)
|
||||
CPStringSizeMeasuringContext = CGBitmapGraphicsContextCreate();
|
||||
|
||||
@@ -95,6 +96,9 @@ CPStringSizeCachingEnabled = YES;
|
||||
|
||||
size = CGSizeMake(CPStringSizeMeasuringContext.measureText(self).width, fontHeight);
|
||||
}
|
||||
#else
|
||||
size = CGSizeMake(0, 0);
|
||||
#endif
|
||||
|
||||
CPStringSizeWithFontInWidthCache[cacheKey] = size;
|
||||
return CGSizeMakeCopy(size);
|
||||
|
||||
Reference in new issue
Block a user