New issue
Advanced search Search tips

Issue 700368 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug



Sign in to add a comment

makeSearchRange() should use Position::computeContainerNode()

Project Member Reported by ah...@yandex-team.ru, Mar 10 2017

Issue description

To reproduce, load this page:

<label>
  <input type="checkbox"></input>
  <div style="user-select: none;">text</div>
</label>

and double-click on the text. The result is:
  FATAL:EphemeralRange.cpp(43) Check failed: m_startPosition <= m_endPosition (INPUT@afterAnchor vs. INPUT@afterChildren)

This happens with the following stack (the problem is in makeSearchRange actually, but it was inlined):

blink_core.dll!blink::EphemeralRangeTemplate<blink::EditingAlgorithm<blink::FlatTreeTraversal> >::EphemeralRangeTemplate Line 44
blink_core.dll!blink::VisibleSelectionTemplate<blink::EditingAlgorithm<blink::FlatTreeTraversal> >::appendTrailingWhitespace Line 207
blink_core.dll!blink::SelectionController::selectClosestWordFromHitTestResult Line 490
blink_core.dll!blink::SelectionController::selectClosestWordFromMouseEvent Line 546
blink_core.dll!blink::SelectionController::handleMousePressEventDoubleClick Line 742
blink_core.dll!blink::MouseEventManager::handleMousePressEvent Line 614
blink_core.dll!blink::EventHandler::handleMousePressEvent Line 722
blink_web.dll!blink::PageWidgetEventHandler::handleMouseDown Line 249
blink_web.dll!blink::WebViewImpl::handleMouseDown Line 521
blink_web.dll!blink::PageWidgetDelegate::handleInputEvent Line 163
blink_web.dll!blink::WebViewImpl::handleInputEvent Line 2225
content.dll!content::RenderWidgetInputHandler::HandleInputEvent Line 312

Note: 100% reproducible on windows, but not on mac.
 
select-crash.html
100 bytes View Download

Comment 1 Deleted

Comment 2 by yosin@chromium.org, Mar 15 2017

In review: http://crrev.com/2747333002
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/66986ea643d5a387e1ec0682663617df0cda2b96

commit 66986ea643d5a387e1ec0682663617df0cda2b96
Author: yosin <yosin@chromium.org>
Date: Wed Mar 15 07:04:45 2017

Make makeSearchRange() in VisibleSelection to handle BeforeAnchor and AfterAnchor position type

This patch makes |makeSearchRange()| in |VisibleSelection| to use |Position|
container node instead of anchor node to return correct range.

Before this patch, |makeSearchRange()| attempts to create a range from
after element to after child nodes of element which violates |start <= end|
in |EphmeralRange| constructor.

BUG= 700368 
TEST=run_webkit_unit_tests --gtest_filter=VisibleSelectionTest.appendTrailingWhitespaceWithAfterAnchor

Review-Url: https://codereview.chromium.org/2747333002
Cr-Commit-Position: refs/heads/master@{#457018}

[modify] https://crrev.com/66986ea643d5a387e1ec0682663617df0cda2b96/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
[modify] https://crrev.com/66986ea643d5a387e1ec0682663617df0cda2b96/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp

Comment 4 by yosin@chromium.org, Mar 15 2017

Status: Fixed (was: Started)
Cc: jmukthavaram@chromium.org
Labels: Needs-Feedback
Tested the issue on Windows 7 with chrome dev version-59.0.3043.0 as per the provided html file in comment#0.Able to check & uncheck the text check box after running the html file in browser.
Please find the atatched screencast for reference & confirm us on the expected behaviour & fix for the same.
Thank you!!.
700368.mp4
396 KB View Download

Sign in to add a comment