<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>68721</bug_id>
          
          <creation_ts>2003-11-21 10:09:21 +0000</creation_ts>
          <short_desc>[test case] a fixed (with css) text/html &lt;object&gt; &quot;jumps&quot; when scrolling</short_desc>
          <delta_ts>2007-02-05 15:18:49 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>konqueror</product>
          <component>khtml renderer</component>
          <version>unspecified</version>
          <rep_platform>openSUSE</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Panther Wyvern">panther</reporter>
          <assigned_to name="Konqueror Bugs">konqueror-bugs-null</assigned_to>
          <cc>zyzstar</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>40</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>178754</commentid>
    <comment_count>0</comment_count>
    <who name="Panther Wyvern">panther</who>
    <bug_when>2003-11-21 10:09:21 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.1.1)
Installed from:    SuSE RPMs
OS:          Linux

I have a css section marked in the following way:

----------------------
#rmenu {
	position: absolute;
	right: 0px;
	top: 230px;
	bottom: 0px;
	width: 80px;
	text-align: center;
	color: #CCEA06;
	}

body&gt; #rmenu {
	position: fixed;
	top: auto;
	}
----------------------

So you can see, the position of &lt;div id=&quot;rmenu&quot;&gt; is fixed.  If I want to put a an html &lt;object&gt; in that &lt;div&gt; (such as rmenu.html), it is also fixed.  However, when the &lt;object&gt; is there and you scroll down the page, the object kind of hops.  It stays fixed, but it jiggles up and down, as opposed to if I put the information that&apos;s in rmenu.html inside the main document (when it doesn&apos;t hop, jiggle or jump) instead of using the &lt;object&gt; tag.

I will create an example if asked.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>179458</commentid>
    <comment_count>1</comment_count>
    <who name="Pablo Pita Leira">pablo.pita</who>
    <bug_when>2003-11-23 13:27:53 +0000</bug_when>
    <thetext>It would be good to have an example of the bug to reproduce or to see it it is fixed in the new versions. 
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>179715</commentid>
    <comment_count>2</comment_count>
    <who name="Panther Wyvern">panther</who>
    <bug_when>2003-11-24 05:48:11 +0000</bug_when>
    <thetext>I just downloaded and installed the SuSE builds of KDE 3.1.4.  Konqueror acts the same.

I have slapped together a quick example and put it up here:

http://www.mylinuxisp.com/~panther/konqueror.html

All of the css attributes are in the main document.  I have four fixed elements - two are contained in the main document (one with image, one without) and two are inline object frames from smaller html files.  Scroll through the page and see how the object frames jump because of their fixed position while the other two do not.  A funny thing I just noticed is that if you scroll the page with the mouse wheel, arrow keys, scrollbar buttons or the scrollbar itself, the object frames jump while the paragraphs within the main document stay still.  However, if you scroll using PageUp/PageDown, the object frames remain still while the paragraphs within the main document jump.  Try it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>179740</commentid>
    <comment_count>3</comment_count>
    <who name="Stephan Kulow">coolo</who>
    <bug_when>2003-11-24 09:29:39 +0000</bug_when>
    <thetext>Can you perhaps reduce it a bit more and attach it here? KDE 3.2 will behave
the same :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>179896</commentid>
    <comment_count>4</comment_count>
      <attachid>3378</attachid>
    <who name="Panther Wyvern">panther</who>
    <bug_when>2003-11-24 15:45:50 +0000</bug_when>
    <thetext>Created attachment 3378
example of jumping elements

This is the first time I&apos;m attaching here... I hope I&apos;m not screwing this up.
:)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>179897</commentid>
    <comment_count>5</comment_count>
      <attachid>3379</attachid>
    <who name="Panther Wyvern">panther</who>
    <bug_when>2003-11-24 15:47:43 +0000</bug_when>
    <thetext>Created attachment 3379
