Closed Bug 545636 Opened 15 years ago Closed 15 years ago

return a wrong value for css style at first call when change stylesheet file

Categories

(Core :: DOM: CSS Object Model, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: xidorn, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(3 files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.1.7) Gecko/20100106 Ubuntu/9.10 (karmic) Firefox/3.5.7 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.9.1.7) Gecko/20100106 Ubuntu/9.10 (karmic) Firefox/3.5.7 When I click the white block for the first time, with the stylesheet to be changed, the text on the right should show the background color (black) and text color (white) of the block modified, but it shows "transparent" and "rgb(0, 0, 0)" instead. Reproducible: Always Steps to Reproduce: 1.Open the HTML file 2.Click the white block 3.It happens! Actual Results: background: transparent color: rgb(0, 0, 0) Expected Results: background: rgb(0, 0, 0) color: rgb(255, 255, 255)
OS: Linux → All
Keywords: testcase
Version: unspecified → Trunk
Attached file modified case 2
Attachment #426503 - Attachment is patch: false
Attachment #426503 - Attachment mime type: text/plain → application/zip
The testcase starts an asynchronous load of a new stylesheet, then immediately (synchronously) checks the computed style. Since the new sheet hasn't loaded yet at that point, you don't get the new sheet's styles applied.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
Oh, and Opera and Safari have the same behavior.
(In reply to comment #5) > Oh, and Opera and Safari have the same behavior. But when I test it locally, only Firefox behaves like that, and other browsers including IE6 give the correct value.
(In reply to comment #5) > Oh, and Opera and Safari have the same behavior. And when testing the modified testcase submitted by John P Baker, Firefox is the only browser returns a wrong value as well.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Local behavior will depend on browser; some might decide to make the load synchronous. Firefox always does loads asynchronously, so that you don't get inconsistent behavior between local and non-local.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → INVALID
See Also: → 1403107
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: