зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
9dc32348bb
Коммит
df3d156e41
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче