Bug 51845 - CSS3 gradients with em-based stops fail to repaint when font size changes
Summary: CSS3 gradients with em-based stops fail to repaint when font size changes
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
Depends on: 52701
  Show dependency treegraph
Reported: 2011-01-03 12:24 PST by Simon Fraser (smfr)
Modified: 2011-01-30 10:20 PST (History)
3 users (show)

See Also:

Patch (10.43 KB, patch)
2011-01-29 12:32 PST, Simon Fraser (smfr)
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2011-01-03 12:24:32 PST
CSS3 gradients allow use of various units to control color stop position, including 'em'. However, we cache gradients based purely on size, so fail to repaint them when just font size changes.
Comment 1 Simon Fraser (smfr) 2011-01-05 22:56:19 PST
It may also be that a gradient shared between two renderers with different font sizes does not render correctly in one of them.
Comment 2 Simon Fraser (smfr) 2011-01-29 12:32:47 PST
Created attachment 80570 [details]
Comment 3 Eric Seidel (no email) 2011-01-30 03:51:20 PST
Comment on attachment 80570 [details]

Hmm... I wonder how many other places we get this wrong. :)
Comment 4 mitz 2011-01-30 09:47:49 PST
Comment on attachment 80570 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=80570&action=review

> Source/WebCore/css/CSSGradientValue.cpp:412
> +    for (size_t i = 0; i < m_stops.size(); i++) {

Please change this to ++i.
Comment 5 Simon Fraser (smfr) 2011-01-30 10:20:13 PST