Open Bug 500997 Opened 16 years ago Updated 2 years ago

Change image size with javascript on first load gives very flat picture, on reload ok

Categories

(Core :: Layout, defect)

x86
All
defect

Tracking

()

People

(Reporter: mail, Unassigned)

References

()

Details

(Keywords: regression, testcase)

Attachments

(3 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.4) Gecko/20030619 Netscape/7.1 (ax) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.4) Gecko/20030619 Netscape/7.1 (ax) On a web page I change the sizes of images with javascript according to screen size. Part of the javascript is: var altebreite = bild.width; var altehoehe = bild.height; ... bild.width = neuebreite; bild.height = neuehoehe; When I apply this to a HTML-page that is first loaded in this session of Firefox (3.0.11), the height of the pictures is very small. On "reload" all is fine. This obviously happens with all graphics that had not been loaded before in the same session, not with others. More details: the HTML code contain "width=", but not "height=". Changing width resp. height only if the old values are unequal to zero does not help. The problem does not occur in Internet Explorer 8 and Opera 9.51. It is reproducable as described. Reproducible: Always Steps to Reproduce: 1. load http://www.gueltsteiner-tor.de/Wuerfe/M-Wurf/M-Wurf-Test-bug.htm 2. press "reload" 3. The javascript is in http://www.gueltsteiner-tor.de/JavaScript/JavaScript-Bildanpassungs-Funktionen-bug.js Expected Results: Should have done the same as after "reload" in the first place
Assignee: nobody → general
Status: UNCONFIRMED → NEW
Component: General → JavaScript Engine
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk
Assignee: general → nobody
Component: JavaScript Engine → Layout
Keywords: regression
QA Contact: general → layout
Depends on: pixels
OS: Windows XP → All
Blocks: pixels
No longer depends on: pixels
Attached file More information on the bug (deleted) —
Additional information on the problem, that I forgot to mention: When I added an "alert" to show the width and height values read and to be stored, they looked as expected, and only the first graphic was distorted. When checking for "bild.complete==true" only the first graphic showed false (and resultet in an alert), and only the first graphic was distorted. So very likely a timing problem. However, a simple (CPU-intensive) wait for 10 ms did not solve the problem. Kind regards, Gerhard Müller
Gerhard, could you please attach a reduced test case with the least ammount of code needed to reproduce this bug? That would help get this bug fixed as quickly as possible.
Gerhard, in reply to your email response: "I did not succeed in creating a new attachment to the bugzilla file, but attached please find a reduced minimal test case. This is what I wanted to add as attachment File: As attached Description: A reduced minimal test consisting of .html and .jpg file zipped by 7-Zip" Could you attach the html file and for the images just link to lets say the google logo (http://www.google.com/intl/en_ALL/images/logo.gif) or the bugzilla logo (http://www.bugzilla.org/img/buggie.png), just some image that isn't likely to go missing. I can attach the zip when I get home but having just the html file is easier to test and more people are likely to test without having to download and unzip files.
Testcase (.htm-file) with (almost) minimal lines of code. It uses a graphic from the internet. Funnily enough, this testcase shows the same problem with Internet Explorer 8 and Opera 9.51 as well - and with IE a reload does not even help! With my original (large) file the problem occurred only with Firefox. Kind regards, Gerhard Mueller
FWIW, The attached test WFM with IE7 at work.
Keywords: testcase
The testcase I mailed in earlier with a wait (setTimeout) of 500 ms before execution. It works in most cases - seemingly not when the download time for the picture ist slow in comparison to the browser speed. Kind regards, Gerhard Mueller
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: