[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
hyatt
hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:54:35 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit e732e8773af3186a292a4c9951445eda220a9272
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Aug 28 21:24:07 2003 +0000
Fix for 3381377, fix the calcBlockMinMaxWidth function to not use the
renderobject's computed margins except when it has to. This makes
table cells with align=right not mess up and fixes margin problems
in general with floated elements and table cells.
Since XUL boxes also use a similar function and since it had a similar
error, vertical XUL boxes have been patched as well.
Reviewed by gramps
* khtml/rendering/render_block.cpp:
* khtml/rendering/render_flexbox.cpp:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index bfe5a1a..91e6905 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,20 @@
2003-08-28 David Hyatt <hyatt at apple.com>
+ Fix for 3381377, fix the calcBlockMinMaxWidth function to not use the
+ renderobject's computed margins except when it has to. This makes
+ table cells with align=right not mess up and fixes margin problems
+ in general with floated elements and table cells.
+
+ Since XUL boxes also use a similar function and since it had a similar
+ error, vertical XUL boxes have been patched as well.
+
+ Reviewed by gramps
+
+ * khtml/rendering/render_block.cpp:
+ * khtml/rendering/render_flexbox.cpp:
+
+2003-08-28 David Hyatt <hyatt at apple.com>
+
Fix for 3398463, a regression caused by an unintended line movement.
<br/> was no longer being treated just like <br> in HTML.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index bfe5a1a..91e6905 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,20 @@
2003-08-28 David Hyatt <hyatt at apple.com>
+ Fix for 3381377, fix the calcBlockMinMaxWidth function to not use the
+ renderobject's computed margins except when it has to. This makes
+ table cells with align=right not mess up and fixes margin problems
+ in general with floated elements and table cells.
+
+ Since XUL boxes also use a similar function and since it had a similar
+ error, vertical XUL boxes have been patched as well.
+
+ Reviewed by gramps
+
+ * khtml/rendering/render_block.cpp:
+ * khtml/rendering/render_flexbox.cpp:
+
+2003-08-28 David Hyatt <hyatt at apple.com>
+
Fix for 3398463, a regression caused by an unintended line movement.
<br/> was no longer being treated just like <br> in HTML.
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index ddcae70..7ce84cb 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -2274,51 +2274,39 @@ void RenderBlock::calcBlockMinMaxWidth()
RenderObject *child = firstChild();
while(child != 0)
{
- // positioned children don't affect the minmaxwidth
- if (child->isPositioned())
- {
+ // Positioned children don't affect the min/max width
+ if (child->isPositioned()) {
child = child->nextSibling();
continue;
}
- int margin=0;
- // auto margins don't affect minwidth
-
Length ml = child->style()->marginLeft();
Length mr = child->style()->marginRight();
- if (style()->textAlign() == KHTML_CENTER)
- {
- if (ml.type==Fixed) margin+=ml.value;
- if (mr.type==Fixed) margin+=mr.value;
- }
- else
- {
- // Call calcWidth on the child to ensure that our margins are
- // up to date. This method can be called before the child has actually
- // calculated its margins (which are computed inside calcWidth).
- child->calcWidth();
-
- if (!(ml.type==Variable) && !(mr.type==Variable))
- {
- if (!(child->style()->width().type==Variable))
- {
- if (child->style()->direction()==LTR)
- margin = child->marginLeft();
- else
- margin = child->marginRight();
- }
- else
- margin = child->marginLeft()+child->marginRight();
-
- }
- else if (!(ml.type == Variable))
- margin = child->marginLeft();
- else if (!(mr.type == Variable))
- margin = child->marginRight();
- }
-
- if (margin<0) margin=0;
+ // Call calcWidth on the child to ensure that our margins are
+ // up to date. This method can be called before the child has actually
+ // calculated its margins (which are computed inside calcWidth).
+ if (ml.type == Percent || mr.type == Percent)
+ calcWidth();
+
+ // A margin basically has three types: fixed, percentage, and auto (variable).
+ // Auto margins simply become 0 when computing min/max width.
+ // Fixed margins can be added in as is.
+ // Percentage margins are computed as a percentage of the width we calculated in
+ // the calcWidth call above. In this case we use the actual cached margin values on
+ // the RenderObject itself.
+ int margin = 0;
+ if (ml.type == Fixed)
+ margin += ml.value;
+ else if (ml.type == Percent)
+ margin += child->marginLeft();
+
+ if (mr.type == Fixed)
+ margin += mr.value;
+ else if (mr.type == Percent)
+ margin += child->marginRight();
+
+ if (margin < 0) margin = 0;
int w = child->minWidth() + margin;
if(m_minWidth < w) m_minWidth = w;
diff --git a/WebCore/khtml/rendering/render_flexbox.cpp b/WebCore/khtml/rendering/render_flexbox.cpp
index 07253c1..6bab9dd 100644
--- a/WebCore/khtml/rendering/render_flexbox.cpp
+++ b/WebCore/khtml/rendering/render_flexbox.cpp
@@ -159,52 +159,40 @@ void RenderFlexibleBox::calcVerticalMinMaxWidth()
RenderObject *child = firstChild();
while(child != 0)
{
- // positioned children don't affect the minmaxwidth
- if (child->isPositioned() || child->style()->visibility() == COLLAPSE)
- {
+ // Positioned children and collapsed children don't affect the min/max width
+ if (child->isPositioned() || child->style()->visibility() == COLLAPSE) {
child = child->nextSibling();
continue;
}
- int margin=0;
- // auto margins don't affect minwidth
-
Length ml = child->style()->marginLeft();
Length mr = child->style()->marginRight();
- if (style()->textAlign() == KHTML_CENTER)
- {
- if (ml.type==Fixed) margin+=ml.value;
- if (mr.type==Fixed) margin+=mr.value;
- }
- else
- {
- // Call calcWidth on the child to ensure that our margins are
- // up to date. This method can be called before the child has actually
- // calculated its margins (which are computed inside calcWidth).
- child->calcWidth();
-
- if (!(ml.type==Variable) && !(mr.type==Variable))
- {
- if (!(child->style()->width().type==Variable))
- {
- if (child->style()->direction()==LTR)
- margin = child->marginLeft();
- else
- margin = child->marginRight();
- }
- else
- margin = child->marginLeft()+child->marginRight();
-
- }
- else if (!(ml.type == Variable))
- margin = child->marginLeft();
- else if (!(mr.type == Variable))
- margin = child->marginRight();
- }
-
- if (margin<0) margin=0;
+ // Call calcWidth on the child to ensure that our margins are
+ // up to date. This method can be called before the child has actually
+ // calculated its margins (which are computed inside calcWidth).
+ if (ml.type == Percent || mr.type == Percent)
+ calcWidth();
+
+ // A margin basically has three types: fixed, percentage, and auto (variable).
+ // Auto margins simply become 0 when computing min/max width.
+ // Fixed margins can be added in as is.
+ // Percentage margins are computed as a percentage of the width we calculated in
+ // the calcWidth call above. In this case we use the actual cached margin values on
+ // the RenderObject itself.
+ int margin = 0;
+ if (ml.type == Fixed)
+ margin += ml.value;
+ else if (ml.type == Percent)
+ margin += child->marginLeft();
+
+ if (mr.type == Fixed)
+ margin += mr.value;
+ else if (mr.type == Percent)
+ margin += child->marginRight();
+ if (margin < 0) margin = 0;
+
int w = child->minWidth() + margin;
if(m_minWidth < w) m_minWidth = w;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list