Bug 1700375. Treat replaced elements as non-inline for the purposes of determining which element to zoom to for double tap to zoom. r=emilio

The specific case that motivated this was text areas, but in bug 1700535 we changed those to inline block to match all other input elements and other browsers.

Bug 1539469 changed all inputs to inline-block based on the spec discussion https://github.com/whatwg/html/issues/4082 but textarea's were not part of that.

<img> elements remain as inline though, and we probably do want to zoom to them (and they are replaced), so this change is still desirable.

Differential Revision: https://phabricator.services.mozilla.com/D109574
This commit is contained in:
Timothy Nikkel 2021-04-07 11:38:41 +00:00
Родитель 9dc32348bb
Коммит df3d156e41
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -64,7 +64,11 @@ static already_AddRefed<dom::Element> ElementFromPoint(
static bool ShouldZoomToElement(const nsCOMPtr<dom::Element>& aElement) {
if (nsIFrame* frame = aElement->GetPrimaryFrame()) {
if (frame->StyleDisplay()->IsInlineFlow()) {
if (frame->StyleDisplay()->IsInlineFlow() &&
// Replaced elements are suitable zoom targets because they act like
// inline-blocks instead of inline. (textarea's are the specific reason
// we do this)
!frame->IsFrameOfType(nsIFrame::eReplaced)) {
return false;
}
}