[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

bdakin at apple.com bdakin at apple.com
Wed Dec 22 14:39:31 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 428d6b67ee167d8b801313441bd7b1f8d87c3cda
Author: bdakin at apple.com <bdakin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 14 23:35:36 2010 +0000

    This patch lays the groundwork for
    https://bugs.webkit.org/show_bug.cgi?id=47514 CSS transforms should
    affect scrolling
    by adding topmostPosition().
    
    Reviewed by Dave Hyatt.
    
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::topmostPosition):
    * rendering/RenderBlock.h:
    * rendering/RenderBox.cpp:
    (WebCore::RenderBox::topmostPosition):
    * rendering/RenderBox.h:
    * rendering/RenderMedia.cpp:
    (WebCore::RenderMedia::topmostPosition):
    * rendering/RenderMedia.h:
    * rendering/RenderTableSection.cpp:
    (WebCore::RenderTableSection::topmostPosition):
    * rendering/RenderTableSection.h:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69822 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 11e183f..863384d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-10-14  Beth Dakin  <bdakin at apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        This patch lays the groundwork for 
+        https://bugs.webkit.org/show_bug.cgi?id=47514 CSS transforms should 
+        affect scrolling
+        by adding topmostPosition().
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::topmostPosition):
+        * rendering/RenderBlock.h:
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::topmostPosition):
+        * rendering/RenderBox.h:
+        * rendering/RenderMedia.cpp:
+        (WebCore::RenderMedia::topmostPosition):
+        * rendering/RenderMedia.h:
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::topmostPosition):
+        * rendering/RenderTableSection.h:
+
 2010-10-14  Sergio Villar Senin  <svillar at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index ced46f3..10218b2 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -3336,6 +3336,83 @@ int RenderBlock::lowestFloatLogicalBottom(FloatingObject::Type floatType) const
     return lowestFloatBottom;
 }
 
+int RenderBlock::topmostPosition(bool includeOverflowInterior, bool includeSelf) const
+{
+    int top = includeSelf && width() > 0 ? 0 : height();
+    
+    if (!includeOverflowInterior && (hasOverflowClip() || hasControlClip()))
+        return top;
+
+    if (!firstChild() && (!width() || !height()))
+        return top;
+
+    if (!hasColumns()) {
+        // FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
+        // For now, we have to descend into all the children, since we may have a huge abs div inside
+        // a tiny rel div buried somewhere deep in our child tree.  In this case we have to get to
+        // the abs div.
+        for (RenderObject* c = firstChild(); c; c = c->nextSibling()) {
+            if (!c->isFloatingOrPositioned() && c->isBox()) {
+                RenderBox* childBox = toRenderBox(c);
+                top = min(top, childBox->y() + childBox->topmostPosition(false));
+            }
+        }
+    }
+
+    if (includeSelf && isRelPositioned())
+        top += relativePositionOffsetY(); 
+
+    if (!includeOverflowInterior && hasOverflowClip())
+        return top;
+    
+    int relativeOffset = includeSelf && isRelPositioned() ? relativePositionOffsetY() : 0;
+
+    if (includeSelf)
+        top = min(top, topLayoutOverflow() + relativeOffset);
+
+    if (m_positionedObjects) {
+        RenderBox* r;
+        Iterator end = m_positionedObjects->end();
+        for (Iterator it = m_positionedObjects->begin(); it != end; ++it) {
+            r = *it;
+            // Fixed positioned objects do not scroll and thus should not constitute
+            // part of the topmost position.
+            if (r->style()->position() != FixedPosition) {
+                // FIXME: Should work for overflow sections too.
+                // If a positioned object lies completely to the left of the root it will be unreachable via scrolling.
+                // Therefore we should not allow it to contribute to the topmost position.
+                if (!isRenderView() || r->x() + r->width() > 0 || r->x() + r->rightmostPosition(false) > 0) {
+                    int tp = r->y() + r->topmostPosition(false);
+                    top = min(top, tp + relativeOffset);
+                }
+            }
+        }
+    }
+
+    if (hasColumns()) {
+        ColumnInfo* colInfo = columnInfo();
+        for (unsigned i = 0; i < columnCount(colInfo); i++)
+            top = min(top, columnRectAt(colInfo, i).y() + relativeOffset);
+        return top;
+    }
+
+    if (m_floatingObjects) {
+        FloatingObject* r;
+        DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
+        for ( ; (r = it.current()); ++it) {
+            if (r->m_shouldPaint || r->m_renderer->hasSelfPaintingLayer()) {
+                int tp = r->top() + r->m_renderer->marginTop() + r->m_renderer->topmostPosition(false);
+                top = min(top, tp + relativeOffset);
+            }
+        }
+    }
+
+    if (!includeSelf && firstRootBox())
+        top = min(top, firstRootBox()->selectionTop() + relativeOffset);
+    
+    return top;
+}
+
 int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
 {
     int bottom = includeSelf && width() > 0 ? height() : 0;
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index 61c889c..961f0fe 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -99,6 +99,7 @@ public:
     int logicalRightOffsetForLine(int position, bool firstLine) const { return logicalRightOffsetForLine(position, logicalRightOffsetForContent(), firstLine); }
     int logicalLeftOffsetForLine(int position, bool firstLine) const { return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), firstLine); }
 
+    virtual int topmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index 9de592f..06393b5 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -2914,6 +2914,16 @@ IntRect RenderBox::localCaretRect(InlineBox* box, int caretOffset, int* extraWid
     return rect;
 }
 
+int RenderBox::topmostPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
+{
+    if (!includeSelf || !width())
+        return 0;
+    int top = 0;
+    if (isRelPositioned())
+        top += relativePositionOffsetY();
+    return top;
+}
+
 int RenderBox::lowestPosition(bool /*includeOverflowInterior*/, bool includeSelf) const
 {
     if (!includeSelf || !width())
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index 2260ac9..9ded12c 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -259,6 +259,7 @@ public:
     void setInlineBoxWrapper(InlineBox* boxWrapper) { m_inlineBoxWrapper = boxWrapper; }
     void deleteLineBoxWrapper();
 
+    virtual int topmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
diff --git a/WebCore/rendering/RenderMedia.cpp b/WebCore/rendering/RenderMedia.cpp
index a589a2d..e26ee26 100644
--- a/WebCore/rendering/RenderMedia.cpp
+++ b/WebCore/rendering/RenderMedia.cpp
@@ -599,6 +599,15 @@ void RenderMedia::forwardEvent(Event* event)
     }
 }
 
+int RenderMedia::topmostPosition(bool includeOverflowInterior, bool includeSelf) const
+{
+    int top = RenderImage::topmostPosition(includeOverflowInterior, includeSelf);
+    if (!m_controlsShadowRoot || !m_controlsShadowRoot->renderer())
+        return top;
+    
+    return min(top,  m_controlsShadowRoot->renderBox()->y() + m_controlsShadowRoot->renderBox()->topmostPosition(includeOverflowInterior, includeSelf));
+}
+
 int RenderMedia::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
 {
     int bottom = RenderImage::lowestPosition(includeOverflowInterior, includeSelf);
diff --git a/WebCore/rendering/RenderMedia.h b/WebCore/rendering/RenderMedia.h
index 4c980b5..2bdbbd1 100644
--- a/WebCore/rendering/RenderMedia.h
+++ b/WebCore/rendering/RenderMedia.h
@@ -85,6 +85,7 @@ private:
     virtual bool isMedia() const { return true; }
     virtual bool isImage() const { return false; }
 
+    virtual int topmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
     virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp
index a5ee3e2..b74daef 100644
--- a/WebCore/rendering/RenderTableSection.cpp
+++ b/WebCore/rendering/RenderTableSection.cpp
@@ -661,6 +661,24 @@ int RenderTableSection::layoutRows(int toAdd)
     return height();
 }
 
+int RenderTableSection::topmostPosition(bool includeOverflowInterior, bool includeSelf) const
+{
+    int top = RenderBox::topmostPosition(includeOverflowInterior, includeSelf);
+    if (!includeOverflowInterior && hasOverflowClip())
+        return top;
+
+    for (RenderObject* row = firstChild(); row; row = row->nextSibling()) {
+        for (RenderObject* curr = row->firstChild(); curr; curr = curr->nextSibling()) {
+            if (curr->isTableCell()) {
+                RenderTableCell* cell = toRenderTableCell(curr);
+                top = min(top, cell->y() + cell->topmostPosition(false));
+            }
+        }
+    }
+    
+    return top;
+}
+
 int RenderTableSection::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
 {
     int bottom = RenderBox::lowestPosition(includeOverflowInterior, includeSelf);
diff --git a/WebCore/rendering/RenderTableSection.h b/WebCore/rendering/RenderTableSection.h
index 6d2f752..0393aae 100644
--- a/WebCore/rendering/RenderTableSection.h
+++ b/WebCore/rendering/RenderTableSection.h
@@ -136,6 +136,7 @@ private:
 
     virtual void removeChild(RenderObject* oldChild);
 
+    virtual int topmostPosition(bool includeOverflowInterior, bool includeSelf) const;
     virtual int lowestPosition(bool includeOverflowInterior, bool includeSelf) const;
     virtual int rightmostPosition(bool includeOverflowInterior, bool includeSelf) const;
     virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf) const;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list