[Webkit-unassigned] [Bug 22457] New: Webpages without bgcolor definition are rendered transparent by default when transparency is activated

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 24 09:27:19 PST 2008


https://bugs.webkit.org/show_bug.cgi?id=22457

           Summary: Webpages without bgcolor definition are rendered
                    transparent by default when transparency is activated
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: bwebe at dolby.com


I run a GTK webkit here with transparency activated. Now we found when we load
an HTML page that has no bgcolor information, neither as attribute in the body
tag, nor as stylesheet property, then the page background is set to transparent
and not to the default background color defined in WebCore/page/FrameView.cpp
(->m_baseBackgroundColor). This seems to be because the check in
WebCore/rendering/RenderBox.cpp is wrong (See patch). In case of an invalid
background color, like in our case, it shouldn't matter whether transparency is
active or not the background should then always be set to the
baseBackgroundColor. I think the parenthesis' are just set incorrectly here.

Test page:
No background color information. Can be as short as just one line of HTML,
like:

<a href="http://www.google.com">google</a>



Proposed patch:
--- RenderBox.cpp       2008-11-24 09:19:12.418949000 -0800
+++ WebKit-r38707/WebCore/rendering/RenderBox.cpp       2008-11-24
09:19:25.707078000 -0800
@@ -834,7 +834,7 @@
     if (!bgLayer->next()) {
         IntRect rect(tx, clipY, w, clipH);
         // If we have an alpha and we are painting the root element, go ahead
and blend with the base background color.
-        if (isRoot() && (!bgColor.isValid() || bgColor.alpha() < 0xFF) &&
!isTransparent) {
+        if (isRoot() && (!bgColor.isValid() || (bgColor.alpha() < 0xFF &&
!isTransparent))) {
             Color baseColor = view()->frameView()->baseBackgroundColor();
             if (baseColor.alpha() > 0) {
                 context->save();


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list