Closed
Bug 371864
Opened 18 years ago
Closed 18 years ago
Background images don't load until scrolled into the viewport
Categories
(Core :: Layout, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: stephend, Assigned: sharparrow1)
References
()
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
1.43 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
Steps to Reproduce:
1. In a trunk build, load http://www.tv.com/prison-break/show/31635/official-discussion-thread-andquotwashandquot-spoilers/topic/14245-671484/msgs.html?tag=board_topics;title;0
2. Scroll down slowly, paying attention to the user icons, which are background images, "pop-up" in the page; that is, they aren't rendered until scrolled into the viewport.
Expected Results:
Images should appear, and not "pop-up."
Actual Results:
Images only render/appear when scrolled into the viewport.
Comment 1•18 years ago
|
||
So this is basically a regression from bug 370379, as far as I can tell. We used to get the background style struct (and thus start the background image load) at frame construction time (or more precisely when we called FrameNeedsView). Now we probably don't get the struct until paint time, so that's when the images start to load....
Assignee | ||
Comment 2•18 years ago
|
||
Ugh, why exactly aren't dependencies like this documented? (Or maybe was it accidental...)
Hmm, so what do we want to do here? If we wanted a horrible hack, we could just get the style struct in FrameNeedsView even though we don't need it... Any proposals for a non-hack solution?
Comment 3•18 years ago
|
||
I don't think any of us stopped to think about it. It wasn't a purposeful dependency by any means.
In nsCSSFrameConstructor::ConstructFrameInternal we just call GetStyleVisibility(), precisely because it has side-effects. Maybe we should do the same for backgrounds. And maybe we should simply not worry about it and stick with the current behavior.
Comment 4•18 years ago
|
||
On Mac, if I grab the scrollbar thumb and scroll down, the user icons don't appear until I let go of the scrollbar!
Summary: Background images (icons) shouldn't pop-up when scrolled into the viewport. → Background images don't load until scrolled into the viewport
Comment 5•18 years ago
|
||
I noticed another bug on this page, so I filed bug 371903, "overflow: auto causes background to bleed through while scrolling".
Assignee | ||
Comment 6•18 years ago
|
||
(In reply to comment #3)
> I don't think any of us stopped to think about it. It wasn't a purposeful
> dependency by any means.
>
> In nsCSSFrameConstructor::ConstructFrameInternal we just call
> GetStyleVisibility(), precisely because it has side-effects. Maybe we should
> do the same for backgrounds. And maybe we should simply not worry about it and
> stick with the current behavior.
The issue is the the "current behavior" depends on calling FrameNeedsView, which will be going away once we finish zapping views completely. ConstructFrameInternal would be a reasonable place for it?
Comment 7•18 years ago
|
||
Oh, by "current behavior" I meant "the behavior we have right now". So effectively wontfixing this bug.
I do think that ConstructFrameInternal is a perfectly good place to call this.
Assignee | ||
Comment 8•18 years ago
|
||
I think this should behave correctly in all the cases we care about... and the worst that could happen if it messes up is that we load the wrong background and have to load the right one when we paint.
Do we need the FindBackground call? Shouldn't the background load for "body background propagates to viewport" be triggered by the GetStyleBackground() for the body element itself?
Yeah, I don't see any need to do the FindBackground -- in fact, it might be harmful, since you might do FindBackground for the canvas before the body element is loaded.
Any background that will be found by FindBackground will be the background from some style context. So why not just add a GetStyleBackground call right next to the GetStyleVisibility call?
Assignee | ||
Comment 11•18 years ago
|
||
There is the edge case of someone setting the root content or body to display: none, but I guess we don't really care... okay, I'll change it.
(In reply to comment #10)
> Yeah, I don't see any need to do the FindBackground -- in fact, it might be
> harmful, since you might do FindBackground for the canvas before the body
> element is loaded.
It would be a bug if it were harmful... we can paint a document before its body loads.
Assignee | ||
Comment 12•18 years ago
|
||
Oh wait, I didn't realize I posted a diff where I did both :( Obviously one or the other would be sufficient.
Assignee | ||
Comment 13•18 years ago
|
||
Attachment #256654 -
Attachment is obsolete: true
Attachment #256664 -
Flags: review?(roc)
Attachment #256654 -
Flags: review?(roc)
Attachment #256664 -
Flags: superreview+
Attachment #256664 -
Flags: review?(roc)
Attachment #256664 -
Flags: review+
Assignee | ||
Comment 14•18 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment 15•18 years ago
|
||
I have no idea whether this can be automatically tested, but we should at least try to think of a way to do so.
Flags: in-testsuite?
Comment 16•18 years ago
|
||
There is a pref to fire onload when background images are set, see bug 253851.
I think that could be used for testing (it seems that pref might even be turned on for 1.9).
Reporter | ||
Comment 17•18 years ago
|
||
Verified FIXED using build 2007-03-01-10 of SeaMonkey trunk on Windows XP. Thanks for the quick turnaround!
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•