[editing] Don't go into UA shadow in Find{For,Back}wardInlineContents
Before this patch, for HTML like "<select></select>foo", Element* select = GetDocument().QuerySelector("select"); TextOffsetMapping::FindForwardInlineContents( PositionInFlatTree::BeforeNode(*select))); would go into the shadow root of the <select>, and return TextOffsetMapping::InlineContents(To<LayoutBlockFlow>( *select->GetShadowRoot()->firstChild()->GetLayoutObject())); This patch changes FindForwardInlineContents so that it instead returns TextOffsetMapping::InlineContents( To<LayoutBlockFlow>(*GetDocument().body()->GetLayoutObject()), *select->GetLayoutObject(), *select->GetLayoutObject()) just like it already happens for PositionInFlatTree::AfterNode(*select). And analogous for FindBackwardInlineContents. Bug: 1154430 TEST=All/ParameterizedTextOffsetMappingTest.RangeWithSelect1/0 TEST=All/ParameterizedTextOffsetMappingTest.RangeWithSelect1/1 TEST=All/ParameterizedTextOffsetMappingTest.RangeWithSelect2/0 TEST=All/ParameterizedTextOffsetMappingTest.RangeWithSelect2/1 Change-Id: Ib894e8d691f99189fc5f35f1bfa18365f4b59e4d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2566939 Commit-Queue: Yoshifumi Inoue <yosin@chromium.org> Reviewed-by:Yoshifumi Inoue <yosin@chromium.org> Cr-Commit-Position: refs/heads/master@{#832658}
Showing
Please register or sign in to comment