Commit 23d876c2 authored by adele's avatar adele
Browse files

LayoutTests:

        Reviewed by Darin.

        - pixel test for http://bugs.webkit.org/show_bug.cgi?id=13837
          Separator in new <select> widget disappears when block element with border is in document.

        * fast/forms/menulist-separator-painting-expected.checksum: Added.
        * fast/forms/menulist-separator-painting-expected.png: Added.
        * fast/forms/menulist-separator-painting-expected.txt: Added.
        * fast/forms/menulist-separator-painting.html: Added.

WebCore:

        Reviewed by Darin.

        - fix http://bugs.webkit.org/show_bug.cgi?id=13837
          Separator in new <select> widget disappears when block element with border is in document.

        Test: fast/forms/menulist-separator-painting.html

        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::drawConvexPolygon): Changed this function to
        actually do both filling and stroking when needed, even though all existing
        callers set the stroke to none.
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::paintMenuListButton): Added calls to set the stroke
        style and thickness when painting the arrows and the separator.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e83e7f4c
2007-05-24 Mitz Pettel <mitz@webkit.org>
Reviewed by Darin.
- pixel test for http://bugs.webkit.org/show_bug.cgi?id=13837
Separator in new <select> widget disappears when block element with border is in document.
* fast/forms/menulist-separator-painting-expected.checksum: Added.
* fast/forms/menulist-separator-painting-expected.png: Added.
* fast/forms/menulist-separator-painting-expected.txt: Added.
* fast/forms/menulist-separator-painting.html: Added.
2007-05-24 Sam Weinig <sam@webkit.org> 2007-05-24 Sam Weinig <sam@webkit.org>
   
Reviewed by Anders. Reviewed by Anders.
4ce8ca148475146e6a6d933943f92772
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {DIV} at (0,0) size 784x6 [border: (3px solid #FFFFFF)]
RenderBlock (anonymous) at (0,6) size 784x22
RenderMenuList {SELECT} at (2,2) size 36x18 [bgcolor=#FFFFFF] [border: (1px solid #008000)]
RenderBlock (anonymous) at (9,2) size 5x13
RenderBR at (0,0) size 0x13 [bgcolor=#FFFFFF] [border: (1px solid #008000)]
RenderText {#text} at (0,0) size 0x0
<div style="border: solid white"></div>
<select style="border-color: green;"><option></option></select>
2007-05-24 Mitz Pettel <mitz@webkit.org>
Reviewed by Darin.
- fix http://bugs.webkit.org/show_bug.cgi?id=13837
Separator in new <select> widget disappears when block element with border is in document.
Test: fast/forms/menulist-separator-painting.html
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawConvexPolygon): Changed this function to
actually do both filling and stroking when needed, even though all existing
callers set the stroke to none.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMenuListButton): Added calls to set the stroke
style and thickness when painting the arrows and the separator.
2007-05-24 Timothy Hatcher <timothy@apple.com> 2007-05-24 Timothy Hatcher <timothy@apple.com>
   
Reviewed by Sam Weinig. Reviewed by Sam Weinig.
...@@ -369,7 +369,7 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp ...@@ -369,7 +369,7 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp
void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points, bool shouldAntialias) void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points, bool shouldAntialias)
{ {
if (paintingDisabled()) if (paintingDisabled() || !fillColor().alpha() && (strokeThickness() <= 0 || strokeStyle() == NoStroke))
return; return;
if (npoints <= 1) if (npoints <= 1)
...@@ -387,10 +387,12 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points ...@@ -387,10 +387,12 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points
CGContextAddLineToPoint(context, points[i].x(), points[i].y()); CGContextAddLineToPoint(context, points[i].x(), points[i].y());
CGContextClosePath(context); CGContextClosePath(context);
if (fillColor().alpha()) if (fillColor().alpha()) {
CGContextEOFillPath(context); if (strokeStyle() != NoStroke)
CGContextDrawPath(context, kCGPathEOFillStroke);
if (strokeStyle() != NoStroke) else
CGContextEOFillPath(context);
} else
CGContextStrokePath(context); CGContextStrokePath(context);
CGContextRestoreGState(context); CGContextRestoreGState(context);
......
...@@ -861,7 +861,7 @@ bool RenderThemeMac::paintMenuListButton(RenderObject* o, const RenderObject::Pa ...@@ -861,7 +861,7 @@ bool RenderThemeMac::paintMenuListButton(RenderObject* o, const RenderObject::Pa
float spaceBetweenArrows = baseSpaceBetweenArrows * fontScale; float spaceBetweenArrows = baseSpaceBetweenArrows * fontScale;
paintInfo.context->setFillColor(o->style()->color()); paintInfo.context->setFillColor(o->style()->color());
paintInfo.context->setStrokeColor(o->style()->color()); paintInfo.context->setStrokeStyle(NoStroke);
FloatPoint arrow1[3]; FloatPoint arrow1[3];
arrow1[0] = FloatPoint(leftEdge, centerY - spaceBetweenArrows / 2.0f); arrow1[0] = FloatPoint(leftEdge, centerY - spaceBetweenArrows / 2.0f);
...@@ -881,10 +881,14 @@ bool RenderThemeMac::paintMenuListButton(RenderObject* o, const RenderObject::Pa ...@@ -881,10 +881,14 @@ bool RenderThemeMac::paintMenuListButton(RenderObject* o, const RenderObject::Pa
Color leftSeparatorColor(0, 0, 0, 40); Color leftSeparatorColor(0, 0, 0, 40);
Color rightSeparatorColor(255, 255, 255, 40); Color rightSeparatorColor(255, 255, 255, 40);
// FIXME: Should the separator thickness and space be scaled up by fontScale?
int separatorSpace = 2; int separatorSpace = 2;
int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft); // FIXME: Round? int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft); // FIXME: Round?
// Draw the separator to the left of the arrows // Draw the separator to the left of the arrows
paintInfo.context->setStrokeThickness(1.0f);
paintInfo.context->setStrokeStyle(SolidStroke);
paintInfo.context->setStrokeColor(leftSeparatorColor); paintInfo.context->setStrokeColor(leftSeparatorColor);
paintInfo.context->drawLine(IntPoint(leftEdgeOfSeparator, bounds.y()), paintInfo.context->drawLine(IntPoint(leftEdgeOfSeparator, bounds.y()),
IntPoint(leftEdgeOfSeparator, bounds.bottom())); IntPoint(leftEdgeOfSeparator, bounds.bottom()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment