TextIterator::rangeLength() returns wrong result for display:none |
|||||||
Issue descriptionDetailed report: https://cluster-fuzz.appspot.com/testcase?key=6043894071951360 Fuzzer: inferno_layout_test_unmodified Job Type: linux_debug_content_shell_drt Platform Id: linux Crash Type: ASSERT Crash Address: Crash State: ASSERTION FAILED: start <= end blink::PlainTextRange::PlainTextRange blink::PlainTextRange::create Minimized Testcase (1.75 Kb): https://cluster-fuzz.appspot.com/download/AMIfv95IoHoDNLjjhVeqdlwwaLlQry3A1WGvF9R6ac8NEJ42M1wSMOOPaLroVxwxvjl8-qvs9DbdkIQnXjGv_76B0u7tIvY__cY-n5LqWTEpVIpNE7P8msbjXeUH2M62y1lVznLWu_CHiZ26Gt4OLOeJg0F04NPVvg Filer: ashejole See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information.
,
Mar 24 2016
,
Mar 25 2016
PlainTextRange::PlainTextRange(int start, int end)
: m_start(start)
, m_end(end)
{
ASSERT(start >= 0);
ASSERT(end >= 0);
ASSERT(start <= end);
Where |start| = 100, |end| = 2
|start| and |end| come from |PlainTextRange::create()| with
- |scope| = Document node
- |range.start| "hello"@2
- |range.end| wold2d"@3
by |TextIterator::rangeLength()|
m_frame.m_raw->m_selection.m_raw->showTreeForThis()
BODY 000001D05F2E3240
DIV 000001D05F2E32A8 ID="test" STYLE="display: none;" (focused)
SPAN 000001D05F2E3480
S #text 000001D05F2E34E8 "hello"
E #text 000001D05F2E3538 " wo12d"
#text 000001D05F2E3310 "\n"
SCRIPT 000001D05F2E3360
#text 000001D05F2E33D8 "..script.."
#text 000001D05F2E3588 "PASS: Replacing 2 characters in endContainer by 2 characters after the end point null but expected 3\n"
,
Jul 7 2016
The root cause is in |TextIteratorAlgorithm::advance()|: When |m_node| is neither a shadow host nor a laid-out node, text iterator simply skips |m_node| and its subtree, and directly proceeds to the next sibling of |m_node| (lines 286, 348 and 352). The bug occurs if both |m_endContainer| and |m_pastEndNode| are also in the skipped subtree, in which case text iterator would erroneously proceed all the way to the end of the document.
,
Jul 12 2016
ClusterFuzz has detected this issue as fixed in range 404631:404811. Detailed report: https://cluster-fuzz.appspot.com/testcase?key=6043894071951360 Fuzzer: inferno_layout_test_unmodified Job Type: linux_debug_content_shell_drt Platform Id: linux Crash Type: ASSERT Crash Address: Crash State: start <= end blink::PlainTextRange::PlainTextRange blink::PlainTextRange::create Regressed: https://cluster-fuzz.appspot.com/revisions?job=linux_debug_content_shell_drt&range=268656:269696 Fixed: https://cluster-fuzz.appspot.com/revisions?job=linux_debug_content_shell_drt&range=404631:404811 Minimized Testcase (0.86 Kb): Download: https://cluster-fuzz.appspot.com/download/AMIfv943AMylWYdlYBWHwSGNcWQkD-vgR4IWTFBHFMa0fgxsc8CdMskI6yJ9z-WUkYr9eAL2YyG5x7NQzuTs5WMdTpaY0d8qASb7TVaF6fVroos_nLBJZGw80yyJHZiagzVIjXln6eEzzvjpTn5SA9tOCLNEaS70SQ?testcase_id=6043894071951360 <div id="test" contenteditable></div> <script> test.focus(); var baseIsFirst = true; function runSingleTest(actor, isStart, expectedOffset) { test.innerHTML = '<span>hello</span> world'; var selection = window.getSelection(); selection.setBaseAndExtent(test.firstChild.firstChild, 2, test.lastChild, 3); var action = isStart ? actor() : actor(); var message = null; if (expectedOffset == 'undefined') { }!selection.rangeCount passed = true; document.write((passed ? 'PASS: ' : 'FAIL: ') + action + ' ' + message + '\n'); } function runTestPairs(actor, expectedEndOffset) { runSingleTest(actor, false); } function runTests() { runTestPairs(function( nodeName) { '12'; return 'Replacing 2 characters in ' + nodeName + ' by 2 characters after the end point'; }); } runTests(); test.style.display = 'none'; </script> See https://dev.chromium.org/Home/chromium-security/bugs/reproducing-clusterfuzz-bugs for more information. If you suspect that the result above is incorrect, try re-doing that job on the test case report page.
,
Jul 12 2016
ClusterFuzz testcase is verified as fixed, closing issue. If this is incorrect, please add ClusterFuzz-Wrong label and re-open the issue.
,
Jul 25 2016
The test case no longer reproduces due to its flakiness, but the root cause is still there.
,
Nov 22 2016
Removing EditIssue view restrictions from ClusterFuzz filed bugs. If you believe that this issue should still be restricted, please reapply the label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by ashej...@chromium.org
, Mar 24 2016Labels: -Pri-1 findit-wrong Te-Logged M-50 Pri-2
Owner: yosin@chromium.org
Status: Assigned (was: Available)