Граф коммитов

37 Коммитов

Автор SHA1 Сообщение Дата
Ting-Yu Lin c508a968ca Bug 1612983 - Disable APZ only when AccessibleCaret's position is changed. r=botond
`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
2020-02-07 22:31:40 +00:00
Thomas Dolezal 062c15357a Bug 1611733 - Bug 1611633 - convert ns style position defines to enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61958

--HG--
extra : moz-landing-system : lando
2020-02-07 12:35:30 +00:00
Ting-Yu Lin 91b81ef6ad Bug 1607123 - Terminate AccessibleCaretEventHub after tearing down the frame tree. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D58738

--HG--
extra : moz-landing-system : lando
2020-01-06 20:18:06 +00:00
Ting-Yu Lin df35f07d16 Bug 1526268 Part 3 - Disable APZ if AccessibleCaret is in position:fixed subtree or its position is changed. r=botond,mats
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
2019-11-02 03:05:28 +00:00
Ting-Yu Lin 742cd4bddc Bug 1526268 Part 2 - Fix the logic to detect whether AccessibleCaret's position is changed. r=mats
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
2019-11-01 22:19:18 +00:00
Ting-Yu Lin 22b2870b5a Bug 1526268 Part 1 - Make AccessibleCaret's #text-overlay and #image children be normal in-flow elements. r=mats
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
2019-11-01 22:16:08 +00:00
Nicholas Nethercote 18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
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
2019-07-26 01:10:23 +00:00
Masayuki Nakano f5737567dd Bug 1544343 - part 3: Make layout use mozilla::PresShell instead of nsIPresShell as far as possible r=emilio
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
2019-04-16 07:25:10 +00:00
Ryan Hunt b936c00a65 Bug 1523969 part 14 - Move method definition inline comments to new line in 'layout/'. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D21115

--HG--
extra : rebase_source : 4d65c07d8822f3a54ac881b5d0f55468ce884554
2019-02-25 16:09:24 -06:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
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.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Ting-Yu Lin 787b6292f5 Bug 1485063 Part 1 - Move preferences used in AccessibleCaret to StaticPrefsList.h r=mats
Differential Revision: https://phabricator.services.mozilla.com/D5470

--HG--
extra : moz-landing-system : lando
2018-09-21 21:48:27 +00:00
Ryan VanderMeulen 649c54f993 Backed out 4 changesets (bug 1485063) for breaking text selection on Android (bug 1490818).
Backed out changeset 8ad3af468d26 (bug 1485063)
Backed out changeset 8f53e771094d (bug 1485063)
Backed out changeset 99456cff7313 (bug 1485063)
Backed out changeset d43869851540 (bug 1485063)
2018-09-13 10:21:46 -04:00
Ting-Yu Lin 5d3dc041de Bug 1485063 Part 1 - Move preferences used in AccessibleCaret to StaticPrefsList.h r=mats
Differential Revision: https://phabricator.services.mozilla.com/D5470
2018-09-11 14:21:21 -07:00
Ting-Yu Lin 6f4a25f896 Bug 1347048 - Remove AccessibleCaret's selection bar support. r=mats
This UI feature was used by B2G only.

Differential Revision: https://phabricator.services.mozilla.com/D4040

--HG--
extra : moz-landing-system : lando
2018-08-31 13:51:51 +00:00
"Emilio Cobos Álvarez" f3d30ca484 Bug 1472020 - Make AccessibleCaret a bit saner. r=bz,TYLin
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
2018-08-13 11:56:48 +02:00
Emilio Cobos Álvarez 927ea89c0d Bug 1426649: Remove nsCSSFrameConstructor updates. r=mats
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
2017-12-21 19:34:48 +01:00
Mats Palmgren 1c2b8c222e Bug 1414666 part 1 - Add nsIFrame::PresShell() for convenient access to the shell. r=emilio
MozReview-Commit-ID: 8FPTPKWyVtY
2017-11-09 03:00:48 +01:00
Mats Palmgren c908bacce6 Bug 1400618 part 5 - Destroy the frames before removing the AccessibleCaret anonymous content (to ensure it happens before the UnbindFromTree). r=bz
MozReview-Commit-ID: Kvudz7bJFEZ
2017-11-07 01:20:34 +01:00
Astley Chen 4126cab5bb Bug 1355752 - Remove B2G wording in AccessibleCaret. r=TYLin
MozReview-Commit-ID: JOv2caZc8J0

--HG--
extra : rebase_source : 48a14052cc8dc0b3f7054465cec81ae322a59899
2017-04-20 13:16:42 +08:00
Boris Zbarsky 5a5123809e Bug 1276186. Stop using the locale-sensitive AppendPrintf in code that is supposed to always use '.' as a decimal separator. r=dbaron
MozReview-Commit-ID: ILXSgv5QUr4
2017-03-14 23:16:32 -04:00
Ting-Yu Lin 2a80705ce0 Bug 1296990 - Make AppearanceString() return nsAutoString directly. r=mtseng
MozReview-Commit-ID: IQ3KrFnCswx

--HG--
extra : rebase_source : ed646cc89797c104708c55d50a058ddd6c76b5bd
2016-08-21 21:41:32 +08:00
Ting-Yu Lin 1ef637a036 Bug 1292904 Part 3 - Use only caret image for touch area if event is a mouse type. r=mtseng
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
2016-08-14 21:39:30 +08:00
Ting-Yu Lin b2eef835ec Bug 1292904 Part 2 - Split touch area into image and text overlay. r=mtseng
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
2016-08-14 20:22:04 +08:00
Ting-Yu Lin 02f58e267d Bug 1292904 Part 1 - Use element id to get caret child element. r=mtseng
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
2016-08-18 15:09:19 +08:00
Kartikaya Gupta e0f363fe61 Bug 1255555 - When a frame reconstruction triggers caret elements to be cloned, ensure the dummy touch listeners are re-registered on the clones. r=tylin
MozReview-Commit-ID: 8txWmd64LC9
2016-07-11 08:16:39 -04:00
Ting-Yu Lin 19677da566 Bug 1248309 - Fix caret size not updated when only zoom level is changed. r=roc
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
2016-02-15 18:29:32 +08:00
Chris Peterson 68d33ca9b5 Bug 1235186 - Part 1: Fix -Wformat warnings in layout/. r=dholbert
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 *'
2015-12-24 16:04:20 -07:00
Boris Zbarsky 1fec018fcb Bug 1224007 part 4. Fix some cases in which ErrorResult instances are destroyed without doing anything useful with exceptions on them. r=peterv 2015-11-20 16:29:41 -05:00
Ting-Yu Lin 5f39bd27b7 Bug 1207934 - Reset mImaginaryCaretRect if it is out of scrollport. r=roc
--HG--
extra : commitid : CbqEsabADIl
extra : rebase_source : d3cb8ee74940b5f26cf706f63c8533c7547b2ad5
2015-10-07 18:09:03 +08:00
Ting-Yu Lin 549ac3b8f4 Bug 1204872 - Prettify enum class printing. r=roc
Provide operator<< functions so that gtest can use them to print enum
classes.

--HG--
extra : commitid : JYu6ffen2Zr
extra : rebase_source : 6628de44b343a0c625fd4526d36dba34ad0cb5cc
2015-09-19 01:05:19 +08:00
Ting-Yu Lin 7d5437ce32 Bug 1204872 - Make AccessibleCaret testable. r=roc
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
2015-09-19 01:05:18 +08:00
Ting-Yu Lin d8ee309227 Bug 1200194 - Tweak formatting and debug logging. r=roc
No logic change is involved.

--HG--
extra : commitid : KCG4QMsPhdY
extra : rebase_source : 2dc984fe27992b95e51f9bc1c5af52fcafc57844
2015-09-09 16:47:20 +08:00
Ting-Yu Lin 3ae4454e2a Bug 1200194 - Make Appearance convertible to string representation. r=roc
--HG--
extra : commitid : KCG4QMsPhdY
extra : rebase_source : ebad97bf4ed57a5f532f94074c035ddb3dabaf47
2015-09-09 16:47:20 +08:00
Ting-Yu Lin 2a47a562fb Bug 1161392 - Enlarge touch area for AccessibleCaret. r=roc
Porting the patch for Touch/SelectionCarets in bug 1021499 to
AccessibleCaret.
2015-05-27 16:37:28 +08:00
Ting-Yu Lin 053054ff69 Bug 1068525 - Ignore zoom level for AccessibleCaret. f=mtseng, r=roc
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.
2015-05-16 00:05:00 +08:00
Ting-Yu Lin 034c5058c3 Bug 1110039 - Part 2.2 - Add AccessibleCaret. r=roc
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.
2015-05-04 21:25:00 +02:00