Closed Bug 1627573 Opened 5 years ago Closed 5 years ago

Mark some methods of `CSSEditUtils` as `MOZ_CAN_RUN_SCRIPT`

Categories

(Core :: DOM: Editor, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(4 files)

No description provided.

Some methods take StyleType to work them with specified values or computed
values. This method hides StyleType into CSSEditUtils and splits the
public methods which took StyleType to 2 methods, one is for working with
specified values, the other is for working with computed values.

Additionally, this patch fixes some argument name and type.

Depends on D70148

When it refers computed value of style, it may flush pending notifications.
Therefore, they should be marked as MOZ_CAN_RUN_SCRIPT.

Depends on D70150

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/77486fd073af part 1: Remove unused `CSSEditUtils::IsCSSEquivalentToHTMLInlineStyleSet()` overload r=m_kato https://hg.mozilla.org/integration/autoland/rev/04734d17e8d0 part 2: Split public methods of `CSSEditUtils` which work with both specified values and computed values r=m_kato https://hg.mozilla.org/integration/autoland/rev/07b5b67c32c2 part 3: Get rid of `CSSEditUtils::GetSpecifiedCSSEquivalentToHTMLInlineStyleSet()` because of unused r=m_kato https://hg.mozilla.org/integration/autoland/rev/8ced0e6ed31e part 4: Mark `CSSEditUtils` methods which refer computed style as `MOZ_CAN_RUN_SCRIPT` r=m_kato

Backed out 4 changesets (bug 1627573) for bustages complaining about CSSEditUtils.cpp

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&fromchange=8ced0e6ed31e336ee56cd002fd52a80515cc46f5&tochange=eb0fdd0ea21ac5a3f8c172194b98ff084243385e&searchStr=build&selectedJob=296909314

Backout link: https://hg.mozilla.org/integration/autoland/rev/ba2f3be47bafbab4d9044e2a1fafcf6e9819f1c9

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=296909314&repo=autoland&lineNumber=32433

[task 2020-04-09T07:53:01.107Z] 07:53:01     INFO -  make[4]: Entering directory '/builds/worker/workspace/obj-build/editor/libeditor'
[task 2020-04-09T07:53:01.107Z] 07:53:01     INFO -  /builds/worker/fetches/sccache/sccache /builds/worker/fetches/gcc/bin/g++ -std=gnu++17 -o Unified_cpp_editor_libeditor0.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 -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-build/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-build/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/checkouts/gecko/ipc/glue -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 -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wduplicated-cond -Wimplicit-fallthrough -Wunused-function -Wunused-variable -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wformat -Wformat-overflow=2 -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -Os -fno-omit-frame-pointer -funwind-tables -Werror -Wno-error=shadow  -MD -MP -MF .deps/Unified_cpp_editor_libeditor0.o.pp   Unified_cpp_editor_libeditor0.cpp
[task 2020-04-09T07:53:01.107Z] 07:53:01     INFO -  In file included from Unified_cpp_editor_libeditor0.cpp:2:0:
[task 2020-04-09T07:53:01.107Z] 07:53:01     INFO -  /builds/worker/checkouts/gecko/editor/libeditor/CSSEditUtils.cpp: In static member function 'static nsStaticAtom* mozilla::CSSEditUtils::GetCSSPropertyAtom(mozilla::CSSEditUtils::nsCSSEditableProperty)':
[task 2020-04-09T07:53:01.108Z] 07:53:01    ERROR -  /builds/worker/checkouts/gecko/editor/libeditor/CSSEditUtils.cpp:702:1: error: control reaches end of non-void function [-Werror=return-type]
[task 2020-04-09T07:53:01.108Z] 07:53:01     INFO -   }
[task 2020-04-09T07:53:01.108Z] 07:53:01     INFO -   ^
[task 2020-04-09T07:53:01.108Z] 07:53:01     INFO -  cc1plus: all warnings being treated as errors
[task 2020-04-09T07:53:01.108Z] 07:53:01     INFO -  /builds/worker/checkouts/gecko/config/rules.mk:750: recipe for target 'Unified_cpp_editor_libeditor0.o' failed
[task 2020-04-09T07:53:01.108Z] 07:53:01    ERROR -  make[4]: *** [Unified_cpp_editor_libeditor0.o] Error 1
[task 2020-04-09T07:53:01.108Z] 07:53:01     INFO -  make[4]: Leaving directory '/builds/worker/workspace/obj-build/editor/libeditor'
[task 2020-04-09T07:53:01.108Z] 07:53:01     INFO -  /builds/worker/checkouts/gecko/config/recurse.mk:74: recipe for target 'editor/libeditor/target-objects' failed
[task 2020-04-09T07:53:01.108Z] 07:53:01    ERROR -  make[3]: *** [editor/libeditor/target-objects] Error 2
[task 2020-04-09T07:53:01.108Z] 07:53:01     INFO -  make[3]: *** Waiting for unfinished jobs....
Flags: needinfo?(masayuki)

Also seeing a hazard failure on the backed out changes:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=296909295&repo=autoland&lineNumber=43643

