[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:48:12 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 04e493a1e441d046bbdbd41444d02b31120b13b1
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 23 06:35:21 2003 +0000

    	Allow HTML and BODY to be any display type.  This patch primarily eliminates the
    	RenderBody class and makes the code that deals with background propagation smart
    	enough to locate the correct renderers for the HTML and BODY elements (by crossing
    	back into the DOM tree).
    
            Reviewed by darin
    
            * ForwardingHeaders/rendering/render_body.h: Removed.
            * WebCore.pbproj/project.pbxproj:
            * khtml/html/html_baseimpl.cpp:
            (HTMLBodyElementImpl::insertedIntoDocument):
            * khtml/html/html_baseimpl.h:
            * khtml/rendering/render_body.cpp: Removed.
            * khtml/rendering/render_body.h: Removed.
            * khtml/rendering/render_box.cpp:
            (RenderBox::setStyle):
            (RenderBox::paintRootBoxDecorations):
            (RenderBox::paintBoxDecorations):
            (RenderBox::repaint):
            * khtml/rendering/render_inline.cpp:
            (RenderInline::paintObject):
            * khtml/rendering/render_inline.h:
            * khtml/rendering/render_object.cpp:
            (RenderObject::isBody):
            * khtml/rendering/render_object.h:
            * khtml/xml/dom_elementimpl.cpp:
            (ElementImpl::createRenderer):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4690 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index bd2245c..2351c67 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,33 @@
+2003-07-22  Dave Hyatt  <hyatt at apple.com>
+
+	Allow HTML and BODY to be any display type.  This patch primarily eliminates the
+	RenderBody class and makes the code that deals with background propagation smart
+	enough to locate the correct renderers for the HTML and BODY elements (by crossing
+	back into the DOM tree).
+	
+        Reviewed by darin
+
+        * ForwardingHeaders/rendering/render_body.h: Removed.
+        * WebCore.pbproj/project.pbxproj:
+        * khtml/html/html_baseimpl.cpp:
+        (HTMLBodyElementImpl::insertedIntoDocument):
+        * khtml/html/html_baseimpl.h:
+        * khtml/rendering/render_body.cpp: Removed.
+        * khtml/rendering/render_body.h: Removed.
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::setStyle):
+        (RenderBox::paintRootBoxDecorations):
+        (RenderBox::paintBoxDecorations):
+        (RenderBox::repaint):
+        * khtml/rendering/render_inline.cpp:
+        (RenderInline::paintObject):
+        * khtml/rendering/render_inline.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::isBody):
+        * khtml/rendering/render_object.h:
+        * khtml/xml/dom_elementimpl.cpp:
+        (ElementImpl::createRenderer):
+
 2003-07-22  Darin Adler  <darin at apple.com>
 
         Reviewed by Maciej.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index bd2245c..2351c67 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,33 @@
+2003-07-22  Dave Hyatt  <hyatt at apple.com>
+
+	Allow HTML and BODY to be any display type.  This patch primarily eliminates the
+	RenderBody class and makes the code that deals with background propagation smart
+	enough to locate the correct renderers for the HTML and BODY elements (by crossing
+	back into the DOM tree).
+	
+        Reviewed by darin
+
+        * ForwardingHeaders/rendering/render_body.h: Removed.
+        * WebCore.pbproj/project.pbxproj:
+        * khtml/html/html_baseimpl.cpp:
+        (HTMLBodyElementImpl::insertedIntoDocument):
+        * khtml/html/html_baseimpl.h:
+        * khtml/rendering/render_body.cpp: Removed.
+        * khtml/rendering/render_body.h: Removed.
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::setStyle):
+        (RenderBox::paintRootBoxDecorations):
+        (RenderBox::paintBoxDecorations):
+        (RenderBox::repaint):
+        * khtml/rendering/render_inline.cpp:
+        (RenderInline::paintObject):
+        * khtml/rendering/render_inline.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::isBody):
+        * khtml/rendering/render_object.h:
+        * khtml/xml/dom_elementimpl.cpp:
+        (ElementImpl::createRenderer):
+
 2003-07-22  Darin Adler  <darin at apple.com>
 
         Reviewed by Maciej.
diff --git a/WebCore/ForwardingHeaders/rendering/render_body.h b/WebCore/ForwardingHeaders/rendering/render_body.h
deleted file mode 100644
index 43df74d..0000000
--- a/WebCore/ForwardingHeaders/rendering/render_body.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <render_body.h>
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index 6b955d5..6a10adf 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -304,7 +304,6 @@
 				F523D2CF02DE4438018635CA,
 				BC7294FE03804B5600A80166,
 				BC7C965303E9EE7000A80004,
