Closed Bug 631682 Opened 10 years ago Closed 10 years ago

window.onload event is fired before background image for html element in style

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b12

People

(Reporter: hiro, Assigned: bzbarsky)

References

Details

Attachments

(2 files)

I will attach a test case.

Please see bug 580873#c248  and bug 580873#c265.
Attached patch A test caseSplinter Review
I could not find a way to know loading background image in style is completed, so checked that the background image is in image cache. As mkato said in bug 580873#c265, this test case works if html element is changed to body element, so I thinks the check works fine for this bug.
Component: Event Handling → Style System (CSS)
QA Contact: events → style-system
Blocks: 580873
Attached patch Proposed fixSplinter Review
This test fails for me without the patch, passes with.  Worst-case, it could randomly pass even if someone regresses this bug...
Attachment #509977 - Flags: review?(dbaron)
Nice catch.

What's going on here is that background image loads start when we compute the background style.  For non-root elements, this happens in nsCSSFrameConstructor::ConstructFramesFromItem because we make and explicit GetStyleBackground call there.  But for the root element we don't call ConstructFramesFromItem.
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Comment on attachment 509977 [details] [diff] [review]
Proposed fix

r=dbaron
Attachment #509977 - Flags: review?(dbaron)
Attachment #509977 - Flags: review+
Attachment #509977 - Flags: approval2.0+
Whiteboard: [need review] → [need landing]
http://hg.mozilla.org/mozilla-central/rev/16cc18d74a8c
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [need landing]
Target Milestone: --- → mozilla2.0b12
Depends on: 633566
You need to log in before you can comment on or make changes to this bug.