<?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>169608</bug_id>
          
          <creation_ts>2008-08-22 20:43:55 +0000</creation_ts>
          <short_desc>Background-attachment: scroll should scroll within the containing block, not within the viewport</short_desc>
          <delta_ts>2009-01-26 12:19:52 +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>4.1.0</version>
          <rep_platform>Microsoft Windows</rep_platform>
          <op_sys>Microsoft Windows</op_sys>
          <bug_status>VERIFIED</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>0</everconfirmed>
          <reporter name="Gérard Talbot (no longer involved)">browserbugs2</reporter>
          <assigned_to name="Konqueror Bugs">konqueror-bugs-null</assigned_to>
          <cc>germain</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>640055</commentid>
    <comment_count>0</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2008-08-22 20:43:55 +0000</bug_when>
    <thetext>Version:            (using KDE 4.1.0)
Compiler:          cc 
OS:                Linux
Installed from:    Debian stable Packages

According to CSS 1, section 5.3.5 and CSS 2.1, section 14.2.1, when background-attachment is scroll, then an image should scroll within its containing block, not within the viewport.

Instructions: resize vertically the browser window to change the vertical dimension of the viewport.

Expected results: the lime squared + image should remain vertically in the middle of its containining block, which is the body which has a lime border. The lime squared + image should not scroll up and down.

Relevant URLs:

http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/#bug7

http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/BackgroundCenterOfBodyBugInIE7.html

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

Regards, Gérard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>640373</commentid>
    <comment_count>1</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2008-08-23 23:10:14 +0000</bug_when>
    <thetext>Konqueror 4.1 / Windows XP screenshot:

http://browsershots.org/http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/BackgroundCenterOfBodyBugInIE7.html

http://browsershots.org/screenshots/c499d76efbc8944534c54e66b90adf49/

http://api.browsershots.org/png/original/c4/c499d76efbc8944534c54e66b90adf49.png

In such screenshot, the lime square [+] image should be vertically in the middle of the lime bordered &lt;body&gt; element, at all times, regardless of browser window viewport vertical dimension/height.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>642478</commentid>
    <comment_count>2</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2008-08-31 18:48:01 +0000</bug_when>
    <thetext>CSS 2.1, section 14.2 The Background states:
&quot;
The background of the root element becomes the background of the canvas and covers the entire canvas, anchored (for &apos;background-position&apos;) at the same point as it would be if it was painted only for the root element itself. The root element does not paint this background again. 
&quot;
http://www.w3.org/TR/CSS21/colors.html#background

indicating that the background-origin to be considered for background-position is relative to the root element, not the canvas. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>642565</commentid>
    <comment_count>3</comment_count>
    <who name="Germain Garand">germain</who>
    <bug_when>2008-09-01 02:07:34 +0000</bug_when>
    <thetext>SVN commit 855521 by ggarand:

Consider the real root background box when computing some background
properties - not the one that is extended on the whole canvas.

Patch based on work by Anatoli Papirovski &lt;apapirovski mac dot com&gt;

BUG: 169608


 M  +15 -2     render_box.cpp  


--- trunk/KDE/kdelibs/khtml/rendering/render_box.cpp #855520:855521
@@ -575,8 +575,21 @@
                 }
             }
 
-            int pw = w - hpab;
-            int ph = h - vpab;
+            int pw, ph;
+            if (isRoot()) {
+                // the root&apos;s background box &apos;spills out&apos; to cover the whole canvas, so we have to
+                // go back to its true edge for the purpose of computing background-size
+                // and honouring background-origin
+                pw = width() - hpab;
+                ph = height() - vpab; 
+                left += marginLeft();
+                hpab += marginLeft() + marginRight();
+                vpab += marginTop() + marginBottom();
+                top += marginTop();
+            } else {
+                pw = w - hpab;
+                ph = h - vpab;
+            }
             scaledImageWidth = pw;
             scaledImageHeight = ph;
             calculateBackgroundSize(bgLayer, scaledImageWidth, scaledImageHeight);
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>705884</commentid>
    <comment_count>4</comment_count>
    <who name="Gérard Talbot (no longer involved)">browserbugs2</who>
    <bug_when>2009-01-26 12:19:52 +0000</bug_when>
    <thetext>I get expected results with Konqueror 4.1.3 for Windows.
Marking as VERIFIED</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>