Clean up `SplitNodeTransaction`
Categories
(Core :: DOM: Editor, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox100 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(4 files)
For making the coming patches for bug 1735608 smaller, I'd like to clean up SplitNodeTransaction in this bug.
| Assignee | ||
Comment 1•4 years ago
|
||
First, it should not store split point with EditorDOMPoint because it has
child node pointer and other flags but they are never used and they make
the footprint worse. Therefore, this patch makes it exactly same structure
as JoinNodesTransaction.
Additionally, this patch removes "left" and "right" words especially from
the member names and variable names (preparation of bug 1735608).
| Assignee | ||
Comment 2•4 years ago
|
||
They have duplicated code so that they should be merged to a new internal
method.
Depends on D140461
| Assignee | ||
Comment 3•4 years ago
|
||
Currently, it's notified by JoinNodesTransaction::DoTransactionInternal so
that it's SplitNodeTransaction::UndoTransaction cannot track the DOM point
and this might cause odd editing result if execCommand("undo") is called
while HTMLEditor handles an edit action.
For avoiding to duplicate the code, it should be handled in
HTMLEditor::DoJoinNodes.
Depends on D140462
| Assignee | ||
Comment 4•4 years ago
|
||
Similar to the previous patch, in the splitting a node case,
SplitNodeWithTransaction notifies RangeUpdater. Currently, this must not
cause any trouble, but for consistency with DoJoinNodes, DoSplitNode does
it instead.
Different from the previous patch, SelAdjSplitNode is not called if splitting
the node fails. Therefore, it's enough to do it at end of DoSplitNode.
Depends on D140463
Comment 9•4 years ago
|
||
Backed out for causing build bustages on HTMLEditor.cpp.
[task 2022-03-10T04:23:46.819Z] gmake[4]: Leaving directory '/builds/worker/workspace/obj-analyzed-browser/gfx/skia'
[task 2022-03-10T04:23:46.860Z] gmake[4]: *** Deleting file 'Unified_cpp_editor_libeditor1.o'
[task 2022-03-10T04:23:46.866Z] gmake[4]: Entering directory '/builds/worker/workspace/obj-analyzed-browser/editor/libeditor'
[task 2022-03-10T04:23:46.871Z] /builds/worker/fetches/sixgill/usr/libexec/sixgill/scripts/wrap_gcc/basecc /builds/worker/fetches/gcc/bin/g++ --sysroot /builds/worker/fetches/sysroot-x86_64-linux-gnu -std=gnu++17 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/c++/7.5.0 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu/c++/7.5.0 -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include/x86_64-linux-gnu -isystem /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/include -o Unified_cpp_editor_libeditor1.o -c -I/builds/worker/workspace/obj-analyzed-browser/dist/stl_wrappers -I/builds/worker/workspace/obj-analyzed-browser/dist/system_wrappers -include /builds/worker/checkouts/gecko/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -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/editor/libeditor -I/builds/worker/workspace/obj-analyzed-browser/editor/libeditor -I/builds/worker/checkouts/gecko/dom/base -I/builds/worker/checkouts/gecko/dom/html -I/builds/worker/checkouts/gecko/extensions/spellcheck/src -I/builds/worker/checkouts/gecko/layout/generic -I/builds/worker/checkouts/gecko/layout/style -I/builds/worker/checkouts/gecko/layout/tables -I/builds/worker/checkouts/gecko/layout/xul -I/builds/worker/workspace/obj-analyzed-browser/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/workspace/obj-analyzed-browser/dist/include -I/builds/worker/workspace/obj-analyzed-browser/dist/include/nspr -I/builds/worker/workspace/obj-analyzed-browser/dist/include/nss -DMOZILLA_CLIENT -include /builds/worker/workspace/obj-analyzed-browser/mozilla-config.h -Wno-attributes -Wno-ignored-attributes -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wduplicated-cond -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wno-error=deprecated-copy -Wformat -Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -Wno-attributes -Wno-ignored-attributes -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -Os -fno-omit-frame-pointer -funwind-tables -Werror -fno-strict-aliasing -MD -MP -MF .deps/Unified_cpp_editor_libeditor1.o.pp Unified_cpp_editor_libeditor1.cpp
[task 2022-03-10T04:23:46.871Z] In file included from Unified_cpp_editor_libeditor1.cpp:29:
[task 2022-03-10T04:23:46.871Z] /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditor.cpp: In lambda function:
[task 2022-03-10T04:23:46.871Z] /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditor.cpp:4837:51: error: expected '{' before '->' token
[task 2022-03-10T04:23:46.871Z] 4837 | nsresult rv = [&]() MOZ_CAN_RUN_SCRIPT_BOUNDARY -> nsresult {
[task 2022-03-10T04:23:46.871Z] | ^~
[task 2022-03-10T04:23:46.871Z] /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditor.cpp: In member function 'nsresult mozilla::HTMLEditor::DoJoinNodes(nsIContent&, nsIContent&)':
[task 2022-03-10T04:23:46.872Z] /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditor.cpp:4837:51: error: base operand of '->' has non-pointer type 'mozilla::HTMLEditor::DoJoinNodes(nsIContent&, nsIContent&)::<lambda()>'
[task 2022-03-10T04:23:46.872Z] In file included from /builds/worker/checkouts/gecko/layout/generic/nsIFrame.h:53,
[task 2022-03-10T04:23:46.872Z] from /builds/worker/checkouts/gecko/dom/base/nsIContentInlines.h:14,
[task 2022-03-10T04:23:46.872Z] from /builds/worker/workspace/obj-analyzed-browser/dist/include/mozilla/EditorBase.h:30,
[task 2022-03-10T04:23:46.873Z] from /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditor.h:12,
[task 2022-03-10T04:23:46.873Z] from /builds/worker/checkouts/gecko/editor/libeditor/HTMLEditHelpers.cpp:9,
[task 2022-03-10T04:23:46.873Z] from Unified_cpp_editor_libeditor1.cpp:2:
[task 2022-03-10T04:23:46.873Z] /builds/worker/workspace/obj-analyzed-browser/dist/include/FrameProperties.h: In instantiation of 'static mozilla::FrameProperties::PropertyType<T> mozilla::FrameProperties::ReinterpretHelper<T>::FromInternalValue(uint64_t) [with T = mozilla::SmallValueHolder<mozilla::FrameBidiData>; mozilla::FrameProperties::PropertyType<T> = mozilla::FrameBidiData; uint64_t = long unsigned int]':
[task 2022-03-10T04:23:46.873Z] /builds/worker/workspace/obj-analyzed-browser/dist/include/FrameProperties.h:202:51: required from 'mozilla::FrameProperties::PropertyType<T> mozilla::FrameProperties::Get(mozilla::FrameProperties::Descriptor<T>, bool*) const [with T = mozilla::SmallValueHolder<mozilla::FrameBidiData>; mozilla::FrameProperties::PropertyType<T> = mozilla::FrameBidiData; mozilla::FrameProperties::Descriptor<T> = const mozilla::FramePropertyDescriptor<mozilla::SmallValueHolder<mozilla::FrameBidiData> >*]'
[task 2022-03-10T04:23:46.873Z] /builds/worker/checkouts/gecko/layout/generic/nsIFrame.h:4117:51: required from 'mozilla::FrameProperties::PropertyType<T> nsIFrame::GetProperty(mozilla::FrameProperties::Descriptor<T>, bool*) const [with T = mozilla::SmallValueHolder<mozilla::FrameBidiData>; mozilla::FrameProperties::PropertyType<T> = mozilla::FrameBidiData; mozilla::FrameProperties::Descriptor<T> = const mozilla::FramePropertyDescriptor<mozilla::SmallValueHolder<mozilla::FrameBidiData> >*]'
[task 2022-03-10T04:23:46.874Z] /builds/worker/checkouts/gecko/layout/generic/nsIFrame.h:1327:78: required from here
[task 2022-03-10T04:23:46.874Z] /builds/worker/workspace/obj-analyzed-browser/dist/include/FrameProperties.h:302:13: warning: 'void* memcpy(void*, const void*, size_t)' copying an object of non-trivial type 'mozilla::FrameProperties::PropertyType<mozilla::SmallValueHolder<mozilla::FrameBidiData> >' {aka 'struct mozilla::FrameBidiData'} from an array of 'uint64_t' {aka 'long unsigned int'} [-Wclass-memaccess]
[task 2022-03-10T04:23:46.874Z] 302 | memcpy(&value, &aInternalValue, sizeof(value));
[task 2022-03-10T04:23:46.874Z] | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[task 2022-03-10T04:23:46.874Z] In file included from /builds/worker/checkouts/gecko/dom/base/nsIContentInlines.h:14,
[task 2022-03-10T04:23:46.874Z] from /builds/worker/workspace/obj-analyzed-browser/dist/include/mozilla/EditorBase.h:30,
<...>
Updated•4 years ago
|
| Assignee | ||
Comment 10•4 years ago
•
|
||
It seems that it's a bug of the compiler... According to the document, it uses GCC instead of clang.
| Assignee | ||
Comment 11•4 years ago
|
||
Perhaps, GCC does not support explicit result type specification of lambda with attributes.
https://treeherder.mozilla.org/jobs?repo=try&author=masayuki%40d-toybox.com&tochange=400d10a0ec1d379e40964eb7b611f5f597c3f40e&fromchange=a52bfbcaa3becb428b887e6356c2fb3a0d12e6f0
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
Comment 14•4 years ago
|
||
Comment 15•4 years ago
|
||
Comment 16•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/11ede8a9182f
https://hg.mozilla.org/mozilla-central/rev/2155ccd6f6b4
https://hg.mozilla.org/mozilla-central/rev/b7b1979c7985
https://hg.mozilla.org/mozilla-central/rev/8fb082fb987e
Updated•3 years ago
|
Description
•