Fix for bugzilla bugs 10895 and 6336, fieldsets misbehaving when floats
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Sep 2006 15:27:04 +0000 (15:27 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 17 Sep 2006 15:27:04 +0000 (15:27 +0000)
        are declared right before the fieldsets.  It turns out fieldsets in other
        browsers avoid floats (like overflow:auto/hidden/scroll sections do), so
        adding that behavior to fieldset fixes the bug.

        Made avoidsFloats virtual and did some refactoring to make tables, flexboxes
        and fieldsets all subclass.

        Reviewed by anders

        Added fast/forms/float-before-fieldset.html

        * rendering/RenderFieldset.h:
        (WebCore::RenderFieldset::avoidsFloats):
        * rendering/RenderFlexibleBox.h:
        (WebCore::RenderFlexibleBox::avoidsFloats):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::avoidsFloats):
        * rendering/RenderObject.h:
        * rendering/RenderTable.h:
        (WebCore::RenderTable::avoidsFloats):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16403 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/rendering/RenderFieldset.h
WebCore/rendering/RenderFlexibleBox.h
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderObject.h
WebCore/rendering/RenderTable.h

index 882da0a3058b44fec65adc6c67dba7cad47a6e4a..6c493d95c7e211cfa8e71dc149b24651b73dbb63 100644 (file)
@@ -1,3 +1,27 @@
+2006-09-17  David Hyatt  <hyatt@apple.com>
+
+        Fix for bugzilla bugs 10895 and 6336, fieldsets misbehaving when floats
+        are declared right before the fieldsets.  It turns out fieldsets in other
+        browsers avoid floats (like overflow:auto/hidden/scroll sections do), so
+        adding that behavior to fieldset fixes the bug.
+
+        Made avoidsFloats virtual and did some refactoring to make tables, flexboxes
+        and fieldsets all subclass.
+
+        Reviewed by anders
+
+        Added fast/forms/float-before-fieldset.html
+
+        * rendering/RenderFieldset.h:
+        (WebCore::RenderFieldset::avoidsFloats):
+        * rendering/RenderFlexibleBox.h:
+        (WebCore::RenderFlexibleBox::avoidsFloats):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::avoidsFloats):
+        * rendering/RenderObject.h:
+        * rendering/RenderTable.h:
+        (WebCore::RenderTable::avoidsFloats):
+
 2006-09-17  David Hyatt  <hyatt@apple.com>
 
         Fix for bugzilla bug 3240, implement support for the HTML4 "frame" and
index 2b229c0d8e2a76c3c3962e51dc0d7dfc730aa29e..e41bd1899da75a06cba64a239165cfa93a286a63 100644 (file)
                FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; };
 /* End PBXBuildFile section */
 
+/* Begin PBXBuildStyle section */
+               BCFAD45F0ABD3ABA00B7663D /* Development */ = {
+                       isa = PBXBuildStyle;
+                       buildSettings = {
+                               COPY_PHASE_STRIP = NO;
+                       };
+                       name = Development;
+               };
+               BCFAD4600ABD3ABA00B7663D /* Deployment */ = {
+                       isa = PBXBuildStyle;
+                       buildSettings = {
+                               COPY_PHASE_STRIP = YES;
+                       };
+                       name = Deployment;
+               };
+/* End PBXBuildStyle section */
+
 /* Begin PBXContainerItemProxy section */
                DD041FF009D9E3250010AF2A /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
+                       buildSettings = {
+                       };
+                       buildStyles = (
+                               BCFAD45F0ABD3ABA00B7663D /* Development */,
+                               BCFAD4600ABD3ABA00B7663D /* Deployment */,
+                       );
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
                        mainGroup = 0867D691FE84028FC02AAC07 /* WebKit */;
                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
                        projectDirPath = "";
-                       projectRoot = "";
                        targets = (
                                93F198A508245E59001E9ABC /* WebCore */,
                                DD041FBE09D9DDBE0010AF2A /* Derived Sources */,
index e31ccc4a9304957d4f0b18a724e6c0c69c3fa7ca..704db0ea158cb69e15275be0118c9fba20e607be 100644 (file)
@@ -41,7 +41,8 @@ public:
     virtual RenderObject* layoutLegend(bool relayoutChildren);
 
     virtual void setStyle(RenderStyle*);
-    
+
+    virtual bool avoidsFloats() const { return true; }
     virtual bool expandsToEncloseOverhangingFloats() const { return style()->height().isAuto(); }
 
 private:
index 2c3f7ee46cc4a45b1c71f657ec260c8576771da3..16671ea7e445c66d0a4ca702916ba4c0289b55c8 100644 (file)
@@ -40,6 +40,8 @@ public:
     void layoutHorizontalBox(bool relayoutChildren);
     void layoutVerticalBox(bool relayoutChildren);
 
+    virtual bool avoidsFloats() const { return true; }
+
     virtual bool isFlexibleBox() const { return true; }
     virtual bool isFlexingChildren() const { return m_flexingChildren; }
     virtual bool isStretchingChildren() const { return m_stretchingChildren; }
index 31e95098926e223859e906ac266fdef886375ee7..556e38d9051ff01235a454e78926b21064bce1cc 100644 (file)
@@ -2826,7 +2826,7 @@ void RenderObject::collectBorders(DeprecatedValueList<CollapsedBorderValue>& bor
 
 bool RenderObject::avoidsFloats() const
 {
-    return isReplaced() || isTable() || hasOverflowClip() || isHR() || isFlexibleBox(); 
+    return isReplaced() || hasOverflowClip() || isHR(); 
 }
 
 bool RenderObject::usesLineWidth() const
index c6513d089af7a1f5bd046652710edd1f938d0094..6316b40ea0ee5789c8adefce69f5b7516648d0de 100644 (file)
@@ -756,7 +756,7 @@ public:
 
     virtual void removePositionedObjects(RenderBlock*) { }
 
-    bool avoidsFloats() const;
+    virtual bool avoidsFloats() const;
     bool usesLineWidth() const;
 
     // positioning of inline children (bidi)
index 73ab1e9f023b8894965d6ead9a40773efe45fb4f..30bc2ce723c56ced2609da0130abec1128c58689 100644 (file)
@@ -68,6 +68,8 @@ public:
 
     virtual bool isTable() const { return true; }
 
+    virtual bool avoidsFloats() const { return true; }
+
     int getColumnPos(int col) const { return columnPos[col]; }
 
     int hBorderSpacing() const { return hspacing; }