Fortify code around `AccessibleCaretManager::OnSelectionChanged`
Categories
(Core :: DOM: Selection, enhancement)
Tracking
()
People
(Reporter: mbrodesser-Igalia, Assigned: mbrodesser-Igalia)
References
(Blocks 1 open bug)
Details
Attachments
(28 files, 11 obsolete files)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
Assignee | ||
Comment 1•4 years ago
|
||
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D100984
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D100985
Assignee | ||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
bugherder |
Assignee | ||
Comment 6•4 years ago
|
||
Assignee | ||
Comment 7•4 years ago
|
||
Depends on D101354
Assignee | ||
Comment 8•4 years ago
|
||
Depends on D101355
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 10•4 years ago
|
||
bugherder |
Assignee | ||
Comment 11•4 years ago
|
||
Simplifie reasoning about them.
Assignee | ||
Comment 12•4 years ago
|
||
Depends on D101454
Assignee | ||
Comment 13•4 years ago
|
||
Assignee | ||
Comment 14•4 years ago
|
||
Depends on D101571
Comment 15•4 years ago
|
||
Comment 16•4 years ago
|
||
Backed out 4 changesets (bug 1685303) for bustage complaining about offsets.
Backout link: https://hg.mozilla.org/integration/autoland/rev/8e6019fb90580edb5be59e72240120610b92a713
Failure log: https://treeherder.mozilla.org/logviewer?job_id=326668098&repo=autoland&lineNumber=49127
[task 2021-01-14T10:51:08.684Z] 10:51:08 INFO - make[4]: Entering directory '/builds/worker/workspace/obj-build/layout/base'
[task 2021-01-14T10:51:08.684Z] 10:51:08 INFO - /builds/worker/fetches/sccache/sccache /builds/worker/fetches/clang/bin/clang++ -std=gnu++17 -o Unified_cpp_layout_base0.o -c -I/builds/worker/workspace/obj-build/dist/stl_wrappers -I/builds/worker/workspace/obj-build/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -ftrivial-auto-var-init=pattern -DDEBUG=1 -DOS_POSIX=1 -DOS_LINUX=1 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/builds/worker/checkouts/gecko/layout/base -I/builds/worker/workspace/obj-build/layout/base -I/builds/worker/workspace/obj-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/checkouts/gecko/ipc/glue -I/builds/worker/checkouts/gecko/layout/forms -I/builds/worker/checkouts/gecko/layout/generic -I/builds/worker/checkouts/gecko/layout/mathml -I/builds/worker/checkouts/gecko/layout/painting -I/builds/worker/checkouts/gecko/layout/printing -I/builds/worker/checkouts/gecko/layout/style -I/builds/worker/checkouts/gecko/layout/tables -I/builds/worker/checkouts/gecko/layout/xul -I/builds/worker/checkouts/gecko/layout/xul/tree -I/builds/worker/checkouts/gecko/docshell/base -I/builds/worker/checkouts/gecko/dom/base -I/builds/worker/checkouts/gecko/dom/html -I/builds/worker/checkouts/gecko/dom/svg -I/builds/worker/checkouts/gecko/dom/xul -I/builds/worker/checkouts/gecko/view -I/builds/worker/workspace/obj-build/dist/include -I/builds/worker/workspace/obj-build/dist/include/nspr -I/builds/worker/workspace/obj-build/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-build/mozilla-config.h -Qunused-arguments -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wempty-init-stmt -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wno-range-loop-analysis -Wc++2a-compat -Wcomma -Wimplicit-fallthrough -Wunused-function -Wunused-variable -Werror=non-literal-null-conversion -Wstring-conversion -Wtautological-overlap-compare -Wtautological-unsigned-enum-zero-compare -Wtautological-unsigned-zero-compare -Wno-error=tautological-type-limit-compare -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wno-error=return-std-move -Wno-error=atomic-alignment -Wno-error=deprecated-copy -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-psabi -Wno-unknown-warning-option -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fcrash-diagnostics-dir=/builds/worker/artifacts -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -Xclang -load -Xclang /builds/worker/workspace/obj-build/build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -Os -fno-omit-frame-pointer -funwind-tables -Werror -Wno-error=shadow -fexperimental-new-pass-manager -MD -MP -MF .deps/Unified_cpp_layout_base0.o.pp Unified_cpp_layout_base0.cpp
[task 2021-01-14T10:51:08.684Z] 10:51:08 INFO - In file included from Unified_cpp_layout_base0.cpp:20:
[task 2021-01-14T10:51:08.684Z] 10:51:08 ERROR - /builds/worker/checkouts/gecko/layout/base/AccessibleCaretManager.cpp:634:13: error: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument). 'offsets.content' is neither.
[task 2021-01-14T10:51:08.684Z] 10:51:08 INFO - offsets.content, offsets.StartOffset(), offsets.EndOffset(),
[task 2021-01-14T10:51:08.684Z] 10:51:08 INFO - ^~~~~~~~~~~~~~~
[task 2021-01-14T10:51:08.684Z] 10:51:08 ERROR - /builds/worker/checkouts/gecko/layout/base/AccessibleCaretManager.cpp:1254:19: error: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument). 'offsets.content' is neither.
[task 2021-01-14T10:51:08.684Z] 10:51:08 INFO - fs->HandleClick(offsets.content, offsets.StartOffset(), offsets.EndOffset(),
[task 2021-01-14T10:51:08.684Z] 10:51:08 INFO - ^~~~~~~~~~~~~~~
[task 2021-01-14T10:51:08.684Z] 10:51:08 INFO - 2 errors generated.
[task 2021-01-14T10:51:08.684Z] 10:51:08 INFO - /builds/worker/checkouts/gecko/config/rules.mk:674: recipe for target 'Unified_cpp_layout_base0.o' failed
[task 2021-01-14T10:51:08.684Z] 10:51:08 ERROR - make[4]: *** [Unified_cpp_layout_base0.o] Error 1
[task 2021-01-14T10:51:08.684Z] 10:51:08 INFO - make[4]: Leaving directory '/builds/worker/workspace/obj-build/layout/base'
[task 2021-01-14T10:51:08.684Z] 10:51:08 INFO - make[4]: *** Waiting for unfinished jobs....
Comment 17•4 years ago
|
||
Assignee | ||
Comment 18•4 years ago
|
||
:bogdant: thanks for the ni?-request. Analyzing the problem.
Assignee | ||
Comment 19•4 years ago
|
||
Helps distinguishing what modifies frames and what doesn't.
Depends on D101598
Comment 20•4 years ago
|
||
Assignee | ||
Comment 21•4 years ago
|
||
Depends on D101751
Assignee | ||
Comment 22•4 years ago
|
||
Depends on D101760
Assignee | ||
Comment 23•4 years ago
|
||
Depends on D101761
Updated•4 years ago
|
Comment 24•4 years ago
|
||
Comment 25•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Comment 26•4 years ago
|
||
Comment 27•4 years ago
|
||
bugherder |
Assignee | ||
Comment 28•4 years ago
|
||
Assignee | ||
Comment 29•4 years ago
|
||
Depends on D101931
Comment 30•4 years ago
|
||
Assignee | ||
Comment 31•4 years ago
|
||
Now the method states clearer what it does.
Assignee | ||
Comment 32•4 years ago
|
||
Might later help to clean up the dependencies to Selection
.
Comment 33•4 years ago
|
||
bugherder |
Comment 34•4 years ago
|
||
Assignee | ||
Comment 35•4 years ago
|
||
The wording is less ambigous and more const
-access is allowed.
Assignee | ||
Comment 36•4 years ago
|
||
Depends on D102301
Assignee | ||
Comment 37•4 years ago
|
||
It reflects clearer what the method does.
Depends on D102302
Assignee | ||
Comment 38•4 years ago
|
||
Comment 39•4 years ago
|
||
bugherder |
Comment 40•4 years ago
|
||
Assignee | ||
Comment 41•4 years ago
|
||
Assignee | ||
Comment 42•4 years ago
|
||
Encapsulates flushing-related functionality.
Please see part 25) for further simplifcation of LayoutFlusher
.
Depends on D102413
Assignee | ||
Comment 43•4 years ago
|
||
Depends on D102414
Comment 44•4 years ago
|
||
bugherder |
Comment 45•4 years ago
|
||
Assignee | ||
Comment 46•4 years ago
|
||
Assignee | ||
Comment 47•4 years ago
|
||
Depends on D102606
Assignee | ||
Comment 48•4 years ago
|
||
In the unit-tests, flushing is not done. This was prevented implicitly
by nulling mPresShell
. This change makes that explicit by stubbing
MaybeFlushLayout
.
Note that IsTerminated
, which is called in the same context is already
virtual, so I expect this to not have a noticeable performance-impact.
Depends on D102607
Assignee | ||
Comment 49•4 years ago
|
||
It's clearer and saves one superfluous call to MaybeFlushLayout
.
Depends on D102608
Comment 50•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 51•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 52•4 years ago
|
||
bugherder |
Comment 53•4 years ago
|
||
Assignee | ||
Comment 54•4 years ago
|
||
They belong together.
Assignee | ||
Comment 55•4 years ago
|
||
Depends on D102917
Assignee | ||
Comment 56•4 years ago
|
||
Depends on D102918
Assignee | ||
Comment 57•4 years ago
|
||
Will help to simplify AccessibleCaretManager::Dispatch...
.
Depends on D102919
Assignee | ||
Comment 58•4 years ago
|
||
Preparation to simplify AccessibleCaretManager::Dispatch...
.
Depends on D102920
Assignee | ||
Comment 59•4 years ago
|
||
Depends on D102921
Assignee | ||
Comment 60•4 years ago
|
||
Will help to hide the UniquePtr
s.
Depends on D102922
Assignee | ||
Comment 61•4 years ago
|
||
Depends on D102923
Assignee | ||
Comment 62•4 years ago
|
||
Preparation to hide the UniquePtr
s of Carets
.
Depends on D102924
Assignee | ||
Comment 63•4 years ago
|
||
Depends on D102925
Updated•4 years ago
|
Comment 64•4 years ago
|
||
bugherder |
Comment 65•4 years ago
|
||
Now that 86 has moved to Beta, maybe this bug should be closed and the remaining patches moved to another bug. That would help track potential regressions against this bug since it wouldn't span multiple releases.
Assignee | ||
Comment 66•4 years ago
|
||
(In reply to Mathew Hodson from comment #65)
Now that 86 has moved to Beta, maybe this bug should be closed and the remaining patches moved to another bug. That would help track potential regressions against this bug since it wouldn't span multiple releases.
Thanks, it's a valid concern. In this case the 'fortification' is a refactoring, intentionally not changing functionality with mini-reviews. I'll file a new bug for new reviews.
Updated•4 years ago
|
Comment 67•4 years ago
|
||
Thanks, it's a valid concern. In this case the 'fortification' is a refactoring, intentionally not changing functionality with mini-reviews. I'll file a new bug for new reviews.
Yes, please move part 27 and later patches to another bug to land them. Ideally, to help sheriff tracking regressions, it's more preferable to land a series of patches in one bug, and clone the bug to land another series of patches if needed.
Assignee | ||
Comment 68•4 years ago
|
||
(In reply to Ting-Yu Lin [:TYLin] (UTC-8) from comment #67)
Thanks, it's a valid concern. In this case the 'fortification' is a refactoring, intentionally not changing functionality with mini-reviews. I'll file a new bug for new reviews.
Yes, please move part 27 and later patches to another bug to land them. Ideally, to help sheriff tracking regressions, it's more preferable to land a series of patches in one bug, and clone the bug to land another series of patches if needed.
Will do so.
Comment 69•4 years ago
|
||
Comment on attachment 9199014 [details]
Bug 1685303: part 29) Encapsulate AccessibleCaretManager::mFirstCaret
, mSecondCaret
in mCarets
. r=TYLin
Revision D102917 was moved to bug 1688832. Setting attachment 9199014 [details] to obsolete.
Comment 70•4 years ago
|
||
Comment on attachment 9199015 [details]
Bug 1685303: part 30) Add AccessibleCaretManager::Carets::AreLogicallyVisible
. r=TYLin
Revision D102918 was moved to bug 1688832. Setting attachment 9199015 [details] to obsolete.
Comment 71•4 years ago
|
||
Comment on attachment 9199016 [details]
Bug 1685303: part 31) Add AccessibleCaretManager::Carets::AreVisuallyVisible
r=TYLin
Revision D102919 was moved to bug 1688832. Setting attachment 9199016 [details] to obsolete.
Comment 72•4 years ago
|
||
Comment on attachment 9199017 [details]
Bug 1685303: part 32) Add AccessibleCaretManager::SelectionStringifyer
. r=TYLin
Revision D102920 was moved to bug 1688832. Setting attachment 9199017 [details] to obsolete.
Comment 73•4 years ago
|
||
Comment on attachment 9199018 [details]
Bug 1685303: part 33) Add static
AccessibleCaretManager::GetSelection
, ::GetFrameSelection
. r=TYLin
Revision D102921 was moved to bug 1688832. Setting attachment 9199018 [details] to obsolete.
Comment 74•4 years ago
|
||
Comment on attachment 9199019 [details]
Bug 1685303: part 34) Prepare AccessibleCaretManager::DispatchCaretStateChangedEvent
for splitting. r=TYLin
Revision D102922 was moved to bug 1688832. Setting attachment 9199019 [details] to obsolete.
Comment 75•4 years ago
|
||
Comment on attachment 9199020 [details]
Bug 1685303: part 35) Add AccessibleCaretManager::Carets::GetFirst
. r=TYLin
Revision D102923 was moved to bug 1688832. Setting attachment 9199020 [details] to obsolete.
Comment 76•4 years ago
|
||
Comment on attachment 9199021 [details]
Bug 1685303: part 36) Add AccessibleCaretManager::Carets::GetSecond
. r=TYLin
Revision D102924 was moved to bug 1688832. Setting attachment 9199021 [details] to obsolete.
Comment 77•4 years ago
|
||
Comment on attachment 9199022 [details]
Bug 1685303: part 37) Add non-default constructor to AccessibleCaretManager::Carets
. r=TYLin
Revision D102925 was moved to bug 1688832. Setting attachment 9199022 [details] to obsolete.
Comment 78•4 years ago
|
||
Comment on attachment 9199024 [details]
Bug 1685303: part 38) Hide UniquePtr
s in AccessibleCaretManager::Carets
. r=TYLin
Revision D102927 was moved to bug 1688832. Setting attachment 9199024 [details] to obsolete.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Description
•