-				F523D2D102DE4438018635CA,
 				F523D2D302DE4438018635CA,
 				F523D2D502DE4438018635CA,
 				F523D2D702DE4438018635CA,
@@ -688,7 +687,6 @@
 				F523D2CA02DE4438018635CA,
 				F523D2CC02DE4438018635CA,
 				F523D2CE02DE4438018635CA,
-				F523D2D002DE4438018635CA,
 				F523D2D202DE4438018635CA,
 				F523D2D402DE4438018635CA,
 				F523D2D602DE4438018635CA,
@@ -4468,22 +4466,6 @@
 			refType = 4;
 			sourceTree = "<group>";
 		};
-		F523D2A502DE4438018635CA = {
-			expectedFileType = sourcecode.cpp.cpp;
-			fileEncoding = 30;
-			isa = PBXFileReference;
-			path = render_body.cpp;
-			refType = 4;
-			sourceTree = "<group>";
-		};
-		F523D2A602DE4438018635CA = {
-			expectedFileType = sourcecode.c.h;
-			fileEncoding = 30;
-			isa = PBXFileReference;
-			path = render_body.h;
-			refType = 4;
-			sourceTree = "<group>";
-		};
 		F523D2A702DE4438018635CA = {
 			expectedFileType = sourcecode.cpp.cpp;
 			fileEncoding = 30;
@@ -4740,18 +4722,6 @@
 			settings = {
 			};
 		};
