Bug 11952 - style changes made through CSSMediaRule functions insertRule() and deleteRule do not show up on the screen
Summary: style changes made through CSSMediaRule functions insertRule() and deleteRule...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-23 15:57 PST by Sam Weinig
Modified: 2006-12-24 08:04 PST (History)
0 users

See Also:


Attachments
patch (24.69 KB, patch)
2006-12-23 18:02 PST, Sam Weinig
ggaren: review+
Details | Formatted Diff | Diff
updated patch (24.87 KB, patch)
2006-12-24 07:54 PST, Sam Weinig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2006-12-23 15:57:23 PST
Changes made using insertRule(rule, index) and deleteRule(index) do not get reflected into the rendering.  I beleive all that's needed is to add the line stylesheet()->styleSheetChanged() to the two functions.
Comment 1 Sam Weinig 2006-12-23 18:02:51 PST
Created attachment 11991 [details]
patch

Patch with 2 test cases.  The only thing that worries me is the call to stylesheet() could return null.
Comment 2 Geoffrey Garen 2006-12-23 23:25:44 PST
Comment on attachment 11991 [details]
patch

r=me

styleSheet() is a function that can return NULL, and other spots in WebCore chck for NULL, so I think you should, too. If you know that styleSheet() should never be NULL in this case (and, according to the spec, I don't think it should), then use an ASSERT instead. Eventually, it may be worth clearing up exactly when styleSheet() can return NULL. (I believe it's only in the case of a computed style declaration.)
Comment 3 Alexey Proskuryakov 2006-12-23 23:40:15 PST
(In reply to comment #2)
> If you know that styleSheet() should
> never be NULL in this case (and, according to the spec, I don't think it
> should), then use an ASSERT instead. 

I believe stylesheet()->styleSheetChanged() would crash as reliably as an assert, so maybe a comment is enough.
Comment 4 Sam Weinig 2006-12-24 07:54:22 PST
Created attachment 12003 [details]
updated patch

Adds comments noting that stylesheet() can only return 0 for computed style declarations.
Comment 5 Sam Weinig 2006-12-24 08:03:23 PST
Didn't notice Geoff's r+, landed in r18410 with the new comments.