| Summary: | [test case] Negative background-position value spoils no-repeat | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | Wojciech Wierchoła <w2p> |
| Component: | khtml renderer | Assignee: | Konqueror Bugs <konqueror-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
testcase
testcase screenshot |
||
|
Description
Wojciech Wierchoła
2006-09-06 02:16:07 UTC
Created attachment 17647 [details]
testcase
Created attachment 17652 [details]
testcase screenshot
SVN commit 586793 by carewolf:
Clean-up background-paint so we don't forget the case of negative
offset and no-repeat.
BUG:133626
M +11 -21 render_box.cpp
--- branches/KDE/3.5/kdelibs/khtml/rendering/render_box.cpp #586792:586793
@@ -503,37 +503,32 @@
calculateBackgroundSize(bgLayer, scaledImageWidth, scaledImageHeight);
EBackgroundRepeat bgr = bgLayer->backgroundRepeat();
- if ((bgr == NO_REPEAT || bgr == REPEAT_Y) && w > scaledImageWidth) {
+ if (bgr == NO_REPEAT || bgr == REPEAT_Y) {
cw = scaledImageWidth;
int xPosition = bgLayer->backgroundXPosition().minWidth(pw-scaledImageWidth);
if ( xPosition >= 0 ) {
cx = _tx + xPosition;
- cw = kMin(cw, pw - xPosition);
+ cw = kMin(scaledImageWidth, pw - xPosition);
}
else {
cx = _tx;
if (scaledImageWidth > 0) {
sx = -xPosition;
- cw += xPosition;
+ cw = kMin(scaledImageWidth+xPosition, pw);
}
}
cx += left;
} else {
- // repeat over x or background is wider than box
+ // repeat over x
cw = w;
cx = _tx;
if (scaledImageWidth > 0) {
int xPosition = bgLayer->backgroundXPosition().minWidth(pw-scaledImageWidth);
- if ((xPosition > 0) && (bgr == NO_REPEAT)) {
- cx += xPosition;
- cw -= xPosition;
- } else {
- sx = scaledImageWidth - (xPosition % scaledImageWidth);
- sx -= left % scaledImageWidth;
- }
+ sx = scaledImageWidth - (xPosition % scaledImageWidth);
+ sx -= left % scaledImageWidth;
}
}
- if( (bgr == NO_REPEAT || bgr == REPEAT_X) && ph > scaledImageHeight ) {
+ if (bgr == NO_REPEAT || bgr == REPEAT_X) {
ch = scaledImageHeight;
int yPosition = bgLayer->backgroundYPosition().minWidth(ph - scaledImageHeight);
if ( yPosition >= 0 ) {
@@ -544,24 +539,19 @@
cy = _ty;
if (scaledImageHeight > 0) {
sy = -yPosition;
- ch += yPosition;
+ ch = kMin(scaledImageHeight+yPosition, ph);
}
}
cy += top;
} else {
- // repeat over y or background is taller than box
+ // repeat over y
ch = h;
cy = _ty;
if (scaledImageHeight > 0) {
int yPosition = bgLayer->backgroundYPosition().minWidth(ph - scaledImageHeight);
- if ((yPosition > 0) && (bgr == NO_REPEAT)) {
- cy += yPosition;
- ch -= yPosition;
- } else {
- sy = scaledImageHeight - (yPosition % scaledImageHeight);
- sy -= top % scaledImageHeight;
- }
+ sy = scaledImageHeight - (yPosition % scaledImageHeight);
+ sy -= top % scaledImageHeight;
}
}
if (layer())
|