[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:59:59 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 4de1beda126e0b7ef06af54ebeadda74805ab6bf
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 9 00:45:35 2003 +0000
Implement min/max width and min/max height support for replaced elements.
Reviewed by ken
* khtml/rendering/render_box.cpp:
(RenderBox::calcReplacedWidth):
(RenderBox::calcReplacedWidthUsing):
(RenderBox::calcReplacedHeight):
(RenderBox::calcReplacedHeightUsing):
(RenderBox::availableHeight):
(RenderBox::availableHeightUsing):
* khtml/rendering/render_box.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index db18479..a7774dd 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,18 @@
+2003-10-08 David Hyatt <hyatt at apple.com>
+
+ Implement min/max width and min/max height support for replaced elements.
+
+ Reviewed by ken
+
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::calcReplacedWidth):
+ (RenderBox::calcReplacedWidthUsing):
+ (RenderBox::calcReplacedHeight):
+ (RenderBox::calcReplacedHeightUsing):
+ (RenderBox::availableHeight):
+ (RenderBox::availableHeightUsing):
+ * khtml/rendering/render_box.h:
+
2003-10-08 Maciej Stachowiak <mjs at apple.com>
Fix development build.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index db18479..a7774dd 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,18 @@
+2003-10-08 David Hyatt <hyatt at apple.com>
+
+ Implement min/max width and min/max height support for replaced elements.
+
+ Reviewed by ken
+
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::calcReplacedWidth):
+ (RenderBox::calcReplacedWidthUsing):
+ (RenderBox::calcReplacedHeight):
+ (RenderBox::calcReplacedHeightUsing):
+ (RenderBox::availableHeight):
+ (RenderBox::availableHeightUsing):
+ * khtml/rendering/render_box.h:
+
2003-10-08 Maciej Stachowiak <mjs at apple.com>
Fix development build.
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index be1f323..c24e0fc 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -930,9 +930,30 @@ void RenderBox::calcHeight()
short RenderBox::calcReplacedWidth() const
{
- Length w = style()->width();
+ int width = calcReplacedWidthUsing(Width);
+ int minW = calcReplacedWidthUsing(MinWidth);
+ int maxW = style()->maxWidth().value == UNDEFINED ? width : calcReplacedWidthUsing(MaxWidth);
- switch( w.type ) {
+ if (width > maxW)
+ width = maxW;
+
+ if (width < minW)
+ width = minW;
+
+ return width;
+}
+
+int RenderBox::calcReplacedWidthUsing(WidthType widthType) const
+{
+ Length w;
+ if (widthType == Width)
+ w = style()->width();
+ else if (widthType == MinWidth)
+ w = style()->minWidth();
+ else
+ w = style()->maxWidth();
+
+ switch (w.type) {
case Fixed:
return w.value;
case Percent:
@@ -951,12 +972,31 @@ short RenderBox::calcReplacedWidth() const
int RenderBox::calcReplacedHeight() const
{
- const Length& h = style()->height();
+ int height = calcReplacedHeightUsing(Height);
+ int minH = calcReplacedHeightUsing(MinHeight);
+ int maxH = style()->maxHeight().value == UNDEFINED ? height : calcReplacedHeightUsing(MaxHeight);
+
+ if (height > maxH)
+ height = maxH;
+
+ if (height < minH)
+ height = minH;
+
+ return height;
+}
+
+int RenderBox::calcReplacedHeightUsing(HeightType heightType) const
+{
+ Length h;
+ if (heightType == Height)
+ h = style()->height();
+ else if (heightType == MinHeight)
+ h = style()->minHeight();
+ else
+ h = style()->maxHeight();
switch( h.type ) {
- case Percent: {
- int ah = availableHeight();
- return ah;
- }
+ case Percent:
+ return availableHeightUsing(h);
case Fixed:
return h.value;
default:
@@ -966,8 +1006,11 @@ int RenderBox::calcReplacedHeight() const
int RenderBox::availableHeight() const
{
- Length h = style()->height();
+ return availableHeightUsing(style()->height());
+}
+int RenderBox::availableHeightUsing(const Length& h) const
+{
if (h.isFixed())
return h.value;
diff --git a/WebCore/khtml/rendering/render_box.h b/WebCore/khtml/rendering/render_box.h
index 3df449b..3a27639 100644
--- a/WebCore/khtml/rendering/render_box.h
+++ b/WebCore/khtml/rendering/render_box.h
@@ -32,6 +32,7 @@ namespace khtml {
class CachedObject;
enum WidthType { Width, MinWidth, MaxWidth };
+ enum HeightType { Height, MinHeight, MaxHeight };
class RenderBox : public RenderContainer
{
@@ -101,11 +102,14 @@ public:
virtual void calcHeight();
int calcWidthUsing(WidthType widthType, int cw, LengthType& lengthType);
+ int calcReplacedWidthUsing(WidthType widthType) const;
+ int calcReplacedHeightUsing(HeightType heightType) const;
virtual short calcReplacedWidth() const;
virtual int calcReplacedHeight() const;
virtual int availableHeight() const;
+ int availableHeightUsing(const Length& h) const;
void calcVerticalMargins();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list