-		F523D2D002DE4438018635CA = {
-			fileRef = F523D2A502DE4438018635CA;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
-		F523D2D102DE4438018635CA = {
-			fileRef = F523D2A602DE4438018635CA;
-			isa = PBXBuildFile;
-			settings = {
-			};
-		};
 		F523D2D202DE4438018635CA = {
 			fileRef = F523D2A702DE4438018635CA;
 			isa = PBXBuildFile;
@@ -4922,8 +4892,6 @@
 				BC7294FB03804B5600A80166,
 				BC7C964F03E9EE7000A80004,
 				BC7C964E03E9EE7000A80004,
-				F523D2A602DE4438018635CA,
-				F523D2A502DE4438018635CA,
 				F523D2A802DE4438018635CA,
 				F523D2A702DE4438018635CA,
 				F523D2AA02DE4438018635CA,
@@ -9509,7 +9477,7 @@
 //F83
 //F84
 		F8216299029F4FB501000131 = {
-			expectedFileType = wrapper.framework;
+			expectedFileType = file;
 			fallbackIsa = PBXFileReference;
 			isa = PBXFrameworkReference;
 			path = JavaScriptCore.framework;
diff --git a/WebCore/khtml/html/html_baseimpl.cpp b/WebCore/khtml/html/html_baseimpl.cpp
index 4ec8484..232dc94 100644
--- a/WebCore/khtml/html/html_baseimpl.cpp
+++ b/WebCore/khtml/html/html_baseimpl.cpp
@@ -31,7 +31,6 @@
 #include "khtml_part.h"
 
 #include "rendering/render_frames.h"
-#include "rendering/render_body.h"
 #include "css/cssstyleselector.h"
 #include "css/css_stylesheetimpl.h"
 #include "css/cssproperties.h"
@@ -180,17 +179,6 @@ void HTMLBodyElementImpl::insertedIntoDocument()
     getDocument()->updateStyleSelector();
 }
 
-RenderObject *HTMLBodyElementImpl::createRenderer(RenderArena *arena, RenderStyle *style)
-{
-    return new (arena) RenderBody(this);
-}
-
-void HTMLBodyElementImpl::attach()
-{
-    createRendererIfNeeded();
-    NodeBaseImpl::attach();
-}
-
 // -------------------------------------------------------------------------
 
 HTMLFrameElementImpl::HTMLFrameElementImpl(DocumentPtr *doc)
diff --git a/WebCore/khtml/html/html_baseimpl.h b/WebCore/khtml/html/html_baseimpl.h
index ef423bb..a2b6108 100644
--- a/WebCore/khtml/html/html_baseimpl.h
+++ b/WebCore/khtml/html/html_baseimpl.h
@@ -58,9 +58,7 @@ public:
 
     virtual void parseAttribute(AttributeImpl *);
     virtual void insertedIntoDocument();
-    virtual void attach();
-    virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
-
+    
     CSSStyleSheetImpl *sheet() const { return m_styleSheet; }
 
 protected:
diff --git a/WebCore/khtml/rendering/render_body.cpp b/WebCore/khtml/rendering/render_body.cpp
deleted file mode 100644
index 40121be..0000000
--- a/WebCore/khtml/rendering/render_body.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * This file is part of the html renderer for KDE.
- *
- * Copyright (C) 2000 Lars Knoll (knoll at kde.org)
- * Copyright (C) 2003 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-#include "render_body.h"
-#include "render_canvas.h"
-#include "html/html_baseimpl.h"
-#include "xml/dom_docimpl.h"
-#include "khtmlview.h"
-
-#include <kglobal.h>
-#include <kdebug.h>
-
-using namespace khtml;
-using namespace DOM;
-
-RenderBody::RenderBody(HTMLBodyElementImpl* element)
-    : RenderBlock(element)
-{
-    scrollbarsStyled = false;
-}
-
-RenderBody::~RenderBody()
-{
-}
-
-void RenderBody::setStyle(RenderStyle* style)
-{
-//     qDebug("RenderBody::setStyle()");
-    style->setDisplay(BLOCK); // Don't allow RenderBody to be inline at the moment.
-    RenderBlock::setStyle(style);
-    element()->getDocument()->setTextColor( style->color() );
-    scrollbarsStyled = false;
-}
-
-void RenderBody::paintBoxDecorations(QPainter *p,int, int _y,
-                                     int, int _h, int _tx, int _ty)
-{
-    //kdDebug( 6040 ) << renderName() << "::paintBoxDecorations()" << endl;
-    QColor c;
-    CachedImage *bg = 0;
-    
-    if (parent()->style()->backgroundColor().isValid() || parent()->style()->backgroundImage()) {
-        c = style()->backgroundColor();
-        bg = style()->backgroundImage();
-    }
-    
-    int w = width();
-    int h = height() + borderTopExtra() + borderBottomExtra();
-    _ty -= borderTopExtra();
-
-    int my = QMAX(_ty,_y);
-    int mh;
-    if (_ty<_y)
-    	mh=QMAX(0,h-(_y-_ty));
-    else
-    	mh = QMIN(_h,h);
-
-    paintBackground(p, c, bg, my, mh, _tx, _ty, w, h);
-
-    if(style()->hasBorder())
-        paintBorder(p, _tx, _ty, w, h, style());
-}
-
-void RenderBody::repaint(bool immediate)
-{
-    RenderObject *cb = containingBlock();
-    if(cb != this)
-        cb->repaint(immediate);
-}
-
-void RenderBody::layout()
-{
-    RenderBlock::layout();
-
-#if !APPLE_CHANGES
-    if (!scrollbarsStyled)
-    {
-        if (root()->view())
-        {
-            root()->view()->horizontalScrollBar()->setPalette(style()->palette());
-            root()->view()->verticalScrollBar()->setPalette(style()->palette());
-        }
-        scrollbarsStyled=true;
-    }
-#endif /* APPLE_CHANGES not defined */
-}
-
-int RenderBody::availableHeight() const
-{
-    int h = RenderBlock::availableHeight();
-
-    if( style()->marginTop().isFixed() )
-        h  -= style()->marginTop().value;
-    if( style()->marginBottom().isFixed() )
-        h -= style()->marginBottom().value;
-
-    return kMax(0, h);
-}
-
diff --git a/WebCore/khtml/rendering/render_body.h b/WebCore/khtml/rendering/render_body.h
deleted file mode 100644
index 5ef14af..0000000
--- a/WebCore/khtml/rendering/render_body.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This file is part of the html renderer for KDE.
- *
- * Copyright (C) 2000 Lars Knoll (knoll at kde.org)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-#ifndef RENDER_BODY
-#define RENDER_BODY
-
-#include "render_block.h"
-
-namespace DOM
-{
-    class HTMLBodyElementImpl;
-}
-
-namespace khtml {
-
-class RenderBody : public RenderBlock
-{
-public:
-    RenderBody(DOM::HTMLBodyElementImpl* node);
-    virtual ~RenderBody();
-
-    virtual bool isBody() const { return true; }
-
-    virtual const char *renderName() const { return "RenderBody"; }
-    virtual void repaint(bool immediate=false);
-
-    virtual void layout();
-    virtual void setStyle(RenderStyle* style);
-
-    virtual int availableHeight() const;
-    
-protected:
-    virtual void paintBoxDecorations(QPainter *p,int _x, int _y,
-                                     int _w, int _h, int _tx, int _ty);
-    bool scrollbarsStyled;
-};
-
-}; // end namespace
-#endif
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index 38bdb3e..7d4d0fb 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -71,22 +71,12 @@ static void workAroundBug3321716(int)
 
 void RenderBox::setStyle(RenderStyle *_style)
 {
-    // Make sure the root element retains its display:block type even across style
-    // changes.
-    if (isRoot() && _style->display() != NONE)
-        _style->setDisplay(BLOCK);
-    
     RenderObject::setStyle(_style);
 
     // The root always paints its background/border.
     if (isRoot())
         setShouldPaintBackgroundOrBorder(true);
     
-    // ### move this into the parser. --> should work. Lars
-    // if only horizontal position was defined, vertical should be 50%
-    //if(!_style->backgroundXPosition().isVariable() && _style->backgroundYPosition().isVariable())
-    //style()->setBackgroundYPosition(Length(50, Percent));
-
     setInline(_style->isDisplayInlineType());
     
     switch(_style->position())
@@ -118,6 +108,10 @@ void RenderBox::setStyle(RenderStyle *_style)
     }
 
     adjustZIndex();
+
+    // Set the text color if we're the body.
+    if (isBody())
+        element()->getDocument()->setTextColor(_style->color());
 }
 
 void RenderBox::adjustZIndex()
@@ -228,11 +222,23 @@ void RenderBox::paintRootBoxDecorations(QPainter *p,int, int _y,
     QColor c = style()->backgroundColor();
     CachedImage *bg = style()->backgroundImage();
 
-    if (!c.isValid() && !bg && firstChild()) {
-        if (!c.isValid())
-            c = firstChild()->style()->backgroundColor();
-        if (!bg)
-            bg = firstChild()->style()->backgroundImage();
+    if (!c.isValid() && !bg) {
+        // 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.
+        RenderObject* bodyObject = 0;
+        for (DOM::NodeImpl* elt = element()->firstChild(); elt; elt = elt->nextSibling()) {
+            if (elt->id() == ID_BODY) {
+                bodyObject = elt->renderer();
+                break;
+            }
+        }
+
+        if (bodyObject) {
+            c = bodyObject->style()->backgroundColor();
+            bg = bodyObject->style()->backgroundImage();
+        }
     }
 
     // Only fill with a base color (e.g., white) if we're the root document, since iframes/frames with
@@ -274,7 +280,7 @@ void RenderBox::paintRootBoxDecorations(QPainter *p,int, int _y,
 
     paintBackground(p, c, bg, my, _h, bx, by, bw, bh);
 
-    if(style()->hasBorder())
+    if (style()->hasBorder() && style()->display() != INLINE)
         paintBorder( p, _tx, _ty, w, h, style() );
 }
 
@@ -296,9 +302,14 @@ void RenderBox::paintBoxDecorations(QPainter *p,int _x, int _y,
     else
         mh = QMIN(_h,h);
 
-    paintBackground(p, style()->backgroundColor(), style()->backgroundImage(), my, mh, _tx, _ty, w, h);
-
-    if(style()->hasBorder())
+    // The <body> only paints its background if the root element has defined a background
+    // independent of the body.  Go through the DOM to get to the root element's render object,
+    // since the root could be inline and wrapped in an anonymous block.
+    if (!isBody()
+        || element()->getDocument()->documentElement()->renderer()->style()->backgroundColor().isValid()
+        || element()->getDocument()->documentElement()->renderer()->style()->backgroundImage())        	paintBackground(p, style()->backgroundColor(), style()->backgroundImage(), my, mh, _tx, _ty, w, h);
+   
+    if (style()->hasBorder())
         paintBorder(p, _tx, _ty, w, h, style());
 }
 
@@ -583,7 +594,7 @@ void RenderBox::position(InlineBox* box, int from, int len, bool reverse)
 void RenderBox::repaint(bool immediate)
 {
     //kdDebug( 6040 ) << "repaint!" << endl;
-    if (isRoot()) {
+    if (isRoot() || isBody()) {
         RenderObject *cb = containingBlock();
         if(cb != this)
             cb->repaint(immediate);
diff --git a/WebCore/khtml/rendering/render_inline.cpp b/WebCore/khtml/rendering/render_inline.cpp
index 33770aa..8d1211a 100644
--- a/WebCore/khtml/rendering/render_inline.cpp
+++ b/WebCore/khtml/rendering/render_inline.cpp
@@ -246,13 +246,21 @@ void RenderInline::paintObject(QPainter *p, int _x, int _y,
     //    kdDebug( 6040 ) << renderName() << "(RenderInline) " << this << " ::paintObject() w/h = (" << width() << "/" << height() << ")" << endl;
 #endif
 
+    // If we have an inline root, it has to call the special root box decoration painting
+    // function.
+    if (isRoot() &&
+        (paintAction == PaintActionElementBackground || paintAction == PaintActionChildBackground) &&
+        shouldPaintBackgroundOrBorder() && style()->visibility() == VISIBLE) {
+        paintRootBoxDecorations(p, _x, _y, _w, _h, _tx, _ty);
+    }
+    
     // We're done.  We don't bother painting any children.
     if (paintAction == PaintActionElementBackground)
         return;
     // We don't paint our own background, but we do let the kids paint their backgrounds.
     if (paintAction == PaintActionChildBackgrounds)
         paintAction = PaintActionChildBackground;
-    
+
     paintLineBoxBackgroundBorder(p, _x, _y, _w, _h, _tx, _ty, paintAction);
     
     RenderObject *child = firstChild();
@@ -281,6 +289,10 @@ void RenderInline::calcMinMaxWidth()
     setMinMaxKnown();
 }
 
+bool RenderInline::requiresLayer() {
+    return isRoot() || isRelPositioned() || style()->opacity() < 1.0f;
+}
+
 short RenderInline::width() const
 {
     // Return the width of the minimal left side and the maximal right side.
diff --git a/WebCore/khtml/rendering/render_inline.h b/WebCore/khtml/rendering/render_inline.h
index 1bc9c78..ec2f3a1 100644
--- a/WebCore/khtml/rendering/render_inline.h
+++ b/WebCore/khtml/rendering/render_inline.h
@@ -61,7 +61,7 @@ public:
     virtual void calcMinMaxWidth();
 
     // overrides RenderObject
-    virtual bool requiresLayer() { return isRelPositioned() || style()->opacity() < 1.0f; }
+    virtual bool requiresLayer();
 
     virtual short width() const;
     virtual int height() const;
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 0e1e903..b3e4843 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -164,11 +164,17 @@ RenderObject::~RenderObject()
         m_style->deref();
 }
 
-bool RenderObject::isRoot() const {
+bool RenderObject::isRoot() const
+{
     return element() && element()->renderer() == this &&
            element()->getDocument()->documentElement() == element();
 }
 
+bool RenderObject::isBody() const
+{
+    return element() && element()->renderer() == this && element()->id() == ID_BODY;
+}
+
 bool RenderObject::canHaveChildren() const
 {
     return false;
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 692554a..d10e463 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -203,6 +203,7 @@ public:
     virtual bool isListMarker() const { return false; }
     virtual bool isCanvas() const { return false; }
     bool isRoot() const;
+    bool isBody() const;
     virtual bool isBR() const { return false; }
     virtual bool isTableCell() const { return false; }
     virtual bool isTableRow() const { return false; }
@@ -210,7 +211,6 @@ public:
     virtual bool isTableCol() const { return false; }
     virtual bool isTable() const { return false; }
     virtual bool isWidget() const { return false; }
-    virtual bool isBody() const { return false; }
     virtual bool isFormElement() const { return false; }
     virtual bool isImage() const { return false; }
     virtual bool isTextArea() const { return false; }
@@ -238,6 +238,7 @@ public:
     bool recalcMinMax() const { return m_recalcMinMax; }
 
     RenderCanvas* canvas() const;
+
     // don't even think about making this method virtual!
     DOM::NodeImpl* element() const { return m_node; }
 
diff --git a/WebCore/khtml/xml/dom_elementimpl.cpp b/WebCore/khtml/xml/dom_elementimpl.cpp
index 0505a15..0b281eb 100644
--- a/WebCore/khtml/xml/dom_elementimpl.cpp
+++ b/WebCore/khtml/xml/dom_elementimpl.cpp
@@ -315,8 +315,8 @@ RenderStyle *ElementImpl::styleForRenderer(RenderObject *parentRenderer)
 
 RenderObject *ElementImpl::createRenderer(RenderArena *arena, RenderStyle *style)
 {
-    if (getDocument()->documentElement() == this) {
-        // FIXME: We're a root object. For now, force a display of block.
+    if (getDocument()->documentElement() == this && style->display() == NONE) {
+        // Ignore display: none on root elements.  Force a display of block in that case.
         RenderBlock* result = new (arena) RenderBlock(this);
         if (result) result->setStyle(style);
         return result;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list