[Webkit-unassigned] [Bug 42593] element.scrollIntoView() sometimes doesn't scroll

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 19 08:08:22 PST 2022


--- Comment #7 from Martin Robinson <mrobinson at webkit.org> ---
It seems like this MIN_INTERSECT_FOR_REVEAL is not used when tabbing through fields any longer:

1. Tabbing with the keyboard through forms eventually calls HTMLTextFormControlElement::setSelectionRange 
2. HTMLTextFormControlElement::setSelectionRange calls FrameSelection::moveWithoutValidationTo
3. FrameSelection::moveWithoutValidationTo calls FrameSelection::setSelection
4. FrameSelection::setSelection calls FrameSelection::updateAndRevealSelection with RevealExtentOption::RevealExtent because options **does not** contain RevealSelectionBounds
5. FrameSelection::updateAndRevealSelection calls FrameSelection::revealSelection
6. FrameSelection::revealSelection assigns the caret boundaries to the reveal rectangle since revealExtentOption == RevealExtent (passed from step 4) and uses the rect in the call to RenderLayer::scrollRectToVisible
7. scrollRectToVisible calls getExtentRect which compares the intersection of the rectangle to reveal to the exposure rectangle. Since the caret is usually one pixel wide, this rectangle is never larger than MIN_INTERSECT_FOR_REVEAL (which is 32) and the condition is never fulfilled.

My conclusion is that MIN_INTERSECT_FOR_REVEAL is interfering with scrolling to elements in a lot of cases, but never for its original purpose. It seems like it is safe just to remove this legacy workaround.

Note: The meanings of RevealExtent and RevealSelectionBounds seems to be opposite from each other, which is very confusing. The only time that RevealSelectionBounds is used is when restoring highlights from AppHighlightStorage via temporary selection changes.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220119/544e2afd/attachment.htm>

More information about the webkit-unassigned mailing list