[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:01:55 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c84035d71ab61451bfe7e3a35c1cf717fa7e658a
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Nov 17 09:04:35 2002 +0000

    	This is a fix for bug 3058470.  The bug was that replaced elements
    	were computing their min and max widths wrong.  Specifically they
    	were not adding in borders and padding!  This means that any image
    	with a border around it would potentially break to another line
    	too early.
    
    	Once I fixed this for replaced elements I then went in and
    	fixed form controls.  I added two APPLE_CHANGES features for
    	our form controls.  First I overrode the border/padding functions
    	to always return 0 for all form controls, since no Aqua control
    	honors border/padding (nor should it).  This fixes the menulist
    	at the top of wired.com.
    
    	Second I made sure that certain controls will ignore CSS-specified
    	heights and always use their intrinsic heights.  These include
    	<select size=1> (combobox), single line text fields, and buttons.
    	I allow listboxes and textareas to honor height.
    
            * khtml/rendering/render_box.cpp:
            (RenderBox::contentWidth):
            (RenderBox::contentHeight):
            (RenderBox::calcWidth):
            (RenderBox::calcHeight):
            * khtml/rendering/render_form.h:
            * khtml/rendering/render_image.h:
            * khtml/rendering/render_object.h:
            * khtml/rendering/render_replaced.cpp:
            (RenderReplaced::calcMinMaxWidth):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2714 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 978a922..c581b14 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,34 @@
+2002-11-17  David Hyatt  <hyatt at apple.com>
+
+	This is a fix for bug 3058470.  The bug was that replaced elements
+	were computing their min and max widths wrong.  Specifically they
+	were not adding in borders and padding!  This means that any image
+	with a border around it would potentially break to another line
+	too early.
+
+	Once I fixed this for replaced elements I then went in and
+	fixed form controls.  I added two APPLE_CHANGES features for
+	our form controls.  First I overrode the border/padding functions
+	to always return 0 for all form controls, since no Aqua control
+	honors border/padding (nor should it).  This fixes the menulist
+	at the top of wired.com.
+
+	Second I made sure that certain controls will ignore CSS-specified
+	heights and always use their intrinsic heights.  These include
+	<select size=1> (combobox), single line text fields, and buttons.
+	I allow listboxes and textareas to honor height.
+	
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::contentWidth):
+        (RenderBox::contentHeight):
+        (RenderBox::calcWidth):
+        (RenderBox::calcHeight):
+        * khtml/rendering/render_form.h:
+        * khtml/rendering/render_image.h:
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_replaced.cpp:
+        (RenderReplaced::calcMinMaxWidth):
+
 2002-11-16  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3078240, <pre> should not establish its own text-align,
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 978a922..c581b14 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,34 @@
+2002-11-17  David Hyatt  <hyatt at apple.com>
+
+	This is a fix for bug 3058470.  The bug was that replaced elements
+	were computing their min and max widths wrong.  Specifically they
+	were not adding in borders and padding!  This means that any image
+	with a border around it would potentially break to another line
+	too early.
+
+	Once I fixed this for replaced elements I then went in and
+	fixed form controls.  I added two APPLE_CHANGES features for
+	our form controls.  First I overrode the border/padding functions
+	to always return 0 for all form controls, since no Aqua control
+	honors border/padding (nor should it).  This fixes the menulist
+	at the top of wired.com.
+
+	Second I made sure that certain controls will ignore CSS-specified
+	heights and always use their intrinsic heights.  These include
+	<select size=1> (combobox), single line text fields, and buttons.
+	I allow listboxes and textareas to honor height.
+	
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::contentWidth):
+        (RenderBox::contentHeight):
+        (RenderBox::calcWidth):
+        (RenderBox::calcHeight):
+        * khtml/rendering/render_form.h:
+        * khtml/rendering/render_image.h:
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_replaced.cpp:
+        (RenderReplaced::calcMinMaxWidth):
+
 2002-11-16  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3078240, <pre> should not establish its own text-align,
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 978a922..c581b14 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,34 @@
+2002-11-17  David Hyatt  <hyatt at apple.com>
+
+	This is a fix for bug 3058470.  The bug was that replaced elements
+	were computing their min and max widths wrong.  Specifically they
+	were not adding in borders and padding!  This means that any image
+	with a border around it would potentially break to another line
+	too early.
+
+	Once I fixed this for replaced elements I then went in and
+	fixed form controls.  I added two APPLE_CHANGES features for
+	our form controls.  First I overrode the border/padding functions
+	to always return 0 for all form controls, since no Aqua control
+	honors border/padding (nor should it).  This fixes the menulist
+	at the top of wired.com.
+
+	Second I made sure that certain controls will ignore CSS-specified
+	heights and always use their intrinsic heights.  These include
+	<select size=1> (combobox), single line text fields, and buttons.
+	I allow listboxes and textareas to honor height.
+	
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::contentWidth):
+        (RenderBox::contentHeight):
+        (RenderBox::calcWidth):
+        (RenderBox::calcHeight):
+        * khtml/rendering/render_form.h:
+        * khtml/rendering/render_image.h:
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_replaced.cpp:
+        (RenderReplaced::calcMinMaxWidth):
+
 2002-11-16  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3078240, <pre> should not establish its own text-align,
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index 381b348..1575d14 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -105,7 +105,7 @@ void RenderBox::detach(RenderArena* renderArena)
 
 short RenderBox::contentWidth() const
 {
-    short w = m_width - style()->borderLeftWidth() - style()->borderRightWidth();
+    short w = m_width - borderLeft() - borderRight();
     if (hasPadding())
         w -= paddingLeft() + paddingRight();
 
@@ -115,7 +115,7 @@ short RenderBox::contentWidth() const
 
 int RenderBox::contentHeight() const
 {
-    int h = m_height - style()->borderTopWidth() - style()->borderBottomWidth();
+    int h = m_height - borderTop() - borderBottom();
     if (hasPadding())
         h -= paddingTop() + paddingBottom();
 
@@ -480,8 +480,7 @@ void RenderBox::calcWidth()
             if (isReplaced())
             {
                 m_width = w.width(cw);
-                m_width += paddingLeft() + paddingRight() + style()->borderLeftWidth() + style()->borderRightWidth();
-
+                m_width += paddingLeft() + paddingRight() + borderLeft() + borderRight();
                 if(m_width < m_minWidth) m_width = m_minWidth;
             }
 
@@ -506,7 +505,7 @@ void RenderBox::calcWidth()
         {
 //          kdDebug( 6040 ) << "non-variable " << w.type << ","<< w.value << endl;
             m_width = w.width(cw);
-            m_width += paddingLeft() + paddingRight() + style()->borderLeftWidth() + style()->borderRightWidth();
+            m_width += paddingLeft() + paddingRight() + borderLeft() + borderRight();
 
             calcHorizontalMargins(ml,mr,cw);
         }
@@ -577,8 +576,9 @@ void RenderBox::calcHeight()
     else
     {
         Length h;
-        if ( isReplaced() )
+        if ( isReplaced() ) {
             h = Length( calcReplacedHeight(), Fixed );
+        }
         else
             h = style()->height();
 
diff --git a/WebCore/khtml/rendering/render_form.h b/WebCore/khtml/rendering/render_form.h
index 1ec0c37..cd40094 100644
--- a/WebCore/khtml/rendering/render_form.h
+++ b/WebCore/khtml/rendering/render_form.h
@@ -72,6 +72,18 @@ public:
     virtual bool isRendered() const  { return true; }
     virtual bool isFormElement() const { return true; }
 
+#if APPLE_CHANGES
+    // Aqua form controls never have border/padding.
+    int borderTop() const { return 0; }
+    int borderBottom() const { return 0; }
+    int borderLeft() const { return 0; }
+    int borderRight() const { return 0; }
+    int paddingTop() const { return 0; }
+    int paddingBottom() const { return 0; }
+    int paddingLeft() const { return 0; }
+    int paddingRight() const { return 0; }
+#endif
+
     // IE does not scale according to intrinsicWidth/Height
     // aspect ratio :-(
     virtual short calcReplacedWidth(bool* ieHack=0) const;
@@ -109,6 +121,10 @@ class RenderButton : public RenderFormElement
 public:
     RenderButton(DOM::HTMLGenericFormElementImpl* node);
 
+#if APPLE_CHANGES
+    int calcReplacedHeight() const { return intrinsicHeight(); }
+#endif
+
     virtual const char *renderName() const { return "RenderButton"; }
     virtual short baselinePosition( bool ) const;
 
@@ -217,6 +233,9 @@ public:
     RenderLineEdit(DOM::HTMLInputElementImpl *element);
 
     virtual void calcMinMaxWidth();
+#if APPLE_CHANGES
+    int calcReplacedHeight() const { return intrinsicHeight(); }
+#endif
 
     virtual const char *renderName() const { return "RenderLineEdit"; }
     virtual void updateFromElement();
@@ -273,6 +292,10 @@ public:
     virtual void updateFromElement();
     void select();
 
+#if APPLE_CHANGES
+    int calcReplacedHeight() const { return intrinsicHeight(); }
+#endif
+
     DOM::HTMLInputElementImpl *element() const
     { return static_cast<DOM::HTMLInputElementImpl*>(RenderObject::element()); }
 
@@ -340,6 +363,7 @@ public:
 
 #if APPLE_CHANGES
     short baselinePosition( bool f ) const;
+    int calcReplacedHeight() const { if (!m_useListBox) return intrinsicHeight(); return RenderFormElement::calcReplacedHeight(); }
 #endif
 
     virtual void calcMinMaxWidth();
diff --git a/WebCore/khtml/rendering/render_image.h b/WebCore/khtml/rendering/render_image.h
index 6203d69..730b99c 100644
--- a/WebCore/khtml/rendering/render_image.h
+++ b/WebCore/khtml/rendering/render_image.h
@@ -44,7 +44,8 @@ public:
     virtual const char *renderName() const { return "RenderImage"; }
 
     virtual bool isRendered() const { return true; }
-
+    virtual bool isImage() const { return false; }
+    
     virtual void printObject( QPainter *p, int /*x*/, int /*y*/, int /*w*/, int /*h*/, int tx, int ty);
 
     virtual void layout();
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 5f37b87..05bbdd6 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -153,6 +153,7 @@ public:
     virtual bool isWidget() const { return false; }
     virtual bool isBody() const { return false; }
     virtual bool isFormElement() const { return false; }
+    virtual bool isImage() const { return false; }
     virtual bool isTextArea() const { return false; }
     virtual bool isFrameSet() const { return false; }
     virtual bool isApplet() const { return false; }
@@ -415,10 +416,10 @@ public:
     virtual int paddingRight() const;
     virtual bool hasPadding() const { return style()->hasPadding(); }
     
-    int borderTop() const { return style()->borderTopWidth(); }
-    int borderBottom() const { return style()->borderBottomWidth(); }
-    int borderLeft() const { return style()->borderLeftWidth(); }
-    int borderRight() const { return style()->borderRightWidth(); }
+    virtual int borderTop() const { return style()->borderTopWidth(); }
+    virtual int borderBottom() const { return style()->borderBottomWidth(); }
+    virtual int borderLeft() const { return style()->borderLeftWidth(); }
+    virtual int borderRight() const { return style()->borderRightWidth(); }
 
     virtual short minWidth() const { return 0; }
     virtual short maxWidth() const { return 0; }
diff --git a/WebCore/khtml/rendering/render_replaced.cpp b/WebCore/khtml/rendering/render_replaced.cpp
index e1e4f27..cd15f24 100644
--- a/WebCore/khtml/rendering/render_replaced.cpp
+++ b/WebCore/khtml/rendering/render_replaced.cpp
@@ -80,12 +80,18 @@ void RenderReplaced::calcMinMaxWidth()
     bool isPercent = false;
     int width = calcReplacedWidth(&isPercent);
 
+    int toAdd = 0;
+    if (hasPadding())
+        toAdd += paddingLeft() + paddingRight();
+    if (style()->hasBorder())
+        toAdd += borderLeft() + borderRight();
+
     if ( isPercent ) {
         m_minWidth = 0;
-        m_maxWidth = width;
+        m_maxWidth = width + toAdd;
     }
     else
-        m_minWidth = m_maxWidth = width;
+        m_minWidth = m_maxWidth = width + toAdd;
 
     setMinMaxKnown();
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list