Bug 109612 - Switching layer to invisible leaves artifacts
Summary: Switching layer to invisible leaves artifacts
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: 3.4.1
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-26 01:33 UTC by Sebastian Kügler
Modified: 2006-06-18 15:13 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Shows the artifacts that are left (18.96 KB, image/png)
2005-07-26 01:34 UTC, Sebastian Kügler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Kügler 2005-07-26 01:33:21 UTC
Version:           3.4.1 (using KDE KDE 3.4.1)
Installed from:    Unspecified Linux
Compiler:          gcc 3.3 
OS:                Linux

Using DHTML central's coolmenu, I'm encountering rendering problems on several sites. When a long drop down menu is switched away from to a short one, on another location, the long one leaves artifacts where the short one wouldn't be overlapping if it had been at the same location. 
So there might be an issue with repainting all area's that actually change, which manifests itself in this case.

Have a look at http://vizzzion.org to see what I mean. The same works perfectly in all other browsers I've tested it with.
Comment 1 Sebastian Kügler 2005-07-26 01:34:56 UTC
Created attachment 11927 [details]
Shows the artifacts that are left

The layer is already gone again (mouse has moved away), but some of the menu
(it's created by using div's) is still there.
Comment 2 groot 2005-07-26 10:19:48 UTC
http://www.dhtmlcentral.com/projects/coolmenus/ is the source of these menus, and you can see the bug on that page as well. In the top menu bar, point to the right-most menu item (dhtmlcentral, 7 items high) and then move the mouse directly left to the "resources" menu (only 3 items high). Notice that the bottom four items of the menu that was just closed are still visible.
Comment 3 Sebastian Kügler 2006-05-24 13:15:01 UTC
After the last update, konqi doesn't crash anymore.
Comment 4 Sebastian Kügler 2006-05-24 13:19:20 UTC
Argh. Closed the wrong bug. :/
Comment 5 Germain Garand 2006-06-18 15:13:21 UTC
SVN commit 552596 by ggarand:

.layers with clipping need a repaint with old style on style change
.make RenderObject::setStyle a tad more efficient

BUG: 109612


 M  +29 -22    render_object.cpp  
 M  +1 -0      render_style.h  


--- branches/KDE/3.5/kdelibs/khtml/rendering/render_object.cpp #552595:552596
@@ -1242,22 +1242,38 @@
 
     //qDebug("m_style: %p new style, diff=%d", m_style,  d);
 
-    if ( d == RenderStyle::Visible && m_parent && m_style &&
-         m_style->outlineWidth() > style->outlineWidth() )
-        repaint();
+    if (m_style) {
+        if ( d >= RenderStyle::Visible && !isText() && m_parent &&
+             ( m_style->outlineWidth() > style->outlineWidth() ||
+               ( m_style->hasClip() && !(m_style->clip() == style->clip()) ) ) ) {
+            // schedule a repaint with the old style
+            if (layer() && !isInlineFlow())
+                layer()->repaint();
+            else
+                repaint();
+        }
 
-    if ( m_style &&
-         ( ( isFloating() && m_style->floating() != style->floating() ) ||
-           ( isPositioned() && m_style->position() != style->position() &&
-             style->position() != ABSOLUTE && style->position() != FIXED ) ) )
-        removeFromObjectLists();
+        if ( ( isFloating() && m_style->floating() != style->floating() ) ||
+               ( isPositioned() && m_style->position() != style->position() &&
+                 style->position() != ABSOLUTE && style->position() != FIXED ) )
+            removeFromObjectLists();
 
-    // reset style flags
-    m_floating = false;
-    m_positioned = false;
-    m_relPositioned = false;
-    m_paintBackground = false;
+        if ( layer() ) {
+            if ( ( m_style->hasAutoZIndex() != style->hasAutoZIndex() ||
+                   m_style->zIndex() != style->zIndex() ||
+                   m_style->visibility() != style->visibility() ) ) {
+                layer()->stackingContext()->dirtyZOrderLists();
+                layer()->dirtyZOrderLists();
+            }
+        }
 
+        // reset style flags
+        m_floating = false;
+        m_positioned = false;
+        m_relPositioned = false;
+        m_paintBackground = false;
+    }
+
     // only honour z-index for non-static objects
     // ### and objects with opacity
     if ( style->position() == STATIC ) {
@@ -1267,15 +1283,6 @@
             style->setHasAutoZIndex();
     }
 
-    if ( layer() && style && m_style ) {
-        if ( ( m_style->hasAutoZIndex() != style->hasAutoZIndex() ||
-               m_style->zIndex() != style->zIndex() ||
-               m_style->visibility() != style->visibility() ) ) {
-            layer()->stackingContext()->dirtyZOrderLists();
-            layer()->dirtyZOrderLists();
-        }
-    }
-
     RenderStyle *oldStyle = m_style;
     m_style = style;
 
--- branches/KDE/3.5/kdelibs/khtml/rendering/render_style.h #552595:552596
@@ -1089,6 +1089,7 @@
     Length clipRight() const { return visual->clip.right; }
     Length clipTop() const { return visual->clip.top; }
     Length clipBottom() const { return visual->clip.bottom; }
+    LengthBox clip() const { return visual->clip; }
     bool hasClip() const { return noninherited_flags.f._hasClip; }
 
     EUnicodeBidi unicodeBidi() const { return noninherited_flags.f._unicodeBidi; }