Commit 0c77be31 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

2010-12-09 Sadrul Habib Chowdhury <sadrul@chromium.org>

        Reviewed by Kent Tamura.

        Make sure a non-zero value is used for tile-width to avoid a crash
        https://bugs.webkit.org/show_bug.cgi?id=50341

        The scaled tile width can be very small at times (e.g. with 'style: font 1
        required'). So use a minimum width of 1 instead of using 0 (which leads to a
        crash).

        * fast/dom/HTMLProgressElement/progress-element-with-style-crash.html: Added.
        * fast/dom/HTMLProgressElement/progress-element-with-style-crash-expected.txt: Added.
2010-12-09  Sadrul Habib Chowdhury  <sadrul@chromium.org>

        Reviewed by Kent Tamura.

        Make sure a non-zero value is used for tile-width to avoid a crash
        https://bugs.webkit.org/show_bug.cgi?id=50341

        The scaled tile width can be very small at times (e.g. with 'style: font 1
        required'). So use a minimum width of 1 instead of using 0 (which leads to a
        crash).

        Tests: fast/dom/HTMLProgressElement/progress-element-with-style-crash.html

        * rendering/RenderThemeChromiumSkia.cpp:
        (WebCore::RenderThemeChromiumSkia::paintProgressBar):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 59951184
2010-12-09 Sadrul Habib Chowdhury <sadrul@chromium.org>
Reviewed by Kent Tamura.
Make sure a non-zero value is used for tile-width to avoid a crash
https://bugs.webkit.org/show_bug.cgi?id=50341
The scaled tile width can be very small at times (e.g. with 'style: font 1
required'). So use a minimum width of 1 instead of using 0 (which leads to a
crash).
* fast/dom/HTMLProgressElement/progress-element-with-style-crash.html: Added.
* fast/dom/HTMLProgressElement/progress-element-with-style-crash-expected.txt: Added.
2010-12-09 Ryosuke Niwa <rniwa@webkit.org>
Reviewed by Ojan Vafai.
......
<html>
<head>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
function test() {
// It is necessary to allow some time for the progress bar to render the
// progress and produce the crash.
window.setTimeout(function() {
if (window.layoutTestController)
layoutTestController.notifyDone();
}, 10);
}
</script>
</head>
<body onload="test();">
<h1>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=50341">Bug 50341</a>. It is not OK to crash.</h1>
<progress style='font: 1 required'/>
</body>
</html>
2010-12-09 Sadrul Habib Chowdhury <sadrul@chromium.org>
Reviewed by Kent Tamura.
Make sure a non-zero value is used for tile-width to avoid a crash
https://bugs.webkit.org/show_bug.cgi?id=50341
The scaled tile width can be very small at times (e.g. with 'style: font 1
required'). So use a minimum width of 1 instead of using 0 (which leads to a
crash).
Tests: fast/dom/HTMLProgressElement/progress-element-with-style-crash.html
* rendering/RenderThemeChromiumSkia.cpp:
(WebCore::RenderThemeChromiumSkia::paintProgressBar):
2010-12-09 Ryosuke Niwa <rniwa@webkit.org>
Reviewed by Ojan Vafai.
......
......@@ -840,7 +840,8 @@ bool RenderThemeChromiumSkia::paintProgressBar(RenderObject* renderObject, const
IntRect valueRect = progressValueRectFor(renderProgress, rect);
if (valueRect.width()) {
IntSize valueTileSize(static_cast<int>(valueImage->width() * tileScale), valueRect.height());
IntSize valueTileSize(std::max(1, static_cast<int>(valueImage->width() * tileScale)), valueRect.height());
int leftOffset = valueRect.x() - rect.x();
int roundedLeftOffset= (leftOffset / valueTileSize.width()) * valueTileSize.width();
int dstLeftValueWidth = roundedLeftOffset - leftOffset + (leftOffset % valueImage->width()) ? valueTileSize.width() : 0;
......
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