2006-05-13  Sam Weinig  <sam.weinig@gmail.com>

        Reviewed by Hyatt, landed by ap.

WebCore:
        Patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=7604
        calcAbsoluteHorizontalValues() is being getting passed arguments
        in the wrong order in calcAbsoluteHorizontal()

        Cleans up the RenderBox code for absolutely positioned elements
        and adds new functions for replaced absolutely positioned 
        elements. Now uses Length so that magic number -666666 for 
        auto lengths is no longer used.

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::calcAbsoluteHorizontal):
        (WebCore::RenderBox::calcAbsoluteHorizontalValues):
        (WebCore::RenderBox::calcAbsoluteVertical):
        (WebCore::RenderBox::calcAbsoluteVerticalValues): 
        (WebCore::RenderBox::calcAbsoluteHorizontalReplaced): Handle replaced
        case separately.
        (WebCore::RenderBox::calcAbsoluteVerticalReplaced): ditto.
        * rendering/RenderBox.h:

LayoutTests:
        * fast/block/positioning/absolute-length-of-neg-666666.html: Added.
        * fast/block/positioning/absolute-positioned-overconstrained.html: Added.
        * fast/block/positioning/auto/006.html: Updated to reflect that the containing
        block's direction, not the parent's is used.
        * fast/css/absolute-poition-in-rtl-parent.html: Updated and cleaned up.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@14351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index 8958a6d..b3a5648 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -158,11 +158,18 @@
 
     void calcAbsoluteHorizontal();
     void calcAbsoluteVertical();
-    void calcAbsoluteHorizontalValues(WidthType widthType, RenderObject* cb, int cw, int pab, int static_distance,
-                                      int l, int r, int& w, int& ml, int& mr, int& x);
-    void calcAbsoluteVerticalValues(HeightType heightType, RenderObject* cb, int ch, int pab, 
-                                    int t, int b, int& h, int& mt, int& mb, int& y); 
-    
+    void calcAbsoluteHorizontalValues(Length width, const RenderObject* cb, 
+                                      const int containerWidth, const int bordersPlusPadding, 
+                                      const Length left, const Length right, const Length marginLeft, const Length marginRight,
+                                      int& widthValue, int& marginLeftValue, int& marginRightValue, int& xPos);
+    void calcAbsoluteVerticalValues(Length height, const RenderObject* cb, 
+                                    const int containerHeight, const int bordersPlusPadding,
+                                    const Length top, const Length bottom, const Length marginTop, const Length marginBottom,
+                                    int& heightValue, int& marginTopValue, int& marginBottomValue, int& yPos);
+
+    void calcAbsoluteVerticalReplaced();
+    void calcAbsoluteHorizontalReplaced();
+
     virtual IntRect getOverflowClipRect(int tx, int ty);
     virtual IntRect getClipRect(int tx, int ty);