Bug 20367 - CSSRuleSet::addRulesFromSheet uses the wrong object for fontFaceRule?
Summary: CSSRuleSet::addRulesFromSheet uses the wrong object for fontFaceRule?
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-12 18:04 PDT by Simon Fraser (smfr)
Modified: 2008-08-14 16:04 PDT (History)
3 users (show)

See Also:


Attachments
Patch, testcase, changelog (3.19 KB, patch)
2008-08-13 17:44 PDT, Simon Fraser (smfr)
eric: 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) 2008-08-12 18:04:56 PDT
CSSRuleSet::addRulesFromSheet seems to use the wrong object when casting to a fontFaceRule. Maybe patch:

                             addRule(rule, s);
                     } else if (childItem->isFontFaceRule() && styleSelector) {
                         // Add this font face to our set.
-                        const CSSFontFaceRule* fontFaceRule = static_cast<CSSFontFaceRule*>(item);
+                        const CSSFontFaceRule* fontFaceRule = static_cast<CSSFontFaceRule*>(childItem);
                         styleSelector->fontSelector()->addFontFaceRule(fontFaceRule);
                     } else if (childItem->isKeyframesRule() && styleSelector) {
                         // Add this keyframe rule to our set.
Comment 1 mitz 2008-08-12 23:37:40 PDT
Yup. Just add a test case (it's easy to make one, and it instantly crashes a debug build) etc.
Comment 2 Simon Fraser (smfr) 2008-08-13 17:44:49 PDT
Created attachment 22783 [details]
Patch, testcase, changelog
Comment 3 Eric Seidel (no email) 2008-08-13 20:24:02 PDT
Comment on attachment 22783 [details]
Patch, testcase, changelog

Thanks!
Comment 4 Simon Fraser (smfr) 2008-08-14 16:04:54 PDT
Committed r35760
	M	WebCore/ChangeLog
	M	WebCore/css/CSSStyleSelector.cpp
	A	LayoutTests/platform/mac/fast/css/font-face-in-media-rule-expected.txt
	M	LayoutTests/ChangeLog
	A	LayoutTests/fast/css/font-face-in-media-rule.html
r35760 = 50954e56fb2e2204e506513419f556cf0dc8a1fc (trunk)