Closed Bug 482148 Opened 14 years ago Closed 14 years ago

crash when serializing font-family descriptor for @font-face that doesn't have one

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.1b4

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file)

Attached patch patchSplinter Review
Right now, if we ask for fontFaceRule.style.fontFamily on an @font-face rule that doesn't have a font-family descriptor, we crash, rather than returning the empty string.

This fixes it by checking earlier for descriptors that aren't present, so that we also don't have to check explicitly for the descriptor not being present in SerializeFontSrc.

I noticed this while writing some tests for descriptor storage and serialization (currently in test-descriptors in my patch queue at http://hg.mozilla.org/users/dbaron_mozilla.com/patches/ ) because of lack of code coverage in the output at http://people.mozilla.org/~mnandigama/codecoverage/src/layout/style/nsCSSDeclaration.cpp.gcov.html
Attachment #366213 - Flags: review?(zweinberg)
Attachment #366213 - Flags: review?(zweinberg) → review+
Comment on attachment 366213 [details] [diff] [review]
patch

Nice catch.  It looks like you can also remove the aResult.Truncate() call in SerializeFontSrc();
(In reply to comment #1)
> (From update of attachment 366213 [details] [diff] [review])
> Nice catch.  It looks like you can also remove the aResult.Truncate() call in
> SerializeFontSrc();

OK, but in that case I should rename the function to AppendFontSrc or AppendSerializedFontSrc.
http://hg.mozilla.org/mozilla-central/rev/e9b0ca8dd58d

... and tested by http://hg.mozilla.org/mozilla-central/rev/1e5159da23d5
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Priority: -- → P3
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Attachment #366213 - Flags: approval1.9.1?
Attachment #366213 - Flags: approval1.9.1? → approval1.9.1+
Target Milestone: mozilla1.9.1 → mozilla1.9.1b4
You need to log in before you can comment on or make changes to this bug.