small html file loaded into main document via &lt;object&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>179898</commentid>
    <comment_count>6</comment_count>
      <attachid>3380</attachid>
    <who name="Panther Wyvern">panther</who>
    <bug_when>2003-11-24 15:48:21 +0000</bug_when>
    <thetext>Created attachment 3380
small html file loaded into main document via &lt;object&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>179900</commentid>
    <comment_count>7</comment_count>
      <attachid>3381</attachid>
    <who name="Panther Wyvern">panther</who>
    <bug_when>2003-11-24 15:55:45 +0000</bug_when>
    <thetext>Created attachment 3381
example of jumping elements

Okay, I messed up before but I *think* I have a better grasp on it now. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>180067</commentid>
    <comment_count>8</comment_count>
    <who name="Pablo Pita Leira">pablo.pita</who>
    <bug_when>2003-11-24 23:15:21 +0000</bug_when>
    <thetext>Well, I can confirm this with KDE CVS 3.1.93. When scrolling, the &lt;object&gt;s rendering is very unstable; they certainly jump a lot, and sometimes, even vanish. With Mozilla Firebird, the objects remain in their fixed position, and they are rendered in subwindows that also get scrollbars. 

Just in case this could be a duplicate, this bug is also related to &lt;object&gt; rendering : http://bugs.kde.org/show_bug.cgi?id=61286.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>269031</commentid>
    <comment_count>9</comment_count>
    <who name="Florian Ehrenthal">dizzinger</who>
    <bug_when>2004-09-15 23:31:18 +0000</bug_when>
    <thetext>i am experiencing the same problem.
position fixed and either a &lt;object&gt; or an &lt;iframe&gt; result in the described manner.
i am using kde 3.3 so this is still valid :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>273609</commentid>
    <comment_count>10</comment_count>
    <who name="Alexander Shaduri">ashaduri</who>
    <bug_when>2004-10-02 20:11:24 +0000</bug_when>
    <thetext>Same here with KDE 3.3.
I put up an example page at
http://members.lycos.co.uk/alexv6/test.html .
the iframe element there jumps a lot.
That would be torelable if it didn&apos;t vanish sometimes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>392244</commentid>
    <comment_count>11</comment_count>
    <who name="Florian Ehrenthal">dizzinger</who>
    <bug_when>2005-11-22 17:37:04 +0000</bug_when>
    <thetext>updating, still valid in kde 3.4.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>433173</commentid>
    <comment_count>12</comment_count>
    <who name="Thiago Macieira">thiago</who>
    <bug_when>2006-04-22 16:07:15 +0000</bug_when>
    <thetext>*** Bug 125910 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>506797</commentid>
    <comment_count>13</comment_count>
    <who name="Germain Garand">germain</who>
    <bug_when>2007-02-05 15:18:43 +0000</bug_when>
    <thetext>SVN commit 630479 by ggarand:

A simple &quot;page scaling&quot; zoom à la Opera. 
For now, it replaces the font scaling action, as the method names used for it 
in KHTML part are better suited to a real zoom (e.g. setZoomFactor).
Need to reintroduce pure font-scaling under another name..

Also introduce an alternate, non-blitting painting mode for being able to do 
fixed positioning again.
QScrollArea&apos;s quite a bit on the terse side, so there was no such thing ;(
Should fix widget jittering issues as a bonus.


BUG: 42029, 68721



 M  +2 -2      css/cssstyleselector.cpp  
 M  +9 -4      khtml_part.cpp  
 M  +111 -18   khtmlview.cpp  
 M  +20 -1     khtmlview.h  
 M  +15 -8     rendering/render_canvas.cpp  
 M  +1 -1      rendering/render_replaced.cpp  
 M  +2 -0      xml/dom_nodeimpl.cpp  


--- trunk/KDE/kdelibs/khtml/css/cssstyleselector.cpp #630478:630479
@@ -749,7 +749,7 @@
     // FIXME: We only need to invalidate the fixed regions when scrolling.  It&apos;s total overkill to
     // prevent the entire view from blitting on a scroll.
     if (style-&gt;hasFixedBackgroundImage() &amp;&amp; view)
-        view-&gt;useSlowRepaints();
+        view-&gt;setHasStaticBackground();
 }
 
 unsigned int CSSStyleSelector::addInlineDeclarations(DOM::ElementImpl* e,
@@ -2414,7 +2414,7 @@
             p = ABSOLUTE; break;
         case CSS_VAL_FIXED:
             {
-                view-&gt;useSlowRepaints();
+                view-&gt;setHasStaticBackground();
                 p = FIXED;
                 break;
             }
--- trunk/KDE/kdelibs/khtml/khtml_part.cpp #630478:630479
@@ -5754,11 +5754,16 @@
   if (d-&gt;m_zoomFactor == percent) return;
   d-&gt;m_zoomFactor = percent;
 
-  if(d-&gt;m_doc) {
+  if(d-&gt;m_view) {
       QApplication::setOverrideCursor( Qt::WaitCursor );
-    if (d-&gt;m_doc-&gt;styleSelector())
-      d-&gt;m_doc-&gt;styleSelector()-&gt;computeFontSizes(d-&gt;m_doc-&gt;paintDeviceMetrics(), d-&gt;m_zoomFactor);
-    d-&gt;m_doc-&gt;recalcStyle( NodeImpl::Force );
+
+// ### make the increasing/decreasing of font size a separate setting
+//
+//    if (d-&gt;m_doc-&gt;styleSelector())
+//      d-&gt;m_doc-&gt;styleSelector()-&gt;computeFontSizes(d-&gt;m_doc-&gt;paintDeviceMetrics(), d-&gt;m_zoomFactor);
+//    d-&gt;m_doc-&gt;recalcStyle( NodeImpl::Force );
+
+    d-&gt;m_view-&gt;setZoomLevel( d-&gt;m_zoomFactor );
     QApplication::restoreOverrideCursor();
   }
 
--- trunk/KDE/kdelibs/khtml/khtmlview.cpp #630478:630479
@@ -186,10 +186,11 @@
 	    oldUnderMouse-&gt;deref();
         oldUnderMouse = 0;
         linkPressed = false;
-        useSlowRepaints = false;
+        staticWidget = false;
 	tabMovePending = false;
 	lastTabbingDirection = true;
 	pseudoFocusNode = PFNone;
+	zoomLevel = 100;
 #ifndef KHTML_NO_SCROLLBARS
         //We don&apos;t turn off the toolbars here
 	//since if the user turns them
@@ -287,6 +288,8 @@
         scrollSuspended = false;
     }
 
+    bool haveZoom() const { return zoomLevel != 100; }
+
 #ifndef KHTML_NO_CARET
     /** this function returns an instance of the caret view context. If none
      * exists, it will be instantiated.
@@ -324,9 +327,10 @@
     Qt::ScrollBarPolicy hpolicy;
     bool prevScrollbarVisible:1;
     bool linkPressed:1;
-    bool useSlowRepaints:1;
+    bool staticWidget:1;
     bool ignoreWheelEvents:1;
 
+    int zoomLevel;
     int borderX, borderY;
     KSimpleConfig *formCompletions;
 
@@ -510,9 +514,13 @@
     QSize s = viewport()-&gt;size();
     resizeContents(s.width(), s.height());
 
-    // ### we&apos;ll enable redirection of khtmlview here
-    //     when event and painting issues have been thoroughly worked out
-    // m_kwp-&gt;setIsRedirected(true);
+    // ### we&apos;ll enable redirection of khtmlview
+    //     when event issues have been thoroughly worked out
+
+    bool redirect = false; // m_part-&gt;parentPart() &amp;&amp; !isFrame() ...
+
+    m_kwp-&gt;setIsRedirected( redirect );
+    d-&gt;staticWidget = redirect;
 }
 
 void KHTMLView::clear()
@@ -640,6 +648,7 @@
 
 void KHTMLView::updateContents(int x, int y, int w, int h)
 {
+    applyTransforms(x, y, w, h);
     widget()-&gt;update(x, y, w, h);
 }
 
@@ -650,6 +659,7 @@
 
 void KHTMLView::repaintContents(int x, int y, int w, int h)
 {
+    applyTransforms(x, y, w, h);
     widget()-&gt;repaint(x, y, w, h);
 }
 
@@ -658,6 +668,42 @@
     repaintContents( r.x(), r.y(), r.width(), r.height() );
 }
 
+void KHTMLView::applyTransforms( int&amp; x, int&amp; y, int&amp; w, int&amp; h) const
+{
+     if (d-&gt;staticWidget) {
+        x -= contentsX();
+        y -= contentsY();
+    }
+    if (d-&gt;haveZoom()) {
+        const int z = d-&gt;zoomLevel;
+        x = x*z/100;
+        y = y*z/100;
+        w = w*z/100;
+        h = h*z/100;
+    }
+}
+
+void KHTMLView::revertTransforms( int&amp; x, int&amp; y, int&amp; w, int&amp; h) const
+{
+     if (d-&gt;staticWidget) {
+        x += contentsX();
+        y += contentsY();
+    }
+    if (d-&gt;haveZoom()) {
+        const int z = d-&gt;zoomLevel;
+        x = x*100/z;
+        y = y*100/z;
+        w = w*100/z;
+        h = h*100/z;
+    }
+}
+
+void KHTMLView::revertTransforms( int&amp; x, int&amp; y ) const
+{
+    int dummy = 0;
+    revertTransforms(x, y, dummy, dummy);
+}
+   
 void KHTMLView::resizeEvent (QResizeEvent* e)
 {
     int dw = e-&gt;oldSize().width() - e-&gt;size().width();
@@ -692,16 +738,30 @@
 
     QRect r = e-&gt;rect();
     QRect v(contentsX(), contentsY(), visibleWidth(), visibleHeight());
+    if (d-&gt;staticWidget) {
+        QPoint off(contentsX(),contentsY());
+        p.translate(-off);
+        r.translate(off);
+    }
 
     r = r.intersect(v);
     if (!r.isValid() || r.isEmpty()) return;
-    p.setClipRect(v);
+    
+    if (d-&gt;haveZoom()) {
+        p.scale( d-&gt;zoomLevel/100., d-&gt;zoomLevel/100.);
 
+        r.setX(r.x()*100/d-&gt;zoomLevel);
+        r.setY(r.y()*100/d-&gt;zoomLevel);
+        r.setWidth(r.width()*100/d-&gt;zoomLevel);
+        r.setHeight(r.height()*100/d-&gt;zoomLevel);
+    }
+    p.setClipRect(r);
+  
     int ex = r.x();
     int ey = r.y();
     int ew = r.width();
     int eh = r.height();
-    
+
     if(!m_part || !m_part-&gt;xmlDocImpl() || !m_part-&gt;xmlDocImpl()-&gt;renderer()) {
         p.fillRect(ex, ey, ew, eh, palette().brush(QPalette::Active, QPalette::Base));
         return;
@@ -882,6 +942,23 @@
     QScrollArea::closeEvent( ev );
 }
 
+void KHTMLView::setZoomLevel(int percent)
+{
+    percent = percent &lt; 20 ? 20 : (percent &gt; 800 ? 800 : percent);
+    int oldpercent = d-&gt;zoomLevel;
+    d-&gt;zoomLevel = percent;
+    if (percent != oldpercent) {
+        if (d-&gt;layoutSchedulingEnabled)
+            layout();
+        widget()-&gt;update();
+    }
+}
+
+int KHTMLView::zoomLevel() const
+{
+    return d-&gt;zoomLevel;
+}
+
 //
 // Event Handling
 //
@@ -898,6 +975,7 @@
 
     int xm = _mouse-&gt;x();
     int ym = _mouse-&gt;y();
+    revertTransforms(xm, ym);
 
     // kDebug( 6000 ) &lt;&lt; &quot;mousePressEvent: viewport=(&quot;&lt;&lt;_mouse-&gt;x()-contentsX()&lt;&lt;&quot;/&quot;&lt;&lt;_mouse-&gt;y()-contentsY()&lt;&lt;&quot;), contents=(&quot; &lt;&lt; xm &lt;&lt; &quot;/&quot; &lt;&lt; ym &lt;&lt; &quot;)\n&quot;;
 
@@ -1018,6 +1096,7 @@
 
     int xm = _mouse-&gt;x();
     int ym = _mouse-&gt;y();
+    revertTransforms(xm, ym);
 
     // kDebug( 6000 ) &lt;&lt; &quot;mouseDblClickEvent: x=&quot; &lt;&lt; xm &lt;&lt; &quot;, y=&quot; &lt;&lt; ym &lt;&lt; endl;
 
@@ -1087,6 +1166,7 @@
 
     int xm = _mouse-&gt;x();
     int ym = _mouse-&gt;y();
+    revertTransforms(xm, ym);
 
     DOM::NodeImpl::MouseEvent mev( _mouse-&gt;buttons(), DOM::NodeImpl::MouseMove );
     // Do not modify :hover/:active state while mouse is pressed.
@@ -1240,6 +1320,7 @@
 
     int xm = _mouse-&gt;x();
     int ym = _mouse-&gt;y();
+    revertTransforms(xm, ym);
 
     DOM::NodeImpl::MouseEvent mev( _mouse-&gt;buttons(), DOM::NodeImpl::MouseRelease );
 
@@ -3001,10 +3082,11 @@
 }
 
 
-void KHTMLView::useSlowRepaints()
+void KHTMLView::setHasStaticBackground()
 {
-    d-&gt;useSlowRepaints = true;
-//    setStaticBackground(true); ### ?? FIXME
+    if (!d-&gt;staticWidget)
+        widget()-&gt;move(0,0);
+    d-&gt;staticWidget = true;
 }
 
 
@@ -3136,6 +3218,7 @@
     int exceptioncode = 0;
     int pageX = _mouse-&gt;x();
     int pageY = _mouse-&gt;y();
+    revertTransforms(pageX, pageY);
     int clientX = pageX - contentsX();
     int clientY = pageY - contentsY();
     int screenX = _mouse-&gt;globalX();
@@ -3164,7 +3247,7 @@
 
     // mouseout/mouseover
     if (setUnder &amp;&amp; d-&gt;oldUnderMouse != targetNode) {
-        if (d-&gt;oldUnderMouse &amp;&amp; d-&gt;oldUnderMouse-&gt;getDocument() != targetNode-&gt;getDocument()) {
+        if (d-&gt;oldUnderMouse &amp;&amp; d-&gt;oldUnderMouse-&gt;getDocument() != m_part-&gt;xmlDocImpl()) {
             d-&gt;oldUnderMouse-&gt;deref();
             d-&gt;oldUnderMouse = 0;
         }
@@ -3436,16 +3519,29 @@
                      horizontalScrollBar()-&gt;maximum()-horizontalScrollBar()-&gt;value() : horizontalScrollBar()-&gt;value();
     d-&gt;contentsY = verticalScrollBar()-&gt;value();
 
-    if (d-&gt;useSlowRepaints) {
-        widget()-&gt;blockSignals( true );
-        widget()-&gt;move( widget()-&gt;pos().x() + dx, widget()-&gt;pos().y() +dy );
-        widget()-&gt;blockSignals( false );
+    if ( d-&gt;staticWidget ) {
         widget()-&gt;repaint();
         return;
     }
     QScrollArea::scrollContentsBy(dx, dy);
 }
 
+void KHTMLView::addChild(QWidget * child, int x, int y)
+{
+    if (!child) 
+        return;
+
+    if (child-&gt;parent() != widget())
+        child-&gt;setParent( widget() );
+    
+    // ### handle pseudo-zooming of non-redirected widgets (e.g. just resize&apos;em)
+
+    if (!d-&gt;staticWidget)
+        child-&gt;move(x, y);
+    else
+        child-&gt;move(x-contentsX(), y-contentsY());
+}
+
 void KHTMLView::timerEvent ( QTimerEvent *e )
 {
 //    kDebug() &lt;&lt; &quot;timer event &quot; &lt;&lt; e-&gt;timerId() &lt;&lt; endl;
@@ -3518,9 +3614,6 @@
 	}
     }
 
-//    setStaticBackground(d-&gt;useSlowRepaints); ?? ### FIXME
-
-//        kDebug() &lt;&lt; &quot;scheduled repaint &quot;&lt;&lt; d-&gt;repaintTimerId  &lt;&lt; endl;
     if (d-&gt;repaintTimerId)
         killTimer(d-&gt;repaintTimerId);
     d-&gt;repaintTimerId = 0;
--- trunk/KDE/kdelibs/khtml/khtmlview.h #630478:630479
@@ -98,6 +98,7 @@
     friend class DOM::HTMLFormElementImpl;
     friend class DOM::HTMLAnchorElementImpl;
     friend class DOM::HTMLInputElementImpl;
+    friend class DOM::NodeImpl;
     friend class DOM::DocumentImpl;
     friend class KHTMLPart;
     friend class khtml::RenderCanvas;
@@ -257,6 +258,8 @@
      */
     void updateContents( const QRect&amp; r );
     void updateContents(int x, int y, int w, int h);
+    
+    void addChild(QWidget *child, int dx, int dy);
 
     /**
      * Requests an immediate repaint of the content area
@@ -264,6 +267,18 @@
      */
     void repaintContents( const QRect&amp; r );
     void repaintContents(int x, int y, int w, int h);
+    
+    /**
+     * Apply a zoom level to the content area
+     * @param percent a zoom level expressed as a percentage
+     */
+    void setZoomLevel( int percent );
+    
+    /**
+     * Retrieve the current zoom level
+     *
+     */
+    int zoomLevel() const;
 
 public Q_SLOTS:
     /**
@@ -393,7 +408,10 @@
     QMap&lt; DOM::ElementImpl*, QChar &gt; buildFallbackAccessKeys() const;
     void displayAccessKeys( KHTMLView* caller, KHTMLView* origview, QVector&lt; QChar &gt;&amp; taken, bool use_fallbacks );
 
-    void useSlowRepaints();
+    void setHasStaticBackground();
+    void applyTransforms( int&amp; x, int&amp; y, int&amp; w, int&amp; h) const;
+    void revertTransforms( int&amp; x, int&amp; y, int&amp; w, int&amp; h) const;
+    void revertTransforms( int&amp; x, int&amp; y ) const;
 
     void setIgnoreWheelEvents(bool e);
 
@@ -699,6 +717,7 @@
 
     void setWidgetVisible(::khtml::RenderWidget*, bool visible);
 
+
     int _width;
     int _height;
 
--- trunk/KDE/kdelibs/khtml/rendering/render_canvas.cpp #630478:630479
@@ -220,35 +220,42 @@
      // update our cached document size
     int hDocH = m_cachedDocHeight = docHeight();
     int hDocW = m_cachedDocWidth = docWidth();
+    
+    int zLevel = m_view? m_view-&gt;zoomLevel() : 100;
+    hDocW = hDocW*zLevel/100;
+    hDocH = hDocH*zLevel/100;
 
     if (!m_pagedMode &amp;&amp; m_view) {
 
         bool vss = !m_view-&gt;verticalScrollBar()-&gt;isHidden();
         bool hss = !m_view-&gt;horizontalScrollBar()-&gt;isHidden();
         QSize s = m_view-&gt;maximumViewportSize();
-        if ( m_cachedDocWidth &gt; s.width() )
+
+        int zoomedDocWidth = m_cachedDocWidth*zLevel/100;
+        int zoomedDocHeight = m_cachedDocHeight*zLevel/100;
+        if ( zoomedDocWidth &gt; s.width() )
             s.setWidth( s.width()-m_view-&gt;verticalScrollBar()-&gt;sizeHint().width() );
-        if ( m_cachedDocHeight &gt; s.height() )
+        if ( zoomedDocHeight &gt; s.height() )
             s.setHeight( s.height()-m_view-&gt;horizontalScrollBar()-&gt;sizeHint().height() );
    
         // if we are about to show a scrollbar, and the document is sized to the viewport w or h,
         // then reserve the scrollbar space so that it doesn&apos;t trigger the _other_ scrollbar
 
         if (!vss &amp;&amp; m_width - m_view-&gt;verticalScrollBar()-&gt;sizeHint().width() == s.width() &amp;&amp;
-            m_cachedDocWidth &lt;= m_width)
-            hDocW = qMin( m_cachedDocWidth, s.width() );
+            zoomedDocWidth &lt;= m_width)
+            hDocW = qMin( zoomedDocWidth, s.width() );
 
         if (!hss &amp;&amp; m_height - m_view-&gt;horizontalScrollBar()-&gt;sizeHint().height() == s.height() &amp;&amp;
-            m_cachedDocHeight &lt;= m_height)
-            hDocH = qMin( m_cachedDocHeight, s.height() );
+            zoomedDocHeight &lt;= m_height)
+            hDocH = qMin( zoomedDocHeight, s.height() );
 
         // likewise, if a scrollbar is shown, and we have a cunning plan to turn it off,
         // think again if we are falling downright in the hysteresis zone
 
-        if (vss &amp;&amp; s.width() &gt; m_cachedDocWidth &amp;&amp; m_cachedDocWidth &gt; m_view-&gt;visibleWidth())
+        if (vss &amp;&amp; s.width() &gt; zoomedDocWidth &amp;&amp; zoomedDocWidth &gt; m_view-&gt;visibleWidth())
             hDocW = s.width()+1;
 
-        if (hss &amp;&amp; s.height() &gt; m_cachedDocHeight &amp;&amp; m_cachedDocHeight &gt; m_view-&gt;visibleHeight())
+        if (hss &amp;&amp; s.height() &gt; zoomedDocHeight &amp;&amp; zoomedDocHeight &gt; m_view-&gt;visibleHeight())
             hDocH = s.height()+1;
 
         m_view-&gt;resizeContents(hDocW, hDocH);
--- trunk/KDE/kdelibs/khtml/rendering/render_replaced.cpp #630478:630479
@@ -524,7 +524,7 @@
     }
     m_view-&gt;setWidgetVisible(this, true);
     if (!khtmlw)
-        m_widget-&gt;move( xPos, yPos );
+        m_view-&gt;addChild( m_widget, xPos, yPos );
     else
         m_widget-&gt;move( xPos, -500000 +yPos);
     m_widget-&gt;show();
--- trunk/KDE/kdelibs/khtml/xml/dom_nodeimpl.cpp #630478:630479
@@ -503,6 +503,8 @@
     int exceptioncode = 0;
     int pageX = _mouse-&gt;x();
     int pageY = _mouse-&gt;y();
+    if ( getDocument()-&gt;view() )
+        getDocument()-&gt;view()-&gt;revertTransforms( pageX, pageY );
     int clientX = pageX;
     int clientY = pageY;
     if ( getDocument()-&gt;view() )
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3378</attachid>
            <date>2003-11-24 15:45:50 +0000</date>
            <delta_ts>2003-11-24 15:55:45 +0000</delta_ts>
            <desc>example of jumping elements</desc>
            <filename>konqueror.html</filename>
            <type>text/html</type>
            <size>1810</size>
            <attacher name="Panther Wyvern">panther</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgU3RyaWN0Ly9FTiIg
Imh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L3N0cmljdC5kdGQiPgo8aHRtbD4KPGhlYWQ+Cgo8
c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoKI2V4YW1wbGVfb25lIHsKCXBvc2l0aW9uOiBmaXhlZDsK
CWxlZnQ6IDBweDsKCXRvcDogMHB4OwoJd2lkdGg6IDgwcHg7Cglmb250LXNpemU6IHNtYWxsOwo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C9ib2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3379</attachid>
            <date>2003-11-24 15:47:43 +0000</date>
            <delta_ts>2003-11-24 15:47:43 +0000</delta_ts>
            <desc>small html file loaded into main document via &lt;object&gt;</desc>
            <filename>ex1.html</filename>
            <type>text/html</type>
            <size>431</size>
            <attacher name="Panther Wyvern">panther</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFs
Ly9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L2xvb3NlLmR0ZCI+Cgo8c3R5bGUgdHlw
ZT0idGV4dC9jc3MiPgojZXhhbXBsZV9vbmUgewoJbGVmdDogMHB4OwoJYm90dG9tOiAwcHg7Cgl3
aWR0aDogODBweDsKCWZvbnQtc2l6ZTogc21hbGw7Cgl9Cjwvc3R5bGU+Cgo8aHRtbD4KPGhlYWQ+
CiAgPHRpdGxlPlNtYWxsIEV4YW1wbGUgRmlsZSBPbmU8L3RpdGxlPgogIDxtZXRhIG5hbWU9IkdF
TkVSQVRPUiIgY29udGVudD0iUXVhbnRhIFBsdXMiPgo8L2hlYWQ+Cjxib2R5PgoKPGRpdiBpZD0i
ZXhhbXBsZV9vbmUiPjxwPlRoaXMgaXMgYSBwYXJhZ3JhcGggaW4gYSBmaWxlIGNhbGxlZCBleDEu
aHRtbC48L3A+PC9kaXY+Cgo8L2JvZHk+CjwvaHRtbD4=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3380</attachid>
            <date>2003-11-24 15:48:21 +0000</date>
            <delta_ts>2003-11-24 15:48:21 +0000</delta_ts>
            <desc>small html file loaded into main document via &lt;object&gt;</desc>
            <filename>ex2.html</filename>
            <type>text/html</type>
            <size>428</size>
            <attacher name="Panther Wyvern">panther</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgVHJhbnNpdGlvbmFs
Ly9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L2xvb3NlLmR0ZCI+Cgo8c3R5bGUgdHlw
ZT0idGV4dC9jc3MiPgojZXhhbXBsZV9vbmUgewoJbGVmdDogMHB4OwoJdG9wOiAwcHg7Cgl3aWR0
aDogODBweDsKCWZvbnQtc2l6ZTogc21hbGw7Cgl9Cjwvc3R5bGU+Cgo8aHRtbD4KPGhlYWQ+CiAg
PHRpdGxlPlNtYWxsIEV4YW1wbGUgRmlsZSBPbmU8L3RpdGxlPgogIDxtZXRhIG5hbWU9IkdFTkVS
QVRPUiIgY29udGVudD0iUXVhbnRhIFBsdXMiPgo8L2hlYWQ+Cjxib2R5PgoKPGRpdiBpZD0iZXhh
bXBsZV9vbmUiPjxwPlRoaXMgaXMgYSBwYXJhZ3JhcGggaW4gYSBmaWxlIGNhbGxlZCBleDIuaHRt
bC48L3A+PC9kaXY+Cgo8L2JvZHk+CjwvaHRtbD4=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3381</attachid>
            <date>2003-11-24 15:55:45 +0000</date>
            <delta_ts>2003-11-24 15:55:45 +0000</delta_ts>
            <desc>example of jumping elements</desc>
            <filename>konqueror.html</filename>
            <type>text/html</type>
            <size>1902</size>
            <attacher name="Panther Wyvern">panther</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMDEgU3RyaWN0Ly9FTiIg
Imh0dHA6Ly93d3cudzMub3JnL1RSL2h0bWw0L3N0cmljdC5kdGQiPgo8aHRtbD4KPGhlYWQ+Cgo8
c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoKI2V4YW1wbGVfb25lIHsKCXBvc2l0aW9uOiBmaXhlZDsK
CWxlZnQ6IDBwe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