paintInfo.context->setStrokeStyle(); 设置边边的样式;
paintInfo.context->drawLine() 画矩形的一条边,需要画四次。
修改的文件:
(1).webkit/WebCore/css/CSSPropertyNames.in 中,在文件末尾增加如下两行:
hic;
picl;
(2).webkit/WebCore/css/CSSParser.cpp 中,CSSParser::parseValue()函数中增加“case CSSPropertyPicl: ”以及对应的处理代码。如下:
case CSSPropertyPicl: {
const int properties4 = { CSSPropertyBorderWidth, CSSPropertyBorderStyle,
CSSPropertyBorderColor, CSSPropertyHic};
return parseShorthand(propId, properties, 4, important);
}
(3).webkit/WebCore /css/CSSStyleSelector.cpp中,CSSStyleSelector::applyProperty()函数中添加对应的 “case CSSPropertyHic: ”,这里取出矩形的四条边的值,并传送到下面。
(4).webkit/WebCore /rendering/RenderObject.h中添加hasHic(),getHicRect()两个函数的定义。
(5).webkit/WebCore /rendering/style/RenderStyle.h中添加如下几个函数:
Length hicLeft() const { return visual->hic.left(); }
Length hicRight() const { return visual->hic.right(); }
Length hicTop() const { return visual->hic.top(); }
Length hicBottom() const { return visual->hic.bottom(); }
LengthBox hic() const { return visual->hic; }
bool hasHic() const { return visual->hasHic; }
void setHasHic(bool b =true) { SET_VAR(visual, hasHic, b) }
void setHic(Length top, Length right, Length bottom, Length left);
(6).webkit/WebCore /rendering/style/RenderStyle.cpp中添加setHic()函数的实现;
(7).webkit/WebCore /rendering/style/StyleVisualData.h中添加:
LengthBox hic;
bool hasHic : 1; //hasHic
(8).webkit/WebCore/rendering/RendBox.h中添加:
virtual IntRect getHicRect(int tx, int ty);
(9).webkit/WebCore/rendering /RendBox.cpp中,RenderBox::paintBoxDecorations()函数中添加画矩形的实现,以及getHicRect() 函数的实现










