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

mitz at apple.com mitz at apple.com
Wed Dec 22 13:08:37 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit a144fd7efab883609c3df3a490d204629a3ebf6b
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 7 19:40:56 2010 +0000

    <rdar://problem/7794761> Floats inside of multicol fail to hit test
    https://bugs.webkit.org/show_bug.cgi?id=44730
    
    Reviewed by Dave Hyatt.
    
    WebCore:
    
    Test: fast/multicol/hit-test-float.html
    
    Factored float hit-testing out of nodeAtPoint so that hitTestColumns could
    call it with column-adjusted coordinates.
    
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::nodeAtPoint):
    (WebCore::RenderBlock::hitTestFloats):
    (WebCore::RenderBlock::hitTestColumns):
    * rendering/RenderBlock.h:
    
    LayoutTests:
    
    * fast/multicol/hit-test-float-expected.txt: Added.
    * fast/multicol/hit-test-float.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66900 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f0d7637..a877870 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-07  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        <rdar://problem/7794761> Floats inside of multicol fail to hit test
+        https://bugs.webkit.org/show_bug.cgi?id=44730
+
+        * fast/multicol/hit-test-float-expected.txt: Added.
+        * fast/multicol/hit-test-float.html: Added.
+
 2010-09-07  François Sausset  <sausset at gmail.com>
 
         Reviewed by Beth Dakin.
diff --git a/LayoutTests/fast/multicol/hit-test-float-expected.txt b/LayoutTests/fast/multicol/hit-test-float-expected.txt
new file mode 100644
index 0000000..58ec9cb
--- /dev/null
+++ b/LayoutTests/fast/multicol/hit-test-float-expected.txt
@@ -0,0 +1,5 @@
+Test for https://bugs.webkit.org/show_bug.cgi?id=44730 Floats inside of multicol fail to hit test.
+
+The red square should turn green when hovered.
+
+PASS
diff --git a/LayoutTests/fast/multicol/hit-test-float.html b/LayoutTests/fast/multicol/hit-test-float.html
new file mode 100644
index 0000000..e50f3b7
--- /dev/null
+++ b/LayoutTests/fast/multicol/hit-test-float.html
@@ -0,0 +1,31 @@
+<style>
+    #target { width: 50px; height: 50px; background-color: red; margin: 10px; }
+    #target:hover { background-color: green; }
+</style>
+<p>
+    Test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=44730">https://bugs.webkit.org/show_bug.cgi?id=44730</a>
+    Floats inside of multicol fail to hit test</i>.
+</p>
+<p>
+    The red square should turn green when hovered.
+</p>
+<div style="margin: 100; width: 300; height: 200; outline: solid black; -webkit-columns: 2;">
+    <div>
+        <div style="height: 250px; background-color: purple;"></div>
+        <div style="float: right; background-color: lightyellow; margin: 5px;">
+            <div id="target"></div>
+        </div>
+    </div>
+</div>
+<div id="result">FAIL: Test did not run.</div>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var result = document.getElementById("result");
+    var hitElement = document.elementFromPoint(370, 250);
+    if (hitElement === document.getElementById("target"))
+        result.innerText = "PASS";
+    else
+        result.innerText = "FAIL: Hit " + hitElement;
+</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8a582f4..1475634 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-07  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        <rdar://problem/7794761> Floats inside of multicol fail to hit test
+        https://bugs.webkit.org/show_bug.cgi?id=44730
+
+        Test: fast/multicol/hit-test-float.html
+
+        Factored float hit-testing out of nodeAtPoint so that hitTestColumns could
+        call it with column-adjusted coordinates.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::nodeAtPoint):
+        (WebCore::RenderBlock::hitTestFloats):
+        (WebCore::RenderBlock::hitTestColumns):
+        * rendering/RenderBlock.h:
+
 2010-09-07  François Sausset  <sausset at gmail.com>
 
         Reviewed by Beth Dakin.
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 5b2abe8..e7f28a3 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -3794,37 +3794,17 @@ bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
         }
 
         // Hit test contents if we don't have columns.
