[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 06:38:02 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a026dc29f2c99fff325b109ba4378c5f1824eeee
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 11 10:36:13 2002 +0000

    	This patch fixes a slew of bugs.  It is an implementation
    	of the IE extensions offsetLeft, offsetTop, and offsetParent.
    	Konqueror actually had implementations for these properties
    	that were totally wrong, leading any DHTML that would use
    	these properties (like the DHTML on brainjar.com or livepage.apple.com)
    	to misposition child elements.
    
    	With these properties now implemented, the menus on brainjar.com
    	position correctly, and the marquee on livepage.apple.com once
    	again shows up (and now you can see how I've regressed clipping
    	by not shoving it into the layer system as well).
    
    	Next up will be fixing the clipping bug on livepage.apple.com.
    
            * khtml/ecma/kjs_dom.cpp:
            (DOMNode::getValueProperty):
            * khtml/rendering/render_flow.cpp:
            (RenderFlow::offsetHeight):
            (RenderFlow::offsetLeft):
            (RenderFlow::offsetTop):
            * khtml/rendering/render_flow.h:
            * khtml/rendering/render_object.cpp:
            (RenderObject::offsetLeft):
            (RenderObject::offsetTop):
            (RenderObject::offsetParent):
            * khtml/rendering/render_object.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2030 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 65c7285..c524fc5 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,32 @@
+2002-09-11  David Hyatt  <hyatt at apple.com>
+
+	This patch fixes a slew of bugs.  It is an implementation
+	of the IE extensions offsetLeft, offsetTop, and offsetParent.
+	Konqueror actually had implementations for these properties
+	that were totally wrong, leading any DHTML that would use
+	these properties (like the DHTML on brainjar.com or livepage.apple.com)
+	to misposition child elements.
+
+	With these properties now implemented, the menus on brainjar.com
+	position correctly, and the marquee on livepage.apple.com once
+	again shows up (and now you can see how I've regressed clipping
+	by not shoving it into the layer system as well).
+
+	Next up will be fixing the clipping bug on livepage.apple.com.
+	
+        * khtml/ecma/kjs_dom.cpp:
+        (DOMNode::getValueProperty):
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::offsetHeight):
+        (RenderFlow::offsetLeft):
+        (RenderFlow::offsetTop):
+        * khtml/rendering/render_flow.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::offsetLeft):
+        (RenderObject::offsetTop):
+        (RenderObject::offsetParent):
+        * khtml/rendering/render_object.h:
+
 2002-09-10  David Hyatt  <hyatt at apple.com>
 
 	Get more elements on mrskin painting as well as the menus
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 65c7285..c524fc5 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,32 @@
+2002-09-11  David Hyatt  <hyatt at apple.com>
+
+	This patch fixes a slew of bugs.  It is an implementation
+	of the IE extensions offsetLeft, offsetTop, and offsetParent.
+	Konqueror actually had implementations for these properties
+	that were totally wrong, leading any DHTML that would use
+	these properties (like the DHTML on brainjar.com or livepage.apple.com)
+	to misposition child elements.
+
+	With these properties now implemented, the menus on brainjar.com
+	position correctly, and the marquee on livepage.apple.com once
+	again shows up (and now you can see how I've regressed clipping
+	by not shoving it into the layer system as well).
+
+	Next up will be fixing the clipping bug on livepage.apple.com.
+	
+        * khtml/ecma/kjs_dom.cpp:
+        (DOMNode::getValueProperty):
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::offsetHeight):
+        (RenderFlow::offsetLeft):
+        (RenderFlow::offsetTop):
+        * khtml/rendering/render_flow.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::offsetLeft):
+        (RenderObject::offsetTop):
+        (RenderObject::offsetParent):
+        * khtml/rendering/render_object.h:
+
 2002-09-10  David Hyatt  <hyatt at apple.com>
 
 	Get more elements on mrskin painting as well as the menus
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 65c7285..c524fc5 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,32 @@
+2002-09-11  David Hyatt  <hyatt at apple.com>
+
+	This patch fixes a slew of bugs.  It is an implementation
+	of the IE extensions offsetLeft, offsetTop, and offsetParent.
+	Konqueror actually had implementations for these properties
+	that were totally wrong, leading any DHTML that would use
+	these properties (like the DHTML on brainjar.com or livepage.apple.com)
+	to misposition child elements.
+
+	With these properties now implemented, the menus on brainjar.com
+	position correctly, and the marquee on livepage.apple.com once
+	again shows up (and now you can see how I've regressed clipping
+	by not shoving it into the layer system as well).
+
+	Next up will be fixing the clipping bug on livepage.apple.com.
+	
+        * khtml/ecma/kjs_dom.cpp:
+        (DOMNode::getValueProperty):
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::offsetHeight):
+        (RenderFlow::offsetLeft):
+        (RenderFlow::offsetTop):
+        * khtml/rendering/render_flow.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::offsetLeft):
+        (RenderObject::offsetTop):
+        (RenderObject::offsetParent):
+        * khtml/rendering/render_object.h:
+
 2002-09-10  David Hyatt  <hyatt at apple.com>
 
 	Get more elements on mrskin painting as well as the menus
