when the fieldset has auto height. This is a nifty undocumented behavior
of the fieldset element. The bug is 3898.
Reviewed by mjs
Added fast/forms/fieldset-with-float.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlock):
* rendering/RenderFieldset.h:
(WebCore::RenderFieldset::renderName):
(WebCore::RenderFieldset::expandsToEncloseOverhangingFloats):
* rendering/RenderObject.h:
(WebCore::RenderObject::expandsToEncloseOverhangingFloats):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::expandsToEncloseOverhangingFloats):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16319
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-09-12 David Hyatt <hyatt@apple.com>
+
+ Fix fieldsets so that they properly expand to enclose overhanging floats
+ when the fieldset has auto height. This is a nifty undocumented behavior
+ of the fieldset element. The bug is 3898.
+
+ Reviewed by mjs
+
+ Added fast/forms/fieldset-with-float.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::layoutBlock):
+ * rendering/RenderFieldset.h:
+ (WebCore::RenderFieldset::renderName):
+ (WebCore::RenderFieldset::expandsToEncloseOverhangingFloats):
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::expandsToEncloseOverhangingFloats):
+ * rendering/RenderTableCell.h:
+ (WebCore::RenderTableCell::expandsToEncloseOverhangingFloats):
+
2006-09-11 Eric Seidel <eric@eseidel.com>
Reviewed by hyatt.
m_height = m_overflowHeight + borderBottom() + paddingBottom();
}
- if (hasOverhangingFloats() && ((isFloating() && style()->height().isAuto()) || isTableCell())) {
+ // Some classes of objects (floats and fieldsets with no specified heights and table cells) expand to encompass
+ // overhanging floats.
+ if (hasOverhangingFloats() && expandsToEncloseOverhangingFloats()) {
m_height = floatBottom();
m_height += borderBottom() + paddingBottom();
}
namespace WebCore {
- class HTMLGenericFormElement;
+class HTMLGenericFormElement;
- class RenderFieldset : public RenderBlock {
- public:
- RenderFieldset(HTMLGenericFormElement*);
+class RenderFieldset : public RenderBlock {
+public:
+ RenderFieldset(HTMLGenericFormElement*);
- virtual const char* renderName() const { return "RenderFieldSet"; }
+ virtual const char* renderName() const { return "RenderFieldSet"; }
- virtual RenderObject* layoutLegend(bool relayoutChildren);
+ virtual RenderObject* layoutLegend(bool relayoutChildren);
- virtual void setStyle(RenderStyle*);
-
- private:
- virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
- void paintBorderMinusLegend(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, int lx, int lw);
- RenderObject* findLegend();
- };
+ virtual void setStyle(RenderStyle*);
+
+ virtual bool expandsToEncloseOverhangingFloats() const { return style()->height().isAuto(); }
+
+private:
+ virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
+ void paintBorderMinusLegend(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, int lx, int lw);
+ RenderObject* findLegend();
+};
} // namespace WebCore
virtual bool containsFloats() { return false; }
virtual bool containsFloat(RenderObject* o) { return false; }
virtual bool hasOverhangingFloats() { return false; }
+ virtual bool expandsToEncloseOverhangingFloats() const { return isFloating() && style()->height().isAuto(); }
virtual IntRect floatRect() const { return borderBox(); }
virtual void removePositionedObjects(RenderBlock*) { }
virtual void setWidth(int);
virtual void setStyle(RenderStyle*);
+ virtual bool expandsToEncloseOverhangingFloats() const { return true; }
+
int borderLeft() const;
int borderRight() const;
int borderTop() const;