[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
ouch
ouch at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:42:59 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 7854abb4044df39747fbf151bad7b2c9fe238e14
Author: ouch <ouch at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat May 29 04:23:22 2004 +0000
Reviewed by gramps.
- removed setShadowWithColor and change setShadow to work with optional attributes
it follows the same rules as setFill/StrokeColor
- Fixed bug in setFillColor and setStrokeColor for CMYK colors (missing break in case).
* khtml/ecma/kjs_html.cpp:
(KJS::Context2DFunction::tryCall):
* khtml/ecma/kjs_html.h:
(KJS::Context2D::):
* khtml/ecma/kjs_html.lut.h:
(KJS::):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 067e535..6ff9c6d 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,19 @@
+2004-05-28 John Louch <ouch at apple.com>
+
+ Reviewed by gramps.
+
+ - removed setShadowWithColor and change setShadow to work with optional attributes
+ it follows the same rules as setFill/StrokeColor
+ - Fixed bug in setFillColor and setStrokeColor for CMYK colors (missing break in case).
+
+
+ * khtml/ecma/kjs_html.cpp:
+ (KJS::Context2DFunction::tryCall):
+ * khtml/ecma/kjs_html.h:
+ (KJS::Context2D::):
+ * khtml/ecma/kjs_html.lut.h:
+ (KJS::):
+
2004-05-28 Darin Adler <darin at apple.com>
Reviewed by Ken.
diff --git a/WebCore/khtml/ecma/kjs_html.cpp b/WebCore/khtml/ecma/kjs_html.cpp
index 95708cc..f4c2944 100644
--- a/WebCore/khtml/ecma/kjs_html.cpp
+++ b/WebCore/khtml/ecma/kjs_html.cpp
@@ -3437,6 +3437,7 @@ Value KJS::Context2DFunction::tryCall(ExecState *exec, Object &thisObj, const Li
float a = (float)args[4].toNumber(exec);
CGContextSetCMYKStrokeColor(drawingContext, c, m, y, k, a);
}
+ break;
default: {
Object err = Error::create(exec,SyntaxError);
exec->setException(err);
@@ -3497,6 +3498,7 @@ Value KJS::Context2DFunction::tryCall(ExecState *exec, Object &thisObj, const Li
float a = (float)args[4].toNumber(exec);
CGContextSetCMYKStrokeColor(drawingContext, c, m, y, k, a);
}
+ break;
default: {
Object err = Error::create(exec,SyntaxError);
exec->setException(err);
@@ -3761,21 +3763,9 @@ Value KJS::Context2DFunction::tryCall(ExecState *exec, Object &thisObj, const Li
break;
}
case Context2D::SetShadow: {
- if (args.size() != 3) {
- Object err = Error::create(exec,SyntaxError);
- exec->setException(err);
- return err;
- }
- CGSize offset;
+ int numArgs = args.size();
- offset.width = (float)args[0].toNumber(exec);
- offset.height = (float)args[1].toNumber(exec);
- float blur = (float)args[2].toNumber(exec);
- CGContextSetShadow (drawingContext, offset, blur);
- break;
- }
- case Context2D::SetShadowWithColor: {
- if (args.size() < 4) {
+ if (numArgs < 3) {
Object err = Error::create(exec,SyntaxError);
exec->setException(err);
return err;
@@ -3786,22 +3776,82 @@ Value KJS::Context2DFunction::tryCall(ExecState *exec, Object &thisObj, const Li
offset.height = (float)args[1].toNumber(exec);
float blur = (float)args[2].toNumber(exec);
- QColor color = QColor(args[3].toString(exec).ascii());
- float alpha;
- if (args.size() > 4)
- alpha = (float)args[4].toNumber(exec);
- else
- alpha = 1.;
-
- CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
- float components[4] = {color.red(), color.green(), color.blue(), alpha};
- CGColorRef colorRef = CGColorCreate (colorSpace, components);
- CGContextSetShadowWithColor (drawingContext, offset, blur, colorRef);
- CFRelease (colorSpace);
- CFRelease (colorRef);
+ if (numArgs == 3) {
+ CGContextSetShadow (drawingContext, offset, blur);
+ } else {
+ CGColorSpaceRef colorSpace;
+ float components[5];
+
+ switch (numArgs - 3) {
+ case 1: {
+ if (args[3].type() == StringType) {
+ QRgb rgb = 0;
+ DOM::CSSParser::parseColor(args[3].toString(exec).qstring(), rgb);
+ QColor color(rgb);
+ components[0] = color.red();
+ components[1] = color.green();
+ components[2] = color.blue();
+ components[3] = 1.0f;
+ colorSpace = CGColorSpaceCreateDeviceRGB();
+ }
+ else {
+ components[0] = (float)args[3].toNumber(exec);
+ components[1] = 1.0f;
+ colorSpace = CGColorSpaceCreateDeviceGray();
+ }
+ }
+ break;
+ case 2: {
+ float a = args[4].toNumber(exec);
+ if (args[3].type() == StringType) {
+ QRgb rgb = 0;
+ DOM::CSSParser::parseColor(args[3].toString(exec).qstring(), rgb);
+ QColor color(rgb);
+ components[0] = color.red();
+ components[1] = color.green();
+ components[2] = color.blue();
+ components[3] = a;
+ colorSpace = CGColorSpaceCreateDeviceRGB();
+ }
+ else {
+ components[0] = (float)args[3].toNumber(exec);
+ components[1] = a;
+ colorSpace = CGColorSpaceCreateDeviceGray();
+ }
+ }
+ break;
+ case 4: {
+ components[0] = (float)args[3].toNumber(exec); // r
+ components[1] = (float)args[4].toNumber(exec); // g
+ components[2] = (float)args[5].toNumber(exec); // b
+ components[3] = (float)args[6].toNumber(exec); // a
+ colorSpace = CGColorSpaceCreateDeviceRGB();
+ }
+ break;
+ case 5: {
+ components[0] = (float)args[3].toNumber(exec); // c
+ components[1] = (float)args[4].toNumber(exec); // m
+ components[2] = (float)args[5].toNumber(exec); // y
+ components[3] = (float)args[6].toNumber(exec); // k
+ components[4] = (float)args[7].toNumber(exec); // a
+
+ colorSpace = CGColorSpaceCreateDeviceCMYK();
+ }
+ break;
+ default: {
+ Object err = Error::create(exec,SyntaxError);
+ exec->setException(err);
+ return err;
+ }
+ }
+
+ CGColorRef colorRef = CGColorCreate (colorSpace, components);
+ CGContextSetShadowWithColor (drawingContext, offset, blur, colorRef);
+ CFRelease (colorRef);
+ CFRelease (colorSpace);
+ }
break;
}
-
case Context2D::ClearShadow: {
if (args.size() != 0) {
Object err = Error::create(exec,SyntaxError);
@@ -3862,7 +3912,7 @@ Value KJS::Context2DFunction::tryCall(ExecState *exec, Object &thisObj, const Li
const ClassInfo KJS::Context2D::info = { "Context2D", 0, &Context2DTable, 0 };
/* Source for Context2DTable. Use "make hashtables" to regenerate.
- at begin Context2DTable 32
+ at begin Context2DTable 31
save Context2D::Save DontDelete|Function 0
restore Context2D::Restore DontDelete|Function 0
scale Context2D::Scale DontDelete|Function 2
@@ -3892,7 +3942,6 @@ const ClassInfo KJS::Context2D::info = { "Context2D", 0, &Context2DTable, 0 };
drawImage Context2D::DrawImage DontDelete|Function 6
drawImageFromRect Context2D::DrawImageFromRect DontDelete|Function 10
setShadow Context2D::SetShadow DontDelete|Function 3
- setShadowWithColor Context2D::SetShadowWithColor DontDelete|Function 4
clearShadow Context2D::ClearShadow DontDelete|Function 0
setAlpha Context2D::SetAlpha DontDelete|Function 1
@end
diff --git a/WebCore/khtml/ecma/kjs_html.h b/WebCore/khtml/ecma/kjs_html.h
index f75ba9e..99fd3d8 100644
--- a/WebCore/khtml/ecma/kjs_html.h
+++ b/WebCore/khtml/ecma/kjs_html.h
@@ -260,7 +260,7 @@ namespace KJS {
MoveToPoint, AddLineToPoint, AddQuadraticCurveToPoint, AddBezierCurveToPoint, AddArcToPoint, AddArc, AddRect, Clip,
ClearRect, FillRect, StrokeRect,
DrawImage, DrawImageFromRect,
- SetShadow, SetShadowWithColor, ClearShadow,
+ SetShadow, ClearShadow,
SetAlpha};
DOM::HTMLElementImpl *_element;
diff --git a/WebCore/khtml/ecma/kjs_html.lut.h b/WebCore/khtml/ecma/kjs_html.lut.h
index 4182f33..f4d95cb 100644
--- a/WebCore/khtml/ecma/kjs_html.lut.h
+++ b/WebCore/khtml/ecma/kjs_html.lut.h
@@ -1038,52 +1038,49 @@ namespace KJS {
const struct HashEntry Context2DTableEntries[] = {
{ 0, 0, 0, 0, 0 },
+ { "closePath", Context2D::ClosePath, DontDelete|Function, 0, &Context2DTableEntries[34] },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
- { "closePath", Context2D::ClosePath, DontDelete|Function, 0, &Context2DTableEntries[33] },
- { "restore", Context2D::Restore, DontDelete|Function, 0, &Context2DTableEntries[36] },
- { "strokePath", Context2D::StrokePath, DontDelete|Function, 0, 0 },
- { "strokeRect", Context2D::StrokeRect, DontDelete|Function, 4, 0 },
- { 0, 0, 0, 0, 0 },
- { "scale", Context2D::Scale, DontDelete|Function, 2, &Context2DTableEntries[35] },
+ { "rotate", Context2D::Rotate, DontDelete|Function, 2, 0 },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
+ { "strokePath", Context2D::StrokePath, DontDelete|Function, 0, 0 },
+ { "setLineCap", Context2D::SetLineCap, DontDelete|Function, 1, &Context2DTableEntries[32] },
+ { "moveToPoint", Context2D::MoveToPoint, DontDelete|Function, 2, 0 },
+ { "drawImageFromRect", Context2D::DrawImageFromRect, DontDelete|Function, 10, 0 },
+ { "addLineToPoint", Context2D::AddLineToPoint, DontDelete|Function, 2, 0 },
+ { "setAlpha", Context2D::SetAlpha, DontDelete|Function, 1, 0 },
+ { "translate", Context2D::Translate, DontDelete|Function, 1, &Context2DTableEntries[35] },
+ { "fillPath", Context2D::FillPath, DontDelete|Function, 0, &Context2DTableEntries[40] },
+ { "beginPath", Context2D::BeginPath, DontDelete|Function, 0, &Context2DTableEntries[38] },
+ { "setShadow", Context2D::SetShadow, DontDelete|Function, 3, 0 },
+ { "addArc", Context2D::AddArc, DontDelete|Function, 6, &Context2DTableEntries[41] },
+ { "setStrokeColor", Context2D::SetStrokeColor, DontDelete|Function, 1, &Context2DTableEntries[37] },
{ 0, 0, 0, 0, 0 },
- { "setMiterLimit", Context2D::SetMiterLimit, DontDelete|Function, 1, &Context2DTableEntries[39] },
- { "setShadowWithColor", Context2D::SetShadowWithColor, DontDelete|Function, 4, &Context2DTableEntries[43] },
- { "translate", Context2D::Translate, DontDelete|Function, 1, 0 },
- { "save", Context2D::Save, DontDelete|Function, 0, &Context2DTableEntries[32] },
{ 0, 0, 0, 0, 0 },
- { "drawImage", Context2D::DrawImage, DontDelete|Function, 6, 0 },
- { "beginPath", Context2D::BeginPath, DontDelete|Function, 0, &Context2DTableEntries[34] },
- { "drawImageFromRect", Context2D::DrawImageFromRect, DontDelete|Function, 10, 0 },
- { "setLineWidth", Context2D::SetLineWidth, DontDelete|Function, 1, &Context2DTableEntries[37] },
- { "clearRect", Context2D::ClearRect, DontDelete|Function, 4, &Context2DTableEntries[41] },
+ { "addArcToPoint", Context2D::AddArcToPoint, DontDelete|Function, 5, &Context2DTableEntries[36] },
{ 0, 0, 0, 0, 0 },
- { "addRect", Context2D::AddRect, DontDelete|Function, 4, 0 },
+ { "setMiterLimit", Context2D::SetMiterLimit, DontDelete|Function, 1, 0 },
+ { "scale", Context2D::Scale, DontDelete|Function, 2, 0 },
+ { "setFillColor", Context2D::SetFillColor, DontDelete|Function, 1, 0 },
{ 0, 0, 0, 0, 0 },
- { "addQuadraticCurveToPoint", Context2D::AddQuadraticCurveToPoint, DontDelete|Function, 4, 0 },
+ { "setLineWidth", Context2D::SetLineWidth, DontDelete|Function, 1, 0 },
+ { "save", Context2D::Save, DontDelete|Function, 0, &Context2DTableEntries[31] },
{ 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0 },
+ { "restore", Context2D::Restore, DontDelete|Function, 0, 0 },
+ { "setLineJoin", Context2D::SetLineJoin, DontDelete|Function, 1, &Context2DTableEntries[33] },
+ { "addQuadraticCurveToPoint", Context2D::AddQuadraticCurveToPoint, DontDelete|Function, 4, &Context2DTableEntries[39] },
{ "addBezierCurveToPoint", Context2D::AddBezierCurveToPoint, DontDelete|Function, 6, 0 },
- { 0, 0, 0, 0, 0 },
- { "addLineToPoint", Context2D::AddLineToPoint, DontDelete|Function, 2, 0 },
- { "addArc", Context2D::AddArc, DontDelete|Function, 6, 0 },
- { "rotate", Context2D::Rotate, DontDelete|Function, 2, 0 },
- { "setStrokeColor", Context2D::SetStrokeColor, DontDelete|Function, 1, 0 },
- { "setFillColor", Context2D::SetFillColor, DontDelete|Function, 1, &Context2DTableEntries[42] },
- { "setLineCap", Context2D::SetLineCap, DontDelete|Function, 1, &Context2DTableEntries[40] },
- { "setLineJoin", Context2D::SetLineJoin, DontDelete|Function, 1, &Context2DTableEntries[38] },
- { "fillPath", Context2D::FillPath, DontDelete|Function, 0, 0 },
- { "moveToPoint", Context2D::MoveToPoint, DontDelete|Function, 2, 0 },
- { "addArcToPoint", Context2D::AddArcToPoint, DontDelete|Function, 5, 0 },
+ { "addRect", Context2D::AddRect, DontDelete|Function, 4, 0 },
{ "clip", Context2D::Clip, DontDelete|Function, 0, 0 },
+ { "clearRect", Context2D::ClearRect, DontDelete|Function, 4, 0 },
{ "fillRect", Context2D::FillRect, DontDelete|Function, 4, 0 },
- { "setShadow", Context2D::SetShadow, DontDelete|Function, 3, &Context2DTableEntries[44] },
- { "clearShadow", Context2D::ClearShadow, DontDelete|Function, 0, 0 },
- { "setAlpha", Context2D::SetAlpha, DontDelete|Function, 1, 0 }
+ { "strokeRect", Context2D::StrokeRect, DontDelete|Function, 4, 0 },
+ { "drawImage", Context2D::DrawImage, DontDelete|Function, 6, 0 },
+ { "clearShadow", Context2D::ClearShadow, DontDelete|Function, 0, 0 }
};
-const struct HashTable Context2DTable = { 2, 45, Context2DTableEntries, 32 };
+const struct HashTable Context2DTable = { 2, 42, Context2DTableEntries, 31 };
} // namespace
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list