[Webkit-unassigned] [Bug 31680] WebCore::Document::updateLayoutIgnorePendingStylesheets NULL pointer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 29 23:59:22 PDT 2010


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


Alexey Proskuryakov <ap at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #51994|review?                     |review-
               Flag|                            |




--- Comment #14 from Alexey Proskuryakov <ap at webkit.org>  2010-03-29 23:59:22 PST ---
(From update of attachment 51994)
+        The fix also adds a null guard for canonicalPosition() just in case.

We don't usually add null checks just in case, especially in performance
sensitive code. These can confuse people looking at the code to think that this
can legitimately happen.

You could add an ASSERT - it would be useless for catching errors, because we
crash soon enough anyway, but it would serve as documentation that nodes are
supposed to have a non-null document here.

+    // Because we don't know how to "select" ownerless nodes, we take them as
null.

I was going to suggest raising an exception instead (probably
INVALID_ACCESS_ERR). I'm not sure if that's a good idea. But it made me think
about nodes from different documents. Is there a check somewhere that we don't
set the selection base and extent to nodes from another document?

+It is OK not to crash.

A better way to say this would be "PASSED if didn't crash".

-- 
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