[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:41:15 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 911746bc82051fd05f7dc841a8f0bb7885fdfe49
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri May 9 01:16:29 2003 +0000

    	Fix the definition of isRoot() so that it doesn't depend on
    	the object being in the render tree yet (and to avoid any
    	virtual function calls as well).
    
    	Make sure that requiresLayer() returns true if the object is
    	the root.  This way the layer isn't destroyed when you e.g.,
    	hit Cmd+ to increase font size.
    
    	This fixes bug 3252496.
    
            Reviewed by rjw
    
            * khtml/rendering/render_block.cpp:
            * khtml/rendering/render_box.cpp:
            (RenderBox::setStyle):
            * khtml/rendering/render_object.cpp:
            (RenderObject::isRoot):
            * khtml/rendering/render_object.h:
            * khtml/xml/dom_elementimpl.cpp:
            (ElementImpl::createRenderer):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4325 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index ee35bde..138e408 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,28 @@
 2003-05-08  David Hyatt  <hyatt at apple.com>
 
+	Fix the definition of isRoot() so that it doesn't depend on
+	the object being in the render tree yet (and to avoid any
+	virtual function calls as well).
+
+	Make sure that requiresLayer() returns true if the object is
+	the root.  This way the layer isn't destroyed when you e.g.,
+	hit Cmd+ to increase font size.  
+
+	This fixes bug 3252496.
+	
+        Reviewed by rjw
+
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::setStyle):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::isRoot):
+        * khtml/rendering/render_object.h:
+        * khtml/xml/dom_elementimpl.cpp:
+        (ElementImpl::createRenderer):
+
+2003-05-08  David Hyatt  <hyatt at apple.com>
+
 	Background-position-x and y should be length|percentage.  Number
 	is not a valid option.  Need to remove this so that the quirk will
 	kick in that translates numbers to pixels.  Fixes an issue on
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index ee35bde..138e408 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,28 @@
 2003-05-08  David Hyatt  <hyatt at apple.com>
 
+	Fix the definition of isRoot() so that it doesn't depend on
+	the object being in the render tree yet (and to avoid any
+	virtual function calls as well).
+
+	Make sure that requiresLayer() returns true if the object is
+	the root.  This way the layer isn't destroyed when you e.g.,
+	hit Cmd+ to increase font size.  
+
+	This fixes bug 3252496.
+	
+        Reviewed by rjw
+
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::setStyle):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::isRoot):
+        * khtml/rendering/render_object.h:
+        * khtml/xml/dom_elementimpl.cpp:
+        (ElementImpl::createRenderer):
+
+2003-05-08  David Hyatt  <hyatt at apple.com>
+
 	Background-position-x and y should be length|percentage.  Number
 	is not a valid option.  Need to remove this so that the quirk will
 	kick in that translates numbers to pixels.  Fixes an issue on
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index f311c50..a1706af 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -242,16 +242,6 @@ void RenderBlock::addChildToFlow(RenderObject* newChild, RenderObject* beforeChi
     
     if ( madeBoxesNonInline )
         removeLeftoverAnonymousBoxes();
-
-    if (newChild->isRoot()) {
-        // Create a layer if we need one.
-        RenderBlock* rootBlock = static_cast<RenderBlock*>(newChild);
-        if (!rootBlock->m_layer) {
-            rootBlock->m_layer = new (renderArena()) RenderLayer(rootBlock);
-            rootBlock->m_layer->insertOnlyThisLayer();
-        }
-        rootBlock->setShouldPaintBackgroundOrBorder(true);
-    }
 }
 
 static void getInlineRun(RenderObject* start, RenderObject* stop,
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index 9db60c5..69e2082 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -64,8 +64,17 @@ RenderBox::RenderBox(DOM::NodeImpl* node)
 
 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())
diff --git a/WebCore/khtml/rendering/render_canvas.cpp b/WebCore/khtml/rendering/render_canvas.cpp
index 564ad41..e7bc9df 100644
--- a/WebCore/khtml/rendering/render_canvas.cpp
+++ b/WebCore/khtml/rendering/render_canvas.cpp
@@ -235,6 +235,15 @@ void RenderCanvas::paintObject(QPainter *p, int _x, int _y,
 
 }
 
+void RenderCanvas::paintBoxDecorations(QPainter *p,int _x, int _y,
+                                       int _w, int _h, int _tx, int _ty)
+{
+    if (firstChild() || !view())
+        return;
+
+    p->fillRect(_tx,_ty,_w,_h, view()->palette().active().color(QColorGroup::Base));
+}
+
 void RenderCanvas::repaintRectangle(int x, int y, int w, int h, bool immediate, bool f)
 {
     if (m_printingMode) return;
diff --git a/WebCore/khtml/rendering/render_canvas.h b/WebCore/khtml/rendering/render_canvas.h
index ffb161a..f2aef68 100644
--- a/WebCore/khtml/rendering/render_canvas.h
+++ b/WebCore/khtml/rendering/render_canvas.h
@@ -57,6 +57,9 @@ public:
                        PaintAction paintAction);
     void paintObject(QPainter *p, int _x, int _y,
                      int _w, int _h, int _tx, int _ty, PaintAction paintAction);
+
+    virtual void paintBoxDecorations(QPainter *p,int _x, int _y,
+                                     int _w, int _h, int _tx, int _ty);
     
     virtual void setSelection(RenderObject *s, int sp, RenderObject *e, int ep);
     virtual void clearSelection(bool doRepaint=true);
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 5682f2e..f938a6b 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -159,6 +159,11 @@ RenderObject::~RenderObject()
         m_style->deref();
 }
 
+bool RenderObject::isRoot() const {
+    return element() && element()->renderer() == this &&
+           element()->getDocument()->documentElement() == element();
+}
+
 bool RenderObject::canHaveChildren() const
 {
     return false;
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 52eebd1..3ab392f 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -117,7 +117,9 @@ public:
     RenderLayer* findNextLayer(RenderLayer* parentLayer, RenderObject* startPoint,
                                bool checkParent=true);
     virtual void positionChildLayers() { }
-    virtual bool requiresLayer() { return !isTableCell() && (isPositioned() || isRelPositioned()); }
+    virtual bool requiresLayer() {
+        return isRoot() || (!isTableCell() && (isPositioned() || isRelPositioned()));
+    }
     
     virtual QRect getOverflowClipRect(int tx, int ty) { return QRect(0,0,0,0); }
     virtual QRect getClipRect(int tx, int ty) { return QRect(0,0,0,0); }
@@ -184,7 +186,7 @@ public:
     virtual bool isListItem() const { return false; }
     virtual bool isListMarker() const { return false; }
     virtual bool isCanvas() const { return false; }
-    bool isRoot() const { return parent() && parent()->isCanvas(); }
+    bool isRoot() const;
     virtual bool isBR() const { return false; }
     virtual bool isTableCell() const { return false; }
     virtual bool isTableRow() const { return false; }
diff --git a/WebCore/khtml/xml/dom_elementimpl.cpp b/WebCore/khtml/xml/dom_elementimpl.cpp
index da237ec..142e591 100644
--- a/WebCore/khtml/xml/dom_elementimpl.cpp
+++ b/WebCore/khtml/xml/dom_elementimpl.cpp
@@ -316,8 +316,6 @@ 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 (style->display() != NONE)
-            style->setDisplay(BLOCK);
         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