[LayoutNG] ComputeNGCaretPosition crashes with float ::first-letter |
|||
Issue description
Load the following html.
<style>
.top {
font-size: 30px;
width: 200px
}
</style>
<div class="top">
foo<span id="span">bar</span>
</div>
<div class="top">
<div id="foo">foo</div><div id="bar" contenteditable>bar</div>
</div>
<style>
#div3:first-letter {
float: right
}
</style>
<div class="top" id="div3">foo<span>bar</span></div>
<script>
var i = 0;
setInterval(() => {
i++;
if (i > 2) i = 0;
switch (i) {
case 0:
getSelection().setBaseAndExtent(span.firstChild, 1, span.firstChild, 2);
return;
case 1:
getSelection().setBaseAndExtent(foo.firstChild, 1, bar.firstChild, 2);
return;
case 2:
getSelection().setBaseAndExtent(div3.firstChild, 0, div3.firstChild, 2);
return;
}
}, 500);
getSelection().setBaseAndExtent(span.firstChild, 1, span.firstChild, 2);
</script>
,
Feb 5 2018
,
Feb 6 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/872b5e325643829e279921d8b7f06365e4baaff7 commit 872b5e325643829e279921d8b7f06365e4baaff7 Author: Xiaocheng Hu <xiaochengh@chromium.org> Date: Tue Feb 06 04:59:57 2018 [LayoutNG] Fix caret position resolution when dealing with floats The current caret position resolution algorithm assumes that all descendants of an inline formatting context fragments are inline, and hence contained in a line box. This is not the case with floats and out-of-flow positioned fragments. This patch makes the algorithm handle them correctly. Bug: 808914 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng Change-Id: If238323a9b9694fb4a9d1668254a89eea8d6756e Reviewed-on: https://chromium-review.googlesource.com/902685 Reviewed-by: Emil A Eklund <eae@chromium.org> Reviewed-by: Yoichi Osato <yoichio@chromium.org> Reviewed-by: Koji Ishii <kojii@chromium.org> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/master@{#534629} [modify] https://crrev.com/872b5e325643829e279921d8b7f06365e4baaff7/third_party/WebKit/Source/core/editing/LocalCaretRectTest.cpp [modify] https://crrev.com/872b5e325643829e279921d8b7f06365e4baaff7/third_party/WebKit/Source/core/layout/ng/inline/ng_caret_rect.cc
,
Feb 6 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by yoichio@chromium.org
, Feb 5 2018