`mIsCaretPositionChanged` is used in `UpdateShouldDisableApz()` to
determine whether to disable APZ during scrolling or pinch-zooming.
Suppose the selection is on position:static elements. When
pinch-zooming, the zoom level is changed, but the position is not. We
split `PositionChangedResult::Changed` into two separate states, and set
`mIsCaretPositionChanged` only when the position is changed.
Differential Revision: https://phabricator.services.mozilla.com/D61516
--HG--
extra : moz-landing-system : lando
In common cases where the caret is in a position:static frame subtree,
the caret's position (relative to canvas frame's custom content
container) should not be changed during scrolling.
However, when the caret is in a position:fixed or "stuck"
position:sticky frame subtree, the caret's position will change during
scrolling. We need to disable APZ to avoid jumpy carets.
Differential Revision: https://phabricator.services.mozilla.com/D51351
--HG--
extra : moz-landing-system : lando
This is the main patch to fix bug 1526268.
It is wrong to use the cached rects relative to the root
frame (ViewportFrame) to detect whether AccessibleCaret's position is
changed or not, because it doesn't account the root scroll frame's
scroll offset.
The effect is that we always produce "PositionChangedResult::Changed"
when scrolling on position:static elements, but
"PositionChangedResult::NotChanged" on position:fixed elements.
This patch fixes this by using the rect relative to custom content
container, which is the actually rect to set caret's position, to check
whether the position is changed or not.
Note that even with this patch, the caret on "position:fixed" element is
still jumpy during scrolling due to APZ. Part 3 will fixed this.
Differential Revision: https://phabricator.services.mozilla.com/D51350
--HG--
extra : moz-landing-system : lando
The #text-overlay and #image child divs were "position: absolute" under
the main AccessibleCaret div. However, they don't necessary need to be
position:absolute to achieve the desired layout. We can make them normal
in-flow elements to simplify the frame structure. There should not be
any perceivable change to the user.
Also, AccessibleCaret's position can made more accurate by using float
CSS pixels when converting it from app unit.
Differential Revision: https://phabricator.services.mozilla.com/D51349
--HG--
extra : moz-landing-system : lando
This requires replacing inclusions of it with inclusions of more specific prefs
files.
The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.
Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.
Differential Revision: https://phabricator.services.mozilla.com/D39138
--HG--
extra : moz-landing-system : lando
This patch changes remaining things under `layout/`. However, there are some
places which still need to use `nsIPresShell`. That will be fixed in a
follow up bug.
Differential Revision: https://phabricator.services.mozilla.com/D27477
--HG--
extra : moz-landing-system : lando
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.
Overall it's not a very interesting patch I think.
nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.
I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.
While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
Avoid processing anon content in nsCanvasFrame, then getting more anon content
via AccessibleCaretEventHub::Init. Instead call Init before creating the custom
content container. We could also throw a script runner at it I guess, but this
prevents the reentrancy issue.
Avoid cloning nodes during layout, just use the same node (already cloned in
InsertAnonymousContent) instead.
The RemoveChild in GetAnonymousContent to handle the reframes instead of cloning
around is a bit hacky, but I don't think it's really worth extending
PostDestroyData for this special case.
Differential Revision: https://phabricator.services.mozilla.com/D1889
They used to do quote updates and such but they where moved long ago, and do
nothing now.
MozReview-Commit-ID: 188vzGctbty
--HG--
extra : rebase_source : dd638875f9ef9ceb2343df5f8677a23d820c7a36
That is, exclude the text overlay to fix the double clicking and triple
clicking on a word in editable text area.
MozReview-Commit-ID: 5bELcNSRo2A
--HG--
extra : rebase_source : 4664e186b13b3170022c0fe294f580cd15650271
The touch area of the caret element includes the caret image and the
text above the image. This patch split these two areas, and call the
area covering the text "text overlay".
MozReview-Commit-ID: KWNAwVRP7fN
--HG--
extra : rebase_source : 674dbec65e1c4b04413f9f35fe46aeea46480831
The children of the caret element already have unique class name like
"image" or "bar", we could change the class name to be id, and use id to
locate them.
MozReview-Commit-ID: HLZecyAEYXv
--HG--
extra : rebase_source : 04b59a4d639ad45d2b564f48de15c2f23752fdaf
On Fennec, it's possible that after automatically zooming an editable
input, the mImaginaryCaretRect for the caret remains the same. Only the
zoom level is changed. Therefore, the zoom level should also be
considered to determine whether the position is changed or not so that
the caret can get updated.
MozReview-Commit-ID: CrictS4S0Yl
--HG--
extra : rebase_source : f26f89cb72a9ae8a55104054121486a67e841513
layout/base/AccessibleCaret.cpp:129:48 [-Wformat-extra-args] data argument not used by format string
layout/generic/nsContainerFrame.cpp:425:71 [-Wformat] more '%' conversions than data arguments
layout/style/FontFaceSet.cpp:798:10 [-Wformat] format specifies type 'int' but the argument has type 'size_type' (aka 'unsigned long')
layout/style/Loader.cpp:1817:12 [-Wformat] format specifies type 'unsigned int' but the argument has type 'nsICSSLoaderObserver *'
layout/style/Loader.cpp:1817:35 [-Wformat] format specifies type 'unsigned int' but the argument has type 'mozilla::css::SheetLoadData *'
layout/style/Loader.cpp:1827:12 [-Wformat] format specifies type 'unsigned int' but the argument has type 'nsICSSLoaderObserver *'
layout/style/Loader.cpp:1827:23 [-Wformat] format specifies type 'char *' but the argument has type 'mozilla::css::SheetLoadData *'
Provide operator<< functions so that gtest can use them to print enum
classes.
--HG--
extra : commitid : JYu6ffen2Zr
extra : rebase_source : 6628de44b343a0c625fd4526d36dba34ad0cb5cc
Remove the assert of the existence of PresShell in the constructor since
there's no PresShell in gtest. Also make AccessibleCaret inheritable.
--HG--
extra : commitid : JudUoXt9auc
extra : rebase_source : 882f017063339c2fb2313459d9a9f2f7c1549071
We want AccessibleCaret be of the same size regardless of the zoom
level. We simply divide the caret's width, height, margin-left, and the
text selection bar's margin-left by current zoom level.
The margin-left of the caret is adjusted from -23px to -23.5px for better
looking.
See AccessibleCaret.h for the class description.
Technical difference between AccessibleCaret and Touch/SelectionCarets:
The anonymous dom element containing a caret image will be created by
AccessibleCaret by using the API landed in bug 1020244 instead of being
created by nsCanvasFrame.