https://bugs.webkit.org/show_bug.cgi?id=133256
Reviewed by Simon Fraser.
Source/WebCore:
During a scroll, we set a flag which caret position is gated on, but we never
actually invalidate the caret's position. This patch does so.
Test: editing/input/caret-position-during-scroll.html
* editing/FrameSelection.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
LayoutTests:
This test places the caret, inspects its position, scrolls, and then immediately inspects its
position again. The two positions should be different.
* editing/input/caret-position-during-scroll-expected.txt: Added.
* editing/input/caret-position-during-scroll.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169399
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-05-23 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Caret's screen position does not update during an overflow scroll
+ https://bugs.webkit.org/show_bug.cgi?id=133256
+
+ Reviewed by Simon Fraser.
+
+ This test places the caret, inspects its position, scrolls, and then immediately inspects its
+ position again. The two positions should be different.
+
+ * editing/input/caret-position-during-scroll-expected.txt: Added.
+ * editing/input/caret-position-during-scroll.html: Added.
+
2014-05-27 David Hyatt <hyatt@apple.com>
REGRESSION: Audio volume scrubber does not show volume level thumb
--- /dev/null
+This test places the caret, inspects its position, scrolls, and immediately inspects the caret's position again. The two positions should be different. If this test passes, "Result: Pass" will be printed below the list of numbers.
+Scrolling with the mouse does not cause the caret's screen position to be recomputed
+00
+01
+02
+03
+04
+05
+06
+07
+08
+09
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+Result: PASS
--- /dev/null
+<!DOCTYPE html>
+<head>
+<script type="text/javascript" src="resources/reveal-utilities.js"></script>
+</head>
+<body>
+<div>This test places the caret, inspects its position, scrolls, and immediately inspects the caret's position again.
+The two positions should be different. If this test passes, "Result: Pass" will be printed below the list of numbers.</div>
+<div>Scrolling with the mouse does not cause the caret's screen position to be recomputed</div>
+<span style="position:absolute; visibility:hidden" id="single-digit">0</span>
+<div style="border:thin solid black; overflow:scroll" contenteditable="true" id="input-contenteditable"></div>
+Result: <span id="console"></div>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+var contentEditable = document.getElementById("input-contenteditable");
+contentEditable.innerHTML = generateNumbers(0, 30, 2, "<br>");
+var singleDigitHeight = document.getElementById("single-digit").clientHeight;
+var contentEditableSize = 10;
+contentEditable.style.height = (singleDigitHeight * contentEditableSize) + "px";
+contentEditable.focus();
+var child = contentEditable.firstChild;
+for (var i = 0; i < 36; ++i)
+ child = child.nextSibling;
+getSelection().collapse(child, 0);
+var before;
+if (window.internals)
+ before = internals.absoluteCaretBounds(document).top;
+if (window.eventSender) {
+ var input = document.getElementById('input-contenteditable');
+ var x = contentEditable.offsetLeft + contentEditable.offsetWidth / 2;
+ var y = contentEditable.offsetTop + contentEditable.offsetHeight / 2;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseScrollBy(0, -50);
+}
+var after;
+if (window.internals)
+ after = internals.absoluteCaretBounds(document).top;
+var result = "FAIL";
+if (before != after)
+ result = "PASS";
+document.getElementById("console").textContent = result;
+</script>
+</body>
+2014-05-23 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Caret's screen position does not update during an overflow scroll
+ https://bugs.webkit.org/show_bug.cgi?id=133256
+
+ Reviewed by Simon Fraser.
+
+ During a scroll, we set a flag which caret position is gated on, but we never
+ actually invalidate the caret's position. This patch does so.
+
+ Test: editing/input/caret-position-during-scroll.html
+
+ * editing/FrameSelection.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::scrollTo):
+
2014-05-27 Timothy Horton <timothy_horton@apple.com>
Turn on the LayerPool for iOS
bool shouldShowBlockCursor() const { return m_shouldShowBlockCursor; }
void setShouldShowBlockCursor(bool);
+ void invalidateCaretRect();
+
private:
enum EPositionType { START, END, BASE, EXTENT };
void setCaretVisibility(CaretVisibility);
bool recomputeCaretRect();
- void invalidateCaretRect();
bool dispatchSelectStart();
Frame& frame = renderer().frame();
RenderLayerModelObject* repaintContainer = renderer().containerForRepaint();
// The caret rect needs to be invalidated after scrolling
- frame.selection().setCaretRectNeedsUpdate();
+ frame.selection().invalidateCaretRect();
FloatQuad quadForFakeMouseMoveEvent = FloatQuad(m_repaintRect);
if (repaintContainer)