- Revision
- 147635
- Author
- [email protected]
- Date
- 2013-04-04 09:01:49 -0700 (Thu, 04 Apr 2013)
Log Message
REGRESSION (r145870): Can't get insertion point to appear in some input and textareas on wordpress
https://bugs.webkit.org/show_bug.cgi?id=113591
Patch by Xidorn Quan <[email protected]> on 2013-04-04
Reviewed by Simon Fraser.
Source/WebCore:
Since a child node could overflow its ancestor, it is not wise to check
one's radii boundary before checking whether the given point intersects
its children. This patch moves the related code down to fix the bug.
Test: fast/borders/border-radius-child.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
LayoutTests:
* fast/borders/border-radius-child-expected.txt: Added.
* fast/borders/border-radius-child.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (147634 => 147635)
--- trunk/LayoutTests/ChangeLog 2013-04-04 15:53:14 UTC (rev 147634)
+++ trunk/LayoutTests/ChangeLog 2013-04-04 16:01:49 UTC (rev 147635)
@@ -1,3 +1,13 @@
+2013-04-04 Xidorn Quan <[email protected]>
+
+ REGRESSION (r145870): Can't get insertion point to appear in some input and textareas on wordpress
+ https://bugs.webkit.org/show_bug.cgi?id=113591
+
+ Reviewed by Simon Fraser.
+
+ * fast/borders/border-radius-child-expected.txt: Added.
+ * fast/borders/border-radius-child.html: Added.
+
2013-04-04 Christophe Dumez <[email protected]>
Regression(r142765) Broke Custom SVG cursors and SVG canvas drawing for Chromium
Added: trunk/LayoutTests/fast/borders/border-radius-child-expected.txt (0 => 147635)
--- trunk/LayoutTests/fast/borders/border-radius-child-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/borders/border-radius-child-expected.txt 2013-04-04 16:01:49 UTC (rev 147635)
@@ -0,0 +1,22 @@
+Test for bug 113591: https://bugs.webkit.org/show_bug.cgi?id=113591 REGRESSION (r145870): Can't get insertion point to appear in some input and textareas on wordpress
+
+PASS document.elementFromPoint(x + 5, y - 5).id is 'outerBox'
+PASS document.elementFromPoint(x + 5, y + 5).id is 'innerBox'
+PASS document.elementFromPoint(x + 5, y + 95).id is 'innerBox'
+PASS document.elementFromPoint(x + 5, y + 105).id is 'outerBox'
+PASS document.elementFromPoint(x + 95, y - 5).id is 'outerBox'
+PASS document.elementFromPoint(x + 95, y + 5).id is 'innerBox'
+PASS document.elementFromPoint(x + 95, y + 95).id is 'innerBox'
+PASS document.elementFromPoint(x + 95, y + 105).id is 'outerBox'
+PASS document.elementFromPoint(x + 105, y - 5).id is 'container'
+PASS document.elementFromPoint(x + 105, y + 5).id is 'innerBox'
+PASS document.elementFromPoint(x + 105, y + 95).id is 'innerBox'
+PASS document.elementFromPoint(x + 105, y + 105).id is 'container'
+PASS document.elementFromPoint(x + 195, y - 5).id is 'container'
+PASS document.elementFromPoint(x + 195, y + 5).id is 'innerBox'
+PASS document.elementFromPoint(x + 195, y + 95).id is 'innerBox'
+PASS document.elementFromPoint(x + 195, y + 105).id is 'container'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/borders/border-radius-child.html (0 => 147635)
--- trunk/LayoutTests/fast/borders/border-radius-child.html (rev 0)
+++ trunk/LayoutTests/fast/borders/border-radius-child.html 2013-04-04 16:01:49 UTC (rev 147635)
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+var x, y;
+
+function offset(elem) {
+ var result = {top: 0, left: 0};
+ for (; elem; elem = elem.offsetParent) {
+ result.left += elem.offsetLeft;
+ result.top += elem.offsetTop;
+ }
+ return result;
+}
+
+function test() {
+ var innerBox = document.getElementById('innerBox');
+ x = offset(innerBox).left;
+ y = offset(innerBox).top;
+ shouldBe("document.elementFromPoint(x + 5, y - 5).id", "'outerBox'");
+ shouldBe("document.elementFromPoint(x + 5, y + 5).id", "'innerBox'");
+ shouldBe("document.elementFromPoint(x + 5, y + 95).id", "'innerBox'");
+ shouldBe("document.elementFromPoint(x + 5, y + 105).id", "'outerBox'");
+ shouldBe("document.elementFromPoint(x + 95, y - 5).id", "'outerBox'");
+ shouldBe("document.elementFromPoint(x + 95, y + 5).id", "'innerBox'");
+ shouldBe("document.elementFromPoint(x + 95, y + 95).id", "'innerBox'");
+ shouldBe("document.elementFromPoint(x + 95, y + 105).id", "'outerBox'");
+ shouldBe("document.elementFromPoint(x + 105, y - 5).id", "'container'");
+ shouldBe("document.elementFromPoint(x + 105, y + 5).id", "'innerBox'");
+ shouldBe("document.elementFromPoint(x + 105, y + 95).id", "'innerBox'");
+ shouldBe("document.elementFromPoint(x + 105, y + 105).id", "'container'");
+ shouldBe("document.elementFromPoint(x + 195, y - 5).id", "'container'");
+ shouldBe("document.elementFromPoint(x + 195, y + 5).id", "'innerBox'");
+ shouldBe("document.elementFromPoint(x + 195, y + 95).id", "'innerBox'");
+ shouldBe("document.elementFromPoint(x + 195, y + 105).id", "'container'");
+ isSuccessfullyParsed();
+}
+</script>
+<style>
+ #container {
+ padding: 100px 150px 100px 50px;
+ width: 200px; height: 200px;
+ background-color: lightgray;
+ }
+ #outerBox {
+ width: 100px; height: 100px;
+ padding: 50px 0 50px 100px;
+ border-radius: 10px;
+ background-color: lightgreen;
+ }
+ #innerBox {
+ width: 200px; height: 100px;
+ background-color: green;
+ }
+</style>
+</head>
+<body _onload_="test()">
+ <p>Test for <i>bug 113591</i>: <a href="" REGRESSION (r145870): Can't get insertion point to appear in some input and textareas on wordpress</p>
+ <div id="container">
+ <div id="outerBox">
+ <div id="innerBox"></div>
+ </div>
+ </div>
+ <div id="console"></div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (147634 => 147635)
--- trunk/Source/WebCore/ChangeLog 2013-04-04 15:53:14 UTC (rev 147634)
+++ trunk/Source/WebCore/ChangeLog 2013-04-04 16:01:49 UTC (rev 147635)
@@ -1,3 +1,19 @@
+2013-04-04 Xidorn Quan <[email protected]>
+
+ REGRESSION (r145870): Can't get insertion point to appear in some input and textareas on wordpress
+ https://bugs.webkit.org/show_bug.cgi?id=113591
+
+ Reviewed by Simon Fraser.
+
+ Since a child node could overflow its ancestor, it is not wise to check
+ one's radii boundary before checking whether the given point intersects
+ its children. This patch moves the related code down to fix the bug.
+
+ Test: fast/borders/border-radius-child.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::nodeAtPoint):
+
2013-04-04 Xabier Rodriguez Calvar <[email protected]>
[GStreamer] Virtual modifier for MediaPlayer::simulateAudioInterruption must go
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (147634 => 147635)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2013-04-04 15:53:14 UTC (rev 147634)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2013-04-04 16:01:49 UTC (rev 147635)
@@ -4905,13 +4905,6 @@
LayoutRect overflowBox = visualOverflowRect();
flipForWritingMode(overflowBox);
overflowBox.moveBy(adjustedLocation);
- if (style()->hasBorderRadius()) {
- LayoutRect borderRect = borderBoxRect();
- borderRect.moveBy(adjustedLocation);
- RoundedRect border = style()->getRoundedBorderFor(borderRect, view());
- if (!locationInContainer.intersects(border))
- return false;
- }
if (!locationInContainer.intersects(overflowBox))
return false;
}
@@ -4947,6 +4940,15 @@
}
}
+ // Check if the point is outside radii.
+ if (!isRenderView() && style()->hasBorderRadius()) {
+ LayoutRect borderRect = borderBoxRect();
+ borderRect.moveBy(adjustedLocation);
+ RoundedRect border = style()->getRoundedBorderFor(borderRect, view());
+ if (!locationInContainer.intersects(border))
+ return false;
+ }
+
// Now hit test our background
if (hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) {
LayoutRect boundsRect(adjustedLocation, size());