Skip to content
Permalink
Browse files
LayoutTests:
        Reviewed by Darin.

        Tests for http://bugs.webkit.org/show_bug.cgi?id=14714 REGRESSION:
        ASSERTION FAILED: i < size() in Vector.h:401 on negative -webkit-
        column-width
        - and -
        http://bugs.webkit.org/show_bug.cgi?id=14718 REGRESSION: ASSERTION
        FAILED: i < size() in Vector.h:401 on zero -webkit-column-count

        * fast/multicol/negativeColumnWidth-expected.checksum: Added.
        * fast/multicol/negativeColumnWidth-expected.png: Added.
        * fast/multicol/negativeColumnWidth-expected.txt: Added.
        * fast/multicol/negativeColumnWidth.html: Added.
        * fast/multicol/zeroColumnCount-expected.checksum: Added.
        * fast/multicol/zeroColumnCount-expected.png: Added.
        * fast/multicol/zeroColumnCount-expected.txt: Added.
        * fast/multicol/zeroColumnCount.html: Added.

WebCore:

        Reviewed by Darin.

        Fix for http://bugs.webkit.org/show_bug.cgi?id=14714 REGRESSION:
        ASSERTION FAILED: i < size() in Vector.h:401 on negative -webkit-
        column-width
        - and -
        http://bugs.webkit.org/show_bug.cgi?id=14718 REGRESSION: ASSERTION
        FAILED: i < size() in Vector.h:401 on zero -webkit-column-count

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::calcColumnWidth): Make 1 the minimum value
        for column-width and column-count. Since the spec does not address
        what to do with negative values for these properties, we are
        patching the rendering code instead of the parser.



Canonical link: https://commits.webkit.org/19208@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@24599 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
dethbakin committed Jul 24, 2007
1 parent 7882884 commit 4dd294abe616796fd3d706df48285c9423c3272b
@@ -1,3 +1,23 @@
2007-07-24 Beth Dakin <bdakin@apple.com>

Reviewed by Darin.

Tests for http://bugs.webkit.org/show_bug.cgi?id=14714 REGRESSION:
ASSERTION FAILED: i < size() in Vector.h:401 on negative -webkit-
column-width
- and -
http://bugs.webkit.org/show_bug.cgi?id=14718 REGRESSION: ASSERTION
FAILED: i < size() in Vector.h:401 on zero -webkit-column-count

* fast/multicol/negativeColumnWidth-expected.checksum: Added.
* fast/multicol/negativeColumnWidth-expected.png: Added.
* fast/multicol/negativeColumnWidth-expected.txt: Added.
* fast/multicol/negativeColumnWidth.html: Added.
* fast/multicol/zeroColumnCount-expected.checksum: Added.
* fast/multicol/zeroColumnCount-expected.png: Added.
* fast/multicol/zeroColumnCount-expected.txt: Added.
* fast/multicol/zeroColumnCount.html: Added.

2007-07-24 Mitz Pettel <mitz@webkit.org>

Reviewed by Darin.
@@ -0,0 +1 @@
1e98f2e8a9e8a85d3b96dd50ad1ecfd0
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,12 @@
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
RenderBody {BODY} at (8,8) size 784x584
RenderBlock (anonymous) at (0,0) size 784x18
RenderText {#text} at (0,0) size 236x18
text run at (0,0) width 236: "This test succeeds if it does not crash."
RenderTable {TABLE} at (0,18) size 6x6
RenderTableSection {TBODY} at (0,0) size 6x6
RenderTableRow {TR} at (0,2) size 6x2
RenderTableCell {TD} at (2,2) size 2x2 [r=0 c=0 rs=1 cs=1]
@@ -0,0 +1,3 @@
This test succeeds if it does not crash.

<table<td style="-webkit-columns: -9999px;">
@@ -0,0 +1 @@
1e98f2e8a9e8a85d3b96dd50ad1ecfd0
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,11 @@
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
RenderBody {BODY} at (8,8) size 784x573
RenderBlock (anonymous) at (0,0) size 784x18
RenderText {#text} at (0,0) size 236x18
text run at (0,0) width 236: "This test succeeds if it does not crash."
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
RenderBlock {H2} at (0,37) size 784x0
@@ -0,0 +1,7 @@
This test succeeds if it does not crash.

<html>
<body>
<h2 style="-webkit-column-count: 0;">
</body>
</html>
@@ -1,3 +1,20 @@
2007-07-24 Beth Dakin <bdakin@apple.com>

Reviewed by Darin.

Fix for http://bugs.webkit.org/show_bug.cgi?id=14714 REGRESSION:
ASSERTION FAILED: i < size() in Vector.h:401 on negative -webkit-
column-width
- and -
http://bugs.webkit.org/show_bug.cgi?id=14718 REGRESSION: ASSERTION
FAILED: i < size() in Vector.h:401 on zero -webkit-column-count

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::calcColumnWidth): Make 1 the minimum value
for column-width and column-count. Since the spec does not address
what to do with negative values for these properties, we are
patching the rendering code instead of the parser.

2007-07-24 Anders Carlsson <andersca@apple.com>

Reviewed by Steve.
@@ -3120,9 +3120,10 @@ void RenderBlock::calcColumnWidth()

int availWidth = desiredColumnWidth;
int colGap = columnGap();
int colWidth = max(1, static_cast<int>(style()->columnWidth()));
int colCount = max(1, static_cast<int>(style()->columnCount()));

if (style()->hasAutoColumnWidth()) {
int colCount = style()->columnCount();
if ((colCount - 1) * colGap < availWidth) {
desiredColumnCount = colCount;
desiredColumnWidth = (availWidth - (desiredColumnCount - 1) * colGap) / desiredColumnCount;
@@ -3131,16 +3132,12 @@ void RenderBlock::calcColumnWidth()
desiredColumnWidth = (availWidth - (desiredColumnCount - 1) * colGap) / desiredColumnCount;
}
} else if (style()->hasAutoColumnCount()) {
int colWidth = static_cast<int>(style()->columnWidth());
if (colWidth < availWidth) {
desiredColumnCount = (availWidth + colGap) / (colWidth + colGap);
desiredColumnWidth = (availWidth - (desiredColumnCount - 1) * colGap) / desiredColumnCount;
}
} else {
// Both are set.
int colWidth = static_cast<int>(style()->columnWidth());
int colCount = style()->columnCount();

if (colCount * colWidth + (colCount - 1) * colGap <= availWidth) {
desiredColumnCount = colCount;
desiredColumnWidth = colWidth;

0 comments on commit 4dd294a

Please sign in to comment.