[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
mitz at apple.com
mitz at apple.com
Wed Mar 17 18:18:18 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit c0944d5de9e9edde3777bb88cd6bc3b1a37edf98
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Mar 4 21:02:56 2010 +0000
WebCore: Based on a pacth from Nick Jong.
Reviewed by Simon Fraser.
Improve selection in multi-column blocks when hitting points above or
below a column rect.
Test: fast/multicol/hit-test-above-or-below.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::adjustPointToColumnContents): If the point lies
within the horizontal range for a column, constrain it to the column (if
it is above) or the next column (if it is below).
LayoutTests: Added test for hit-testing points above or below the column rect.
Reviewed by Simon Fraser.
* fast/multicol/hit-test-above-or-below-expected.txt: Added.
* fast/multicol/hit-test-above-or-below.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5dffe7f..494d1c9 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-03-04 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Added test for hit-testing points above or below the column rect.
+
+ * fast/multicol/hit-test-above-or-below-expected.txt: Added.
+ * fast/multicol/hit-test-above-or-below.html: Added.
+
2010-03-04 Diego Gonzalez <diego.gonzalez at openbossa.org>
Reviewed by Simon Hausmann.
diff --git a/LayoutTests/fast/multicol/hit-test-above-or-below-expected.txt b/LayoutTests/fast/multicol/hit-test-above-or-below-expected.txt
new file mode 100644
index 0000000..be4fc6e
--- /dev/null
+++ b/LayoutTests/fast/multicol/hit-test-above-or-below-expected.txt
@@ -0,0 +1,19 @@
+123
+abc
+def
+ghi
+jkl
+mno
+Character at 150, 25 is 1 as expected.
+Character at 350, 25 is d as expected.
+Character at 550, 25 is j as expected.
+Character at 750, 25 is m as expected.
+Character at 150, 275 is d as expected.
+Character at 350, 275 is j as expected.
+Character at 550, 275 is m as expected.
+Character at 750, 275 is null as expected.
+Character at 150, 475 is d as expected.
+Character at 350, 475 is j as expected.
+Character at 550, 475 is m as expected.
+Character at 750, 475 is null as expected.
+
diff --git a/LayoutTests/fast/multicol/hit-test-above-or-below.html b/LayoutTests/fast/multicol/hit-test-above-or-below.html
new file mode 100644
index 0000000..4e23fee
--- /dev/null
+++ b/LayoutTests/fast/multicol/hit-test-above-or-below.html
@@ -0,0 +1,49 @@
+<body style="margin: 0">
+<div style="margin: 50px; background-color: lightblue; width: 800px; -webkit-column-width: 185px; -webkit-column-gap: 15px; height: 200px; font-family: Ahem; font-size: 50px; line-height: 1;">
+ 123<div style="background-color: blue; height: 70px;"></div>abc<br>def<div style="background-color: blue; height: 60px;"></div>ghi<br>jkl<div style="background-color: blue; height: 110px;"></div>mno</div>
+<pre id="console" style="display: none;"></pre>
+<script>
+ function characterAtPoint(x, y)
+ {
+ var range = document.caretRangeFromPoint(x, y);
+ if (range.startContainer.nodeType !== Node.TEXT_NODE)
+ return null;
+ if (range.startOffset >= range.startContainer.length)
+ return null;
+ return range.startContainer.data[range.startOffset];
+ }
+
+ function log(message)
+ {
+ document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
+ }
+
+ function test(x, y, character)
+ {
+ var actualCharacter = characterAtPoint(x, y);
+ if (character === actualCharacter)
+ log ("Character at " + x + ", " + y + " is " + character + " as expected.");
+ else
+ log ("FAIL: Character at " + x + ", " + y + " is " + actualCharacter + ". Expected " + character + ".");
+ }
+
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ test(150, 25, "1");
+ test(350, 25, "d");
+ test(550, 25, "j");
+ test(750, 25, "m");
+
+ test(150, 275, "d");
+ test(350, 275, "j");
+ test(550, 275, "m");
+ test(750, 275, null);
+
+ test(150, 475, "d");
+ test(350, 475, "j");
+ test(550, 475, "m");
+ test(750, 475, null);
+
+ document.getElementById("console").style.display = "block";
+</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ce12ed9..2ee5931 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-03-04 Dan Bernstein <mitz at apple.com>
+
+ Based on a pacth from Nick Jong.
+
+ Reviewed by Simon Fraser.
+
+ Improve selection in multi-column blocks when hitting points above or
+ below a column rect.
+
+ Test: fast/multicol/hit-test-above-or-below.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::adjustPointToColumnContents): If the point lies
+ within the horizontal range for a column, constrain it to the column (if
+ it is above) or the next column (if it is below).
+
2010-03-04 Antonio Gomes <tonikitoo at webkit.org>
Reviewed by Simon Fraser.
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 62ca8fc..acf0dbf 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -3836,8 +3836,20 @@ void RenderBlock::adjustPointToColumnContents(IntPoint& point) const
// Add in half the column gap to the left and right of the rect.
IntRect colRect = colRects->at(i);
IntRect gapAndColumnRect(colRect.x() - leftGap, colRect.y(), colRect.width() + colGap, colRect.height());
-
- if (gapAndColumnRect.contains(point)) {
+
+ if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.right()) {
+ // FIXME: The clamping that follows is not completely right for right-to-left
+ // content.
+ // Clamp everything above the column to its top left.
+ if (point.y() < gapAndColumnRect.y())
+ point = gapAndColumnRect.location();
+ // Clamp everything below the column to the next column's top left. If there is
+ // no next column, this still maps to just after this column.
+ else if (point.y() >= gapAndColumnRect.bottom()) {
+ point = gapAndColumnRect.location();
+ point.move(0, gapAndColumnRect.height());
+ }
+
// We're inside the column. Translate the x and y into our column coordinate space.
point.move(columnPoint.x() - colRect.x(), yOffset);
return;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list