Changeset 125648 in webkit
- Timestamp:
- Aug 14, 2012 10:20:45 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r125647 r125648 1 2012-08-14 Sukolsak Sakshuwong <sukolsak@google.com> 2 3 Text selection in text area in auto scroll mode goes wrong. 4 https://bugs.webkit.org/show_bug.cgi?id=74346 5 6 Reviewed by Ojan Vafai. 7 8 * fast/events/autoscroll-in-textarea-expected.txt: Added. 9 * fast/events/autoscroll-in-textarea.html: Added. 10 1 11 2012-08-14 Yuta Kitamura <yutak@google.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r125644 r125648 1 2012-08-14 Sukolsak Sakshuwong <sukolsak@google.com> 2 3 Text selection in text area in auto scroll mode goes wrong. 4 https://bugs.webkit.org/show_bug.cgi?id=74346 5 6 Reviewed by Ojan Vafai. 7 8 WebKit triggers autoscroll in text area when the user drags the cursor from inside 9 the text area to the outside. When that happens, it gets the local cursor position 10 relative to the node under the cursor from hit-testing, converts it to 11 the absolute position, and then converts it to the local position relative to the 12 text area. However, the hit-testing method of text area did not take scrolling 13 offset into account. This caused it to give an incorrect value of the local cursor 14 position. Make the hit-testing take scrolling offset into account. 15 16 Test: fast/events/autoscroll-in-textarea.html 17 18 * html/shadow/TextControlInnerElements.cpp: 19 (WebCore::TextControlInnerTextElement::createRenderer): 20 * rendering/RenderTextControl.cpp: 21 (WebCore::RenderTextControl::hitInnerTextElement): 22 * rendering/RenderTextControlSingleLine.cpp: 23 (WebCore): 24 * rendering/RenderTextControlSingleLine.h: 25 (WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock): 26 (WebCore::RenderTextControlInnerBlock::hasLineIfEmpty): 27 1 28 2012-08-14 Shinya Kawanaka <shinyak@chromium.org> 2 29 -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp
r125529 r125648 103 103 RenderObject* TextControlInnerTextElement::createRenderer(RenderArena* arena, RenderStyle*) 104 104 { 105 bool multiLine = false; 106 Element* shadowAncestor = shadowHost(); 107 if (shadowAncestor && shadowAncestor->renderer()) { 108 ASSERT(shadowAncestor->renderer()->isTextField() || shadowAncestor->renderer()->isTextArea()); 109 multiLine = shadowAncestor->renderer()->isTextArea(); 110 } 111 return new (arena) RenderTextControlInnerBlock(this, multiLine); 105 return new (arena) RenderTextControlInnerBlock(this); 112 106 } 113 107 -
trunk/Source/WebCore/rendering/RenderTextControl.cpp
r124556 r125648 156 156 void RenderTextControl::hitInnerTextElement(HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset) 157 157 { 158 HTMLElement* innerText = innerTextElement(); 158 159 LayoutPoint adjustedLocation = accumulatedOffset + location(); 159 HTMLElement* innerText = innerTextElement(); 160 LayoutPoint localPoint = pointInContainer - toLayoutSize(adjustedLocation + innerText->renderBox()->location()); 161 if (hasOverflowClip()) 162 localPoint += scrolledContentOffset(); 160 163 result.setInnerNode(innerText); 161 164 result.setInnerNonSharedNode(innerText); 162 result.setLocalPoint( pointInContainer - toLayoutSize(adjustedLocation + innerText->renderBox()->location()));165 result.setLocalPoint(localPoint); 163 166 } 164 167 -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r123329 r125648 50 50 using namespace HTMLNames; 51 51 52 VisiblePosition RenderTextControlInnerBlock::positionForPoint(const LayoutPoint& point)53 {54 LayoutPoint contentsPoint(point);55 56 // Multiline text controls have the scroll on shadowHost, so we need to take57 // that into account here.58 if (m_multiLine) {59 RenderTextControl* renderer = toRenderTextControl(node()->shadowHost()->renderer());60 if (renderer->hasOverflowClip())61 contentsPoint += renderer->scrolledContentOffset();62 }63 64 return RenderBlock::positionForPoint(contentsPoint);65 }66 67 // ----------------------------68 69 52 RenderTextControlSingleLine::RenderTextControlSingleLine(Node* node) 70 53 : RenderTextControl(node) -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h
r120824 r125648 111 111 class RenderTextControlInnerBlock : public RenderBlock { 112 112 public: 113 RenderTextControlInnerBlock(Node* node , bool isMultiLine) : RenderBlock(node), m_multiLine(isMultiLine) { }113 RenderTextControlInnerBlock(Node* node) : RenderBlock(node) { } 114 114 115 115 private: 116 116 virtual bool hasLineIfEmpty() const { return true; } 117 virtual VisiblePosition positionForPoint(const LayoutPoint&);118 119 bool m_multiLine;120 117 }; 121 118
Note: See TracChangeset
for help on using the changeset viewer.