[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
mitz at apple.com
mitz at apple.com
Wed Jan 6 00:09:58 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit d3a5c818f26e98a6804cd017df18992f92dd400e
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Dec 29 21:05:56 2009 +0000
Move the focus ring rect array, width and offset out of GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=33028
Reviewed by Sam Weinig.
* platform/graphics/GraphicsContext.cpp: Removed initFocusRing(),
clearFocusRing(), focusRingBoundingRect(), addFocusRingRect(),
focusRingWidth(), focusRingOffset(), and focusRingRects().
* platform/graphics/GraphicsContext.h: Ditto. Added the focus ring rect
vector, width and offset as parameters to drawFocusRing().
* platform/graphics/GraphicsContextPrivate.h:
(WebCore::GraphicsContextState::GraphicsContextState): Cleaned up style.
(WebCore::GraphicsContextPrivate::GraphicsContextPrivate): Removed
m_focusRingRects, m_focusRingWidth and m_focusRingOffset.
* platform/graphics/IntRect.cpp:
(WebCore::unionRect): Added this helper function.
* platform/graphics/IntRect.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawFocusRing):
* platform/graphics/haiku/GraphicsContextHaiku.cpp:
(WebCore::GraphicsContext::drawFocusRing): Ditto.
* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::GraphicsContext::drawFocusRing): Ditto.
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::drawFocusRing): Ditto.
* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContext::drawFocusRing): Ditto.
* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::GraphicsContext::drawFocusRing): Ditto.
* platform/graphics/wince/GraphicsContextWince.cpp:
(WebCore::GraphicsContext::drawFocusRing): Ditto.
* platform/graphics/wx/GraphicsContextWx.cpp:
(WebCore::GraphicsContext::drawFocusRing): Ditto.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addFocusRingRects): Updated for new prototype.
Added empty rect checks that were previously done in
GraphicsContext::addFocusRingRect().
* rendering/RenderBlock.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::addFocusRingRects): Ditto.
* rendering/RenderBox.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addFocusRingRects): Ditto.
(WebCore::RenderInline::paintOutline): Collect focus ring rects into a
vector and pass it to drawFocusRing(). Use unionRect() instead of
focusRingBoundingRect().
* rendering/RenderInline.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::paintOutline): Ditto.
* rendering/RenderObject.h:
(WebCore::RenderObject::addFocusRingRects): Changed to take a
Vector<IntRect> to which the rects are added.
* rendering/RenderPath.cpp:
(WebCore::RenderPath::addFocusRingRects): Updated for new prototype.
Added empty rect check that was previously done in
GraphicsContext::addFocusRingRect().
* rendering/RenderPath.h:
* rendering/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::addFocusRingRects): Updated for new prototype.
Added empty rect check that was previously done in
GraphicsContext::addFocusRingRect().
* rendering/RenderSVGContainer.h:
* rendering/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::addFocusRingRects): Updated for new prototype.
Added empty rect check that was previously done in
GraphicsContext::addFocusRingRect().
* rendering/RenderSVGImage.h:
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::addFocusRingRects): Updated for new prototype.
Added empty rect check that was previously done in
GraphicsContext::addFocusRingRect().
* rendering/RenderTextControl.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ce94af8..6ea4676 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,78 @@
+2009-12-29 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Move the focus ring rect array, width and offset out of GraphicsContext
+ https://bugs.webkit.org/show_bug.cgi?id=33028
+
+ * platform/graphics/GraphicsContext.cpp: Removed initFocusRing(),
+ clearFocusRing(), focusRingBoundingRect(), addFocusRingRect(),
+ focusRingWidth(), focusRingOffset(), and focusRingRects().
+ * platform/graphics/GraphicsContext.h: Ditto. Added the focus ring rect
+ vector, width and offset as parameters to drawFocusRing().
+ * platform/graphics/GraphicsContextPrivate.h:
+ (WebCore::GraphicsContextState::GraphicsContextState): Cleaned up style.
+ (WebCore::GraphicsContextPrivate::GraphicsContextPrivate): Removed
+ m_focusRingRects, m_focusRingWidth and m_focusRingOffset.
+ * platform/graphics/IntRect.cpp:
+ (WebCore::unionRect): Added this helper function.
+ * platform/graphics/IntRect.h:
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::drawFocusRing):
+ * platform/graphics/haiku/GraphicsContextHaiku.cpp:
+ (WebCore::GraphicsContext::drawFocusRing): Ditto.
+ * platform/graphics/mac/GraphicsContextMac.mm:
+ (WebCore::GraphicsContext::drawFocusRing): Ditto.
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::drawFocusRing): Ditto.
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+ (WebCore::GraphicsContext::drawFocusRing): Ditto.
+ * platform/graphics/win/GraphicsContextCGWin.cpp:
+ (WebCore::GraphicsContext::drawFocusRing): Ditto.
+ * platform/graphics/wince/GraphicsContextWince.cpp:
+ (WebCore::GraphicsContext::drawFocusRing): Ditto.
+ * platform/graphics/wx/GraphicsContextWx.cpp:
+ (WebCore::GraphicsContext::drawFocusRing): Ditto.
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::addFocusRingRects): Updated for new prototype.
+ Added empty rect checks that were previously done in
+ GraphicsContext::addFocusRingRect().
+ * rendering/RenderBlock.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::addFocusRingRects): Ditto.
+ * rendering/RenderBox.h:
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::addFocusRingRects): Ditto.
+ (WebCore::RenderInline::paintOutline): Collect focus ring rects into a
+ vector and pass it to drawFocusRing(). Use unionRect() instead of
+ focusRingBoundingRect().
+ * rendering/RenderInline.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::paintOutline): Ditto.
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::addFocusRingRects): Changed to take a
+ Vector<IntRect> to which the rects are added.
+ * rendering/RenderPath.cpp:
+ (WebCore::RenderPath::addFocusRingRects): Updated for new prototype.
+ Added empty rect check that was previously done in
+ GraphicsContext::addFocusRingRect().
+ * rendering/RenderPath.h:
+ * rendering/RenderSVGContainer.cpp:
+ (WebCore::RenderSVGContainer::addFocusRingRects): Updated for new prototype.
+ Added empty rect check that was previously done in
+ GraphicsContext::addFocusRingRect().
+ * rendering/RenderSVGContainer.h:
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::addFocusRingRects): Updated for new prototype.
+ Added empty rect check that was previously done in
+ GraphicsContext::addFocusRingRect().
+ * rendering/RenderSVGImage.h:
+ * rendering/RenderTextControl.cpp:
+ (WebCore::RenderTextControl::addFocusRingRects): Updated for new prototype.
+ Added empty rect check that was previously done in
+ GraphicsContext::addFocusRingRect().
+ * rendering/RenderTextControl.h:
+
2009-12-28 Dumitru Daniliuc <dumi at chromium.org>
Reviewed by Maciej Stachowiak.
diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp
index fee05ee..d89bd28 100644
--- a/WebCore/platform/graphics/GraphicsContext.cpp
+++ b/WebCore/platform/graphics/GraphicsContext.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,17 +10,17 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
@@ -382,55 +382,6 @@ void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run,
fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor, colorSpace);
}
-void GraphicsContext::initFocusRing(int width, int offset)
-{
- if (paintingDisabled())
- return;
- clearFocusRing();
-
- m_common->m_focusRingWidth = width;
- m_common->m_focusRingOffset = offset;
-}
-
-void GraphicsContext::clearFocusRing()
-{
- m_common->m_focusRingRects.clear();
-}
-
-IntRect GraphicsContext::focusRingBoundingRect()
-{
- IntRect result = IntRect(0, 0, 0, 0);
-
- const Vector<IntRect>& rects = focusRingRects();
- unsigned rectCount = rects.size();
- for (unsigned i = 0; i < rectCount; i++)
- result.unite(rects[i]);
-
- return result;
-}
-
-void GraphicsContext::addFocusRingRect(const IntRect& rect)
-{
- if (paintingDisabled() || rect.isEmpty())
- return;
- m_common->m_focusRingRects.append(rect);
-}
-
-int GraphicsContext::focusRingWidth() const
-{
- return m_common->m_focusRingWidth;
-}
-
-int GraphicsContext::focusRingOffset() const
-{
- return m_common->m_focusRingOffset;
-}
-
-const Vector<IntRect>& GraphicsContext::focusRingRects() const
-{
- return m_common->m_focusRingRects;
-}
-
void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, bool useLowQualityScale)
{
if (paintingDisabled() || !image)
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index 52c90c5..8fdcaf7 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -262,11 +262,7 @@ namespace WebCore {
bool getShadow(IntSize&, int&, Color&) const;
void clearShadow();
- void initFocusRing(int width, int offset);
- void addFocusRingRect(const IntRect&);
- void drawFocusRing(const Color&);
- void clearFocusRing();
- IntRect focusRingBoundingRect();
+ void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Color&);
void setLineCap(LineCap);
void setLineDash(const DashArray&, float dashOffset);
@@ -411,10 +407,6 @@ namespace WebCore {
static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, const StrokeStyle&);
- int focusRingWidth() const;
- int focusRingOffset() const;
- const Vector<IntRect>& focusRingRects() const;
-
static GraphicsContextPrivate* createGraphicsContextPrivate();
static void destroyGraphicsContextPrivate(GraphicsContextPrivate*);
diff --git a/WebCore/platform/graphics/GraphicsContextPrivate.h b/WebCore/platform/graphics/GraphicsContextPrivate.h
index c532162..1980337 100644
--- a/WebCore/platform/graphics/GraphicsContextPrivate.h
+++ b/WebCore/platform/graphics/GraphicsContextPrivate.h
@@ -48,7 +48,7 @@ namespace WebCore {
, shadowBlur(0)
, shadowsIgnoreTransforms(false)
#if PLATFORM(CAIRO)
- , globalAlpha(1.0f)
+ , globalAlpha(1)
#endif
{
}
@@ -87,17 +87,12 @@ namespace WebCore {
class GraphicsContextPrivate : public Noncopyable {
public:
GraphicsContextPrivate()
- : m_focusRingWidth(0)
- , m_focusRingOffset(0)
- , m_updatingControlTints(false)
+ : m_updatingControlTints(false)
{
}
GraphicsContextState state;
Vector<GraphicsContextState> stack;
- Vector<IntRect> m_focusRingRects;
- int m_focusRingWidth;
- int m_focusRingOffset;
bool m_updatingControlTints;
};
diff --git a/WebCore/platform/graphics/IntRect.cpp b/WebCore/platform/graphics/IntRect.cpp
index 622e525..188b5f9 100644
--- a/WebCore/platform/graphics/IntRect.cpp
+++ b/WebCore/platform/graphics/IntRect.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,17 +10,17 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
@@ -104,4 +104,15 @@ void IntRect::scale(float s)
m_size.setHeight((int)(height() * s));
}
+IntRect unionRect(const Vector<IntRect>& rects)
+{
+ IntRect result;
+
+ size_t count = rects.size();
+ for (size_t i = 0; i < count; ++i)
+ result.unite(rects[i]);
+
+ return result;
}
+
+} // namespace WebCore
diff --git a/WebCore/platform/graphics/IntRect.h b/WebCore/platform/graphics/IntRect.h
index 97b21bc..34f7fd8 100644
--- a/WebCore/platform/graphics/IntRect.h
+++ b/WebCore/platform/graphics/IntRect.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,17 +10,17 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef IntRect_h
@@ -28,6 +28,7 @@
#include "IntPoint.h"
#include <wtf/Platform.h>
+#include <wtf/Vector.h>
#if PLATFORM(CG)
typedef struct CGRect CGRect;
@@ -185,6 +186,8 @@ inline IntRect unionRect(const IntRect& a, const IntRect& b)
return c;
}
+IntRect unionRect(const Vector<IntRect>&);
+
inline bool operator==(const IntRect& a, const IntRect& b)
{
return a.location() == b.location() && a.size() == b.size();
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 14034fd..9e1cd1e 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -606,12 +606,11 @@ void GraphicsContext::clipPath(WindRule clipRule)
cairo_clip(cr);
}
-void GraphicsContext::drawFocusRing(const Color& color)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int /* offset */, const Color& color)
{
if (paintingDisabled())
return;
- const Vector<IntRect>& rects = focusRingRects();
unsigned rectCount = rects.size();
cairo_t* cr = m_data->cr;
@@ -632,14 +631,14 @@ void GraphicsContext::drawFocusRing(const Color& color)
cairo_set_line_width(cr, 2.0f);
setPlatformStrokeStyle(DottedStroke);
#else
- int radius = (focusRingWidth() - 1) / 2;
+ int radius = (width - 1) / 2;
for (unsigned i = 0; i < rectCount; i++)
addPath(Path::createRoundedRectangle(rects[i], FloatSize(radius, radius)));
// Force the alpha to 50%. This matches what the Mac does with outline rings.
Color ringColor(color.red(), color.green(), color.blue(), 127);
setColor(cr, ringColor);
- cairo_set_line_width(cr, focusRingWidth());
+ cairo_set_line_width(cr, width);
setPlatformStrokeStyle(SolidStroke);
#endif
diff --git a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
index 4728d56..64d1179 100644
--- a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
@@ -204,12 +204,11 @@ void GraphicsContext::clip(const FloatRect& rect)
m_data->m_view->ConstrainClippingRegion(®ion);
}
-void GraphicsContext::drawFocusRing(const Color& color)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int /* width */, int /* offset */, const Color& color)
{
if (paintingDisabled())
return;
- const Vector<IntRect>& rects = focusRingRects();
unsigned rectCount = rects.size();
// FIXME: maybe we should implement this with BShape?
diff --git a/WebCore/platform/graphics/mac/GraphicsContextMac.mm b/WebCore/platform/graphics/mac/GraphicsContextMac.mm
index 6c9b872..5cf127b 100644
--- a/WebCore/platform/graphics/mac/GraphicsContextMac.mm
+++ b/WebCore/platform/graphics/mac/GraphicsContextMac.mm
@@ -26,7 +26,7 @@
#import "config.h"
#import "GraphicsContext.h"
-#import "../cg/GraphicsContextPlatformPrivateCG.h"
+#import "GraphicsContextPlatformPrivateCG.h"
#import <AppKit/AppKit.h>
#import <wtf/StdLibExtras.h>
@@ -43,19 +43,18 @@ namespace WebCore {
// calls in this file are all exception-safe, so we don't block
// exceptions for those.
-void GraphicsContext::drawFocusRing(const Color& color)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int offset, const Color& color)
{
if (paintingDisabled())
return;
- int radius = (focusRingWidth() - 1) / 2;
- int offset = radius + focusRingOffset();
+ int radius = (width - 1) / 2;
+ offset += radius;
RetainPtr<CGColorRef> colorRef;
if (color.isValid())
colorRef.adoptCF(createCGColor(color));
RetainPtr<CGMutablePathRef> focusRingPath(AdoptCF, CGPathCreateMutable());
- const Vector<IntRect>& rects = focusRingRects();
unsigned rectCount = rects.size();
for (unsigned i = 0; i < rectCount; i++)
CGPathAddRect(focusRingPath.get(), 0, CGRectInset(rects[i], -offset, -offset));
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index ecdb5f5..49d7a27 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -800,12 +800,11 @@ void GraphicsContext::clipPath(WindRule clipRule)
* RenderTheme handles drawing focus on widgets which
* need it.
*/
-void GraphicsContext::drawFocusRing(const Color& color)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int /* width */, int /* offset */, const Color& color)
{
if (paintingDisabled())
return;
- const Vector<IntRect>& rects = focusRingRects();
unsigned rectCount = rects.size();
if (!rects.size())
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index f1536a6..877da89 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -498,12 +498,11 @@ void GraphicsContext::drawEllipse(const IntRect& elipseRect)
}
}
-void GraphicsContext::drawFocusRing(const Color& color)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int /* width */, int /* offset */, const Color& color)
{
if (paintingDisabled())
return;
- const Vector<IntRect>& rects = focusRingRects();
unsigned rectCount = rects.size();
if (!rectCount)
return;
diff --git a/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp b/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
index 137b914..e5ebaf0 100644
--- a/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
+++ b/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
@@ -124,17 +124,16 @@ void GraphicsContext::drawWindowsBitmap(WindowsBitmap* image, const IntPoint& po
CGContextDrawImage(m_data->m_cgContext.get(), CGRectMake(point.x(), point.y(), image->size().width(), image->size().height()), cgImage.get());
}
-void GraphicsContext::drawFocusRing(const Color& color)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int offset, const Color& color)
{
if (paintingDisabled())
return;
- float radius = (focusRingWidth() - 1) / 2.0f;
- int offset = radius + focusRingOffset();
+ float radius = (width - 1) / 2.0f;
+ offset += radius;
CGColorRef colorRef = color.isValid() ? createCGColor(color) : 0;
CGMutablePathRef focusRingPath = CGPathCreateMutable();
- const Vector<IntRect>& rects = focusRingRects();
unsigned rectCount = rects.size();
for (unsigned i = 0; i < rectCount; i++)
CGPathAddRect(focusRingPath, 0, CGRectInset(rects[i], -offset, -offset));
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
index f22e6c9..608cdd1 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
@@ -1002,7 +1002,7 @@ void GraphicsContext::clipOut(const IntRect& rect)
ExcludeClipRect(m_data->m_dc, trRect.x(), trRect.y(), trRect.right(), trRect.bottom());
}
-void GraphicsContext::drawFocusRing(const Color& color)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int offset, const Color& color)
{
if (!m_data->m_opacity || paintingDisabled())
return;
@@ -1011,10 +1011,9 @@ void GraphicsContext::drawFocusRing(const Color& color)
if (!m_data->m_dc)
return;
- int radius = (focusRingWidth() - 1) / 2;
- int offset = radius + focusRingOffset();
+ int radius = (width - 1) / 2;
+ offset += radius;
- const Vector<IntRect>& rects = focusRingRects();
unsigned rectCount = rects.size();
IntRect finalFocusRect;
for (unsigned i = 0; i < rectCount; i++) {
diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
index 9c05ce5..6e67e68 100644
--- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
+++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
@@ -270,7 +270,7 @@ void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLef
notImplemented();
}
-void GraphicsContext::drawFocusRing(const Color& color)
+void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int offset, const Color& color)
{
if (paintingDisabled())
return;
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index d7061d1..4b1cfdb 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -5008,7 +5008,7 @@ IntRect RenderBlock::localCaretRect(InlineBox* inlineBox, int caretOffset, int*
return IntRect(x, y, caretWidth, height);
}
-void RenderBlock::addFocusRingRects(GraphicsContext* graphicsContext, int tx, int ty)
+void RenderBlock::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty)
{
// For blocks inside inlines, we go ahead and include margins so that we run right up to the
// inline boxes above and below us (thus getting merged with them to form a single irregular
@@ -5020,16 +5020,19 @@ void RenderBlock::addFocusRingRects(GraphicsContext* graphicsContext, int tx, in
bool prevInlineHasLineBox = toRenderInline(inlineContinuation()->node()->renderer())->firstLineBox();
int topMargin = prevInlineHasLineBox ? collapsedMarginTop() : 0;
int bottomMargin = nextInlineHasLineBox ? collapsedMarginBottom() : 0;
- graphicsContext->addFocusRingRect(IntRect(tx, ty - topMargin,
- width(), height() + topMargin + bottomMargin));
- } else
- graphicsContext->addFocusRingRect(IntRect(tx, ty, width(), height()));
+ IntRect rect(tx, ty - topMargin, width(), height() + topMargin + bottomMargin);
+ if (!rect.isEmpty())
+ rects.append(rect);
+ } else if (width() && height())
+ rects.append(IntRect(tx, ty, width(), height()));
if (!hasOverflowClip() && !hasControlClip()) {
for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
int top = max(curr->lineTop(), curr->y());
int bottom = min(curr->lineBottom(), curr->y() + curr->height());
- graphicsContext->addFocusRingRect(IntRect(tx + curr->x(), ty + top, curr->width(), bottom - top));
+ IntRect rect(tx + curr->x(), ty + top, curr->width(), bottom - top);
+ if (!rect.isEmpty())
+ rects.append(rect);
}
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
@@ -5041,13 +5044,13 @@ void RenderBlock::addFocusRingRects(GraphicsContext* graphicsContext, int tx, in
pos = curr->localToAbsolute();
else
pos = FloatPoint(tx + box->x(), ty + box->y());
- box->addFocusRingRects(graphicsContext, pos.x(), pos.y());
+ box->addFocusRingRects(rects, pos.x(), pos.y());
}
}
}
if (inlineContinuation())
- inlineContinuation()->addFocusRingRects(graphicsContext,
+ inlineContinuation()->addFocusRingRects(rects,
tx - x() + inlineContinuation()->containingBlock()->x(),
ty - y() + inlineContinuation()->containingBlock()->y());
}
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index cbac627..51a7ac0 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -351,7 +351,7 @@ private:
virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0);
- virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
+ virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
void adjustPointToColumnContents(IntPoint&) const;
void adjustForBorderFit(int x, int& left, int& right) const; // Helper function for borderFitAdjust
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index f36359f..339193a 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -330,12 +330,12 @@ IntRect RenderBox::outlineBoundsForRepaint(RenderBoxModelObject* repaintContaine
return box;
}
-void RenderBox::addFocusRingRects(GraphicsContext* graphicsContext, int tx, int ty)
+void RenderBox::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty)
{
- graphicsContext->addFocusRingRect(IntRect(tx, ty, width(), height()));
+ if (width() && height())
+ rects.append(IntRect(tx, ty, width(), height()));
}
-
IntRect RenderBox::reflectionBox() const
{
IntRect result;
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index 9050dcb..302b443 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -74,7 +74,7 @@ public:
// Bounds of the outline box in absolute coords. Respects transforms
virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/) const;
- virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
+ virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
// Use this with caution! No type checking is done!
RenderBox* previousSiblingBox() const;
diff --git a/WebCore/rendering/RenderInline.cpp b/WebCore/rendering/RenderInline.cpp
index 1088cee..9571751 100644
--- a/WebCore/rendering/RenderInline.cpp
+++ b/WebCore/rendering/RenderInline.cpp
@@ -932,13 +932,15 @@ void RenderInline::imageChanged(WrappedImagePtr, const IntRect*)
repaint();
}
-void RenderInline::addFocusRingRects(GraphicsContext* graphicsContext, int tx, int ty)
+void RenderInline::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty)
{
for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
RootInlineBox* root = curr->root();
int top = max(root->lineTop(), curr->y());
int bottom = min(root->lineBottom(), curr->y() + curr->height());
- graphicsContext->addFocusRingRect(IntRect(tx + curr->x(), ty + top, curr->width(), bottom - top));
+ IntRect rect(tx + curr->x(), ty + top, curr->width(), bottom - top);
+ if (!rect.isEmpty())
+ rects.append(rect);
}
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
@@ -949,17 +951,17 @@ void RenderInline::addFocusRingRects(GraphicsContext* graphicsContext, int tx, i
pos = curr->localToAbsolute();
else if (curr->isBox())
pos.move(toRenderBox(curr)->x(), toRenderBox(curr)->y());
- curr->addFocusRingRects(graphicsContext, pos.x(), pos.y());
+ curr->addFocusRingRects(rects, pos.x(), pos.y());
}
}
if (continuation()) {
if (continuation()->isInline())
- continuation()->addFocusRingRects(graphicsContext,
+ continuation()->addFocusRingRects(rects,
tx - containingBlock()->x() + continuation()->containingBlock()->x(),
ty - containingBlock()->y() + continuation()->containingBlock()->y());
else
- continuation()->addFocusRingRects(graphicsContext,
+ continuation()->addFocusRingRects(rects,
tx - containingBlock()->x() + toRenderBox(continuation())->x(),
ty - containingBlock()->y() + toRenderBox(continuation())->y());
}
@@ -976,13 +978,12 @@ void RenderInline::paintOutline(GraphicsContext* graphicsContext, int tx, int ty
if (!oc.isValid())
oc = style()->color();
- graphicsContext->initFocusRing(ow, style()->outlineOffset());
- addFocusRingRects(graphicsContext, tx, ty);
+ Vector<IntRect> focusRingRects;
+ addFocusRingRects(focusRingRects, tx, ty);
if (style()->outlineStyleIsAuto())
- graphicsContext->drawFocusRing(oc);
+ graphicsContext->drawFocusRing(focusRingRects, ow, style()->outlineOffset(), oc);
else
- addPDFURLRect(graphicsContext, graphicsContext->focusRingBoundingRect());
- graphicsContext->clearFocusRing();
+ addPDFURLRect(graphicsContext, unionRect(focusRingRects));
}
if (style()->outlineStyleIsAuto() || style()->outlineStyle() == BNONE)
diff --git a/WebCore/rendering/RenderInline.h b/WebCore/rendering/RenderInline.h
index 8e9715c..d35aa85 100644
--- a/WebCore/rendering/RenderInline.h
+++ b/WebCore/rendering/RenderInline.h
@@ -65,7 +65,7 @@ public:
IntSize relativePositionedInlineOffset(const RenderBox* child) const;
- virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
+ virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
void paintOutline(GraphicsContext*, int tx, int ty);
int verticalPositionFromCache(bool firstLine) const;
diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp
index 5b7c662..d2161ac 100644
--- a/WebCore/rendering/RenderObject.cpp
+++ b/WebCore/rendering/RenderObject.cpp
@@ -1009,13 +1009,12 @@ void RenderObject::paintOutline(GraphicsContext* graphicsContext, int tx, int ty
if (style->outlineStyleIsAuto() || hasOutlineAnnotation()) {
if (!theme()->supportsFocusRing(style)) {
// Only paint the focus ring by hand if the theme isn't able to draw the focus ring.
- graphicsContext->initFocusRing(ow, offset);
- addFocusRingRects(graphicsContext, tx, ty);
+ Vector<IntRect> focusRingRects;
+ addFocusRingRects(focusRingRects, tx, ty);
if (style->outlineStyleIsAuto())
- graphicsContext->drawFocusRing(oc);
+ graphicsContext->drawFocusRing(focusRingRects, ow, offset, oc);
else
- addPDFURLRect(graphicsContext, graphicsContext->focusRingBoundingRect());
- graphicsContext->clearFocusRing();
+ addPDFURLRect(graphicsContext, unionRect(focusRingRects));
}
}
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index d40ae6d..f899027 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -750,7 +750,7 @@ public:
bool shouldUseTransformFromContainer(const RenderObject* container) const;
void getTransformFromContainer(const RenderObject* container, const IntSize& offsetInContainer, TransformationMatrix&) const;
- virtual void addFocusRingRects(GraphicsContext*, int /*tx*/, int /*ty*/) { };
+ virtual void addFocusRingRects(Vector<IntRect>&, int /*tx*/, int /*ty*/) { };
IntRect absoluteOutlineBounds() const
{
diff --git a/WebCore/rendering/RenderPath.cpp b/WebCore/rendering/RenderPath.cpp
index d07e506..0237198 100644
--- a/WebCore/rendering/RenderPath.cpp
+++ b/WebCore/rendering/RenderPath.cpp
@@ -209,9 +209,11 @@ void RenderPath::paint(PaintInfo& paintInfo, int, int)
// This method is called from inside paintOutline() since we call paintOutline()
// while transformed to our coord system, return local coords
-void RenderPath::addFocusRingRects(GraphicsContext* graphicsContext, int, int)
+void RenderPath::addFocusRingRects(Vector<IntRect>& rects, int, int)
{
- graphicsContext->addFocusRingRect(enclosingIntRect(repaintRectInLocalCoordinates()));
+ IntRect rect = enclosingIntRect(repaintRectInLocalCoordinates());
+ if (!rect.isEmpty())
+ rects.append(rect);
}
bool RenderPath::nodeAtFloatPoint(const HitTestRequest&, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
diff --git a/WebCore/rendering/RenderPath.h b/WebCore/rendering/RenderPath.h
index 9b525c6..2c917e8 100644
--- a/WebCore/rendering/RenderPath.h
+++ b/WebCore/rendering/RenderPath.h
@@ -59,7 +59,7 @@ private:
virtual void layout();
virtual void paint(PaintInfo&, int parentX, int parentY);
- virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
+ virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
diff --git a/WebCore/rendering/RenderSVGContainer.cpp b/WebCore/rendering/RenderSVGContainer.cpp
index e6bcdba..3984ddd 100644
--- a/WebCore/rendering/RenderSVGContainer.cpp
+++ b/WebCore/rendering/RenderSVGContainer.cpp
@@ -136,10 +136,11 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, int, int)
}
// addFocusRingRects is called from paintOutline and needs to be in the same coordinates as the paintOuline call
-void RenderSVGContainer::addFocusRingRects(GraphicsContext* graphicsContext, int, int)
+void RenderSVGContainer::addFocusRingRects(Vector<IntRect>& rects, int, int)
{
IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates()));
- graphicsContext->addFocusRingRect(paintRectInParent);
+ if (!paintRectInParent.isEmpty())
+ rects.append(paintRectInParent);
}
FloatRect RenderSVGContainer::objectBoundingBox() const
diff --git a/WebCore/rendering/RenderSVGContainer.h b/WebCore/rendering/RenderSVGContainer.h
index d19b450..ca6efaf 100644
--- a/WebCore/rendering/RenderSVGContainer.h
+++ b/WebCore/rendering/RenderSVGContainer.h
@@ -54,7 +54,7 @@ private:
virtual void layout();
- virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
+ virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
virtual FloatRect objectBoundingBox() const;
diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp
index a42b2a6..9d0d921 100644
--- a/WebCore/rendering/RenderSVGImage.cpp
+++ b/WebCore/rendering/RenderSVGImage.cpp
@@ -241,11 +241,12 @@ void RenderSVGImage::mapLocalToContainer(RenderBoxModelObject* repaintContainer,
SVGRenderBase::mapLocalToContainer(this, repaintContainer, fixed, useTransforms, transformState);
}
-void RenderSVGImage::addFocusRingRects(GraphicsContext* graphicsContext, int, int)
+void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, int, int)
{
// this is called from paint() after the localTransform has already been applied
IntRect contentRect = enclosingIntRect(repaintRectInLocalCoordinates());
- graphicsContext->addFocusRingRect(contentRect);
+ if (!contentRect.isEmpty())
+ rects.append(contentRect);
}
void RenderSVGImage::absoluteRects(Vector<IntRect>& rects, int, int)
diff --git a/WebCore/rendering/RenderSVGImage.h b/WebCore/rendering/RenderSVGImage.h
index 15ffe57..398c008 100644
--- a/WebCore/rendering/RenderSVGImage.h
+++ b/WebCore/rendering/RenderSVGImage.h
@@ -54,7 +54,7 @@ namespace WebCore {
virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void absoluteQuads(Vector<FloatQuad>&);
- virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
+ virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
void adjustRectsForAspectRatio(FloatRect& destRect, FloatRect& srcRect, const SVGPreserveAspectRatio&);
diff --git a/WebCore/rendering/RenderTextControl.cpp b/WebCore/rendering/RenderTextControl.cpp
index b258597..6e3cabb 100644
--- a/WebCore/rendering/RenderTextControl.cpp
+++ b/WebCore/rendering/RenderTextControl.cpp
@@ -505,9 +505,10 @@ void RenderTextControl::selectionChanged(bool userTriggered)
}
}
-void RenderTextControl::addFocusRingRects(GraphicsContext* graphicsContext, int tx, int ty)
+void RenderTextControl::addFocusRingRects(Vector<IntRect>& rects, int tx, int ty)
{
- graphicsContext->addFocusRingRect(IntRect(tx, ty, width(), height()));
+ if (width() && height())
+ rects.append(IntRect(tx, ty, width(), height()));
}
HTMLElement* RenderTextControl::innerTextElement() const
diff --git a/WebCore/rendering/RenderTextControl.h b/WebCore/rendering/RenderTextControl.h
index 394eb9c..d1f3749 100644
--- a/WebCore/rendering/RenderTextControl.h
+++ b/WebCore/rendering/RenderTextControl.h
@@ -99,7 +99,7 @@ private:
virtual bool avoidsFloats() const { return true; }
void setInnerTextStyle(PassRefPtr<RenderStyle>);
- virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
+ virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
virtual bool canBeProgramaticallyScrolled(bool) const { return true; }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list