Changeset 28523 in webkit
- Timestamp:
- Dec 7, 2007, 11:24:19 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r28519 r28523 1 2007-12-07 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 - repaint test for <rdar://problem/5499918> REGRESSION: insertion point in input field with custom border cuts holes in focus ring interior edges 6 7 * fast/repaint/focus-ring.html: Added. 8 * platform/mac/fast/repaint/focus-ring-expected.checksum: Added. 9 * platform/mac/fast/repaint/focus-ring-expected.png: Added. 10 * platform/mac/fast/repaint/focus-ring-expected.txt: Added. 11 1 12 2007-12-07 Dan Bernstein <mitz@apple.com> 2 13 -
trunk/WebCore/ChangeLog
r28521 r28523 1 2007-12-07 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 - WebCore part of fixing <rdar://problem/5499918> REGRESSION: insertion point in input field with custom border cuts holes in focus ring interior edges 6 7 Test: fast/repaint/focus-ring.html 8 9 * editing/SelectionController.cpp: 10 (WebCore::SelectionController::caretRepaintRect): Changed to return just 11 the caret rect without any padding. 12 (WebCore::SelectionController::recomputeCaretRect): Changed to repaint 13 just the caret rect without any padding. 14 * platform/graphics/GraphicsContext.h: Removed setFocusRingClip() and 15 clearFocusRingClip(). 16 * platform/graphics/cairo/GraphicsContextCairo.cpp: Ditto. 17 * platform/graphics/cg/GraphicsContextCG.cpp: Ditto. 18 * platform/graphics/cg/GraphicsContextPlatformPrivate.h: Removed 19 m_focusRingClip member. 20 * platform/graphics/mac/GraphicsContextMac.mm: 21 (WebCore::GraphicsContext::drawFocusRing): Changed to call 22 wkDrawFocusRing() once without setting up additional clip. On Leopard, 23 wkDrawFocusRing() respects the context clip now. On Tiger, a 24 transparency layer is used to apply clipping to the focus ring. 25 * platform/graphics/qt/GraphicsContextQt.cpp: Removed focus ring clip 26 methods and member. 27 * platform/graphics/wx/GraphicsContextWx.cpp: Ditto. 28 * platform/mac/WebCoreSystemInterface.h: Removed the clipRect argument 29 to wkDrawFocusRing(). 30 * platform/mac/WebCoreSystemInterface.mm: Ditto. 31 * rendering/RenderLayer.cpp: 32 (WebCore::setClip): Removed call to set the focus ring clip. 33 (WebCore::restoreClip): Removed call to reset the focus ring clip. 34 1 35 2007-12-07 Darin Adler <darin@apple.com> 2 36 -
trunk/WebCore/editing/SelectionController.cpp
r27818 r28523 705 705 } 706 706 707 static IntRect repaintRectForCaret(IntRect caret)708 {709 if (caret.isEmpty())710 return IntRect();711 caret.inflate(1);712 return caret;713 }714 715 707 IntRect SelectionController::caretRepaintRect() const 716 708 { 717 return repaintRectForCaret(caretRect());709 return caretRect(); 718 710 } 719 711 … … 736 728 return false; 737 729 738 v->updateContents( repaintRectForCaret(oldRect), false);739 v->updateContents( repaintRectForCaret(newRect), false);730 v->updateContents(oldRect, false); 731 v->updateContents(newRect, false); 740 732 return true; 741 733 } -
trunk/WebCore/platform/graphics/GraphicsContext.h
r28298 r28523 165 165 void clipOutRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight); 166 166 167 // Functions to work around bugs in focus ring clipping on Mac.168 void setFocusRingClip(const IntRect&);169 void clearFocusRingClip();170 171 167 int textDrawingMode(); 172 168 void setTextDrawingMode(int); -
trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r27905 r28523 440 440 cairo_stroke(cr); 441 441 cairo_restore(cr); 442 }443 444 void GraphicsContext::setFocusRingClip(const IntRect&)445 {446 // hopefully a no-op. Comment in CG version says that it exists447 // to work around bugs in Mac focus ring clipping448 }449 450 void GraphicsContext::clearFocusRingClip()451 {452 // hopefully a no-op. Comment in CG version says that it exists453 // to work around bugs in Mac focus ring clipping454 442 } 455 443 -
trunk/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
r27700 r28523 73 73 } 74 74 75 void GraphicsContext::setFocusRingClip(const IntRect& r)76 {77 // This method only exists to work around bugs in Mac focus ring clipping.78 m_data->m_focusRingClip = r;79 }80 81 void GraphicsContext::clearFocusRingClip()82 {83 // This method only exists to work around bugs in Mac focus ring clipping.84 m_data->m_focusRingClip = IntRect();85 }86 87 75 CGContextRef GraphicsContext::platformContext() const 88 76 { -
trunk/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivate.h
r27700 r28523 80 80 81 81 CGContextRef m_cgContext; 82 IntRect m_focusRingClip; // Work around CG bug in focus ring clipping.83 82 bool m_userToDeviceTransformKnownToBeIdentity; 84 83 }; -
trunk/WebCore/platform/graphics/mac/GraphicsContextMac.mm
r27060 r28523 56 56 57 57 CGContextRef context = platformContext(); 58 59 // FIXME: This works only inside a NSView's drawRect method. The view must be 60 // focused and this context must be the current NSGraphicsContext. 61 ASSERT(context == [[NSGraphicsContext currentContext] graphicsPort]); 62 NSView* view = [NSView focusView]; 63 ASSERT(view); 64 65 const NSRect* drawRects; 66 #ifdef __LP64__ 67 long count; 68 #else 69 int count; 58 #ifdef BUILDING_ON_TIGER 59 CGContextBeginTransparencyLayer(context, NULL); 70 60 #endif 71 [view getRectsBeingDrawn:&drawRects count:&count]; 72 73 // We have to pass in our own clip rectangles here because a bug in CG 74 // seems to inflate the clip (thus allowing the focus ring to paint 75 // slightly outside the clip). 76 NSRect transformedClipRect = [view convertRect:m_data->m_focusRingClip toView:nil]; 77 for (int i = 0; i < count; ++i) { 78 NSRect transformedRect = [view convertRect:drawRects[i] toView:nil]; 79 NSRect rectToUse = NSIntersectionRect(transformedRect, transformedClipRect); 80 if (!NSIsEmptyRect(rectToUse)) { 81 CGContextBeginPath(context); 82 CGContextAddPath(context, focusRingPath); 83 wkDrawFocusRing(context, *(CGRect *)&rectToUse, colorRef, radius); 84 } 85 } 86 61 CGContextBeginPath(context); 62 CGContextAddPath(context, focusRingPath); 63 wkDrawFocusRing(context, colorRef, radius); 64 #ifdef BUILDING_ON_TIGER 65 CGContextEndTransparencyLayer(context); 66 #endif 87 67 CGColorRelease(colorRef); 88 68 -
trunk/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r28352 r28523 217 217 QPainter* redirect; 218 218 219 IntRect focusRingClip;220 219 TextShadow shadow; 221 220 … … 567 566 } 568 567 569 void GraphicsContext::setFocusRingClip(const IntRect& rect)570 {571 if (paintingDisabled())572 return;573 574 m_data->focusRingClip = rect;575 }576 577 void GraphicsContext::clearFocusRingClip()578 {579 if (paintingDisabled())580 return;581 582 m_data->focusRingClip = IntRect();583 }584 585 568 void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool printing) 586 569 { -
trunk/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
r27469 r28523 94 94 wxWindowDC* context; 95 95 #endif 96 IntRect focusRect;97 96 int mswDCStateID; 98 97 wxRegion gtkCurrentClipRgn; … … 102 101 GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate() : 103 102 context(0), 104 focusRect(IntRect()),105 103 mswDCStateID(0), 106 104 gtkCurrentClipRgn(wxRegion()), … … 330 328 } 331 329 332 void GraphicsContext::setFocusRingClip(const IntRect& r)333 {334 m_data->focusRect = r;335 }336 337 void GraphicsContext::clearFocusRingClip()338 {339 m_data->focusRect = IntRect();340 }341 342 330 void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool printing) 343 331 { -
trunk/WebCore/platform/mac/WebCoreSystemInterface.h
r27384 r28523 91 91 extern void (*wkDrawCapsLockIndicator)(CGContextRef, CGRect); 92 92 extern void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled); 93 extern void (*wkDrawFocusRing)(CGContextRef, CG Rect clipRect, CGColorRef, int radius);93 extern void (*wkDrawFocusRing)(CGContextRef, CGColorRef, int radius); 94 94 extern BOOL (*wkFontSmoothingModeIsLCD)(int mode); 95 95 extern OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup); -
trunk/WebCore/platform/mac/WebCoreSystemInterface.mm
r27384 r28523 36 36 void (*wkDrawCapsLockIndicator)(CGContextRef, CGRect); 37 37 void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled); 38 void (*wkDrawFocusRing)(CGContextRef, CG Rect clipRect, CGColorRef, int radius);38 void (*wkDrawFocusRing)(CGContextRef, CGColorRef, int radius); 39 39 BOOL (*wkFontSmoothingModeIsLCD)(int mode); 40 40 OSStatus (*wkGetATSStyleGroup)(ATSUStyle, void** styleGroup); -
trunk/WebCore/rendering/RenderLayer.cpp
r27951 r28523 1440 1440 static void setClip(GraphicsContext* p, const IntRect& paintDirtyRect, const IntRect& clipRect) 1441 1441 { 1442 // Work around bugs in focus ring clipping on Mac.1443 p->setFocusRingClip(clipRect);1444 1442 if (paintDirtyRect == clipRect) 1445 1443 return; … … 1450 1448 static void restoreClip(GraphicsContext* p, const IntRect& paintDirtyRect, const IntRect& clipRect) 1451 1449 { 1452 // Work around bugs in focus ring clipping on Mac.1453 p->clearFocusRingClip();1454 1450 if (paintDirtyRect == clipRect) 1455 1451 return; -
trunk/WebKitLibraries/ChangeLog
r28072 r28523 1 2007-12-07 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 - updated system interface for fixing <rdar://problem/5499918> REGRESSION: insertion point in input field with custom border cuts holes in focus ring interior edges 6 7 * WebKitSystemInterface.h: 8 * libWebKitSystemInterfaceLeopard.a: 9 * libWebKitSystemInterfaceTiger.a: 10 1 11 2007-11-27 John Sullivan <sullivan@apple.com> 2 12 -
trunk/WebKitLibraries/WebKitSystemInterface.h
r28039 r28523 96 96 void WKDrawCapsLockIndicator(CGContextRef, CGRect); 97 97 98 void WKDrawFocusRing(CGContextRef context, CGRect clipRect, CGColorRef color, int radius); 99 // Ignore the context's clipping. 98 void WKDrawFocusRing(CGContextRef context, CGColorRef color, int radius); 100 99 // The CG context's current path is the focus ring's path. 101 100 // A color of 0 means "use system focus ring color".
Note:
See TracChangeset
for help on using the changeset viewer.