[Webkit-unassigned] [Bug 160362] NULL Reference Error in ElementRuleCollector

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jul 31 21:04:44 PDT 2016


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

Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #284910|review?                     |review-
              Flags|                            |

--- Comment #3 from Darin Adler <darin at apple.com> ---
Comment on attachment 284910
  --> https://bugs.webkit.org/attachment.cgi?id=284910
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=284910&action=review

I’m not sure this change is the best fix.

Before landing this we need to understand why authorStyle is null. It doesn’t make sense because StyleResolver is the only place I see us creating a DocumentRuleSets object, and when creating it we call resetAuthorStyle. If authorStyle is null I suppose that means this is happening inside the StyleResolver constructor before resetAuthorStyle is called. If so, this can be fixed by reordering the code so it is called earlier.

In fact, I think DocumentRuleSets could probably call resetAuthorStyle inside its own constructor; there is no reason it has to wait until later. Then we could remove the explicit call to it inside the StyleResolver. And we could even change the authorStyle() function to return a reference rather than a pointer.

> Source/WebCore/css/ElementRuleCollector.cpp:299
> +        collectMatchingRulesForList(&(m_authorStyle->slottedPseudoElementRules()), matchRequest, ruleRange);

No need to add the parentheses to this expression. Please don’t add them.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160801/1148c53d/attachment-0001.html>


More information about the webkit-unassigned mailing list