Bug 23298 - Need to be tolerant of null style values passed to CSSStyleSelector::convertToLength
Summary: Need to be tolerant of null style values passed to CSSStyleSelector::convertT...
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: Chris Marrin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-13 11:30 PST by Chris Marrin
Modified: 2009-03-02 11:51 PST (History)
0 users

See Also:


Attachments
Patch (1.93 KB, patch)
2009-01-13 11:40 PST, Chris Marrin
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Marrin 2009-01-13 11:30:50 PST
For future functionality, we need to not crash when a null style is passed to this function. The only place it is used is in EMS and EXS computations. In this case, we will return !ok and not crash.
Comment 1 Chris Marrin 2009-01-13 11:40:39 PST
Created attachment 26677 [details]
Patch
Comment 2 Darin Adler 2009-01-13 11:49:04 PST
Comment on attachment 26677 [details]
Patch

> +        if (!style && (type == CSSPrimitiveValue::CSS_EMS || type == CSSPrimitiveValue::CSS_EXS)) {
> +            if (ok)
> +                *ok = false;
> +        }
> +        else if (type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)

Brace goes on same line as else in the WebKit coding style.

r=me
Comment 3 Chris Marrin 2009-01-13 14:10:12 PST
I will make that change when I checkin
Comment 4 Chris Marrin 2009-01-13 14:47:29 PST
Sending        WebCore/ChangeLog
Sending        WebCore/css/CSSStyleSelector.cpp
Transmitting file data ..
Committed revision 39878.