Reviewed by Dan Bernstein.
Divide by zero in calcColumnWidth
https://bugs.webkit.org/show_bug.cgi?id=58230
Test: fast/multicol/huge-column-count.html
Make sure we have at least one column, to avoid divide by zero.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::calcColumnWidth):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83470
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-04-11 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Divide by zero in calcColumnWidth
+ https://bugs.webkit.org/show_bug.cgi?id=58230
+
+ Testcase for the bug.
+
+ * fast/multicol/huge-column-count.html: Added.
+ * platform/mac/fast/multicol/huge-column-count-expected.txt: Added.
+
2011-04-11 Csaba Osztrogonác <ossy@webkit.org>
[Qt][WK2]http/tests/loading/preload-append-scan.php fails
2011-04-11 Csaba Osztrogonác <ossy@webkit.org>
[Qt][WK2]http/tests/loading/preload-append-scan.php fails
--- /dev/null
+<style>
+ html, body { -webkit-column-count: 2000000000; -webkit-column-width: 0; }
+</style>
+<body>
+This test should not crash.
+</body>
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+2011-04-11 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Divide by zero in calcColumnWidth
+ https://bugs.webkit.org/show_bug.cgi?id=58230
+
+ Test: fast/multicol/huge-column-count.html
+
+ Make sure we have at least one column, to avoid divide by zero.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::calcColumnWidth):
+
2011-04-09 Gavin Barraclough <barraclough@apple.com>
Reviewed by Sam Weinig.
2011-04-09 Gavin Barraclough <barraclough@apple.com>
Reviewed by Sam Weinig.
desiredColumnCount = max<int>(1, (float)(availWidth + colGap) / (colWidth + colGap));
desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap;
} else {
desiredColumnCount = max<int>(1, (float)(availWidth + colGap) / (colWidth + colGap));
desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap;
} else {
- desiredColumnCount = min<int>(colCount, (float)(availWidth + colGap) / (colWidth + colGap));
+ desiredColumnCount = max(min<int>(colCount, (float)(availWidth + colGap) / (colWidth + colGap)), 1);
desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap;
}
setDesiredColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
desiredColumnWidth = ((availWidth + colGap) / desiredColumnCount) - colGap;
}
setDesiredColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);