[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
dbates at webkit.org
dbates at webkit.org
Wed Dec 22 18:09:49 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 9473601e0638092b92df3fec6bb3c060d7414cb7
Author: dbates at webkit.org <dbates at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Dec 8 04:49:57 2010 +0000
2010-12-07 Daniel Bates <dbates at rim.com>
Reviewed by Martin Robinson.
Implement focus ring support for image maps
https://bugs.webkit.org/show_bug.cgi?id=50371
Implement GraphicsContext::drawFocusRing(const Path&, ...) so as to support
drawing a focus ring for image maps.
Tests: fast/images/imagemap-circle-focus-ring.html
fast/images/imagemap-polygon-focus-ring.html
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::adjustFocusRingColor): Added.
(WebCore::adjustFocusRingLineWidth): Added.
(WebCore::focusRingStrokeStyle): Added.
(WebCore::GraphicsContext::drawFocusRing): Moved code for determining focus ring- color,
line width and stroke style into functions adjustFocusRingColor(), adjustFocusRingLineWidth(),
and focusRingStrokeStyle(), respectively. Implemented GraphicsContext::drawFocusRing(const Path&, ...).
2010-12-07 Daniel Bates <dbates at rim.com>
Reviewed by Martin Robinson.
Implement focus ring support for image maps
https://bugs.webkit.org/show_bug.cgi?id=50371
Tests to ensure that we support drawing a focus ring for an image map.
In particular, that the GTK port can draw a focus ring for an image map.
* fast/images/imagemap-circle-focus-ring.html: Added.
* fast/images/imagemap-polygon-focus-ring.html: Added.
* platform/gtk/fast/images/imagemap-circle-focus-ring-expected.checksum: Added.
* platform/gtk/fast/images/imagemap-circle-focus-ring-expected.png: Added.
* platform/gtk/fast/images/imagemap-circle-focus-ring-expected.txt: Added.
* platform/gtk/fast/images/imagemap-focus-ring-expected.checksum: Rebase result since we
now support drawing a focus ring for imagemaps.
* platform/gtk/fast/images/imagemap-focus-ring-expected.png: Ditto.
* platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.checksum: Added.
* platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.png: Added.
* platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.checksum: Added.
* platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.png: Added.
* platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.checksum: Added.
* platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.png: Added.
* platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.checksum: Added.
* platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.png: Added.
* platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.txt: Added.
* platform/mac/fast/images/imagemap-circle-focus-ring-expected.checksum: Added.
* platform/mac/fast/images/imagemap-circle-focus-ring-expected.png: Added.
* platform/mac/fast/images/imagemap-circle-focus-ring-expected.txt: Added.
* platform/mac/fast/images/imagemap-polygon-focus-ring-expected.checksum: Added.
* platform/mac/fast/images/imagemap-polygon-focus-ring-expected.png: Added.
* platform/mac/fast/images/imagemap-polygon-focus-ring-expected.txt: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 66b8860..83d059c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,37 @@
+2010-12-07 Daniel Bates <dbates at rim.com>
+
+ Reviewed by Martin Robinson.
+
+ Implement focus ring support for image maps
+ https://bugs.webkit.org/show_bug.cgi?id=50371
+
+ Tests to ensure that we support drawing a focus ring for an image map.
+ In particular, that the GTK port can draw a focus ring for an image map.
+
+ * fast/images/imagemap-circle-focus-ring.html: Added.
+ * fast/images/imagemap-polygon-focus-ring.html: Added.
+ * platform/gtk/fast/images/imagemap-circle-focus-ring-expected.checksum: Added.
+ * platform/gtk/fast/images/imagemap-circle-focus-ring-expected.png: Added.
+ * platform/gtk/fast/images/imagemap-circle-focus-ring-expected.txt: Added.
+ * platform/gtk/fast/images/imagemap-focus-ring-expected.checksum: Rebase result since we
+ now support drawing a focus ring for imagemaps.
+ * platform/gtk/fast/images/imagemap-focus-ring-expected.png: Ditto.
+ * platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.checksum: Added.
+ * platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.png: Added.
+ * platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.checksum: Added.
+ * platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.png: Added.
+ * platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.checksum: Added.
+ * platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.png: Added.
+ * platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.checksum: Added.
+ * platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.png: Added.
+ * platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.txt: Added.
+ * platform/mac/fast/images/imagemap-circle-focus-ring-expected.checksum: Added.
+ * platform/mac/fast/images/imagemap-circle-focus-ring-expected.png: Added.
+ * platform/mac/fast/images/imagemap-circle-focus-ring-expected.txt: Added.
+ * platform/mac/fast/images/imagemap-polygon-focus-ring-expected.checksum: Added.
+ * platform/mac/fast/images/imagemap-polygon-focus-ring-expected.png: Added.
+ * platform/mac/fast/images/imagemap-polygon-focus-ring-expected.txt: Added.
+
2010-12-05 MORITA Hajime <morrita at google.com>
Reviewed by Dimitri Glazkov.
diff --git a/LayoutTests/fast/images/imagemap-circle-focus-ring.html b/LayoutTests/fast/images/imagemap-circle-focus-ring.html
new file mode 100644
index 0000000..832bcd5
--- /dev/null
+++ b/LayoutTests/fast/images/imagemap-circle-focus-ring.html
@@ -0,0 +1,10 @@
+<html>
+<body>
+<p>Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area shape="circle">. This test PASSED if a circular-shaped focus ring is drawn around the <area> in the imagemap (below).</p>
+<map name="imagemap">
+ <area id="area" shape="circle" coords="64,64,61" href="#dummy" />
+</map>
+<img src="dummy.gif" width="128" height="128" usemap="#imagemap" />
+<script>document.getElementById("area").focus()</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/images/imagemap-polygon-focus-ring.html b/LayoutTests/fast/images/imagemap-polygon-focus-ring.html
new file mode 100644
index 0000000..b60694a
--- /dev/null
+++ b/LayoutTests/fast/images/imagemap-polygon-focus-ring.html
@@ -0,0 +1,10 @@
+<html>
+<body>
+<p>Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area shape="polygon">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below).</p>
+<map name="imagemap">
+ <area id="area" shape="polygon" coords="44,4,84,4,84,44,124,44,124,84,84,84,84,124,44,124,44,84,4,84,4,44,44,44" href="#dummy" />
+</map>
+<img src="dummy.gif" width="128" height="128" usemap="#imagemap" />
+<script>document.getElementById("area").focus()</script>
+</body>
+</html>
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-circle-focus-ring-expected.checksum b/LayoutTests/platform/gtk/fast/images/imagemap-circle-focus-ring-expected.checksum
new file mode 100644
index 0000000..cc07709
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/images/imagemap-circle-focus-ring-expected.checksum
@@ -0,0 +1 @@
+154955386e887763d2e535dc307d29bc
\ No newline at end of file
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-circle-focus-ring-expected.png b/LayoutTests/platform/gtk/fast/images/imagemap-circle-focus-ring-expected.png
new file mode 100644
index 0000000..5de547a
Binary files /dev/null and b/LayoutTests/platform/gtk/fast/images/imagemap-circle-focus-ring-expected.png differ
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-circle-focus-ring-expected.txt b/LayoutTests/platform/gtk/fast/images/imagemap-circle-focus-ring-expected.txt
new file mode 100644
index 0000000..d1d91db
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/images/imagemap-circle-focus-ring-expected.txt
@@ -0,0 +1,17 @@
+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 {P} at (0,0) size 784x38
+ RenderText {#text} at (0,0) size 763x38
+ text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area"
+ text run at (0,19) width 761: "shape=\"circle\">. This test PASSED if a circular-shaped focus ring is drawn around the <area> in the imagemap (below)."
+ RenderBlock (anonymous) at (0,54) size 784x128
+ RenderInline {MAP} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderImage {IMG} at (0,0) size 128x128
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-expected.checksum b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-expected.checksum
index d70af3d..3d6e87b 100644
--- a/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-expected.checksum
+++ b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-expected.checksum
@@ -1 +1 @@
-99fc414fc664384b68bde8eeefdcce6e
\ No newline at end of file
+9e87ee1592b997fd991e7f92f9059b5b
\ No newline at end of file
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-expected.png b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-expected.png
index 14b09f6..f4536f3 100644
Binary files a/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-expected.png and b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-expected.png differ
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.checksum b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.checksum
new file mode 100644
index 0000000..f2525c7
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.checksum
@@ -0,0 +1 @@
+6787c585337ddc5d7a173a61e38d2bcf
\ No newline at end of file
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.png b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.png
new file mode 100644
index 0000000..0004a62
Binary files /dev/null and b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-expected.png differ
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.checksum b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.checksum
new file mode 100644
index 0000000..f3dd0a1
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.checksum
@@ -0,0 +1 @@
+1f1290a87a3b2dd74953c1c99394f261
\ No newline at end of file
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.png b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.png
new file mode 100644
index 0000000..976f752
Binary files /dev/null and b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.png differ
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.checksum b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.checksum
new file mode 100644
index 0000000..b48f9d3
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.checksum
@@ -0,0 +1 @@
+33c14889e19b49a38b5a2ea803aa71e0
\ No newline at end of file
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.png b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.png
new file mode 100644
index 0000000..0766cec
Binary files /dev/null and b/LayoutTests/platform/gtk/fast/images/imagemap-focus-ring-zoom-expected.png differ
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.checksum b/LayoutTests/platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.checksum
new file mode 100644
index 0000000..70b8a0a
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.checksum
@@ -0,0 +1 @@
+b7da246d889aeef1ead64e58632a83f7
\ No newline at end of file
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.png b/LayoutTests/platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.png
new file mode 100644
index 0000000..303824c
Binary files /dev/null and b/LayoutTests/platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.png differ
diff --git a/LayoutTests/platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.txt b/LayoutTests/platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.txt
new file mode 100644
index 0000000..46329b8
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/images/imagemap-polygon-focus-ring-expected.txt
@@ -0,0 +1,17 @@
+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 {P} at (0,0) size 784x38
+ RenderText {#text} at (0,0) size 764x38
+ text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area"
+ text run at (0,19) width 764: "shape=\"polygon\">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below)."
+ RenderBlock (anonymous) at (0,54) size 784x128
+ RenderInline {MAP} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderImage {IMG} at (0,0) size 128x128
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/fast/images/imagemap-circle-focus-ring-expected.checksum b/LayoutTests/platform/mac/fast/images/imagemap-circle-focus-ring-expected.checksum
new file mode 100644
index 0000000..933023b
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/images/imagemap-circle-focus-ring-expected.checksum
@@ -0,0 +1 @@
+d770dda45924da3b34c71c062c682193
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/images/imagemap-circle-focus-ring-expected.png b/LayoutTests/platform/mac/fast/images/imagemap-circle-focus-ring-expected.png
new file mode 100644
index 0000000..a048f2d
Binary files /dev/null and b/LayoutTests/platform/mac/fast/images/imagemap-circle-focus-ring-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/images/imagemap-circle-focus-ring-expected.txt b/LayoutTests/platform/mac/fast/images/imagemap-circle-focus-ring-expected.txt
new file mode 100644
index 0000000..113db4b
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/images/imagemap-circle-focus-ring-expected.txt
@@ -0,0 +1,17 @@
+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 {P} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 763x36
+ text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area"
+ text run at (0,18) width 761: "shape=\"circle\">. This test PASSED if a circular-shaped focus ring is drawn around the <area> in the imagemap (below)."
+ RenderBlock (anonymous) at (0,52) size 784x128
+ RenderInline {MAP} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderImage {IMG} at (0,0) size 128x128
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/fast/images/imagemap-polygon-focus-ring-expected.checksum b/LayoutTests/platform/mac/fast/images/imagemap-polygon-focus-ring-expected.checksum
new file mode 100644
index 0000000..41095c1
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/images/imagemap-polygon-focus-ring-expected.checksum
@@ -0,0 +1 @@
+212b0d783e9424e350ab6575487c859d
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/images/imagemap-polygon-focus-ring-expected.png b/LayoutTests/platform/mac/fast/images/imagemap-polygon-focus-ring-expected.png
new file mode 100644
index 0000000..9e305ab
Binary files /dev/null and b/LayoutTests/platform/mac/fast/images/imagemap-polygon-focus-ring-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/images/imagemap-polygon-focus-ring-expected.txt b/LayoutTests/platform/mac/fast/images/imagemap-polygon-focus-ring-expected.txt
new file mode 100644
index 0000000..81ec82f
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/images/imagemap-polygon-focus-ring-expected.txt
@@ -0,0 +1,17 @@
+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 {P} at (0,0) size 784x36
+ RenderText {#text} at (0,0) size 764x36
+ text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area"
+ text run at (0,18) width 764: "shape=\"polygon\">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below)."
+ RenderBlock (anonymous) at (0,52) size 784x128
+ RenderInline {MAP} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
+ RenderImage {IMG} at (0,0) size 128x128
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7591ee2..542f7e8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-12-07 Daniel Bates <dbates at rim.com>
+
+ Reviewed by Martin Robinson.
+
+ Implement focus ring support for image maps
+ https://bugs.webkit.org/show_bug.cgi?id=50371
+
+ Implement GraphicsContext::drawFocusRing(const Path&, ...) so as to support
+ drawing a focus ring for image maps.
+
+ Tests: fast/images/imagemap-circle-focus-ring.html
+ fast/images/imagemap-polygon-focus-ring.html
+
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::adjustFocusRingColor): Added.
+ (WebCore::adjustFocusRingLineWidth): Added.
+ (WebCore::focusRingStrokeStyle): Added.
+ (WebCore::GraphicsContext::drawFocusRing): Moved code for determining focus ring- color,
+ line width and stroke style into functions adjustFocusRingColor(), adjustFocusRingLineWidth(),
+ and focusRingStrokeStyle(), respectively. Implemented GraphicsContext::drawFocusRing(const Path&, ...).
+
2010-12-07 Sergio Villar Senin <svillar at igalia.com>
Reviewed by Xan Lopez.
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index e4ff82f..2548c5e 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -5,6 +5,7 @@
* Copyright (C) 2008 Nuanti Ltd.
* Copyright (C) 2009 Brent Fulgham <bfulgham at webkit.org>
* Copyright (C) 2010 Igalia S.L.
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -593,9 +594,46 @@ void GraphicsContext::clipPath(const Path& path, WindRule clipRule)
cairo_clip(cr);
}
-void GraphicsContext::drawFocusRing(const Path& path, int width, int offset, const Color& color)
+static inline void adjustFocusRingColor(Color& color)
{
- // FIXME: implement
+#if !PLATFORM(GTK)
+ // Force the alpha to 50%. This matches what the Mac does with outline rings.
+ color.setRGB(makeRGBA(color.red(), color.green(), color.blue(), 127));
+#endif
+}
+
+static inline void adjustFocusRingLineWidth(int& width)
+{
+#if PLATFORM(GTK)
+ width = 2;
+#endif
+}
+
+static inline StrokeStyle focusRingStrokeStyle()
+{
+#if PLATFORM(GTK)
+ return DottedStroke;
+#else
+ return SolidStroke;
+#endif
+}
+
+void GraphicsContext::drawFocusRing(const Path& path, int width, int /* offset */, const Color& color)
+{
+ // FIXME: We should draw paths that describe a rectangle with rounded corners
+ // so as to be consistent with how we draw rectangular focus rings.
+ Color ringColor = color;
+ adjustFocusRingColor(ringColor);
+ adjustFocusRingLineWidth(width);
+
+ cairo_t* cr = m_data->cr;
+ cairo_save(cr);
+ appendWebCorePathToCairoContext(cr, path);
+ setSourceRGBAFromColor(cr, ringColor);
+ cairo_set_line_width(cr, width);
+ setPlatformStrokeStyle(focusRingStrokeStyle());
+ cairo_stroke(cr);
+ cairo_restore(cr);
}
void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int /* offset */, const Color& color)
@@ -632,10 +670,6 @@ void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int
#else
cairo_region_destroy(reg);
#endif
-
- setSourceRGBAFromColor(cr, color);
- cairo_set_line_width(cr, 2.0f);
- setPlatformStrokeStyle(DottedStroke);
#else
int radius = (width - 1) / 2;
Path path;
@@ -645,13 +679,13 @@ void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int
path.addRoundedRect(rects[i], FloatSize(radius, radius));
appendWebCorePathToCairoContext(cr, path);
}
-
- // Force the alpha to 50%. This matches what the Mac does with outline rings.
- Color ringColor(color.red(), color.green(), color.blue(), 127);
+#endif
+ Color ringColor = color;
+ adjustFocusRingColor(ringColor);
+ adjustFocusRingLineWidth(width);
setSourceRGBAFromColor(cr, ringColor);
cairo_set_line_width(cr, width);
- setPlatformStrokeStyle(SolidStroke);
-#endif
+ setPlatformStrokeStyle(focusRingStrokeStyle());
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
cairo_stroke_preserve(cr);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list