[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:23:35 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 19cf3edd5ececbe4eed2b147699dc6c19efe8253
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Feb 5 00:47:08 2003 +0000
Patch calcInlineMaxWidth to add in left/right margins/borders/padding
separately (since the inline could break across multiple lines).
Reviewed by darin
* khtml/rendering/render_block.cpp:
(RenderBlock::calcInlineMinMaxWidth):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 4b85d9b..a3e7f5e 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,13 @@
+2003-02-04 David Hyatt <hyatt at apple.com>
+
+ Patch calcInlineMaxWidth to add in left/right margins/borders/padding
+ separately (since the inline could break across multiple lines).
+
+ Reviewed by darin
+
+ * khtml/rendering/render_block.cpp:
+ (RenderBlock::calcInlineMinMaxWidth):
+
2003-02-04 Maciej Stachowiak <mjs at apple.com>
Reviewed by Darin.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 4b85d9b..a3e7f5e 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,13 @@
+2003-02-04 David Hyatt <hyatt at apple.com>
+
+ Patch calcInlineMaxWidth to add in left/right margins/borders/padding
+ separately (since the inline could break across multiple lines).
+
+ Reviewed by darin
+
+ * khtml/rendering/render_block.cpp:
+ (RenderBlock::calcInlineMinMaxWidth):
+
2003-02-04 Maciej Stachowiak <mjs at apple.com>
Reviewed by Darin.
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 6387cb8..7bc6145 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -37,9 +37,10 @@
#include "khtmlview.h"
#include "htmltags.h"
-using namespace khtml;
using namespace DOM;
+namespace khtml {
+
RenderBlock::RenderBlock(DOM::NodeImpl* node)
:RenderFlow(node)
{
@@ -1819,6 +1820,28 @@ RenderObject* InlineMinMaxIterator::next()
return current;
}
+static int getBPMWidth(int childValue, Length cssUnit)
+{
+ if (cssUnit.type != Variable)
+ return (cssUnit.type == Fixed ? cssUnit.value : childValue);
+ return 0;
+}
+
+static int getBorderPaddingMargin(RenderObject* child, bool endOfInline)
+{
+ RenderStyle* cstyle = child->style();
+ int result = 0;
+ bool leftSide = (cstyle->direction() == LTR) ? !endOfInline : endOfInline;
+ result += getBPMWidth((leftSide ? child->marginLeft() : child->marginRight()),
+ (leftSide ? cstyle->marginLeft() :
+ cstyle->marginRight()));
+ result += getBPMWidth((leftSide ? child->paddingLeft() : child->paddingRight()),
+ (leftSide ? cstyle->paddingLeft() :
+ cstyle->paddingRight()));
+ result += leftSide ? child->borderLeft() : child->borderRight();
+ return result;
+}
+
void RenderBlock::calcInlineMinMaxWidth()
{
int inlineMax=0;
@@ -1849,11 +1872,7 @@ void RenderBlock::calcInlineMinMaxWidth()
// Children fall into three categories:
// (1) An inline flow object. These objects always have a min/max of 0,
// and are included in the iteration solely so that their margins can
- // be added in. XXXdwh Just adding in the margins is totally bogus, since
- // a <span> could wrap to multiple lines. Technically the left margin should
- // be considered part of the first descendant's start, and the right margin
- // should be considered part of the last descendant's end. Leave this alone
- // for now, but fix later.
+ // be added in.
//
// (2) An inline non-text non-flow object, e.g., an inline replaced element.
// These objects can always be on a line by themselves, so in this situation
@@ -1884,35 +1903,30 @@ void RenderBlock::calcInlineMinMaxWidth()
short childMin = 0;
short childMax = 0;
- if (!child->isText() && !childIterator.endOfInline) {
- // Case (1) and (2). Inline replaced and inline flow elements. Both
- // add in their margins to their min/max values.
- int margins = 0;
- LengthType type = cstyle->marginLeft().type;
- if ( type != Variable )
- margins += (type == Fixed ? cstyle->marginLeft().value : child->marginLeft());
- type = cstyle->marginRight().type;
- if ( type != Variable )
- margins += (type == Fixed ? cstyle->marginRight().value : child->marginRight());
- childMin += margins;
- childMax += margins;
-
+ if (!child->isText()) {
+ // Case (1) and (2). Inline replaced and inline flow elements.
if (child->isRenderInline() || child->isRunIn()) {
- // Add in padding for inline flow elements. This is wrong in the
- // same way the margin addition is wrong. XXXdwh fixme.
- int padding = 0;
- type = cstyle->paddingLeft().type;
- if ( type != Variable )
- padding += (type == Fixed ? cstyle->paddingLeft().value : child->paddingLeft());
- type = cstyle->paddingRight().type;
- if ( type != Variable )
- padding += (type == Fixed ? cstyle->paddingRight().value : child->paddingRight());
- childMin += padding;
- childMax += padding;
+ // Add in padding/border/margin from the appropriate side of
+ // the element.
+ int bpm = getBorderPaddingMargin(child, childIterator.endOfInline);
+ childMin += bpm;
+ childMax += bpm;
inlineMin += childMin;
inlineMax += childMax;
}
+ else {
+ // Inline replaced elts add in their margins to their min/max values.
+ int margins = 0;
+ LengthType type = cstyle->marginLeft().type;
+ if ( type != Variable )
+ margins += (type == Fixed ? cstyle->marginLeft().value : child->marginLeft());
+ type = cstyle->marginRight().type;
+ if ( type != Variable )
+ margins += (type == Fixed ? cstyle->marginRight().value : child->marginRight());
+ childMin += margins;
+ childMax += margins;
+ }
}
if (!child->isRenderInline() && !child->isText()) {
@@ -2185,4 +2199,5 @@ void RenderBlock::dump(QTextStream *stream, QString ind) const
#undef DEBUG_LAYOUT
#undef BOX_DEBUG
+} // namespace khtml
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list