Reviewed by Hyatt.
- tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=9100
Absolutely positioned replaced elements with all non-auto
values are rendered incorrectly
* fast/replaced/absolute-position-with-auto-height-and-top-and-bottom.html: Added.
* fast/replaced/absolute-position-with-auto-width-and-left-and-right.html: Added.
WebCore:
Reviewed by Hyatt.
- fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9100
Absolutely positioned replaced elements with all non-auto
values are rendered incorrectly
* rendering/RenderBox.cpp:
(WebCore::RenderBox::calcAbsoluteHorizontalReplaced): Add support for case when all values are specified.
(WebCore::RenderBox::calcAbsoluteVerticalReplaced): ditto
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14660
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-05-31 Sam Weinig <sam.weinig@gmail.com>
+
+ Reviewed by Hyatt.
+
+ - tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=9100
+ Absolutely positioned replaced elements with all non-auto
+ values are rendered incorrectly
+
+ * fast/replaced/absolute-position-with-auto-height-and-top-and-bottom.html: Added.
+ * fast/replaced/absolute-position-with-auto-width-and-left-and-right.html: Added.
+
2006-05-31 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
--- /dev/null
+7c2c9a97550ccfa36e26d91d33eccfc9
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {P} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 643x18
+ text run at (0,0) width 643: "The blue box should be vertically centered in the black box with 25px of white on the top and bottom."
+layer at (8,42) size 104x154
+ RenderBlock (relative positioned) {DIV} at (0,34) size 104x154 [border: (2px solid #000000)]
+layer at (10,69) size 100x100
+ RenderImage {IMG} at (2,27) size 100x100
--- /dev/null
+<html>
+<head>
+ <style>
+ #a { position: relative; height: 150px; width: 100px; border: 2px solid black; }
+ #b { position: absolute; top: 25px; height: auto; bottom: 25px; }
+ </style>
+</head>
+<body>
+ <p>The blue box should be vertically centered in the black box with 25px of white on the top and bottom.</p>
+ <div id="a">
+ <img id="b" src="resources/square-blue-100x100.png">
+ </div>
+</body>
+</html>
--- /dev/null
+24defc3ccdedcb7938777165b00e5a53
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {P} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 645x18
+ text run at (0,0) width 645: "The blue box should be horizontally centered in the black box with 25px of white on the left and right."
+layer at (8,42) size 154x104
+ RenderBlock (relative positioned) {DIV} at (0,34) size 154x104 [border: (2px solid #000000)]
+layer at (35,44) size 100x100
+ RenderImage {IMG} at (27,2) size 100x100
--- /dev/null
+<html>
+<head>
+ <style>
+ #a { position: relative; height: 100px; width: 150px; border: 2px solid black; }
+ #b { position: absolute; left: 25px; height: auto; right: 25px; }
+ </style>
+</head>
+<body>
+ <p>The blue box should be horizontally centered in the black box with 25px of white on the left and right.</p>
+ <div id="a">
+ <img id="b" src="resources/square-blue-100x100.png">
+ </div>
+</body>
+</html>
+2006-05-31 Sam Weinig <sam.weinig@gmail.com>
+
+ Reviewed by Hyatt.
+
+ - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9100
+ Absolutely positioned replaced elements with all non-auto
+ values are rendered incorrectly
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::calcAbsoluteHorizontalReplaced): Add support for case when all values are specified.
+ (WebCore::RenderBox::calcAbsoluteVerticalReplaced): ditto
+
2006-05-31 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
// Solve for 'margin-right'
m_marginRight = availableSpace - (leftValue + rightValue + m_marginLeft);
+ } else {
+ // Nothing is 'auto', just calculate the values.
+ m_marginLeft = marginLeft.calcValue(containerWidth);
+ m_marginRight = marginRight.calcValue(containerWidth);
+ rightValue = right.calcValue(containerWidth);
+ leftValue = left.calcValue(containerWidth);
}
/*-----------------------------------------------------------------------*\
// Solve for 'margin-bottom'
m_marginBottom = availableSpace - (topValue + bottomValue + m_marginTop);
- }
+ } else {
+ // Nothing is 'auto', just calculate the values.
+ m_marginTop = marginTop.calcValue(containerHeight);
+ m_marginBottom = marginBottom.calcValue(containerHeight);
+ topValue = top.calcValue(containerHeight);
+ // NOTE: It is not necessary to solve for 'bottom' because we don't ever
+ // use the value.
+ }
/*-----------------------------------------------------------------------*\
* 6. If at this point the values are over-constrained, ignore the value