Title: [111818] trunk
Revision
111818
Author
[email protected]
Date
2012-03-22 20:07:24 -0700 (Thu, 22 Mar 2012)

Log Message

Fieldset unexpectedly stretches to minimum intrinsic width
https://bugs.webkit.org/show_bug.cgi?id=79128

Patch by SravanKumar Sandela <[email protected]> on 2012-03-22
Reviewed by Julien Chaffraix.

Source/WebCore:

Fieldset element width will now check if css width is specified explicitly
before stretching to minimum intrinsic width. The reference
can be taken from IE9, instead of FF(FF acknowledged the broken behavior).

Tests: fast/forms/fieldset-width-nostretch-ifspecified-expected.html
       fast/forms/fieldset-width-nostretch-ifspecified.html

* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::stretchesToMinIntrinsicLogicalWidth):
(WebCore):
* rendering/RenderFieldset.h:
(RenderFieldset):

LayoutTests:

Ref tests to check no stretching to intrinsic width if width is explicitly specified.
Currently, calc width is Work-In-Progress, so it wont be supported now, and these ref
tests should automatically take care once Webkit enables it. Need to keep an eye on it.

* fast/forms/fieldset-width-nostretch-ifspecified-expected.html: Added.
* fast/forms/fieldset-width-nostretch-ifspecified.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (111817 => 111818)


--- trunk/LayoutTests/ChangeLog	2012-03-23 03:02:40 UTC (rev 111817)
+++ trunk/LayoutTests/ChangeLog	2012-03-23 03:07:24 UTC (rev 111818)
@@ -1,3 +1,17 @@
+2012-03-22  SravanKumar Sandela  <[email protected]>
+
+        Fieldset unexpectedly stretches to minimum intrinsic width
+        https://bugs.webkit.org/show_bug.cgi?id=79128
+
+        Reviewed by Julien Chaffraix.
+
+        Ref tests to check no stretching to intrinsic width if width is explicitly specified.
+        Currently, calc width is Work-In-Progress, so it wont be supported now, and these ref
+        tests should automatically take care once Webkit enables it. Need to keep an eye on it. 
+
+        * fast/forms/fieldset-width-nostretch-ifspecified-expected.html: Added.
+        * fast/forms/fieldset-width-nostretch-ifspecified.html: Added.
+
 2012-03-22  Tom Sepez  <[email protected]>
 
         XSS Auditor bypass via script tag src="" URLS.

Added: trunk/LayoutTests/fast/forms/fieldset-width-nostretch-ifspecified-expected.html (0 => 111818)


--- trunk/LayoutTests/fast/forms/fieldset-width-nostretch-ifspecified-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/fieldset-width-nostretch-ifspecified-expected.html	2012-03-23 03:07:24 UTC (rev 111818)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <style type="text/css">
+            .percentStyle {
+                width: 50%;
+                padding: 0;
+                margin: 0;
+                border: 1px solid green;
+            }
+            .fixedStyle {
+                width: 300px;
+                padding: 0;
+                margin: 0;
+                border: 1px solid green;
+            }
+            .calculatedStyle {
+                width: 200px;
+                width: calc(350px + 50px);
+                padding: 0;
+                margin: 0;
+                border: 1px solid green;
+            }
+            .wrap {
+                width: 500px;
+            }
+        </style>
+    </head>
+    <body>
+    <p> Bug <a href="" Fieldset unexpectedly stretches to minimum intrinsic width </p>
+    <p> For this test to pass, you should see our first container to be 50% of its parent, second 300px fixed and third calc width of 400px(if not supported fallback to 200px fixed) </p>
+        <div class="wrap">
+            <div class="percentStyle">
+               Lorem ipsum dolor sit amet, consectetur adipisicing elit 
+            </div>
+            <div class="fixedStyle">
+               Lorem ipsum dolor sit amet, consectetur adipisicing elit 
+            </div>
+            <div class="calculatedStyle">
+               Lorem ipsum dolor sit amet, consectetur adipisicing elit 
+            </div>
+        </div>
+    </body>
+</html>

Added: trunk/LayoutTests/fast/forms/fieldset-width-nostretch-ifspecified.html (0 => 111818)


--- trunk/LayoutTests/fast/forms/fieldset-width-nostretch-ifspecified.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/fieldset-width-nostretch-ifspecified.html	2012-03-23 03:07:24 UTC (rev 111818)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <style type="text/css">
+            .percentStyle {
+                width: 50%;
+                padding: 0;
+                margin: 0;
+                border: 1px solid green;
+            }
+            .fixedStyle {
+                width: 300px;
+                padding: 0;
+                margin: 0;
+                border: 1px solid green;
+            }
+            .calculatedStyle {
+                width: 200px;
+                width: calc(350px + 50px);
+                padding: 0;
+                margin: 0;
+                border: 1px solid green;
+            }
+            .wrap {
+                width: 500px;
+            }
+        </style>
+    </head>
+    <body>
+    <p> Bug <a href="" Fieldset unexpectedly stretches to minimum intrinsic width </p>
+    <p> For this test to pass, you should see our first container to be 50% of its parent, second 300px fixed and third calc width of 400px(if not supported fallback to 200px fixed) </p>
+        <div class="wrap">
+            <fieldset class="percentStyle">
+               Lorem ipsum dolor sit amet, consectetur adipisicing elit 
+            </fieldset>
+            <fieldset class="fixedStyle">
+               Lorem ipsum dolor sit amet, consectetur adipisicing elit 
+            </fieldset>
+            <fieldset class="calculatedStyle">
+               Lorem ipsum dolor sit amet, consectetur adipisicing elit 
+            </fieldset>
+        </div>
+    </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (111817 => 111818)


--- trunk/Source/WebCore/ChangeLog	2012-03-23 03:02:40 UTC (rev 111817)
+++ trunk/Source/WebCore/ChangeLog	2012-03-23 03:07:24 UTC (rev 111818)
@@ -1,3 +1,23 @@
+2012-03-22  SravanKumar Sandela  <[email protected]>
+
+        Fieldset unexpectedly stretches to minimum intrinsic width
+        https://bugs.webkit.org/show_bug.cgi?id=79128
+
+        Reviewed by Julien Chaffraix.
+
+        Fieldset element width will now check if css width is specified explicitly
+        before stretching to minimum intrinsic width. The reference
+        can be taken from IE9, instead of FF(FF acknowledged the broken behavior). 
+
+        Tests: fast/forms/fieldset-width-nostretch-ifspecified-expected.html
+               fast/forms/fieldset-width-nostretch-ifspecified.html
+
+        * rendering/RenderFieldset.cpp:
+        (WebCore::RenderFieldset::stretchesToMinIntrinsicLogicalWidth):
+        (WebCore):
+        * rendering/RenderFieldset.h:
+        (RenderFieldset):
+
 2012-03-22  Shawn Singh  <[email protected]>
 
         [chromium] Target surface should be damaged for a new layers even when layer had no changes

Modified: trunk/Source/WebCore/rendering/RenderFieldset.cpp (111817 => 111818)


--- trunk/Source/WebCore/rendering/RenderFieldset.cpp	2012-03-23 03:02:40 UTC (rev 111817)
+++ trunk/Source/WebCore/rendering/RenderFieldset.cpp	2012-03-23 03:07:24 UTC (rev 111818)
@@ -195,4 +195,13 @@
     paintMaskImages(paintInfo, paintRect);
 }
 
+bool RenderFieldset::stretchesToMinIntrinsicLogicalWidth() const
+{
+    // If width is explicitly specified then Fieldsets should not stretch
+    if (style()->width().isPercent())
+        return false;
+
+    return true;
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/RenderFieldset.h (111817 => 111818)


--- trunk/Source/WebCore/rendering/RenderFieldset.h	2012-03-23 03:02:40 UTC (rev 111817)
+++ trunk/Source/WebCore/rendering/RenderFieldset.h	2012-03-23 03:07:24 UTC (rev 111818)
@@ -42,7 +42,7 @@
 
     virtual void computePreferredLogicalWidths();
     virtual bool avoidsFloats() const { return true; }
-    virtual bool stretchesToMinIntrinsicLogicalWidth() const { return true; }
+    virtual bool stretchesToMinIntrinsicLogicalWidth() const OVERRIDE;
 
     virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&);
     virtual void paintMask(PaintInfo&, const LayoutPoint&);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to