Open Bug 494590 Opened 15 years ago Updated 2 years ago

nsCSSValue::StartImageLoad does synchronous image load constructing frames

Categories

(Core :: CSS Parsing and Computation, defect)

x86
macOS
defect

Tracking

()

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(4 files, 3 obsolete files)

This causes the forum problem in bug 491063.
Flags: blocking1.9.1?
To add some more context to this bug:

The fix for bug 491063 (described in bug 491063 comment 40) seems to have caused a problem where a blank sheet is presented when visiting an https site, in this case, the Mozilla Intranet Forum.

from bug 491063 comment 49:
> I can reproduce the forum problem if I set 
> security.warn_viewing_mixed to true and security.warn_viewing_mixed.show_once
> to false. Investigating.

Blocking until this is better understood.
Flags: blocking1.9.1? → blocking1.9.1+
(In reply to comment #2)
> The fix for bug 491063 (described in bug 491063 comment 40) seems to have
> caused a problem where a blank sheet is presented when visiting an https site,
> in this case, the Mozilla Intranet Forum.
This is not a regression from bug 491063, but the fix in that bug didn't
include the fix for nsCSSValue.

I don't feel well at all today, but I'll try to write the patch tomorrow
(unless someone takes this bug from me before that ;) ).
Attached patch patch (obsolete) — Splinter Review
..but I think I need to look at also other cases when nsContentUtils::LoadImage is used.
Attachment #379549 - Flags: superreview?(bzbarsky)
Attachment #379549 - Flags: review?(bzbarsky)
Comment on attachment 379549 [details] [diff] [review]
patch

Bah, no, this breaks many reftests.
Attachment #379549 - Flags: superreview?(bzbarsky)
Attachment #379549 - Flags: review?(bzbarsky)
Attachment #379549 - Attachment is obsolete: true
Attached patch idea 2 (obsolete) — Splinter Review
This doesn't work either. Reftest runs ok, but images in xul menus are painted
too late, or not at all.
Jonas, Boris, would this be terrible?
I can't figure out anything simple to fix CSS image load.
Attachment #379566 - Attachment is obsolete: true
Attachment #379570 - Flags: superreview?(bzbarsky)
Attachment #379570 - Flags: review?(jonas)
The xul images thing is weird, but that first patch was clearly wrong in the way you tried to address in the second one: it breaks all the consumers who expect null mRequest to mean the image just couldn't be loaded...

I'll have to think about the chrome flush thing a bit, but long-term we really do need to fix this bug the right way; the current code is totally unsafe.  So maybe the right thing to do is go through the mRequest consumers and see what they're up to.  Not so palatable for 1.9.1.  :(
Yeah, I was thinking the 2nd approach again, and perhaps that is still the
way to go. I need to figure out why icons in xul menus break.
I'd rather examine (and fix) the callers than have the extra shim object, if possible, for what it's worth.
Attachment #379570 - Flags: superreview?(bzbarsky)
Attachment #379570 - Flags: review?(jonas)
Attached patch v2.1 (obsolete) — Splinter Review
For that last diff, the Clone() impl looks wrong (will start new loads instead of just glomming on to the existing one).

And in general, I worry about the memory and performance overhead here...

I was pretty serious about adjusting the consumers to not assume null request means load failed to start.  That almost seems safer to me than trying to get this shim correct _and_ performant.
And just to be clear, just about any change we make here scares the bejeezus out of me.  :(
(In reply to comment #13)
> And just to be clear, just about any change we make here scares the bejeezus
> out of me.  :(
Yeah. Which is why I'm trying several different approaches.
It is very unfortunate that this bug was noticed so late.
(In reply to comment #15)
> Created an attachment (id=379688) [details]
This has still the original Clone behavior.
(In reply to comment #16)
> This has still the original Clone behavior.
I mean the v2 patch behavior.
(In reply to comment #12)
> I was pretty serious about adjusting the consumers to not assume null request
> means load failed to start.  That almost seems safer to me than trying to get
> this shim correct _and_ performant.
So far I haven't figured out any easy way to handle null request.
There are cases like XUL image handling, generated content images, CSS stuff, etc
Yes, they'd need to be handled separately...
Boris mentioned on this morning's phone call that we might be able to spawn the dialog asynchronously, at least on branch, to work around the underlying issues. That makes sense to me.
I'm writing that async patch ATM.
It might be worth spinning that off into a separate bug, or cloning this one, or something.  We do still want to fix this bug as filed.
Depends on: 494940
(In reply to comment #22)
> It might be worth spinning that off into a separate bug, or cloning this one,
> or something.  We do still want to fix this bug as filed.

I agree - filed bug 494940 for the async approach in particular.  Olli, you say you're already writing that patch?
Attached patch async alertSplinter Review
This is pretty much the minimal patch.
Not sure if someone else should sr this.

If some background tab requests alert, that tab is brought to foreground.
Attachment #379736 - Flags: review?(bzbarsky)
Comment on attachment 379736 [details] [diff] [review]
async alert

Even safer patch coming
Attachment #379736 - Flags: review?(bzbarsky)
Attached patch async alert, v2Splinter Review
Attachment #379738 - Flags: review?(bzbarsky)
Bah, I'll move the patch to the new bug
Attachment #379738 - Flags: review?(bzbarsky)
Deblocking, since we're asyncing it up for 3.5.
Flags: blocking1.9.1+ → blocking1.9.1-
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: