[webkit-reviews] review requested: [Bug 29924] Database Inspector crashes Safari when table has more than 21 columns : [Attachment 40420] [PATCH] Fix Hang

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 30 21:20:20 PDT 2009


Joseph Pecoraro <joepeck at webkit.org> has asked	for review:
Bug 29924: Database Inspector crashes Safari when table has more than 21
columns
https://bugs.webkit.org/show_bug.cgi?id=29924

Attachment 40420: [PATCH] Fix Hang
https://bugs.webkit.org/attachment.cgi?id=40420&action=review

------- Additional Comments from Joseph Pecoraro <joepeck at webkit.org>
Since I moved the DataGrid creation code into its view (like DOM Storage and
Cookies did and are unaffected due to fixed/known number of columns) its hard
to see the explicit changes, so I'll mention them here.

Changes:
- numColumns variable to count the number of columns
- const minimumPrecent = Math.min(5, Math.floor(100/numColumns));

The Math.floor is not really necessary but working with integer values seemed
better then having horrible percentages like "4.761904761904762".  I don't
think we should worry about the unrealistic case of >100 columns, causing the
minimumPercent to floor to 0.  The grid could not be useful, but at least it
wouldn't crash.


More information about the webkit-reviews mailing list