-        if (!hasColumns() && hitTestContents(request, result, _x, _y, scrolledX, scrolledY, hitTestAction)) {
-            updateHitTestResult(result, IntPoint(_x - tx, _y - ty));
-            return true;
-        }
-
-        // Hit test our columns if we do have them.
-        if (hasColumns() && hitTestColumns(request, result, _x, _y, scrolledX, scrolledY, hitTestAction)) {
+        if (!hasColumns()) {
+            if (hitTestContents(request, result, _x, _y, scrolledX, scrolledY, hitTestAction)) {
+                updateHitTestResult(result, IntPoint(_x - tx, _y - ty));
+                return true;
+            }
+            if (hitTestAction == HitTestFloat && hitTestFloats(request, result, _x, _y, scrolledX, scrolledY))
+                return true;
+        } else if (hitTestColumns(request, result, _x, _y, scrolledX, scrolledY, hitTestAction)) {
             updateHitTestResult(result, IntPoint(_x - tx, _y - ty));
             return true;
         }
-
-        // Hit test floats.
-        if (hitTestAction == HitTestFloat && m_floatingObjects) {
-            if (isRenderView()) {
-                scrolledX += toRenderView(this)->frameView()->scrollX();
-                scrolledY += toRenderView(this)->frameView()->scrollY();
-            }
-            
-            FloatingObject* o;
-            DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
-            for (it.toLast(); (o = it.current()); --it) {
-                if (o->m_shouldPaint && !o->m_renderer->hasSelfPaintingLayer()) {
-                    int xoffset = scrolledX + o->m_left + o->m_renderer->marginLeft() - o->m_renderer->x();
-                    int yoffset =  scrolledY + o->m_top + o->m_renderer->marginTop() - o->m_renderer->y();
-                    if (o->m_renderer->hitTest(request, result, IntPoint(_x, _y), xoffset, yoffset)) {
-                        updateHitTestResult(result, IntPoint(_x - xoffset, _y - yoffset));
-                        return true;
-                    }
-                }
-            }
-        }
     }
 
     // Now hit test our background
@@ -3840,6 +3820,32 @@ bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
     return false;
 }
 
+bool RenderBlock::hitTestFloats(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty)
+{
+    if (!m_floatingObjects)
+        return false;
+
+    if (isRenderView()) {
+        tx += toRenderView(this)->frameView()->scrollX();
+        ty += toRenderView(this)->frameView()->scrollY();
+    }
+
+    FloatingObject* floatingObject;
+    DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects);
+    for (it.toLast(); (floatingObject = it.current()); --it) {
+        if (floatingObject->m_shouldPaint && !floatingObject->m_renderer->hasSelfPaintingLayer()) {
+            int xOffset = tx + floatingObject->m_left + floatingObject->m_renderer->marginLeft() - floatingObject->m_renderer->x();
+            int yOffset =  ty + floatingObject->m_top + floatingObject->m_renderer->marginTop() - floatingObject->m_renderer->y();
+            if (floatingObject->m_renderer->hitTest(request, result, IntPoint(x, y), xOffset, yOffset)) {
+                updateHitTestResult(result, IntPoint(x - xOffset, y - yOffset));
+                return true;
+            }
+        }
+    }
+
+    return false;
+}
+
 bool RenderBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
 {
     // We need to do multiple passes, breaking up our hit testing into strips.
@@ -3867,7 +3873,7 @@ bool RenderBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& r
             if (result.isRectBasedTest() && !colRect.contains(result.rectFromPoint(x, y)))
                 hitTestContents(request, result, x, y, finalX, finalY, hitTestAction);
             else
-                return hitTestContents(request, result, x, y, finalX, finalY, hitTestAction);
+                return hitTestContents(request, result, x, y, finalX, finalY, hitTestAction) || hitTestAction == HitTestFloat && hitTestFloats(request, result, x, y, finalX, finalY);
         }
     }
 
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index 95d0c29..9147410 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -352,6 +352,7 @@ private:
     int leftOffset() const;
     virtual bool hitTestColumns(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
     virtual bool hitTestContents(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
+    bool hitTestFloats(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty);
 
     virtual bool isPointInOverflowControl(HitTestResult&, int x, int y, int tx, int ty);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list