Changeset 69766 in webkit
- Timestamp:
- Oct 14, 2010 8:40:46 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 12 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r69765 r69766 1 2010-10-14 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Darin Adler. 4 5 Only draw focus ring in RenderInline and RenderImage if the theme 6 is not able to draw a focus ring 7 https://bugs.webkit.org/show_bug.cgi?id=47632 8 9 Pixel tests to ensure that we don't regress focus ring drawing for RenderObject 10 (fast/forms/textfield-focus-ring.html), RenderImage (fast/images/imagemap-focus-ring.html) 11 and RenderInline (fast/inline/inline-focus-ring.html) on ports that support focus 12 ring drawing. 13 14 * fast/forms/textfield-focus-ring.html: Added. 15 * fast/images/imagemap-focus-ring.html: Added. 16 * fast/inline/inline-focus-ring.html: Added. 17 * platform/mac/fast/forms/textfield-focus-ring-expected.checksum: Added. 18 * platform/mac/fast/forms/textfield-focus-ring-expected.png: Added. 19 * platform/mac/fast/forms/textfield-focus-ring-expected.txt: Added. 20 * platform/mac/fast/images/imagemap-focus-ring-expected.checksum: Added. 21 * platform/mac/fast/images/imagemap-focus-ring-expected.png: Added. 22 * platform/mac/fast/images/imagemap-focus-ring-expected.txt: Added. 23 * platform/mac/fast/inline/inline-focus-ring-expected.checksum: Added. 24 * platform/mac/fast/inline/inline-focus-ring-expected.png: Added. 25 * platform/mac/fast/inline/inline-focus-ring-expected.txt: Added. 26 1 27 2010-10-14 Stephen White <senorblanco@chromium.org> 2 28 -
trunk/WebCore/ChangeLog
r69763 r69766 1 2010-10-14 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Darin Adler. 4 5 Only draw focus ring in RenderInline and RenderImage if the theme 6 is not able to draw a focus ring 7 https://bugs.webkit.org/show_bug.cgi?id=47632 8 9 Fixes an issue where RenderInline::paintOutline() and RenderImage::paintFocusRings() 10 would draw a focus ring regardless of whether the port-specific theme is able to 11 draw a focus ring. Instead, these methods should only draw a focus ring if the 12 theme is unable to draw a focus ring. 13 14 Also, extracted common focus ring drawing code from RenderObject::paintOutline() 15 and RenderInline::paintOutline() into RenderObject::paintFocusRing(). 16 17 Tests: fast/forms/textfield-focus-ring.html 18 fast/images/imagemap-focus-ring.html 19 fast/inline/inline-focus-ring.html 20 21 * rendering/RenderImage.cpp: 22 (WebCore::RenderImage::paintFocusRings): Modified to only draw a focus ring if the 23 the theme does not draw one. 24 * rendering/RenderInline.cpp: 25 (WebCore::RenderInline::paintOutline): Modified to call RenderObject::paintFocusRing(). 26 * rendering/RenderObject.cpp: 27 * rendering/RenderObject.cpp: 28 (WebCore::RenderObject::paintFocusRing): Added. 29 (WebCore::RenderObject::paintOutline): Modified to call RenderObject::paintFocusRing(). 30 * rendering/RenderObject.h: 31 1 32 2010-10-14 Pavel Feldman <pfeldman@chromium.org> 2 33 -
trunk/WebCore/rendering/RenderImage.cpp
r69423 r69766 324 324 RefPtr<HTMLCollection> areas = mapElement->areas(); 325 325 unsigned numAreas = areas->length(); 326 327 if (theme()->supportsFocusRing(style)) 328 return; // The theme draws the focus ring. 326 329 327 330 // FIXME: Clip the paths to the image bounding box. -
trunk/WebCore/rendering/RenderInline.cpp
r69220 r69766 994 994 RenderStyle* styleToUse = style(); 995 995 if (styleToUse->outlineStyleIsAuto() || hasOutlineAnnotation()) { 996 int ow = styleToUse->outlineWidth(); 997 Color oc = styleToUse->visitedDependentColor(CSSPropertyOutlineColor); 998 999 Vector<IntRect> focusRingRects; 1000 addFocusRingRects(focusRingRects, tx, ty); 1001 if (styleToUse->outlineStyleIsAuto()) 1002 graphicsContext->drawFocusRing(focusRingRects, ow, styleToUse->outlineOffset(), oc); 1003 else 1004 addPDFURLRect(graphicsContext, unionRect(focusRingRects)); 996 if (!theme()->supportsFocusRing(styleToUse)) { 997 // Only paint the focus ring by hand if the theme isn't able to draw the focus ring. 998 paintFocusRing(graphicsContext, tx, ty, styleToUse); 999 } 1005 1000 } 1006 1001 -
trunk/WebCore/rendering/RenderObject.cpp
r68911 r69766 1152 1152 } 1153 1153 #endif 1154 1155 void RenderObject::paintFocusRing(GraphicsContext* context, int tx, int ty, RenderStyle* style) 1156 { 1157 Vector<IntRect> focusRingRects; 1158 addFocusRingRects(focusRingRects, tx, ty); 1159 if (style->outlineStyleIsAuto()) 1160 context->drawFocusRing(focusRingRects, style->outlineWidth(), style->outlineOffset(), style->visitedDependentColor(CSSPropertyOutlineColor)); 1161 else 1162 addPDFURLRect(context, unionRect(focusRingRects)); 1163 } 1154 1164 1155 1165 void RenderObject::addPDFURLRect(GraphicsContext* context, const IntRect& rect) … … 1182 1192 if (!theme()->supportsFocusRing(styleToUse)) { 1183 1193 // Only paint the focus ring by hand if the theme isn't able to draw the focus ring. 1184 Vector<IntRect> focusRingRects; 1185 addFocusRingRects(focusRingRects, tx, ty); 1186 if (styleToUse->outlineStyleIsAuto()) 1187 graphicsContext->drawFocusRing(focusRingRects, ow, offset, oc); 1188 else 1189 addPDFURLRect(graphicsContext, unionRect(focusRingRects)); 1194 paintFocusRing(graphicsContext, tx, ty, styleToUse); 1190 1195 } 1191 1196 } -
trunk/WebCore/rendering/RenderObject.h
r69642 r69766 752 752 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); 753 753 754 void paintFocusRing(GraphicsContext*, int tx, int ty, RenderStyle*); 754 755 void paintOutline(GraphicsContext*, int tx, int ty, int w, int h); 755 756 void addPDFURLRect(GraphicsContext*, const IntRect&);
Note: See TracChangeset
for help on using the changeset viewer.