Commit 4a931c53 authored by mstensho@opera.com's avatar mstensho@opera.com

Avoid floating point when calculating the actual column count.

It's too inaccurate.

BUG=502407
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1285273004

git-svn-id: svn://svn.chromium.org/blink/trunk@200848 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 405c19c0
<!DOCTYPE html>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
<p>PASS if no crash or assertion failure.</p>
<div style="overflow:-webkit-paged-y; height:27.5px;">
<div style="height:12345678901234px;"></div>
</div>
......@@ -314,7 +314,10 @@ unsigned MultiColumnFragmentainerGroup::actualColumnCount() const
if (!flowThreadPortionHeight)
return 1;
unsigned count = ceil(flowThreadPortionHeight.toFloat() / m_columnHeight.toFloat());
unsigned count = (flowThreadPortionHeight / m_columnHeight).floor();
// flowThreadPortionHeight may be saturated, so detect the remainder manually.
if (count * m_columnHeight < flowThreadPortionHeight)
count++;
ASSERT(count >= 1);
return count;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment