Prevent AccessibleCaret from appearing when dismissing instagram's "use the app" banner on Fennec / GeckoView
Categories
(Core :: DOM: Selection, defect, P2)
Tracking
()
People
(Reporter: emilio, Assigned: TYLin)
References
(Blocks 1 open bug)
Details
(Whiteboard: [geckoview:p2])
Attachments
(5 files)
Assignee | ||
Comment 1•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Updated•7 years ago
|
Assignee | ||
Comment 2•7 years ago
|
||
Beside the caret bug. I saw a separate issue here.
With layout.accessiblecaret.enabled_on_touch=false
on Fennec, I still cannot dismiss the Instagram's "Use the App" banner easily. I need to click it multiple times, or force zoom-in the page to make the X
larger enough to click. I don't feel the same problem on Google Chrome.
Assignee | ||
Comment 3•7 years ago
•
|
||
The reduced test case has a grid or flex container containing only a simple <button>. If one clicks on the background of the container, we'll create a non-collapsed range. That's why AccessibleCaret shows.
<div style="display: grid;">
<button>grid</button>
</div>
Perhaps we should make the selection behavior of the flex or grid container more like a block?
Assignee | ||
Comment 4•7 years ago
|
||
NI for comment 3.
Given more website adopting flex and grid, this bug might be more prominent on mobile (See bug 1464792).
Mats, given your experience in grid and selection. Perhaps you could provide some input?
Emilio, you've hacked bug 1423331. I guess you might know something?
Comment 5•7 years ago
|
||
The root of the problem seems to be in GetSelectionClosestFrame:
https://searchfox.org/mozilla-central/rev/e62b311b2e0e02633afda2004ba4056b09fbcaa4/layout/generic/nsFrame.cpp#4883
We skip the special handling for block frames at the top,
and then SelfIsSelectable(kid, aFlags) is false for the <button>
so we end up at the last line (4909). In particular, the first
'false' there is for "FrameTarget::frameEdge":
https://searchfox.org/mozilla-central/rev/e62b311b2e0e02633afda2004ba4056b09fbcaa4/layout/generic/nsFrame.cpp#4665
which is somewhat mysteriously documented as:
frameEdge says whether one end of the frame is the result
(in which case different handling is needed)
but I think it controls whether we end up treating it
as a single point or a range.
https://searchfox.org/mozilla-central/rev/e62b311b2e0e02633afda2004ba4056b09fbcaa4/layout/generic/nsFrame.cpp#5001-5015
Comment 6•7 years ago
|
||
BTW, the problem also occurs for an empty Grid/Flex container.
Updated•7 years ago
|
Reporter | ||
Comment 9•7 years ago
|
||
I agree with Mats' diagnostic. Though maybe I'd do something like:
// Fall back to the last targetable frame.
if (aFrame->IsBlockOutside()) {
return DrillDownToSelectionFrame(aFrame, false, aFlags);
}
return FrameTarget(aFrame, false, false);
That'd make the fall-back consistent with what we do for blocks more often, probably.
Comment 10•6 years ago
|
||
Will this have an impact on Bug 1532386?
Assignee | ||
Comment 11•6 years ago
|
||
Exclude replaced frame likes image frames otherwise
editor/libeditor/tests/test_abs_positioner_positioning_elements.html
will break.
Assignee | ||
Comment 12•6 years ago
|
||
Both approaches in comment 7 and comment 9 break editor/libeditor/tests/test_abs_positioner_positioning_elements.html
like
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7334f76b833b564d6803346748e974005ef33098&selectedJob=237731148 So I exclude replaced element in my patch.
I'd like to have this bug fixed. Mats, I hope you don't mind I modify your WIP patch, and add some tests.
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
bugherder |
Updated•6 years ago
|
Comment 15•6 years ago
|
||
Ting-Yu, should we uplift your fix to Fennec 67 Beta? Not being able to dismiss the "Use the app" banner sounds like an annoying user experience, but I don't know if the fix is too risky to uplift.
Assignee | ||
Comment 16•6 years ago
|
||
My patch is small, but the selection code is prone to regression. I'd like to have it ride the train.
Assignee | ||
Comment 17•6 years ago
|
||
Chris, I filed a follow-up bug 1542381 for my comment 12 because my patch fixed only part of the story.
Comment 18•6 years ago
|
||
(In reply to Ting-Yu Lin [:TYLin] (UTC-7) from comment #16)
My patch is small, but the selection code is prone to regression. I'd like to have it ride the train.
Sounds good. 67=wontfix
Description
•