[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
kocienda
kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:08:51 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 6118a5e12be0de3f17d8f081b96c7b55291652e3
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 3 19:45:51 2003 +0000
WebCore:
Reviewed by John
Fix for this bug:
<rdar://problem/3470342>: focus rings are shown for links in
web pages even in non-frontmost windows
* kwq/KWQKHTMLPart.h: Add setShowsFirstResponder, showsFirstResponder functions and
_showsFirstResponder member variable.
(KWQKHTMLPart::showsFirstResponder): Added.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart): Initialize _showsFirstResponder to true
(KWQKHTMLPart::setShowsFirstResponder): Sets whether the painter draws focus rings.
* kwq/KWQPainter.h: Add _drawsFocusRing member variable.
(QPainter::setDrawsFocusRing): Sets whether the painter draws focus rings.
* kwq/KWQPainter.mm:
(QPainter::QPainter): Initialize _drawsFocusRing to true.
(QPainter::initFocusRing): Check _drawsFocusRing flag. Return if set to false.
(QPainter::addFocusRingRect): Ditto.
(QPainter::drawFocusRing): Ditto.
* kwq/WebCoreBridge.h: Add setShowsFirstResponder method.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge drawRect:]): Sets the value for _drawsFocusRing on the
painter using _showsFirstResponder value from the part.
(-[WebCoreBridge setShowsFirstResponder:]): Set passed in value on the part.
Redraw the focus ring if flag has changed.
WebKit:
Reviewed by John
Fix for this bug:
<rdar://problem/3470342>: focus rings are shown for links in
web pages even in non-frontmost windows
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView updateFocusRing]): New method. Uses the "keyness"
of the view's window to toggle focus ring drawing.
(-[WebHTMLView windowDidBecomeKey:]): Calls updateFocusRing.
(-[WebHTMLView windowDidResignKey:]): Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index e9be74f..2721bc7 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,32 @@
+2003-11-03 Ken Kocienda <kocienda at apple.com>
+
+ Reviewed by John
+
+ Fix for this bug:
+
+ <rdar://problem/3470342>: focus rings are shown for links in
+ web pages even in non-frontmost windows
+
+ * kwq/KWQKHTMLPart.h: Add setShowsFirstResponder, showsFirstResponder functions and
+ _showsFirstResponder member variable.
+ (KWQKHTMLPart::showsFirstResponder): Added.
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::KWQKHTMLPart): Initialize _showsFirstResponder to true
+ (KWQKHTMLPart::setShowsFirstResponder): Sets whether the painter draws focus rings.
+ * kwq/KWQPainter.h: Add _drawsFocusRing member variable.
+ (QPainter::setDrawsFocusRing): Sets whether the painter draws focus rings.
+ * kwq/KWQPainter.mm:
+ (QPainter::QPainter): Initialize _drawsFocusRing to true.
+ (QPainter::initFocusRing): Check _drawsFocusRing flag. Return if set to false.
+ (QPainter::addFocusRingRect): Ditto.
+ (QPainter::drawFocusRing): Ditto.
+ * kwq/WebCoreBridge.h: Add setShowsFirstResponder method.
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge drawRect:]): Sets the value for _drawsFocusRing on the
+ painter using _showsFirstResponder value from the part.
+ (-[WebCoreBridge setShowsFirstResponder:]): Set passed in value on the part.
+ Redraw the focus ring if flag has changed.
+
2003-11-03 David Hyatt <hyatt at apple.com>
Remove unneeded style property additions for form controls. In the KHTML trunk these moved into the UA
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index bf59680..29aa226 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -221,6 +221,9 @@ public:
void setUsesInactiveTextBackgroundColor(bool u) { _usesInactiveTextBackgroundColor = u; }
bool usesInactiveTextBackgroundColor() const { return _usesInactiveTextBackgroundColor; }
+ void setShowsFirstResponder(bool flag);
+ bool showsFirstResponder() const { return _showsFirstResponder; }
+
// Convenience, to avoid repeating the code to dig down to get this.
QChar backslashAsCurrencySymbol() const;
@@ -278,6 +281,7 @@ private:
KWQWindowWidget *_windowWidget;
bool _usesInactiveTextBackgroundColor;
+ bool _showsFirstResponder;
friend class KHTMLPart;
};
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 976af53..e94bb17 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -150,6 +150,7 @@ KWQKHTMLPart::KWQKHTMLPart()
, _formAboutToBeSubmitted(nil)
, _windowWidget(NULL)
, _usesInactiveTextBackgroundColor(false)
+ , _showsFirstResponder(true)
{
// Must init the cache before connecting to any signals
Cache::init();
@@ -2627,6 +2628,19 @@ void KWQKHTMLPart::setMediaType(const QString &type)
}
}
+void KWQKHTMLPart::setShowsFirstResponder(bool flag)
+{
+ if (flag != _showsFirstResponder) {
+ _showsFirstResponder = flag;
+ DocumentImpl *doc = xmlDocImpl();
+ if (doc) {
+ NodeImpl *node = doc->focusNode();
+ if (node && node->renderer())
+ node->renderer()->repaint();
+ }
+ }
+}
+
QChar KWQKHTMLPart::backslashAsCurrencySymbol() const
{
DocumentImpl *doc = xmlDocImpl();
diff --git a/WebCore/kwq/KWQPainter.h b/WebCore/kwq/KWQPainter.h
index dda805f..dee3093 100644
--- a/WebCore/kwq/KWQPainter.h
+++ b/WebCore/kwq/KWQPainter.h
@@ -119,6 +119,7 @@ public:
void addFocusRingRect(int x, int y, int width, int height);
void drawFocusRing();
void clearFocusRing();
+ void setDrawsFocusRing(bool flag) { _drawsFocusRing = flag; }
private:
// no copying or assignment
@@ -138,6 +139,7 @@ private:
QPainterPrivate *data;
bool _isForPrinting;
bool _usesInactiveTextBackgroundColor;
+ bool _drawsFocusRing;
};
#endif
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index 32cebc8..e2a3844 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -68,11 +68,11 @@ struct QPainterPrivate {
QColor focusRingColor;
};
-QPainter::QPainter() : data(new QPainterPrivate), _isForPrinting(false), _usesInactiveTextBackgroundColor(false)
+QPainter::QPainter() : data(new QPainterPrivate), _isForPrinting(false), _usesInactiveTextBackgroundColor(false), _drawsFocusRing(true)
{
}
-QPainter::QPainter(bool forPrinting) : data(new QPainterPrivate), _isForPrinting(forPrinting), _usesInactiveTextBackgroundColor(false)
+QPainter::QPainter(bool forPrinting) : data(new QPainterPrivate), _isForPrinting(forPrinting), _usesInactiveTextBackgroundColor(false), _drawsFocusRing(true)
{
}
@@ -678,6 +678,9 @@ void QPainter::clearShadow()
void QPainter::initFocusRing(int width, int offset)
{
+ if (!_drawsFocusRing)
+ return;
+
clearFocusRing();
data->focusRingWidth = width;
data->hasFocusRingColor = false;
@@ -688,6 +691,9 @@ void QPainter::initFocusRing(int width, int offset)
void QPainter::initFocusRing(int width, int offset, const QColor &color)
{
+ if (!_drawsFocusRing)
+ return;
+
initFocusRing(width, offset);
data->hasFocusRingColor = true;
data->focusRingColor = color;
@@ -695,6 +701,9 @@ void QPainter::initFocusRing(int width, int offset, const QColor &color)
void QPainter::addFocusRingRect(int x, int y, int width, int height)
{
+ if (!_drawsFocusRing)
+ return;
+
ASSERT(data->focusRingPath);
NSRect rect = NSMakeRect(x, y, width, height);
int offset = (data->focusRingWidth-1)/2 + data->focusRingOffset;
@@ -704,6 +713,9 @@ void QPainter::addFocusRingRect(int x, int y, int width, int height)
void QPainter::drawFocusRing()
{
+ if (!_drawsFocusRing)
+ return;
+
ASSERT(data->focusRingPath);
if (data->state.paintingDisabled)
return;
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 66e5750..ab342ca 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -152,6 +152,8 @@ typedef enum {
- (void)setUsesInactiveTextBackgroundColor:(BOOL)uses;
- (BOOL)usesInactiveTextBackgroundColor;
+- (void)setShowsFirstResponder:(BOOL)flag;
+
- (void)mouseDown:(NSEvent *)event;
- (void)mouseUp:(NSEvent *)event;
- (void)mouseMoved:(NSEvent *)event;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 9ed502d..b577732 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -437,6 +437,7 @@ static BOOL nowPrinting(WebCoreBridge *self)
{
QPainter painter(nowPrinting(self));
painter.setUsesInactiveTextBackgroundColor(_part->usesInactiveTextBackgroundColor());
+ painter.setDrawsFocusRing(_part->showsFirstResponder());
[self drawRect:rect withPainter:&painter];
}
@@ -1006,6 +1007,11 @@ static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
return _part->usesInactiveTextBackgroundColor();
}
+- (void)setShowsFirstResponder:(BOOL)flag
+{
+ _part->setShowsFirstResponder(flag);
+}
+
- (void)setShouldCreateRenderers:(BOOL)f
{
_shouldCreateRenderers = f;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index f9e51b2..3c35c97 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,18 @@
+2003-11-03 Ken Kocienda <kocienda at apple.com>
+
+ Reviewed by John
+
+ Fix for this bug:
+
+ <rdar://problem/3470342>: focus rings are shown for links in
+ web pages even in non-frontmost windows
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView updateFocusRing]): New method. Uses the "keyness"
+ of the view's window to toggle focus ring drawing.
+ (-[WebHTMLView windowDidBecomeKey:]): Calls updateFocusRing.
+ (-[WebHTMLView windowDidResignKey:]): Ditto.
+
2003-11-01 Maciej Stachowiak <mjs at apple.com>
Reviewed by Darin.
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index a2ec8e2..4804505 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -989,6 +989,11 @@ static WebHTMLView *lastHitView = nil;
name:NSMouseMovedNotification object:nil];
}
+- (void)updateFocusRing
+{
+ [[self _bridge] setShowsFirstResponder:[[self window] isKeyWindow]];
+}
+
- (void)addSuperviewObservers
{
// We watch the bounds of our superview, so that we can do a layout when the size
@@ -1384,6 +1389,7 @@ static WebHTMLView *lastHitView = nil;
ASSERT([notification object] == [self window]);
[self addMouseMovedObserver];
[self updateTextBackgroundColor];
+ [self updateFocusRing];
}
- (void)windowDidResignKey: (NSNotification *)notification
@@ -1391,6 +1397,7 @@ static WebHTMLView *lastHitView = nil;
ASSERT([notification object] == [self window]);
[self removeMouseMovedObserver];
[self updateTextBackgroundColor];
+ [self updateFocusRing];
}
- (void)windowWillClose:(NSNotification *)notification
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list