Commit 5066da21 authored by hyatt's avatar hyatt

Revert the redundancy that dirk noticed.

	Fixing issue #3 on diveintomark.org's list, which actually involved
	merging calcAbsoluteVertical to KHTML's trunk and then fixing
	a math error in the bottom computation.

        Reviewed by NOBODY (OOPS!).

        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::parseAttribute):
        * khtml/rendering/render_box.cpp:
        (RenderBox::calcAbsoluteVertical):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3280 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0ce577a1
2003-01-08 David Hyatt <hyatt@apple.com>
Revert the redundancy that dirk noticed.
Fixing issue #3 on diveintomark.org's list, which actually involved
merging calcAbsoluteVertical to KHTML's trunk and then fixing
a math error in the bottom computation.
Reviewed by NOBODY (OOPS!).
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::parseAttribute):
* khtml/rendering/render_box.cpp:
(RenderBox::calcAbsoluteVertical):
2003-01-08 Chris Blumenberg <cblu@apple.com> 2003-01-08 Chris Blumenberg <cblu@apple.com>
Fixed: 3111432 - Support OBJECT tags with type text/plain or text/html Fixed: 3111432 - Support OBJECT tags with type text/plain or text/html
......
2003-01-08 David Hyatt <hyatt@apple.com>
Revert the redundancy that dirk noticed.
Fixing issue #3 on diveintomark.org's list, which actually involved
merging calcAbsoluteVertical to KHTML's trunk and then fixing
a math error in the bottom computation.
Reviewed by NOBODY (OOPS!).
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::parseAttribute):
* khtml/rendering/render_box.cpp:
(RenderBox::calcAbsoluteVertical):
2003-01-08 Chris Blumenberg <cblu@apple.com> 2003-01-08 Chris Blumenberg <cblu@apple.com>
Fixed: 3111432 - Support OBJECT tags with type text/plain or text/html Fixed: 3111432 - Support OBJECT tags with type text/plain or text/html
......
...@@ -85,17 +85,13 @@ void HTMLBodyElementImpl::parseAttribute(AttributeImpl *attr) ...@@ -85,17 +85,13 @@ void HTMLBodyElementImpl::parseAttribute(AttributeImpl *attr)
break; break;
} }
case ATTR_MARGINWIDTH: case ATTR_MARGINWIDTH:
// Marginwidth applies to both left and right margins -dwh
addCSSLength(CSS_PROP_MARGIN_RIGHT, attr->value() ); addCSSLength(CSS_PROP_MARGIN_RIGHT, attr->value() );
addCSSLength(CSS_PROP_MARGIN_LEFT, attr->value());
/* nobreak; */ /* nobreak; */
case ATTR_LEFTMARGIN: case ATTR_LEFTMARGIN:
addCSSLength(CSS_PROP_MARGIN_LEFT, attr->value() ); addCSSLength(CSS_PROP_MARGIN_LEFT, attr->value() );
break; break;
case ATTR_MARGINHEIGHT: case ATTR_MARGINHEIGHT:
// Marginheight applies to both top and bottom margins -dwh
addCSSLength(CSS_PROP_MARGIN_BOTTOM, attr->value()); addCSSLength(CSS_PROP_MARGIN_BOTTOM, attr->value());
addCSSLength(CSS_PROP_MARGIN_TOP, attr->value());
/* nobreak */ /* nobreak */
case ATTR_TOPMARGIN: case ATTR_TOPMARGIN:
addCSSLength(CSS_PROP_MARGIN_TOP, attr->value()); addCSSLength(CSS_PROP_MARGIN_TOP, attr->value());
......
...@@ -1010,17 +1010,18 @@ void RenderBox::calcAbsoluteVertical() ...@@ -1010,17 +1010,18 @@ void RenderBox::calcAbsoluteVertical()
int pab = borderTop()+borderBottom()+paddingTop()+paddingBottom(); int pab = borderTop()+borderBottom()+paddingTop()+paddingBottom();
Length hl = containingBlock()->style()->height(); RenderObject* cb = containingBlock();
Length hl = cb->style()->height();
if (hl.isFixed()) if (hl.isFixed())
ch = hl.value + containingBlock()->paddingTop() ch = hl.value + cb->paddingTop()
+ containingBlock()->paddingBottom(); + cb->paddingBottom();
else else
ch = containingBlock()->height(); ch = cb->height();
if(!style()->top().isVariable()) if(!style()->top().isVariable())
t = style()->top().width(ch); t = style()->top().width(ch) + cb->borderTop();
if(!style()->bottom().isVariable()) if(!style()->bottom().isVariable())
b = style()->bottom().width(ch); b = style()->bottom().width(ch) + cb->borderBottom();
if(!style()->height().isVariable()) if(!style()->height().isVariable())
{ {
h = style()->height().width(ch); h = style()->height().width(ch);
...@@ -1053,11 +1054,8 @@ void RenderBox::calcAbsoluteVertical() ...@@ -1053,11 +1054,8 @@ void RenderBox::calcAbsoluteVertical()
if (ro) static_top = ro->yPos()+ro->marginBottom()+ro->height(); if (ro) static_top = ro->yPos()+ro->marginBottom()+ro->height();
RenderObject* po = parent(); for (RenderObject* po = parent(); po && po != cb; po = po->parent())
while (po && po!=containingBlock()) {
static_top+=po->yPos(); static_top+=po->yPos();
po=po->parent();
}
if (h==AUTO || style()->top().isStatic()) if (h==AUTO || style()->top().isStatic())
t = static_top; t = static_top;
...@@ -1143,7 +1141,7 @@ void RenderBox::calcAbsoluteVertical() ...@@ -1143,7 +1141,7 @@ void RenderBox::calcAbsoluteVertical()
m_marginTop = mt; m_marginTop = mt;
m_marginBottom = mb; m_marginBottom = mb;
m_y = t + mt + containingBlock()->borderTop(); m_y = t + mt;
// printf("v: h=%d, t=%d, b=%d, mt=%d, mb=%d, m_y=%d\n",h,t,b,mt,mb,m_y); // printf("v: h=%d, t=%d, b=%d, mt=%d, mb=%d, m_y=%d\n",h,t,b,mt,mb,m_y);
......
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