[Webkit-unassigned] [Bug 59183] Overlay scroller hard to see on pages with dark background
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Apr 22 09:44:21 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=59183
Sam Weinig <sam at webkit.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #90683|review? |review-
Flag| |
--- Comment #2 from Sam Weinig <sam at webkit.org> 2011-04-22 09:44:22 PST ---
(From update of attachment 90683)
View in context: https://bugs.webkit.org/attachment.cgi?id=90683&action=review
> Source/WebCore/platform/mac/ScrollbarThemeMac.mm:214
> + if (!scrollbar->parent()->isFrameView())
> + return ScrollbarOverlayStyleDefault;
> +
> + FrameView* frameView = static_cast<FrameView*>(scrollbar->parent());
> + Document* document = frameView->frame()->document();
> + Element* rootElementToUse = document->body();
> + if (!rootElementToUse)
> + rootElementToUse = document->documentElement();
> + if (!rootElementToUse)
> + return ScrollbarOverlayStyleDefault;
> +
> + RenderObject* renderer = rootElementToUse->renderer();
> + if (!renderer)
> + return ScrollbarOverlayStyleDefault;
> + Color color = renderer->style()->visitedDependentColor(CSSPropertyBackgroundColor);
> + if (!color.isValid())
> + return ScrollbarOverlayStyleDefault;
> +
> + // reduce the background color from RGB to a lightness value
> + // and determine which scrollbar style to use based on a magic
> + // lightness heuristic
> + double h, s, l;
> + color.getHSL(h, s, l);
> + if (l < .5)
> + return ScrollbarOverlayStyleLight;
This is a layering violation, since classes in WebCore/platform are not supposed to know about rendering, the DOM, or the frame tree. Instead, I think you should add a virtual method to ScrollableArea which FrameView can implement to return the background color. This will also make this possible to implement for overflow areas in the future.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list