Changeset 73490 in webkit
- Timestamp:
- Dec 7, 2010 8:49:57 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 20 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r73488 r73490 1 2010-12-07 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Martin Robinson. 4 5 Implement focus ring support for image maps 6 https://bugs.webkit.org/show_bug.cgi?id=50371 7 8 Tests to ensure that we support drawing a focus ring for an image map. 9 In particular, that the GTK port can draw a focus ring for an image map. 10 11 * fast/images/imagemap-circle-focus-ring.html: Added. 12 * fast/images/imagemap-polygon-focus-ring.html: Added. 13 * platform/gtk/fast/images/imagemap-circle-focus-ring-expected.checksum: Added. 14 * platform/gtk/fast/images/imagemap-circle-focus-ring-expected.png: Added. 15 * platform/gtk/fast/images/imagemap-circle-focus-ring-expected.txt: Added. 16 * platform/gtk/fast/images/imagemap-focus-ring-expected.checksum: Rebase result since we 17 now support drawing a focus ring for imagemaps. 18 * platform/gtk/fast/images/imagemap-focus-ring-expected.png: Ditto. 19 * platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.checksum: Added. 20 * platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.png: Added. 21 * platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.checksum: Added. 22 * platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.png: Added. 23 * platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.checksum: Added. 24 * platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.png: Added. 25 * platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.checksum: Added. 26 * platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.png: Added. 27 * platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.txt: Added. 28 * platform/mac/fast/images/imagemap-circle-focus-ring-expected.checksum: Added. 29 * platform/mac/fast/images/imagemap-circle-focus-ring-expected.png: Added. 30 * platform/mac/fast/images/imagemap-circle-focus-ring-expected.txt: Added. 31 * platform/mac/fast/images/imagemap-polygon-focus-ring-expected.checksum: Added. 32 * platform/mac/fast/images/imagemap-polygon-focus-ring-expected.png: Added. 33 * platform/mac/fast/images/imagemap-polygon-focus-ring-expected.txt: Added. 34 1 35 2010-12-05 MORITA Hajime <morrita@google.com> 2 36 -
trunk/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-expected.checksum
r69780 r73490 1 9 9fc414fc664384b68bde8eeefdcce6e1 9e87ee1592b997fd991e7f92f9059b5b -
trunk/WebCore/ChangeLog
r73489 r73490 1 2010-12-07 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Martin Robinson. 4 5 Implement focus ring support for image maps 6 https://bugs.webkit.org/show_bug.cgi?id=50371 7 8 Implement GraphicsContext::drawFocusRing(const Path&, ...) so as to support 9 drawing a focus ring for image maps. 10 11 Tests: fast/images/imagemap-circle-focus-ring.html 12 fast/images/imagemap-polygon-focus-ring.html 13 14 * platform/graphics/cairo/GraphicsContextCairo.cpp: 15 (WebCore::adjustFocusRingColor): Added. 16 (WebCore::adjustFocusRingLineWidth): Added. 17 (WebCore::focusRingStrokeStyle): Added. 18 (WebCore::GraphicsContext::drawFocusRing): Moved code for determining focus ring- color, 19 line width and stroke style into functions adjustFocusRingColor(), adjustFocusRingLineWidth(), 20 and focusRingStrokeStyle(), respectively. Implemented GraphicsContext::drawFocusRing(const Path&, ...). 21 1 22 2010-12-07 Sergio Villar Senin <svillar@igalia.com> 2 23 -
trunk/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r73369 r73490 6 6 * Copyright (C) 2009 Brent Fulgham <bfulgham@webkit.org> 7 7 * Copyright (C) 2010 Igalia S.L. 8 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 9 * 9 10 * Redistribution and use in source and binary forms, with or without … … 594 595 } 595 596 596 void GraphicsContext::drawFocusRing(const Path& path, int width, int offset, const Color& color) 597 { 598 // FIXME: implement 597 static inline void adjustFocusRingColor(Color& color) 598 { 599 #if !PLATFORM(GTK) 600 // Force the alpha to 50%. This matches what the Mac does with outline rings. 601 color.setRGB(makeRGBA(color.red(), color.green(), color.blue(), 127)); 602 #endif 603 } 604 605 static inline void adjustFocusRingLineWidth(int& width) 606 { 607 #if PLATFORM(GTK) 608 width = 2; 609 #endif 610 } 611 612 static inline StrokeStyle focusRingStrokeStyle() 613 { 614 #if PLATFORM(GTK) 615 return DottedStroke; 616 #else 617 return SolidStroke; 618 #endif 619 } 620 621 void GraphicsContext::drawFocusRing(const Path& path, int width, int /* offset */, const Color& color) 622 { 623 // FIXME: We should draw paths that describe a rectangle with rounded corners 624 // so as to be consistent with how we draw rectangular focus rings. 625 Color ringColor = color; 626 adjustFocusRingColor(ringColor); 627 adjustFocusRingLineWidth(width); 628 629 cairo_t* cr = m_data->cr; 630 cairo_save(cr); 631 appendWebCorePathToCairoContext(cr, path); 632 setSourceRGBAFromColor(cr, ringColor); 633 cairo_set_line_width(cr, width); 634 setPlatformStrokeStyle(focusRingStrokeStyle()); 635 cairo_stroke(cr); 636 cairo_restore(cr); 599 637 } 600 638 … … 633 671 cairo_region_destroy(reg); 634 672 #endif 635 636 setSourceRGBAFromColor(cr, color);637 cairo_set_line_width(cr, 2.0f);638 setPlatformStrokeStyle(DottedStroke);639 673 #else 640 674 int radius = (width - 1) / 2; … … 646 680 appendWebCorePathToCairoContext(cr, path); 647 681 } 648 649 // Force the alpha to 50%. This matches what the Mac does with outline rings. 650 Color ringColor(color.red(), color.green(), color.blue(), 127); 682 #endif 683 Color ringColor = color; 684 adjustFocusRingColor(ringColor); 685 adjustFocusRingLineWidth(width); 651 686 setSourceRGBAFromColor(cr, ringColor); 652 687 cairo_set_line_width(cr, width); 653 setPlatformStrokeStyle(SolidStroke); 654 #endif 688 setPlatformStrokeStyle(focusRingStrokeStyle()); 655 689 656 690 cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
Note: See TracChangeset
for help on using the changeset viewer.