[task 2020-04-09T08:34:56.663Z] 43:23.96 make[4]: Entering directory '/builds/worker/checkouts/gecko/obj-analyzed/editor/libeditor'
[task 2020-04-09T08:34:56.663Z] 43:23.96 /builds/worker/fetches/sixgill/usr/libexec/sixgill/scripts/wrap_gcc/basecc /builds/worker/fetches/sixgill/usr/libexec/sixgill/scripts/wrap_gcc/g++ -std=gnu++17 -o Unified_cpp_editor_libeditor0.o -c  -I/builds/worker/checkouts/gecko/obj-analyzed/dist/stl_wrappers -I/builds/worker/checkouts/gecko/obj-analyzed/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/checkouts/gecko/obj-analyzed/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/checkouts/gecko/obj-analyzed/ipc/ipdl/_ipdlheaders -I/builds/worker/checkouts/gecko/ipc/chromium/src -I/builds/worker/checkouts/gecko/ipc/glue -I/builds/worker/checkouts/gecko/obj-analyzed/dist/include -I/builds/worker/checkouts/gecko/obj-analyzed/dist/include/nspr -I/builds/worker/checkouts/gecko/obj-analyzed/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /builds/worker/checkouts/gecko/obj-analyzed/mozilla-config.h -Wno-attributes -Wno-ignored-attributes -Wno-attributes -Wno-ignored-attributes -Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wduplicated-cond -Wimplicit-fallthrough -Wunused-function -Wunused-variable -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 -Wformat -Wformat-overflow=2 -fno-sized-deallocation -fno-aligned-new -Wno-attributes -Wno-ignored-attributes -Wno-attributes -Wno-ignored-attributes -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -freorder-blocks -Os -fno-omit-frame-pointer -funwind-tables -Werror -Wno-error=shadow  -MD -MP -MF .deps/Unified_cpp_editor_libeditor0.o.pp   Unified_cpp_editor_libeditor0.cpp
[task 2020-04-09T08:34:56.663Z] 43:23.96 In file included from Unified_cpp_editor_libeditor0.cpp:2:
[task 2020-04-09T08:34:56.663Z] 43:23.96 /builds/worker/checkouts/gecko/editor/libeditor/CSSEditUtils.cpp: In static member function 'static nsStaticAtom* mozilla::CSSEditUtils::GetCSSPropertyAtom(mozilla::CSSEditUtils::nsCSSEditableProperty)':
[task 2020-04-09T08:34:56.663Z] 43:23.96 /builds/worker/checkouts/gecko/editor/libeditor/CSSEditUtils.cpp:702:1: error: control reaches end of non-void function [-Werror=return-type]
[task 2020-04-09T08:34:56.663Z] 43:23.96  }
[task 2020-04-09T08:34:56.664Z] 43:23.96  ^
[task 2020-04-09T08:34:56.664Z] 43:23.96 In file included from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/gfx/2D.h:32,
[task 2020-04-09T08:34:56.664Z] 43:23.96                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/nsRect.h:15,
[task 2020-04-09T08:34:56.664Z] 43:23.96                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/Units.h:19,
[task 2020-04-09T08:34:56.664Z] 43:23.96                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/layers/LayersTypes.h:12,
[task 2020-04-09T08:34:56.664Z] 43:23.96                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/BasicEvents.h:15,
[task 2020-04-09T08:34:56.664Z] 43:23.96                  from /builds/worker/checkouts/gecko/dom/base/nsContentUtils.h:24,
[task 2020-04-09T08:34:56.664Z] 43:23.96                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/dom/Element.h:20,
[task 2020-04-09T08:34:56.664Z] 43:23.96                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/ManualNAC.h:9,
[task 2020-04-09T08:34:56.665Z] 43:23.96                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/HTMLEditor.h:12,
[task 2020-04-09T08:34:56.665Z] 43:23.96                  from /builds/worker/checkouts/gecko/editor/libeditor/CSSEditUtils.cpp:10,
[task 2020-04-09T08:34:56.665Z] 43:23.96                  from Unified_cpp_editor_libeditor0.cpp:2:
[task 2020-04-09T08:34:56.665Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h: In function '(static initializers for /builds/worker/checkouts/gecko/editor/libeditor/HTMLAbsPositionEditor.cpp)':
[task 2020-04-09T08:34:56.665Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::RedoCommand::sInstance.mozilla::StaticRefPtr<mozilla::RedoCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.665Z] 43:23.96      MOZ_ASSERT(!mRawPtr);
[task 2020-04-09T08:34:56.665Z] 43:23.96                  ^~~~~~~
[task 2020-04-09T08:34:56.665Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::CutCommand::sInstance.mozilla::StaticRefPtr<mozilla::CutCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.666Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::CutOrDeleteCommand::sInstance.mozilla::StaticRefPtr<mozilla::CutOrDeleteCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.666Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::CopyCommand::sInstance.mozilla::StaticRefPtr<mozilla::CopyCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.666Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::CopyOrDeleteCommand::sInstance.mozilla::StaticRefPtr<mozilla::CopyOrDeleteCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.666Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::PasteCommand::sInstance.mozilla::StaticRefPtr<mozilla::PasteCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.667Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::PasteTransferableCommand::sInstance.mozilla::StaticRefPtr<mozilla::PasteTransferableCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.667Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::SwitchTextDirectionCommand::sInstance.mozilla::StaticRefPtr<mozilla::SwitchTextDirectionCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.668Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::DeleteCommand::sInstance.mozilla::StaticRefPtr<mozilla::DeleteCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.668Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::SelectAllCommand::sInstance.mozilla::StaticRefPtr<mozilla::SelectAllCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.668Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::SelectionMoveCommands::sInstance.mozilla::StaticRefPtr<mozilla::SelectionMoveCommands>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.669Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::InsertPlaintextCommand::sInstance.mozilla::StaticRefPtr<mozilla::InsertPlaintextCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.669Z] 43:23.96 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::InsertParagraphCommand::sInstance.mozilla::StaticRefPtr<mozilla::InsertParagraphCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.670Z] 43:23.97 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::InsertLineBreakCommand::sInstance.mozilla::StaticRefPtr<mozilla::InsertLineBreakCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.670Z] 43:23.97 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::PasteQuotationCommand::sInstance.mozilla::StaticRefPtr<mozilla::PasteQuotationCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.670Z] 43:23.97 cc1plus: all warnings being treated as errors
[task 2020-04-09T08:34:56.671Z] 43:23.97 In file included from Unified_cpp_editor_libeditor0.cpp:2:
[task 2020-04-09T08:34:56.671Z] 43:23.97 /builds/worker/checkouts/gecko/editor/libeditor/CSSEditUtils.cpp: In static member function 'static nsStaticAtom* mozilla::CSSEditUtils::GetCSSPropertyAtom(mozilla::CSSEditUtils::nsCSSEditableProperty)':
[task 2020-04-09T08:34:56.671Z] 43:23.97 /builds/worker/checkouts/gecko/editor/libeditor/CSSEditUtils.cpp:702:1: error: control reaches end of non-void function [-Werror=return-type]
[task 2020-04-09T08:34:56.671Z] 43:23.97  }
[task 2020-04-09T08:34:56.672Z] 43:23.97  ^
[task 2020-04-09T08:34:56.672Z] 43:23.97 In file included from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/gfx/2D.h:32,
[task 2020-04-09T08:34:56.672Z] 43:23.97                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/nsRect.h:15,
[task 2020-04-09T08:34:56.672Z] 43:23.97                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/Units.h:19,
[task 2020-04-09T08:34:56.672Z] 43:23.97                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/layers/LayersTypes.h:12,
[task 2020-04-09T08:34:56.673Z] 43:23.97                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/BasicEvents.h:15,
[task 2020-04-09T08:34:56.673Z] 43:23.97                  from /builds/worker/checkouts/gecko/dom/base/nsContentUtils.h:24,
[task 2020-04-09T08:34:56.673Z] 43:23.97                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/dom/Element.h:20,
[task 2020-04-09T08:34:56.674Z] 43:23.97                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/ManualNAC.h:9,
[task 2020-04-09T08:34:56.674Z] 43:23.97                  from /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/HTMLEditor.h:12,
[task 2020-04-09T08:34:56.675Z] 43:23.97                  from /builds/worker/checkouts/gecko/editor/libeditor/CSSEditUtils.cpp:10,
[task 2020-04-09T08:34:56.675Z] 43:23.97                  from Unified_cpp_editor_libeditor0.cpp:2:
[task 2020-04-09T08:34:56.675Z] 43:23.97 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h: In function '(static initializers for /builds/worker/checkouts/gecko/editor/libeditor/HTMLAbsPositionEditor.cpp)':
[task 2020-04-09T08:34:56.676Z] 43:23.97 /builds/worker/checkouts/gecko/obj-analyzed/dist/include/mozilla/StaticPtr.h:112:17: warning: 'mozilla::RedoCommand::sInstance.mozilla::StaticRefPtr<mozilla::RedoCommand>::mRawPtr' may be used uninitialized in this function [-Wmaybe-uninitialized]
[task 2020-04-09T08:34:56.676Z] 43:23.97      MOZ_ASSERT(!mRawPtr);
...
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/5409940d553e part 1: Remove unused `CSSEditUtils::IsCSSEquivalentToHTMLInlineStyleSet()` overload r=m_kato https://hg.mozilla.org/integration/autoland/rev/3d4a0970dee4 part 2: Split public methods of `CSSEditUtils` which work with both specified values and computed values r=m_kato https://hg.mozilla.org/integration/autoland/rev/1f14a7985e87 part 3: Get rid of `CSSEditUtils::GetSpecifiedCSSEquivalentToHTMLInlineStyleSet()` because of unused r=m_kato https://hg.mozilla.org/integration/autoland/rev/2a4c8b3ee34d part 4: Mark `CSSEditUtils` methods which refer computed style as `MOZ_CAN_RUN_SCRIPT` r=m_kato
Flags: needinfo?(masayuki)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: