Reviewed by Dave Hyatt.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 May 2005 20:55:32 +0000 (20:55 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 May 2005 20:55:32 +0000 (20:55 +0000)
        No new layout tests needed.

        - eliminated the bogus kMin/kMax macros that we had in addition to inline functions
          of the same name

        * kwq/KWQKGlobal.h: Remove the kMin/kMax macros.

        * khtml/css/cssstyleselector.cpp:
        (khtml::CSSStyleSelector::applyProperty): Change type of constant so both sides
        of kMin calls match.
        (khtml::CSSStyleSelector::fontSizeForKeyword): Ditto.
        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseEntity): Ditto.

        - remove unused parameter to dirtyLinesFromChangedChild for clarity

        * khtml/rendering/render_object.h: Don't take the parameter.
        * khtml/rendering/render_object.cpp: (RenderObject::dirtyLinesFromChangedChild): Ditto.

        * khtml/rendering/render_flow.h: Don't take the parameter.
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::detach): Don't pass the parameter.
        (RenderFlow::dirtyLinesFromChangedChild): Don't take the parameter.

        * khtml/rendering/render_text.cpp: (RenderText::detach): Don't pass the parameter.

        - convert DOM::NodeImpl into an abstract base class by making a couple of functions
          pure virtual for clarity

        * khtml/xml/dom_nodeimpl.h: Made nodeName and nodeType pure virtual.
        * khtml/xml/dom_nodeimpl.cpp: Remove bodies of nodeName and nodeType.

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/css/cssstyleselector.cpp
WebCore/khtml/html/htmltokenizer.cpp
WebCore/khtml/rendering/render_flow.cpp
WebCore/khtml/rendering/render_flow.h
WebCore/khtml/rendering/render_object.cpp
WebCore/khtml/rendering/render_object.h
WebCore/khtml/rendering/render_text.cpp
WebCore/khtml/xml/dom_nodeimpl.cpp
WebCore/khtml/xml/dom_nodeimpl.h
WebCore/kwq/KWQKGlobal.h

index a610b073044d2bb9429aaffeea132e57cc38b8c9..534c410694c2041c8686319ad0b6d40c97859ebf 100644 (file)
@@ -1,3 +1,37 @@
+2005-05-03  Darin Adler  <darin@apple.com>
+
+        Reviewed by Dave Hyatt.
+        No new layout tests needed.
+
+        - eliminated the bogus kMin/kMax macros that we had in addition to inline functions
+          of the same name
+
+        * kwq/KWQKGlobal.h: Remove the kMin/kMax macros.
+
+        * khtml/css/cssstyleselector.cpp:
+        (khtml::CSSStyleSelector::applyProperty): Change type of constant so both sides
+        of kMin calls match.
+        (khtml::CSSStyleSelector::fontSizeForKeyword): Ditto.
+        * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseEntity): Ditto.
+
+        - remove unused parameter to dirtyLinesFromChangedChild for clarity
+
+        * khtml/rendering/render_object.h: Don't take the parameter.
+        * khtml/rendering/render_object.cpp: (RenderObject::dirtyLinesFromChangedChild): Ditto.
+
+        * khtml/rendering/render_flow.h: Don't take the parameter.
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::detach): Don't pass the parameter.
+        (RenderFlow::dirtyLinesFromChangedChild): Don't take the parameter.
+
+        * khtml/rendering/render_text.cpp: (RenderText::detach): Don't pass the parameter.
+
+        - convert DOM::NodeImpl into an abstract base class by making a couple of functions
+          pure virtual for clarity
+
+        * khtml/xml/dom_nodeimpl.h: Made nodeName and nodeType pure virtual.
+        * khtml/xml/dom_nodeimpl.cpp: Remove bodies of nodeName and nodeType.
+
 2005-05-03  David Hyatt  <hyatt@apple.com>
 
        Fix for object element to support fallback content.  WIth this change Safari passes the Acid2 test.
index 632ce196fc46766668e480e9aaba3b7c36b5a9f3..44c1865fba61175b0458b30ecfbb27be687932aa 100644 (file)
@@ -3461,7 +3461,7 @@ void CSSStyleSelector::applyProperty( int id, DOM::CSSValueImpl *value )
             return; // Error case.
         
         // Clamp opacity to the range 0-1
-        style->setOpacity(kMin(1.0f, kMax(0, primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER))));
+        style->setOpacity(kMin(1.0, kMax(0.0, primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER))));
         return;
     case CSS_PROP__KHTML_BOX_ALIGN:
         HANDLE_INHERIT_AND_INITIAL(boxAlign, BoxAlign)
@@ -4060,7 +4060,7 @@ float CSSStyleSelector::fontSizeForKeyword(int keyword, bool quirksMode) const
     }
     
     // Value is outside the range of the table. Apply the scale factor instead.
-    float minLogicalSize = kMax(settings->minLogicalFontSize(), 1.0f);
+    float minLogicalSize = kMax(settings->minLogicalFontSize(), 1);
     return kMax(fontSizeFactors[keyword - CSS_VAL_XX_SMALL]*mediumSize, minLogicalSize);
 }
 
index 2141d5681c1f51759c18c73fcd90d2a5a6f72bb6..8532affb6b173b270723cec30ff6db70c4c1e938 100644 (file)
@@ -843,7 +843,7 @@ void HTMLTokenizer::parseEntity(TokenizerString &src, QChar *&dest, bool start)
 
         case Hexadecimal:
         {
-            int ll = kMin(src.length(), 8);
+            int ll = kMin(src.length(), 8U);
             while(ll--) {
                 QChar csrc(src->lower());
                 cc = csrc.cell();
index 4f0c183b1bbb4e860940bc390fdfb8c869de690d..db93adb11a16e4013a09b71228cbb448e6913b78 100644 (file)
@@ -211,7 +211,7 @@ void RenderFlow::detach()
             }
         }
         else if (isInline() && parent())
-            parent()->dirtyLinesFromChangedChild(this, false);
+            parent()->dirtyLinesFromChangedChild(this);
     }
 
     deleteLineBoxes();
@@ -219,7 +219,7 @@ void RenderFlow::detach()
     RenderContainer::detach();
 }
 
-void RenderFlow::dirtyLinesFromChangedChild(RenderObject* child, bool adding)
+void RenderFlow::dirtyLinesFromChangedChild(RenderObject* child)
 {
     if (!parent() || selfNeedsLayout() || isTable())
         return;
index a64a57de0eae98eaffe857cb55861aeb24681781..3c7939dd0275ea24961bd3009a2416923e88e9f8 100644 (file)
@@ -62,7 +62,7 @@ public:
     void deleteLineBoxes();
     virtual void detach();
 
-    virtual void dirtyLinesFromChangedChild(RenderObject* child, bool adding = true);
+    virtual void dirtyLinesFromChangedChild(RenderObject* child);
     
     virtual short lineHeight(bool firstLine, bool isRootLineBox=false) const;
     
index dcaf0eab7e4b65dc6afdc96dae033e76e8f279ff..a28608f9f40c298bde60d8c70a576c4109ff182e 100644 (file)
@@ -1300,7 +1300,7 @@ void RenderObject::computeAbsoluteRepaintRect(QRect& r, bool f)
         return parent()->computeAbsoluteRepaintRect(r, f);
 }
 
-void RenderObject::dirtyLinesFromChangedChild(RenderObject* child, bool adding)
+void RenderObject::dirtyLinesFromChangedChild(RenderObject* child)
 {
 }
 
index 84f815957d3abddaf3d83fe2a475cf1fb853f395..d6452ef4903b7814d14517293ce31b29d782bd84 100644 (file)
@@ -523,7 +523,7 @@ public:
 
     virtual VisiblePosition positionForCoordinates(int x, int y);
     
-    virtual void dirtyLinesFromChangedChild(RenderObject* child, bool adding = true);
+    virtual void dirtyLinesFromChangedChild(RenderObject* child);
     
     // Set the style of the object and update the state of the object accordingly.
     virtual void setStyle(RenderStyle* style);
index 396b88ffe27c46b54084a44b01e9e96d10131031..b5b04fd05b005f319a4ec6bfbf2673c3a5b3441a 100644 (file)
@@ -838,7 +838,7 @@ void RenderText::detach()
                 box->remove();
         }
         else if (parent())
-            parent()->dirtyLinesFromChangedChild(this, false);
+            parent()->dirtyLinesFromChangedChild(this);
     }
     deleteTextBoxes();
     RenderObject::detach();
index 2ad64c7321d85f59b5f7a6d2f02d155cb8c72c87..f81552c54b3c39a4a97a15c16e3097bf0ede77d3 100644 (file)
@@ -138,16 +138,6 @@ void NodeImpl::setNodeValue( const DOMString &/*_nodeValue*/, int &exceptioncode
     // be default nodeValue is null, so setting it has no effect
 }
 
-DOMString NodeImpl::nodeName() const
-{
-  return DOMString();
-}
-
-unsigned short NodeImpl::nodeType() const
-{
-  return 0;
-}
-
 NodeListImpl *NodeImpl::childNodes()
 {
   return new ChildNodeListImpl(this);
index 6713b54e0e62c0880f91f75d69538b32d239bf35..b29d7b6f5306a23f556a61e694df9e1305a42d99 100644 (file)
@@ -99,10 +99,10 @@ public:
     MAIN_THREAD_ALLOCATED;
 
     // DOM methods & attributes for Node
-    virtual DOMString nodeName() const;
+    virtual DOMString nodeName() const = 0;
     virtual DOMString nodeValue() const;
     virtual void setNodeValue( const DOMString &_nodeValue, int &exceptioncode );
-    virtual unsigned short nodeType() const;
+    virtual unsigned short nodeType() const = 0;
     NodeImpl *parentNode() const { return m_parent; }
     NodeImpl *previousSibling() const { return m_previous; }
     NodeImpl *nextSibling() const { return m_next; }
index 791b9dc7674dd690da5c83180a2c660a9cd93994..ac8f3a352de762e849bc5feec435ca086383d8f5 100644 (file)
@@ -34,9 +34,6 @@ class KLocale;
 class KStandardDirs;
 class KConfig;
 
-#define kMin(a, b) ((a) < (b) ? (a) : (b))
-#define kMax(a, b) ((a) > (b) ? (a) : (b))
-
 class KGlobal {
 public:
     static KInstance *instance() { return 0; }