Summary: | Background-attachment: scroll should scroll within the containing block, not within the viewport | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Gérard Talbot (no longer involved) <browserbugs2> |
Component: | khtml renderer | Assignee: | Konqueror Developers <konq-bugs> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | germain |
Priority: | NOR | ||
Version: | 4.1.0 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | Version Fixed In: |
Description
Gérard Talbot (no longer involved)
2008-08-22 20:43:55 UTC
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 <body> element, at all times, regardless of browser window viewport vertical dimension/height. CSS 2.1, section 14.2 The Background states: " The background of the root element becomes the background of the canvas and covers the entire canvas, anchored (for 'background-position') 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. " 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. 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 <apapirovski mac dot com> 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's background box 'spills out' 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); I get expected results with Konqueror 4.1.3 for Windows. Marking as VERIFIED |