Bug 23754 - the view port is filled with the background color of the body element partly.
Summary: the view port is filled with the background color of the body element partly.
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nikolas Zimmermann
URL: http://gocn.maxthon.com/m2/start2/
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-05 00:54 PST by wesleyZeng
Modified: 2022-03-07 13:50 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wesleyZeng 2009-02-05 00:54:38 PST
the view port is filled with the background color of the body element partly.
Just the rectangle of the body element is filled.

http://gocn.maxthon.com/m2/start2/
Comment 1 Alexey Proskuryakov 2009-02-05 11:45:13 PST
This page is rendered by Safari and Firefox in the same way as far as I can tell - what exactly is the problem?

You have set the component to Reindeer - maybe you are not using Safari?
Comment 2 wesleyZeng 2009-02-05 23:27:55 PST
I am using chrome, there's this bug at random.
If start.css is loaded after the creating of the body element, it happened.

void RenderBox::paintRootBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
{
    const FillLayer* bgLayer = style()->backgroundLayers();
    Color bgColor = style()->backgroundColor();
    if (!style()->hasBackground() && element() && element()->hasTagName(HTMLNames::htmlTag)) {
        // Locate the <body> element using the DOM.  This is easier than trying
        // to crawl around a render tree with potential :before/:after content and
        // anonymous blocks created by inline <body> tags etc.  We can locate the <body>
        // render object very easily via the DOM.
        HTMLElement* body = document()->body();
        RenderObject* bodyObject = (body && body->hasLocalName(bodyTag)) ? body->renderer() : 0;
        if (bodyObject) {
            bgLayer = bodyObject->style()->backgroundLayers();
            bgColor = bodyObject->style()->backgroundColor(); // background color of the body
        }
    }

    int w = width();
    int h = height();

    int rw;
    int rh;
    if (view()->frameView()) {
        rw = view()->frameView()->contentsWidth();
        rh = view()->frameView()->contentsHeight();
    } else {
        rw = view()->width();
        rh = view()->height();
    }

    // CSS2 14.2:
    // The background of the box generated by the root element covers the entire canvas including
    // its margins.
    int bx = tx - marginLeft();
    int by = ty - marginTop();
    int bw = max(w + marginLeft() + marginRight() + borderLeft() + borderRight(), rw);
    int bh = max(h + marginTop() + marginBottom() + borderTop() + borderBottom(), rh);

    int my = max(by, paintInfo.rect.y());

    // paintInfo.rect.height() isn't the bh
    paintFillLayers(paintInfo, bgColor, bgLayer, my, paintInfo.rect.height(), bx, by, bw, bh);

    if (style()->hasBorder() && style()->display() != INLINE)
        paintBorder(paintInfo.context, tx, ty, w, h, style());
}
Comment 3 Simon Fraser (smfr) 2010-03-04 15:38:30 PST
Test URL has gone away, and I don't understand why you pasted a bunch of code in the above comment.
Comment 4 Jeremy Moskovich 2010-11-03 10:28:01 PDT
Closing since the link is broken and there have been no updates in 7 months, please reopen if you have an updated URL.