[Webkit-unassigned] [Bug 87533] Crash in styleForFirstLetter (pseudoStyle is null)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 30 16:39:08 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=87533





--- Comment #15 from Joe Thomas <joethomas at motorola.com>  2012-05-30 16:39:07 PST ---
(In reply to comment #14)
> (From update of attachment 144877 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=144877&action=review
> 
> > Source/WebCore/ChangeLog:9
> > +        Adding null check for Pseudo element's RenderStyle as getCachedPseudoStyle returns null in different scenarios.
> > +        In this case, null is returned from StyleResolver::pseudoStyleForElement when the matchedProperties list is empty.
> 
> Please update your ChangeLog, it mentions matchedProperties which bears little (if any) relation to the fix.

I mentioned matchedProperties to give more details about the place from which null is returned. getCachedPseudoStyle() calls StyleResolver::pseudoStyleForElement and this returns null when matchedProperties is empty.
> 
> > Source/WebCore/rendering/RenderBlock.cpp:6074
> > +    if (!pseudoStyle)
> > +        return;
> 
> Why are we calling createFirstLetterRenderer if we don't have a first letter in this case? You haven't answered this question and without that, we can't assess if your patch is right.

There is a firstLetterBlock and calling createFirstLetterRenderer() is right. The problems looks to be in StyleResolver::pseudoStyleForElement, where it returns NULL if there no matchedProperties after trying to match UA, User and Author rules.

Another approach to solve this crash would be to return the style inherited from parent if there are no matchedProperties in pseudoStyleForElement() instead of returning NULL. Eric has mentioned about it in comment#9. Similar functions like StyleResolver::styleForElement does not return NULL if there are no matchedProperties. Please let me know your thoughts on this.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list