Rework selection coloring. Rename displaysWithFocusAttributes
to isActive. Move the white-blending code onto the Color API to make
it more convenient to mutate colors for selection blending. Eliminate all
the selection state from the GraphicsContext and move it to the RenderTheme.
Implement both Win32 and Mac theme selection colors.
Reviewed by sfalken
* bridge/mac/FrameMac.h:
* bridge/mac/FrameMac.mm:
(WebCore::FrameMac::setIsActive):
* bridge/mac/WebCoreFrameBridge.h:
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge drawRect:]):
(-[WebCoreFrameBridge setIsActive:]):
(-[WebCoreFrameBridge selectionColor]):
* css/cssstyleselector.cpp:
(WebCore::CSSStyleSelector::checkOneSelector):
* page/Frame.cpp:
(WebCore::Frame::isActive):
(WebCore::Frame::setIsActive):
* page/Frame.h:
* platform/Color.cpp:
(WebCore::blend):
(WebCore::Color::blendWithWhite):
* platform/Color.h:
(WebCore::Color::hasAlpha):
* platform/GraphicsContext.cpp:
(WebCore::GraphicsContextPrivate::GraphicsContextPrivate):
* platform/GraphicsContext.h:
* platform/mac/GraphicsContextMac.mm:
* platform/win/TemporaryLinkStubs.cpp:
(GraphicsContext::endTransparencyLayer):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintSelection):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::fillHorizontalSelectionGap):
(WebCore::RenderBlock::fillVerticalSelectionGap):
(WebCore::RenderBlock::fillLeftSelectionGap):
(WebCore::RenderBlock::fillRightSelectionGap):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paint):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paint):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
* rendering/RenderListMarker.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::selectionColor):
* rendering/RenderObject.h:
* rendering/RenderReplaced.cpp:
* rendering/RenderReplaced.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::activeSelectionColor):
(WebCore::RenderTheme::inactiveSelectionColor):
(WebCore::RenderTheme::platformActiveSelectionColor):
(WebCore::RenderTheme::platformInactiveSelectionColor):
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformActiveSelectionColor):
(WebCore::RenderThemeMac::platformInactiveSelectionColor):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::platformActiveSelectionColor):
(WebCore::RenderThemeWin::platformInactiveSelectionColor):
* rendering/RenderThemeWin.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paint):
WebKit:
Rename displaysWithFocusAttributes to isActive.
Reviewed by sfalken
* WebKit.xcodeproj/project.pbxproj:
* WebView/WebHTMLView.m:
(-[WebHTMLView _updateFocusState]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14784
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-06-09 David Hyatt <hyatt@apple.com>
+
+ Rework selection coloring. Rename displaysWithFocusAttributes
+ to isActive. Move the white-blending code onto the Color API to make
+ it more convenient to mutate colors for selection blending. Eliminate all
+ the selection state from the GraphicsContext and move it to the RenderTheme.
+ Implement both Win32 and Mac theme selection colors.
+
+ Reviewed by sfalken
+
+ * bridge/mac/FrameMac.h:
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::setIsActive):
+ * bridge/mac/WebCoreFrameBridge.h:
+ * bridge/mac/WebCoreFrameBridge.mm:
+ (-[WebCoreFrameBridge drawRect:]):
+ (-[WebCoreFrameBridge setIsActive:]):
+ (-[WebCoreFrameBridge selectionColor]):
+ * css/cssstyleselector.cpp:
+ (WebCore::CSSStyleSelector::checkOneSelector):
+ * page/Frame.cpp:
+ (WebCore::Frame::isActive):
+ (WebCore::Frame::setIsActive):
+ * page/Frame.h:
+ * platform/Color.cpp:
+ (WebCore::blend):
+ (WebCore::Color::blendWithWhite):
+ * platform/Color.h:
+ (WebCore::Color::hasAlpha):
+ * platform/GraphicsContext.cpp:
+ (WebCore::GraphicsContextPrivate::GraphicsContextPrivate):
+ * platform/GraphicsContext.h:
+ * platform/mac/GraphicsContextMac.mm:
+ * platform/win/TemporaryLinkStubs.cpp:
+ (GraphicsContext::endTransparencyLayer):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::paintSelection):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::fillHorizontalSelectionGap):
+ (WebCore::RenderBlock::fillVerticalSelectionGap):
+ (WebCore::RenderBlock::fillLeftSelectionGap):
+ (WebCore::RenderBlock::fillRightSelectionGap):
+ * rendering/RenderHTMLCanvas.cpp:
+ (WebCore::RenderHTMLCanvas::paint):
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::paint):
+ * rendering/RenderListMarker.cpp:
+ (WebCore::RenderListMarker::paint):
+ * rendering/RenderListMarker.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::selectionColor):
+ * rendering/RenderObject.h:
+ * rendering/RenderReplaced.cpp:
+ * rendering/RenderReplaced.h:
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::activeSelectionColor):
+ (WebCore::RenderTheme::inactiveSelectionColor):
+ (WebCore::RenderTheme::platformActiveSelectionColor):
+ (WebCore::RenderTheme::platformInactiveSelectionColor):
+ * rendering/RenderTheme.h:
+ * rendering/RenderThemeMac.h:
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::platformActiveSelectionColor):
+ (WebCore::RenderThemeMac::platformInactiveSelectionColor):
+ * rendering/RenderThemeWin.cpp:
+ (WebCore::RenderThemeWin::platformActiveSelectionColor):
+ (WebCore::RenderThemeWin::platformInactiveSelectionColor):
+ * rendering/RenderThemeWin.h:
+ * rendering/RenderWidget.cpp:
+ (WebCore::RenderWidget::paint):
+
2006-06-09 Justin Garcia <justin.garcia@apple.com>
Reviewed by levi
virtual void restoreDocumentState();
virtual void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID);
- virtual void setDisplaysWithFocusAttributes(bool);
+ virtual void setIsActive(bool);
NSView* nextKeyView(Node* startingPoint, KWQSelectionDirection);
NSView* nextKeyViewInFrameHierarchy(Node* startingPoint, KWQSelectionDirection);
return String();
}
-void FrameMac::setDisplaysWithFocusAttributes(bool flag)
+void FrameMac::setIsActive(bool flag)
{
if (d->m_isFocused == flag)
return;
- Frame::setDisplaysWithFocusAttributes(flag);
+ Frame::setIsActive(flag);
Document *doc = document();
// Mac Specific: Changing the tint of controls from clear to aqua/graphite and vice versa. We
// do a "fake" paint. When the theme gets a paint call, it can then do an invalidate.
- (NSString *)selectedString;
- (void)setSelectionFromNone;
-- (void)setDisplaysWithFocusAttributes:(BOOL)flag;
+- (void)setIsActive:(BOOL)flag;
- (void)setWindowHasFocus:(BOOL)flag;
ASSERT([[NSGraphicsContext currentContext] isFlipped]);
ASSERT(!m_frame->document() || m_frame->document()->printing() == ![NSGraphicsContext currentContextDrawingToScreen]);
GraphicsContext context(platformContext);
- context.setUsesInactiveTextBackgroundColor(!m_frame->displaysWithFocusAttributes());
[self _setupRootForPrinting:YES];
m_frame->paint(&context, enclosingIntRect(rect));
[self _setupRootForPrinting:NO];
m_frame->setSelectionFromNone();
}
-- (void)setDisplaysWithFocusAttributes:(BOOL)flag
+- (void)setIsActive:(BOOL)flag
{
- m_frame->setDisplaysWithFocusAttributes(flag);
+ m_frame->setIsActive(flag);
}
- (void)setWindowHasFocus:(BOOL)flag
return m_frame->bodyBackgroundColor();
}
+// FIXME: Not sure what this method is for. It seems to only be used by plug-ins over in WebKit.
- (NSColor *)selectionColor
{
- RenderView* root = static_cast<RenderView *>(m_frame->document()->renderer());
- if (root) {
- RenderStyle *pseudoStyle = root->getPseudoStyle(RenderStyle::SELECTION);
- if (pseudoStyle && pseudoStyle->backgroundColor().isValid()) {
- return nsColor(pseudoStyle->backgroundColor());
- }
- }
- return m_frame->displaysWithFocusAttributes() ? [NSColor selectedTextBackgroundColor] : [NSColor secondarySelectedControlColor];
+ return m_frame->isActive() ? [NSColor selectedTextBackgroundColor] : [NSColor secondarySelectedControlColor];
}
- (void)adjustViewSize
break;
}
case CSSSelector::PseudoFocus:
- if (e && e->focused() && e->document()->frame()->displaysWithFocusAttributes()) {
+ if (e && e->focused() && e->document()->frame()->isActive())
return true;
- }
break;
case CSSSelector::PseudoActive:
// If we're in quirks mode, then :active should never match anchors with no
setSelection(SelectionController(Position(node, 0), DOWNSTREAM));
}
-bool Frame::displaysWithFocusAttributes() const
+bool Frame::isActive() const
{
return d->m_isFocused;
}
-void Frame::setDisplaysWithFocusAttributes(bool flag)
+void Frame::setIsActive(bool flag)
{
if (d->m_isFocused == flag)
return;
void clearTimers();
static void clearTimers(FrameView*);
- bool displaysWithFocusAttributes() const;
- virtual void setDisplaysWithFocusAttributes(bool flag);
+ bool isActive() const;
+ virtual void setIsActive(bool flag);
void setWindowHasFocus(bool flag);
// Convenience, to avoid repeating the code to dig down to get this.
return Color((int)(r * 255), (int)(g * 255), (int)(b * 255), (int)(a * 255));
}
+static int blend(int c, int a)
+{
+ // We use white.
+ float alpha = (float)(a) / 255;
+ int whiteBlend = 255 - a;
+ c -= whiteBlend;
+ c = max(0, c);
+ return min(255, (int)(c / alpha)); // Clamp to be within 0-255
+}
+
+Color Color::blendWithWhite(int alpha) const
+{
+ // If the color contains alpha already, we leave it alone.
+ if (hasAlpha())
+ return *this;
+
+ // We have a solid color. Convert to an equivalent color that looks the same when blended with white
+ // at the alpha specified.
+ return Color(blend(red(), alpha), blend(green(), alpha), blend(blue(), alpha), alpha);
+}
+
void Color::getRGBA(float& r, float& g, float& b, float& a) const
{
r = red() / 255.0f;
bool isValid() const { return valid; }
+ bool hasAlpha() const { return alpha() < 255; }
+
int red() const { return (color >> 16) & 0xFF; }
int green() const { return (color >> 8) & 0xFF; }
int blue() const { return color & 0xFF; }
Color light() const;
Color dark() const;
+ Color blendWithWhite(int alpha) const;
+
static const RGBA32 black = 0xFF000000;
static const RGBA32 white = 0xFFFFFFFF;
static const RGBA32 darkGray = 0xFF808080;
Vector<IntRect> m_focusRingRects;
int m_focusRingWidth;
int m_focusRingOffset;
- bool m_usesInactiveTextBackgroundColor;
bool m_updatingControlTints;
};
GraphicsContextPrivate::GraphicsContextPrivate()
: m_focusRingWidth(0)
, m_focusRingOffset(0)
- , m_usesInactiveTextBackgroundColor(false)
, m_updatingControlTints(false)
{
}
return m_common->state.fillColor;
}
-void GraphicsContext::setUsesInactiveTextBackgroundColor(bool u)
-{
- m_common->m_usesInactiveTextBackgroundColor = u;
-}
-
-bool GraphicsContext::usesInactiveTextBackgroundColor() const
-{
- return m_common->m_usesInactiveTextBackgroundColor;
-}
-
bool GraphicsContext::updatingControlTints() const
{
return m_common->m_updatingControlTints;
void drawLineForText(const IntPoint&, int yOffset, int width, bool printing);
void drawLineForMisspelling(const IntPoint&, int width);
-
- Color selectedTextBackgroundColor() const;
- void setUsesInactiveTextBackgroundColor(bool);
- bool usesInactiveTextBackgroundColor() const;
bool paintingDisabled() const;
void setPaintingDisabled(bool);
delete m_data;
}
-static int getBlendedColorComponent(int c, int a)
-{
- // We use white.
- float alpha = (float)(a) / 255;
- int whiteBlend = 255 - a;
- c -= whiteBlend;
- return (int)(c/alpha);
-}
-
-Color GraphicsContext::selectedTextBackgroundColor() const
-{
- NSColor *color = usesInactiveTextBackgroundColor() ? [NSColor secondarySelectedControlColor] : [NSColor selectedTextBackgroundColor];
- // this needs to always use device colorspace so it can de-calibrate the color for
- // Color to possibly recalibrate it
- color = [color colorUsingColorSpaceName:NSDeviceRGBColorSpace];
-
- Color col = Color((int)(255 * [color redComponent]), (int)(255 * [color greenComponent]), (int)(255 * [color blueComponent]));
-
- // Attempt to make the selection 60% transparent. We do this by applying a standard blend and then
- // seeing if the resultant color is still within the 0-255 range.
- int alpha = 153;
- int red = getBlendedColorComponent(col.red(), alpha);
- int green = getBlendedColorComponent(col.green(), alpha);
- int blue = getBlendedColorComponent(col.blue(), alpha);
- if (red >= 0 && red <= 255 && green >= 0 && green <= 255 && blue >= 0 && blue <= 255)
- return Color(red, green, blue, alpha);
- return col;
-}
-
void GraphicsContext::setFocusRingClip(const IntRect& r)
{
// This method only exists to work around bugs in Mac focus ring clipping.
void GraphicsContext::clearShadow() { }
void GraphicsContext::beginTransparencyLayer(float) { }
void GraphicsContext::endTransparencyLayer() { }
-Color GraphicsContext::selectedTextBackgroundColor() const { return Color(0,0,255); }
void GraphicsContext::clearRect(const FloatRect&) { }
void GraphicsContext::strokeRect(const FloatRect&, float) { }
void GraphicsContext::setLineWidth(float) { }
// Macintosh-style text highlighting is to draw with a particular background color, not invert.
Color textColor = style->color();
- Color c = object()->selectionColor(p);
+ Color c = object()->selectionColor();
if (!c.isValid())
return;
}
IntRect RenderBlock::fillHorizontalSelectionGap(RenderObject* selObj, int xPos, int yPos, int width, int height,
- const PaintInfo* i)
+ const PaintInfo* i)
{
if (width <= 0 || height <= 0)
return IntRect();
IntRect gapRect(xPos, yPos, width, height);
if (i)
- i->p->fillRect(gapRect, selObj->selectionColor(i->p));
+ i->p->fillRect(gapRect, selObj->selectionColor());
return gapRect;
}
IntRect RenderBlock::fillVerticalSelectionGap(int lastTop, int lastLeft, int lastRight,
- int bottomY, RenderBlock* rootBlock, int blockX, int blockY,
- const PaintInfo* i)
+ int bottomY, RenderBlock* rootBlock, int blockX, int blockY,
+ const PaintInfo* i)
{
int top = blockY + lastTop;
int height = bottomY - top;
IntRect gapRect(left, top, width, height);
if (i)
- i->p->fillRect(gapRect, selectionColor(i->p));
+ i->p->fillRect(gapRect, selectionColor());
return gapRect;
}
IntRect gapRect(left, top, width, height);
if (i)
- i->p->fillRect(gapRect, selObj->selectionColor(i->p));
+ i->p->fillRect(gapRect, selObj->selectionColor());
return gapRect;
}
IntRect gapRect(left, top, width, height);
if (i)
- i->p->fillRect(gapRect, selObj->selectionColor(i->p));
+ i->p->fillRect(gapRect, selObj->selectionColor());
return gapRect;
}
IntRect(x + borderLeft() + paddingLeft(), y + borderTop() + paddingTop(), contentWidth(), contentHeight()));
if (drawSelectionTint)
- i.p->fillRect(selectionRect(), selectionColor(i.p));
+ i.p->fillRect(selectionRect(), selectionColor());
}
void RenderHTMLCanvas::layout()
p->drawImage(image(), rect, compositeOperator);
if (drawSelectionTint)
- p->fillRect(selectionRect(), selectionColor(p));
+ p->fillRect(selectionRect(), selectionColor());
}
}
if (m_listImage && !m_listImage->isErrorImage()) {
p->drawImage(m_listImage->image(), marker.location());
if (selectionState() != SelectionNone)
- p->fillRect(selectionRect(), selectionColor(p));
+ p->fillRect(selectionRect(), selectionColor());
return;
}
#endif
if (selectionState() != SelectionNone)
- p->fillRect(selectionRect(), selectionColor(p));
+ p->fillRect(selectionRect(), selectionColor());
const Color color(style()->color());
p->setPen(color);
return IntRect(absx + xPos(), absy + root->selectionTop(), width(), root->selectionHeight());
}
-Color RenderListMarker::selectionColor(GraphicsContext* p) const
-{
- Color color = RenderBox::selectionColor(p);
- if (!m_listImage || m_listImage->isErrorImage())
- return color;
- // Limit the opacity so that no user-specified selection color can obscure selected images.
- if (color.alpha() > selectionColorImageOverlayAlpha)
- color = Color(color.red(), color.green(), color.blue(), selectionColorImageOverlayAlpha);
- return color;
-}
-
}
virtual SelectionState selectionState() const { return m_selectionState; }
virtual void setSelectionState(SelectionState);
virtual IntRect selectionRect();
- virtual Color selectionColor(GraphicsContext*) const;
virtual bool canBeSelectionLeaf() const { return true; }
private:
return false;
}
-Color RenderObject::selectionColor(GraphicsContext* p) const
+Color RenderObject::selectionColor() const
{
Color color;
if (style()->userSelect() != SELECT_NONE) {
RenderStyle* pseudoStyle = getPseudoStyle(RenderStyle::SELECTION);
if (pseudoStyle && pseudoStyle->backgroundColor().isValid())
- color = pseudoStyle->backgroundColor();
+ color = pseudoStyle->backgroundColor().blendWithWhite(selectionColorOverlayAlpha);
else
- color = p->selectedTextBackgroundColor();
+ color = document()->frame()->isActive() ? theme()->activeSelectionColor() : theme()->inactiveSelectionColor();
}
return color;
class RenderText;
class VisiblePosition;
-const int selectionColorImageOverlayAlpha = 60 * 255 / 100;
+const int selectionColorOverlayAlpha = 60 * 255 / 100;
enum PaintPhase {
PaintPhaseBlockBackground,
bool shouldSelect() const;
// Obtains the selection background color that should be used when painting a selection.
- virtual Color selectionColor(GraphicsContext*) const;
+ Color selectionColor() const;
// Whether or not a given block needs to paint selection gaps.
virtual bool shouldPaintSelectionGaps() const { return false; }
return false;
}
-Color RenderReplaced::selectionColor(GraphicsContext* p) const
-{
- Color color = RenderBox::selectionColor(p);
-
- // Limit the opacity so that no user-specified selection color can obscure selected images.
- if (color.alpha() > selectionColorImageOverlayAlpha)
- color = Color(color.red(), color.green(), color.blue(), selectionColorImageOverlayAlpha);
-
- return color;
-}
}
virtual void setSelectionState(SelectionState);
virtual IntRect selectionRect();
bool isSelected();
- virtual Color selectionColor(GraphicsContext*) const;
protected:
int m_intrinsicWidth;
return false;
}
+Color RenderTheme::activeSelectionColor() const
+{
+ static Color activeSelectionColor;
+ if (!activeSelectionColor.isValid())
+ activeSelectionColor = platformActiveSelectionColor().blendWithWhite(selectionColorOverlayAlpha);
+ return activeSelectionColor;
+}
+
+Color RenderTheme::inactiveSelectionColor() const
+{
+ static Color inactiveSelectionColor;
+ if (!inactiveSelectionColor.isValid())
+ inactiveSelectionColor = platformInactiveSelectionColor().blendWithWhite(selectionColorOverlayAlpha);
+ return inactiveSelectionColor;
+}
+
+Color RenderTheme::platformActiveSelectionColor() const
+{
+ // Use a blue color by default if the platform theme doesn't define anything.
+ return Color(0, 0, 255);
+}
+
+Color RenderTheme::platformInactiveSelectionColor() const
+{
+ // Use a grey color by default if the platform theme doesn't define anything.
+ return Color(128, 128, 128);
+}
+
short RenderTheme::baselinePosition(const RenderObject* o) const
{
return o->height() + o->marginTop();
// A method asking if the theme's controls actually care about redrawing when hovered.
virtual bool supportsHover(const RenderStyle* style) const { return false; }
+ // The selection color.
+ Color activeSelectionColor() const;
+ Color inactiveSelectionColor() const;
+
+ // The platform selection color.
+ virtual Color platformActiveSelectionColor() const;
+ virtual Color platformInactiveSelectionColor() const;
+
protected:
// Methods for state querying
bool isChecked(const RenderObject* o) const;
virtual void paintResizeControl(GraphicsContext*, const IntRect&);
+ virtual Color platformActiveSelectionColor() const;
+ virtual Color platformInactiveSelectionColor() const;
+
protected:
// Methods for each appearance value.
virtual bool paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r);
{
}
+Color RenderThemeMac::platformActiveSelectionColor() const
+{
+ NSColor* color = [[NSColor selectedTextBackgroundColor] colorUsingColorSpaceName:NSDeviceRGBColorSpace];
+ return Color((int)(255 * [color redComponent]), (int)(255 * [color greenComponent]), (int)(255 * [color blueComponent]));
+}
+
+Color RenderThemeMac::platformInactiveSelectionColor() const
+{
+ NSColor* color = [[NSColor secondarySelectedControlColor] colorUsingColorSpaceName:NSDeviceRGBColorSpace];
+ return Color((int)(255 * [color redComponent]), (int)(255 * [color greenComponent]), (int)(255 * [color blueComponent]));
+}
+
bool RenderThemeMac::isControlStyled(const RenderStyle* style, const BorderData& border,
const BackgroundLayer& background, const Color& backgroundColor) const
{
m_buttonTheme = m_textFieldTheme = 0;
}
+Color RenderThemeWin::platformActiveSelectionColor() const
+{
+ COLORREF color = GetSysColor(COLOR_HIGHLIGHTTEXT);
+ return Color(GetRValue(color), GetGValue(color), GetBValue(color), 255);
+}
+
+Color RenderThemeWin::platformInactiveSelectionColor() const
+{
+ COLORREF color = GetSysColor(COLOR_HIGHLIGHT);
+ return Color(GetRValue(color), GetGValue(color), GetBValue(color), 255);
+}
+
void RenderThemeWin::addIntrinsicMargins(RenderStyle* style) const
{
// Cut out the intrinsic margins completely if we end up using a small font size
// A method asking if the theme's controls actually care about redrawing when hovered.
virtual bool supportsHover(const RenderStyle*) const { return true; }
+ virtual Color platformActiveSelectionColor() const;
+ virtual Color platformInactiveSelectionColor() const;
+
virtual bool paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r)
{ return paintButton(o, i, r); }
virtual void setCheckboxSize(RenderStyle*) const;
// Paint a partially transparent wash over selected widgets.
if (isSelected() && !document()->printing())
- i.p->fillRect(selectionRect(), selectionColor(i.p));
+ i.p->fillRect(selectionRect(), selectionColor());
}
void RenderWidget::focusIn(Widget*)
+2006-06-09 David Hyatt <hyatt@apple.com>
+
+ Rename displaysWithFocusAttributes to isActive.
+
+ Reviewed by sfalken
+
+ * WebKit.xcodeproj/project.pbxproj:
+ * WebView/WebHTMLView.m:
+ (-[WebHTMLView _updateFocusState]):
+
2006-06-08 Justin Garcia <justin.garcia@apple.com>
Reviewed by levi
ED7F6D8B0980683500C235ED /* WebNSDataExtrasPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = ED7F6D8A0980683500C235ED /* WebNSDataExtrasPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
/* End PBXBuildFile section */
+/* Begin PBXBuildStyle section */
+ BCF532600A38D00E00976994 /* Development */ = {
+ isa = PBXBuildStyle;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ };
+ name = Development;
+ };
+ BCF532610A38D00E00976994 /* Deployment */ = {
+ isa = PBXBuildStyle;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ };
+ name = Deployment;
+ };
+/* End PBXBuildStyle section */
+
/* Begin PBXFileReference section */
1C68F640095B5FC100C2984E /* webInspector */ = {isa = PBXFileReference; lastKnownFileType = folder; name = webInspector; path = WebInspector/webInspector; sourceTree = SOURCE_ROOT; };
1C68F65C095B5FC100C2984E /* WebInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebInspector.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
+ buildSettings = {
+ };
+ buildStyles = (
+ BCF532600A38D00E00976994 /* Development */,
+ BCF532610A38D00E00976994 /* Deployment */,
+ );
hasScannedForEncodings = 1;
knownRegions = (
English,
BOOL windowIsKey = [window isKeyWindow];
BOOL windowOrSheetIsKey = windowIsKey || [[window attachedSheet] isKeyWindow];
- BOOL displaysWithFocusAttributes = !_private->resigningFirstResponder && windowIsKey && (_private->descendantBecomingFirstResponder || [self _web_firstResponderCausesFocusDisplay]);
+ BOOL isActive = !_private->resigningFirstResponder && windowIsKey && (_private->descendantBecomingFirstResponder || [self _web_firstResponderCausesFocusDisplay]);
[[self _bridge] setWindowHasFocus:windowOrSheetIsKey];
- [[self _bridge] setDisplaysWithFocusAttributes:displaysWithFocusAttributes];
+ [[self _bridge] setIsActive:isActive];
}
- (unsigned)highlightAllMatchesForString:(NSString *)string caseSensitive:(BOOL)caseFlag