Commit 63ccccdb authored by mitz@apple.com's avatar mitz@apple.com

WebCore:

2008-05-01  Anatoli Papirovski  <apapirovski@mac.com>

        Reviewed by Dave Hyatt.

        - fix https://bugs.webkit.org/show_bug.cgi?id=18347
          Absolutely positioned image percentage width does not respect container's padding

        Test: fast/replaced/absolute-position-percentage-width.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::calcReplacedWidthUsing):

LayoutTests:

2008-05-01  Anatoli Papirovski  <apapirovski@mac.com>

        Reviewed by Dave Hyatt.

        - added a test case for https://bugs.webkit.org/show_bug.cgi?id=18347
          Absolutely positioned image percentage width does not respect container's padding

        * fast/replaced/absolute-position-percentage-width.html: Added.
        * platform/mac/fast/replaced/absolute-position-percentage-width-expected.checksum: Added.
        * platform/mac/fast/replaced/absolute-position-percentage-width-expected.png: Added.
        * platform/mac/fast/replaced/absolute-position-percentage-width-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 62b1949d
2008-05-01 Anatoli Papirovski <apapirovski@mac.com>
Reviewed by Dave Hyatt.
- added a test case for https://bugs.webkit.org/show_bug.cgi?id=18347
Absolutely positioned image percentage width does not respect container's padding
* fast/replaced/absolute-position-percentage-width.html: Added.
* platform/mac/fast/replaced/absolute-position-percentage-width-expected.checksum: Added.
* platform/mac/fast/replaced/absolute-position-percentage-width-expected.png: Added.
* platform/mac/fast/replaced/absolute-position-percentage-width-expected.txt: Added.
2008-04-29 Eric Seidel <eric@webkit.org>
Rubber-stamped by Sam Weinig.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Percentage width of absolute-positioned replaced elements</title>
<style type="text/css">
.box img {
height: 100%;
left: 0px;
position: absolute;
top: 0px;
width: 100%;
z-index: 0;
}
.box {
background-color: red;
border: solid black 2px;
position: relative;
padding: 5px;
width: 300px;
}
.box * {
position: relative;
text-align: center;
z-index: 1;
}
</style>
<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property" title="10.2 Content width: the 'width' property - <percentage> value">
</head>
<body>
<div class="box">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABVJREFUeNpiZPjPgAyYGBgo4gMEGABPkgEJUvO9mgAAAABJRU5ErkJggg==">
<p>There should be no red on this page</p>
</div>
</body>
</html>
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x80
RenderBlock {HTML} at (0,0) size 800x80
RenderBody {BODY} at (8,8) size 784x64
layer at (8,8) size 314x64
RenderBlock (relative positioned) {DIV} at (0,0) size 314x64 [bgcolor=#FF0000] [border: (2px solid #000000)]
layer at (10,10) size 310x60
RenderImage {IMG} at (2,2) size 310x60
layer at (15,31) size 300x18
RenderBlock (relative positioned) zI: 1 {P} at (7,23) size 300x18
RenderText zI: 1 {#text} at (37,0) size 226x18
text run at (37,0) width 226: "There should be no red on this page"
2008-05-01 Anatoli Papirovski <apapirovski@mac.com>
Reviewed by Dave Hyatt.
- fix https://bugs.webkit.org/show_bug.cgi?id=18347
Absolutely positioned image percentage width does not respect container's padding
Test: fast/replaced/absolute-position-percentage-width.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::calcReplacedWidthUsing):
2008-05-01 Dan Bernstein <mitz@apple.com>
- Windows build fix
......@@ -1572,7 +1572,7 @@ int RenderBox::calcReplacedWidthUsing(Length width) const
case Fixed:
return calcContentBoxWidth(width.value());
case Percent: {
const int cw = containingBlockWidth();
const int cw = isPositioned() ? containingBlockWidthForPositioned(container()) : containingBlockWidth();
if (cw > 0)
return calcContentBoxWidth(width.calcMinValue(cw));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment