[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 07:31:02 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit efa00885a734a98a2dd9be9c47f9534763b9e891
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Mar 22 23:27:03 2003 +0000
Bottom border/padding was incorrectly being used in float
computations. The fix is trivial... positioning of floats
occurs before you add in the bottom border/padding rather
than after.
Also implementing support for transparent borders and adding
code that understands how to draw more complex polys when
individual sides are transparent. This code existed for left
and right borders, but not for top and bottom borders.
These two fixes make the tantek demo found at:
http://www.tantek.com/map.html
work properly for the first time in Safari.
Reviewed by darin
* ChangeLog:
* khtml/css/cssparser.cpp:
(CSSParser::parseValue):
* khtml/css/cssstyleselector.cpp:
* khtml/rendering/bidi.cpp:
* khtml/rendering/render_object.cpp:
(RenderObject::paintBorder):
* khtml/rendering/render_style.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index ee08334..0409e28 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,32 @@
+2003-03-22 David Hyatt <hyatt at apple.com>
+
+ Bottom border/padding was incorrectly being used in float
+ computations. The fix is trivial... positioning of floats
+ occurs before you add in the bottom border/padding rather
+ than after.
+
+ Also implementing support for transparent borders and adding
+ code that understands how to draw more complex polys when
+ individual sides are transparent. This code existed for left
+ and right borders, but not for top and bottom borders.
+
+ These two fixes make the tantek demo found at:
+
+ http://www.tantek.com/map.html
+
+ work properly for the first time in Safari.
+
+ Reviewed by darin
+
+ * ChangeLog:
+ * khtml/css/cssparser.cpp:
+ (CSSParser::parseValue):
+ * khtml/css/cssstyleselector.cpp:
+ * khtml/rendering/bidi.cpp:
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::paintBorder):
+ * khtml/rendering/render_style.h:
+
2003-03-21 David Hyatt <hyatt at apple.com>
Fixes for all 4 macromedia rendering problems. They were all
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index ee08334..0409e28 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,32 @@
+2003-03-22 David Hyatt <hyatt at apple.com>
+
+ Bottom border/padding was incorrectly being used in float
+ computations. The fix is trivial... positioning of floats
+ occurs before you add in the bottom border/padding rather
+ than after.
+
+ Also implementing support for transparent borders and adding
+ code that understands how to draw more complex polys when
+ individual sides are transparent. This code existed for left
+ and right borders, but not for top and bottom borders.
+
+ These two fixes make the tantek demo found at:
+
+ http://www.tantek.com/map.html
+
+ work properly for the first time in Safari.
+
+ Reviewed by darin
+
+ * ChangeLog:
+ * khtml/css/cssparser.cpp:
+ (CSSParser::parseValue):
+ * khtml/css/cssstyleselector.cpp:
+ * khtml/rendering/bidi.cpp:
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::paintBorder):
+ * khtml/rendering/render_style.h:
+
2003-03-21 David Hyatt <hyatt at apple.com>
Fixes for all 4 macromedia rendering problems. They were all
diff --git a/WebCore/khtml/css/cssparser.cpp b/WebCore/khtml/css/cssparser.cpp
index 160aa88..62b292e 100644
--- a/WebCore/khtml/css/cssparser.cpp
+++ b/WebCore/khtml/css/cssparser.cpp
@@ -716,11 +716,16 @@ bool CSSParser::parseValue( int propId, bool important )
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_BORDER_TOP_COLOR: // <color> | inherit
- case CSS_PROP_BORDER_RIGHT_COLOR: // <color> | inherit
- case CSS_PROP_BORDER_BOTTOM_COLOR: // <color> | inherit
- case CSS_PROP_BORDER_LEFT_COLOR: // <color> | inherit
case CSS_PROP_TEXT_DECORATION_COLOR:
if ( id >= CSS_VAL_AQUA && id <= CSS_VAL_WINDOWTEXT || id == CSS_VAL_MENU ||
(id >= CSS_VAL_GREY && id <= CSS_VAL__KONQ_TEXT && (nonCSSHint|!strict)) ) {
@@ -1021,11 +1026,6 @@ bool CSSParser::parseValue( int propId, bool important )
case CSS_PROP_BORDER_COLOR:
// <color>{1,4} | transparent | inherit
{
- if ( id == CSS_VAL_TRANSPARENT ) {
- // set border colors to invalid
- valid_primitive = true;
- break;
- }
const int properties[4] = { CSS_PROP_BORDER_TOP_COLOR, CSS_PROP_BORDER_RIGHT_COLOR,
CSS_PROP_BORDER_BOTTOM_COLOR, CSS_PROP_BORDER_LEFT_COLOR };
return parse4Values(properties, important);
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index c99cb15..64774e9 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -2130,6 +2130,7 @@ 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)
{
@@ -2138,13 +2139,21 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
case CSS_PROP_BACKGROUND_COLOR:
col = parentStyle->backgroundColor(); break;
case CSS_PROP_BORDER_TOP_COLOR:
- col = parentStyle->borderTopColor(); break;
+ col = parentStyle->borderTopColor();
+ transparentBorder = parentStyle->borderTopIsTransparent();
+ break;
case CSS_PROP_BORDER_RIGHT_COLOR:
- col = parentStyle->borderRightColor(); break;
+ col = parentStyle->borderRightColor();
+ transparentBorder = parentStyle->borderRightIsTransparent();
+ break;
case CSS_PROP_BORDER_BOTTOM_COLOR:
- col = parentStyle->borderBottomColor(); break;
+ col = parentStyle->borderBottomColor();
+ transparentBorder = parentStyle->borderBottomIsTransparent();
+ break;
case CSS_PROP_BORDER_LEFT_COLOR:
- col = parentStyle->borderLeftColor(); break;
+ col = parentStyle->borderLeftColor();
+ transparentBorder = parentStyle->borderLeftIsTransparent();
+ break;
case CSS_PROP_COLOR:
col = parentStyle->color(); break;
case CSS_PROP_OUTLINE_COLOR:
@@ -2159,8 +2168,10 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
if ( ident ) {
if ( ident == CSS_VAL__KONQ_TEXT )
col = element->getDocument()->textColor();
- else if ( ident == CSS_VAL_TRANSPARENT )
+ else if ( ident == CSS_VAL_TRANSPARENT ) {
col = QColor();
+ transparentBorder = true;
+ }
else
col = colorForCSSValue( ident );
} else if ( primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_RGBCOLOR ) {
@@ -2178,13 +2189,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); break;
+ style->setBorderTopColor(col, transparentBorder); break;
case CSS_PROP_BORDER_RIGHT_COLOR:
- style->setBorderRightColor(col); break;
+ style->setBorderRightColor(col, transparentBorder); break;
case CSS_PROP_BORDER_BOTTOM_COLOR:
- style->setBorderBottomColor(col); break;
+ style->setBorderBottomColor(col, transparentBorder); break;
case CSS_PROP_BORDER_LEFT_COLOR:
- style->setBorderLeftColor(col); break;
+ style->setBorderLeftColor(col, transparentBorder); break;
case CSS_PROP_COLOR:
style->setColor(col); break;
case CSS_PROP_OUTLINE_COLOR:
@@ -2983,15 +2994,6 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
// style->setBackgroundPosition(parentStyle->backgroundPosition());
break;
- case CSS_PROP_BORDER_COLOR:
- if(primitiveValue && primitiveValue->getIdent() == CSS_VAL_TRANSPARENT)
- {
- style->setBorderTopColor(QColor());
- style->setBorderBottomColor(QColor());
- style->setBorderLeftColor(QColor());
- style->setBorderRightColor(QColor());
- return;
- }
case CSS_PROP_BORDER:
case CSS_PROP_BORDER_STYLE:
case CSS_PROP_BORDER_WIDTH:
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index b288377..7d9f273 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -1354,11 +1354,13 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren)
sNumMidpoints = 0;
sCurrMidpoint = 0;
- // Now add in the bottom border/padding.
- m_height += toAdd;
-
// in case we have a float on the last line, it might not be positioned up to now.
+ // This has to be done before adding in the bottom border/padding, or the float will
+ // include the padding incorrectly. -dwh
positionNewFloats();
+
+ // Now add in the bottom border/padding.
+ m_height += toAdd;
// Always make sure this is at least our height.
if (m_overflowHeight < m_height)
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 4d1c951..954fd33 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -657,38 +657,65 @@ void RenderObject::paintBorder(QPainter *p, int _tx, int _ty, int w, int h, cons
{
const QColor& tc = style->borderTopColor();
const QColor& bc = style->borderBottomColor();
+ const QColor& lc = style->borderLeftColor();
+ const QColor& rc = style->borderRightColor();
+ bool tt = style->borderTopIsTransparent();
+ bool bt = style->borderBottomIsTransparent();
+ bool rt = style->borderRightIsTransparent();
+ bool lt = style->borderLeftIsTransparent();
+
EBorderStyle ts = style->borderTopStyle();
EBorderStyle bs = style->borderBottomStyle();
EBorderStyle ls = style->borderLeftStyle();
EBorderStyle rs = style->borderRightStyle();
- bool render_t = ts > BHIDDEN;
- bool render_l = ls > BHIDDEN && begin;
- bool render_r = rs > BHIDDEN && end;
- bool render_b = bs > BHIDDEN;
-
- if(render_t)
+ bool render_t = ts > BHIDDEN && !tt;
+ bool render_l = ls > BHIDDEN && begin && !lt;
+ bool render_r = rs > BHIDDEN && end && !rt;
+ bool render_b = bs > BHIDDEN && !bt;
+
+ if(render_t) {
+ bool ignore_left =
+ (tc == lc) && (tt == lt) &&
+ (ts <= OUTSET) &&
+ (ls == DOTTED || ls == DASHED || ls == SOLID || ls == OUTSET);
+
+ bool ignore_right =
+ (tc == rc) && (tt == rt) &&
+ (ts <= OUTSET) &&
+ (rs == DOTTED || rs == DASHED || rs == SOLID || rs == INSET);
+
drawBorder(p, _tx, _ty, _tx + w, _ty + style->borderTopWidth(), BSTop, tc, style->color(), ts,
- (render_l && ls<=DOUBLE?style->borderLeftWidth():0),
- (render_r && rs<=DOUBLE?style->borderRightWidth():0));
+ ignore_left?0:style->borderLeftWidth(),
+ ignore_right?0:style->borderRightWidth());
+ }
- if(render_b)
- drawBorder(p, _tx, _ty + h - style->borderBottomWidth(), _tx + w, _ty + h, BSBottom, bc, style->color(), bs,
- (render_l && ls<=DOUBLE?style->borderLeftWidth():0),
- (render_r && rs<=DOUBLE?style->borderRightWidth():0));
+ if(render_b) {
+ bool ignore_left =
+ (bc == lc) && (bt == lt) &&
+ (bs <= OUTSET) &&
+ (ls == DOTTED || ls == DASHED || ls == SOLID || ls == OUTSET);
+ bool ignore_right =
+ (bc == rc) && (bt == rt) &&
+ (bs <= OUTSET) &&
+ (rs == DOTTED || rs == DASHED || rs == SOLID || rs == INSET);
+
+ drawBorder(p, _tx, _ty + h - style->borderBottomWidth(), _tx + w, _ty + h, BSBottom, bc, style->color(), bs,
+ ignore_left?0:style->borderLeftWidth(),
+ ignore_right?0:style->borderRightWidth());
+ }
+
if(render_l)
{
- const QColor& lc = style->borderLeftColor();
-
bool ignore_top =
- (tc == lc) &&
+ (tc == lc) && (tt == lt) &&
(ls <= OUTSET) &&
(ts == DOTTED || ts == DASHED || ts == SOLID || ts == OUTSET);
bool ignore_bottom =
- (bc == lc) &&
+ (bc == lc) && (bt == lt) &&
(ls <= OUTSET) &&
(bs == DOTTED || bs == DASHED || bs == SOLID || bs == INSET);
@@ -699,15 +726,13 @@ void RenderObject::paintBorder(QPainter *p, int _tx, int _ty, int w, int h, cons
if(render_r)
{
- const QColor& rc = style->borderRightColor();
-
bool ignore_top =
- (tc == rc) &&
+ (tc == rc) && (tt == rt) &&
(rs <= SOLID || rs == INSET) &&
(ts == DOTTED || ts == DASHED || ts == SOLID || ts == OUTSET);
bool ignore_bottom =
- (bc == rc) &&
+ (bc == rc) && (bt == rt) &&
(rs <= SOLID || rs == INSET) &&
(bs == DOTTED || bs == DASHED || bs == SOLID || bs == INSET);
diff --git a/WebCore/khtml/rendering/render_style.h b/WebCore/khtml/rendering/render_style.h
index 5a23054..a6832f3 100644
--- a/WebCore/khtml/rendering/render_style.h
+++ b/WebCore/khtml/rendering/render_style.h
@@ -197,20 +197,26 @@ public:
{
width = 3; // medium is default value
style = BNONE;
+ transparent = false;
}
QColor color;
- unsigned short width : 12;
+ unsigned short width : 11;
EBorderStyle style : 4;
-
+ bool transparent : 1;
+
bool nonZero() const
{
// rikkus: workaround for gcc 2.95.3
return width!=0 && !(style==BNONE);
}
+ bool isTransparent() const {
+ return transparent;
+ }
+
bool operator==(const BorderValue& o) const
{
- return width==o.width && style==o.style && color==o.color;
+ return width==o.width && style==o.style && color==o.color && transparent==o.transparent;
}
};
@@ -672,19 +678,23 @@ public:
{ if( surround->border.left.style == BNONE) return 0; return surround->border.left.width; }
EBorderStyle borderLeftStyle() const { return surround->border.left.style; }
const QColor & borderLeftColor() const { return surround->border.left.color; }
+ bool borderLeftIsTransparent() const { return surround->border.left.isTransparent(); }
unsigned short borderRightWidth() const
{ if (surround->border.right.style == BNONE) return 0; return surround->border.right.width; }
EBorderStyle borderRightStyle() const { return surround->border.right.style; }
const QColor & borderRightColor() const { return surround->border.right.color; }
+ bool borderRightIsTransparent() const { return surround->border.right.isTransparent(); }
unsigned short borderTopWidth() const
{ if(surround->border.top.style == BNONE) return 0; return surround->border.top.width; }
EBorderStyle borderTopStyle() const {return surround->border.top.style; }
const QColor & borderTopColor() const { return surround->border.top.color; }
+ bool borderTopIsTransparent() const { return surround->border.top.isTransparent(); }
unsigned short borderBottomWidth() const
{ if(surround->border.bottom.style == BNONE) return 0; return surround->border.bottom.width; }
EBorderStyle borderBottomStyle() const { return surround->border.bottom.style; }
const QColor & borderBottomColor() const { return surround->border.bottom.color; }
-
+ bool borderBottomIsTransparent() const { return surround->border.bottom.isTransparent(); }
+
unsigned short outlineWidth() const
{ if(background->outline.style == BNONE) return 0; return background->outline.width; }
EBorderStyle outlineStyle() const { return background->outline.style; }
@@ -785,16 +795,32 @@ 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) { SET_VAR(surround,border.left.color,v) }
+ void setBorderLeftColor(const QColor & v, bool t=false)
+ {
+ SET_VAR(surround,border.left.color,v);
+ SET_VAR(surround,border.left.transparent,t)
+ }
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) { SET_VAR(surround,border.right.color,v) }
+ void setBorderRightColor(const QColor & v, bool t=false)
+ {
+ SET_VAR(surround,border.right.color,v);
+ SET_VAR(surround,border.right.transparent,t)
+ }
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) { SET_VAR(surround,border.top.color,v) }
+ void setBorderTopColor(const QColor & v, bool t=false)
+ {
+ SET_VAR(surround,border.top.color,v);
+ SET_VAR(surround,border.top.transparent,t)
+ }
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) { SET_VAR(surround,border.bottom.color,v) }
+ void setBorderBottomColor(const QColor & v, bool t=false)
+ {
+ SET_VAR(surround,border.bottom.color,v);
+ SET_VAR(surround,border.bottom.transparent,t)
+ }
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