[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
hyatt
hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:08:45 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit df44adc2d5edd5d41eaee40a579bd27bcbfca39f
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 3 18:22:30 2003 +0000
Fix for 3471609, 'transparent' should be an acceptable named color value instead of a special
keyword used only by background/border.
Reviewed by kocienda
* khtml/css/cssparser.cpp:
(CSSParser::parseValue):
* khtml/css/cssstyleselector.cpp:
(khtml::):
(khtml::CSSStyleSelector::applyRule):
* khtml/css/cssvalues.c:
* khtml/css/cssvalues.h:
* khtml/css/cssvalues.in:
* khtml/rendering/render_box.cpp:
(RenderBox::paintBackgroundExtended):
* khtml/rendering/render_object.cpp:
(RenderObject::setStyle):
* khtml/rendering/render_style.h:
(khtml::BorderValue::BorderValue):
(khtml::BorderValue::isTransparent):
(khtml::BorderValue::operator==):
(khtml::CollapsedBorderValue::isTransparent):
(khtml::RenderStyle::setBorderLeftColor):
(khtml::RenderStyle::setBorderRightColor):
(khtml::RenderStyle::setBorderTopColor):
(khtml::RenderStyle::setBorderBottomColor):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index cf2c1c6..84dca23 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,32 @@
+2003-11-03 David Hyatt <hyatt at apple.com>
+
+ Fix for 3471609, 'transparent' should be an acceptable named color value instead of a special
+ keyword used only by background/border.
+
+ Reviewed by kocienda
+
+ * khtml/css/cssparser.cpp:
+ (CSSParser::parseValue):
+ * khtml/css/cssstyleselector.cpp:
+ (khtml::):
+ (khtml::CSSStyleSelector::applyRule):
+ * khtml/css/cssvalues.c:
+ * khtml/css/cssvalues.h:
+ * khtml/css/cssvalues.in:
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::paintBackgroundExtended):
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::setStyle):
+ * khtml/rendering/render_style.h:
+ (khtml::BorderValue::BorderValue):
+ (khtml::BorderValue::isTransparent):
+ (khtml::BorderValue::operator==):
+ (khtml::CollapsedBorderValue::isTransparent):
+ (khtml::RenderStyle::setBorderLeftColor):
+ (khtml::RenderStyle::setBorderRightColor):
+ (khtml::RenderStyle::setBorderTopColor):
+ (khtml::RenderStyle::setBorderBottomColor):
+
2003-11-02 Maciej Stachowiak <mjs at apple.com>
Reviewed by Darin.
diff --git a/WebCore/khtml/css/cssparser.cpp b/WebCore/khtml/css/cssparser.cpp
index de064ab..0eb6742 100644
--- a/WebCore/khtml/css/cssparser.cpp
+++ b/WebCore/khtml/css/cssparser.cpp
@@ -730,20 +730,10 @@ bool CSSParser::parseValue( int propId, bool important )
}
/* nobreak */
case CSS_PROP_BACKGROUND_COLOR: // <color> | transparent | inherit
- if ( propId == CSS_PROP_BACKGROUND_COLOR && id == CSS_VAL_TRANSPARENT ) {
- valid_primitive = true;
- break;
- }
- /* nobreak */
case CSS_PROP_BORDER_TOP_COLOR: // <color> | transparent | inherit
case CSS_PROP_BORDER_RIGHT_COLOR: // <color> | transparent | inherit
case CSS_PROP_BORDER_BOTTOM_COLOR: // <color> | transparent | inherit
case CSS_PROP_BORDER_LEFT_COLOR: // <color> | transparent | inherit
- if (id == CSS_VAL_TRANSPARENT) {
- valid_primitive = true;
- break;
- }
- /* fall through */
case CSS_PROP_COLOR: // <color> | inherit
case CSS_PROP_TEXT_DECORATION_COLOR:
if (id == CSS_VAL__KHTML_TEXT)
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index 815a6dd..b3ef938 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -1469,6 +1469,7 @@ static const colorMap cmap[] = {
{ CSS_VAL_WHITE, 0xFFFFFFFF },
{ CSS_VAL_YELLOW, 0xFFFFFF00 },
{ CSS_VAL_INVERT, invertedColor },
+ { CSS_VAL_TRANSPARENT, transparentColor },
{ CSS_VAL_GREY, 0xff808080 },
{ 0, 0 }
};
@@ -2321,7 +2322,6 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
case CSS_PROP_SCROLLBAR_ARROW_COLOR:
{
- bool transparentBorder = false;
QColor col;
if(value->cssValueType() == CSSValue::CSS_INHERIT)
{
@@ -2331,19 +2331,15 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
col = parentStyle->backgroundColor(); break;
case CSS_PROP_BORDER_TOP_COLOR:
col = parentStyle->borderTopColor();
- transparentBorder = parentStyle->borderTopIsTransparent();
break;
case CSS_PROP_BORDER_RIGHT_COLOR:
col = parentStyle->borderRightColor();
- transparentBorder = parentStyle->borderRightIsTransparent();
break;
case CSS_PROP_BORDER_BOTTOM_COLOR:
col = parentStyle->borderBottomColor();
- transparentBorder = parentStyle->borderBottomIsTransparent();
break;
case CSS_PROP_BORDER_LEFT_COLOR:
col = parentStyle->borderLeftColor();
- transparentBorder = parentStyle->borderLeftIsTransparent();
break;
case CSS_PROP_COLOR:
col = parentStyle->color(); break;
@@ -2359,10 +2355,6 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
if ( ident ) {
if ( ident == CSS_VAL__KHTML_TEXT )
col = element->getDocument()->textColor();
- else if ( ident == CSS_VAL_TRANSPARENT ) {
- col = QColor();
- transparentBorder = true;
- }
else
col = colorForCSSValue( ident );
} else if ( primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_RGBCOLOR )
@@ -2377,13 +2369,13 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
case CSS_PROP_BACKGROUND_COLOR:
style->setBackgroundColor(col); break;
case CSS_PROP_BORDER_TOP_COLOR:
- style->setBorderTopColor(col, transparentBorder); break;
+ style->setBorderTopColor(col); break;
case CSS_PROP_BORDER_RIGHT_COLOR:
- style->setBorderRightColor(col, transparentBorder); break;
+ style->setBorderRightColor(col); break;
case CSS_PROP_BORDER_BOTTOM_COLOR:
- style->setBorderBottomColor(col, transparentBorder); break;
+ style->setBorderBottomColor(col); break;
case CSS_PROP_BORDER_LEFT_COLOR:
- style->setBorderLeftColor(col, transparentBorder); break;
+ style->setBorderLeftColor(col); break;
case CSS_PROP_COLOR:
style->setColor(col); break;
case CSS_PROP_OUTLINE_COLOR:
diff --git a/WebCore/khtml/css/cssvalues.c b/WebCore/khtml/css/cssvalues.c
index 28bd2e1..1fcea14 100644
--- a/WebCore/khtml/css/cssvalues.c
+++ b/WebCore/khtml/css/cssvalues.c
@@ -703,7 +703,6 @@ static const char * const valueList[] = {
"fantasy",
"monospace",
"-khtml-body",
-"transparent",
"aqua",
"black",
"blue",
@@ -721,6 +720,7 @@ static const char * const valueList[] = {
"teal",
"white",
"yellow",
+"transparent",
"activeborder",
"activecaption",
"appworkspace",
diff --git a/WebCore/khtml/css/cssvalues.h b/WebCore/khtml/css/cssvalues.h
index 11fee58..decf6f5 100644
--- a/WebCore/khtml/css/cssvalues.h
+++ b/WebCore/khtml/css/cssvalues.h
@@ -69,24 +69,24 @@ DOM::DOMString getValueName(unsigned short id);
#define CSS_VAL_FANTASY 58
#define CSS_VAL_MONOSPACE 59
#define CSS_VAL__KHTML_BODY 60
-#define CSS_VAL_TRANSPARENT 61
-#define CSS_VAL_AQUA 62
-#define CSS_VAL_BLACK 63
-#define CSS_VAL_BLUE 64
-#define CSS_VAL_FUCHSIA 65
-#define CSS_VAL_GRAY 66
-#define CSS_VAL_GREEN 67
-#define CSS_VAL_LIME 68
-#define CSS_VAL_MAROON 69
-#define CSS_VAL_NAVY 70
-#define CSS_VAL_OLIVE 71
-#define CSS_VAL_ORANGE 72
-#define CSS_VAL_PURPLE 73
-#define CSS_VAL_RED 74
-#define CSS_VAL_SILVER 75
-#define CSS_VAL_TEAL 76
-#define CSS_VAL_WHITE 77
-#define CSS_VAL_YELLOW 78
+#define CSS_VAL_AQUA 61
+#define CSS_VAL_BLACK 62
+#define CSS_VAL_BLUE 63
+#define CSS_VAL_FUCHSIA 64
+#define CSS_VAL_GRAY 65
+#define CSS_VAL_GREEN 66
+#define CSS_VAL_LIME 67
+#define CSS_VAL_MAROON 68
+#define CSS_VAL_NAVY 69
+#define CSS_VAL_OLIVE 70
+#define CSS_VAL_ORANGE 71
+#define CSS_VAL_PURPLE 72
+#define CSS_VAL_RED 73
+#define CSS_VAL_SILVER 74
+#define CSS_VAL_TEAL 75
+#define CSS_VAL_WHITE 76
+#define CSS_VAL_YELLOW 77
+#define CSS_VAL_TRANSPARENT 78
#define CSS_VAL_ACTIVEBORDER 79
#define CSS_VAL_ACTIVECAPTION 80
#define CSS_VAL_APPWORKSPACE 81
diff --git a/WebCore/khtml/css/cssvalues.in b/WebCore/khtml/css/cssvalues.in
index 87a5218..58d626e 100644
--- a/WebCore/khtml/css/cssvalues.in
+++ b/WebCore/khtml/css/cssvalues.in
@@ -100,11 +100,6 @@ monospace
-khtml-body
#
#
-# CSS_PROP_BACKGROUND_COLOR:
-#
-transparent
-#
-#
# CSS_PROP_*_COLOR
#
aqua
@@ -124,6 +119,7 @@ silver
teal
white
yellow
+transparent
activeborder
activecaption
appworkspace
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index a66b90e..4477fbe 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -311,7 +311,7 @@ void RenderBox::paintBackgroundExtended(QPainter *p, const QColor &c, CachedImag
int _tx, int _ty, int w, int h,
int bleft, int bright)
{
- if(c.isValid())
+ if (c.isValid() && qAlpha(c.rgb()) > 0)
p->fillRect(_tx, clipy, w, cliph, c);
// no progressive loading of the background image
if(bg && bg->pixmap_size() == bg->valid_rect().size() && !bg->isTransparent() && !bg->isErrorImage()) {
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 8961887..df7ab0b 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -1290,7 +1290,8 @@ void RenderObject::setStyle(RenderStyle *style)
if(nb) nb->ref(this);
}
- setShouldPaintBackgroundOrBorder(m_style->backgroundColor().isValid() ||
+ setShouldPaintBackgroundOrBorder((m_style->backgroundColor().isValid() &&
+ qAlpha(m_style->backgroundColor().rgb()) > 0) ||
m_style->hasBorder() || nb );
if (affectsParentBlock)
diff --git a/WebCore/khtml/rendering/render_style.h b/WebCore/khtml/rendering/render_style.h
index 2b70095..fcbfc4e 100644
--- a/WebCore/khtml/rendering/render_style.h
+++ b/WebCore/khtml/rendering/render_style.h
@@ -201,13 +201,11 @@ public:
{
width = 3; // medium is default value
style = BNONE;
- transparent = false;
}
QColor color;
- unsigned short width : 11;
+ unsigned short width : 12;
EBorderStyle style : 4;
- bool transparent : 1;
-
+
bool nonZero() const
{
// rikkus: workaround for gcc 2.95.3
@@ -215,12 +213,12 @@ public:
}
bool isTransparent() const {
- return transparent;
+ return color.isValid() && qAlpha(color.rgb()) == 0;
}
bool operator==(const BorderValue& o) const
{
- return width==o.width && style==o.style && color==o.color && transparent==o.transparent;
+ return width==o.width && style==o.style && color==o.color;
}
};
@@ -247,7 +245,7 @@ struct CollapsedBorderValue
EBorderStyle style() const { return border ? border->style : BHIDDEN; }
bool exists() const { return border; }
QColor color() const { return border ? border->color : QColor(); }
- bool isTransparent() const { return border ? border->transparent : true; }
+ bool isTransparent() const { return border ? border->isTransparent() : true; }
bool operator==(const CollapsedBorderValue& o) const
{
@@ -1045,32 +1043,16 @@ public:
void setBorderLeftWidth(unsigned short v) { SET_VAR(surround,border.left.width,v) }
void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround,border.left.style,v) }
- void setBorderLeftColor(const QColor & v, bool t=false)
- {
- SET_VAR(surround,border.left.color,v);
- SET_VAR(surround,border.left.transparent,t)
- }
+ void setBorderLeftColor(const QColor & v) { SET_VAR(surround,border.left.color,v) }
void setBorderRightWidth(unsigned short v) { SET_VAR(surround,border.right.width,v) }
void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround,border.right.style,v) }
- void setBorderRightColor(const QColor & v, bool t=false)
- {
- SET_VAR(surround,border.right.color,v);
- SET_VAR(surround,border.right.transparent,t)
- }
+ void setBorderRightColor(const QColor & v) { SET_VAR(surround,border.right.color,v) }
void setBorderTopWidth(unsigned short v) { SET_VAR(surround,border.top.width,v) }
void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround,border.top.style,v) }
- void setBorderTopColor(const QColor & v, bool t=false)
- {
- SET_VAR(surround,border.top.color,v);
- SET_VAR(surround,border.top.transparent,t)
- }
+ void setBorderTopColor(const QColor & v) { SET_VAR(surround,border.top.color,v) }
void setBorderBottomWidth(unsigned short v) { SET_VAR(surround,border.bottom.width,v) }
void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround,border.bottom.style,v) }
- void setBorderBottomColor(const QColor & v, bool t=false)
- {
- SET_VAR(surround,border.bottom.color,v);
- SET_VAR(surround,border.bottom.transparent,t)
- }
+ void setBorderBottomColor(const QColor & v) { SET_VAR(surround,border.bottom.color,v) }
void setOutlineWidth(unsigned short v) { SET_VAR(background,outline.width,v) }
void setOutlineStyle(EBorderStyle v) { SET_VAR(background,outline.style,v) }
void setOutlineColor(const QColor & v) { SET_VAR(background,outline.color,v) }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list