diff --git a/WebCore/khtml/ecma/kjs_dom.cpp b/WebCore/khtml/ecma/kjs_dom.cpp
index c8de093..1f3fc24 100644
--- a/WebCore/khtml/ecma/kjs_dom.cpp
+++ b/WebCore/khtml/ecma/kjs_dom.cpp
@@ -246,15 +246,17 @@ Value DOMNode::getValueProperty(ExecState *exec, int token) const
 
     switch (token) {
     case OffsetLeft:
-      return rend ? static_cast<Value>(Number(rend->xPos())) : Value(Undefined());
+      return rend ? static_cast<Value>(Number(rend->offsetLeft())) : Value(Undefined());
     case OffsetTop:
-      return rend ? static_cast<Value>(Number(rend->yPos())) : Value(Undefined());
+      return rend ? static_cast<Value>(Number(rend->offsetTop())) : Value(Undefined());
     case OffsetWidth:
       return rend ? static_cast<Value>(Number(rend->offsetWidth()) ) : Value(Undefined());
     case OffsetHeight:
       return rend ? static_cast<Value>(Number(rend->offsetHeight() ) ) : Value(Undefined());
-    case OffsetParent:
-      return getDOMNode(exec,node.parentNode()); // not necessarily correct
+    case OffsetParent: {
+      khtml::RenderObject* par = rend ? rend->offsetParent() : 0;
+      return getDOMNode(exec, par ? par->element() : 0);
+    }
     case ClientWidth:
       if (!rend)
         return Undefined();
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index 7d943be..16b8ca9 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -1299,11 +1299,33 @@ short RenderFlow::offsetWidth() const
 
 int RenderFlow::offsetHeight() const
 {
-   // if (isInline() && !isText() && firstChild())
-   //     return firstChild()->height();
+    if (isInline() && !isText() && firstChild())
+        return firstChild()->offsetHeight();
     return height();
 }
 
+int RenderFlow::offsetLeft() const
+{
+    int x = RenderBox::offsetLeft();
+    RenderObject* textChild = (RenderObject*)this;
+    while (textChild && textChild->isInline() && !textChild->isText())
+        textChild = textChild->firstChild();
+    if (textChild && textChild != this)
+        x += textChild->xPos() - textChild->borderLeft() - textChild->paddingLeft();
+    return x;
+}
+
+int RenderFlow::offsetTop() const
+{
+    RenderObject* textChild = (RenderObject*)this;
+    while (textChild && textChild->isInline() && !textChild->isText())
+        textChild = textChild->firstChild();
+    int y = RenderBox::offsetTop();
+    if (textChild && textChild != this)
+        y += textChild->yPos() - textChild->borderTop() - textChild->paddingTop();
+    return y;
+}
+
 void RenderFlow::addChild(RenderObject *newChild, RenderObject *beforeChild)
 {
 #ifdef DEBUG_LAYOUT
diff --git a/WebCore/khtml/rendering/render_flow.h b/WebCore/khtml/rendering/render_flow.h
index 7c9465a..74fa74e 100644
--- a/WebCore/khtml/rendering/render_flow.h
+++ b/WebCore/khtml/rendering/render_flow.h
@@ -111,7 +111,9 @@ public:
     // the remaining width on a given line (and the height of a single line).
     virtual short offsetWidth() const;
     virtual int offsetHeight() const;
-
+    virtual int offsetLeft() const;
+    virtual int offsetTop() const;
+    
     void insertSpecialObject(RenderObject *o);
 
     // from BiDiParagraph
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 9142baf..01c6054 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -150,6 +150,52 @@ void RenderObject::insertChildNode(RenderObject*, RenderObject*)
     KHTMLAssert(0);
 }
 
+int RenderObject::offsetLeft() const
+{
+    int x = xPos();
+    if (!isPositioned()) {
+        if (isRelPositioned()) {
+            int y = 0;
+            ((RenderBox*)this)->relativePositionOffset(x, y);
+        }
+        
+        RenderObject* offsetPar = offsetParent();
+        RenderObject* curr = parent();
+        while (curr && curr != offsetPar) {
+            x += curr->xPos();
+            curr = curr->parent();
+        }
+    }
+    return x;
+}
+
+int RenderObject::offsetTop() const
+{
+    int y = yPos();
+    if (!isPositioned()) {
+        if (isRelPositioned()) {
+            int x = 0;
+            ((RenderBox*)this)->relativePositionOffset(x, y);
+        }
+        RenderObject* offsetPar = offsetParent();
+        RenderObject* curr = parent();
+        while (curr && curr != offsetPar) {
+            y += curr->yPos();
+            curr = curr->parent();
+        }
+    }
+    return y;
+}
+    
+RenderObject* RenderObject::offsetParent() const
+{
+    RenderObject* curr = parent();
+    while (curr && !curr->isTableCell() && !curr->isTable() &&
+           !curr->isPositioned() && !curr->isRelPositioned() &&
+           !curr->isBody())
+        curr = curr->parent();
+    return curr;
+}
 
 void RenderObject::setLayouted(bool b) 
 {
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index cf7a140..eabe71c 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -348,11 +348,17 @@ public:
     virtual short width() const { return 0; }
     virtual int height() const { return 0; }
 
-    // used to calculate offsetWidth/Height.  Overridden by inlines (render_flow) to return
-    // the remaining width on a given line (and the height of a single line). -dwh
+    // IE extensions. Used to calculate offsetWidth/Height.  Overridden by inlines (render_flow) 
+    // to return the remaining width on a given line (and the height of a single line). -dwh
     virtual short offsetWidth() const { return width(); }
     virtual int offsetHeight() const { return height(); }
     
+    // IE exxtensions.  Also supported by Gecko.  We override in render flow to get the
+    // left and top correct. -dwh
+    virtual int offsetLeft() const;
+    virtual int offsetTop() const;
+    virtual RenderObject* offsetParent() const;
+     
     virtual short marginTop() const { return 0; }
     virtual short marginBottom() const { return 0; }
     virtual short marginLeft() const { return 0; }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list