Add logging code of `Selection` change for debugging complicated editable applications
Categories
(Core :: DOM: Selection, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox112 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
Details
Attachments
(1 file)
I'm sometimes blocked to debug our editor bug reports by Selection changes outside editor. However, adding break point to there is hard to debug due to Selection changes may occur at preparation. Therefore, it's really helpful for me if debug information is printed into the terminal.
| Assignee | ||
Comment 1•3 years ago
|
||
It's hard to check Selection API calls from both JS and internals when we debug
web apps which has complicated contenteditable editor. Therefore, I'd like to
add an ability to log Selection API calls.
This patch needs to stop some methods inlined. Therefore, this could affect to
the performance in release builds, though. If so, perhaps, there should be
logging method for each inline method and define them in Selection.cpp.
For minimizing the impact for performance, this patch also makes them to check
the logging level before calling logging methods. It's currently redundant
for LogLevel::Debug case. However, this avoids any performance impact from
changes of MOZ_LOG implementation.
Updated•3 years ago
|
Comment 3•3 years ago
|
||
| bugherder | ||
Comment 4•3 years ago
|
||
Might be worthwhile to add this as a preset in about:logging for better visibility of this feature.
| Assignee | ||
Comment 5•3 years ago
|
||
Well, I didn't know it has the UI. However, I'm not sure the rules of adding a log to it...
Comment 6•3 years ago
|
||
Masayuki, I think this is worth being mentioned in release note. Could you please nominate relnote-firefox? Thanks.
| Assignee | ||
Comment 7•3 years ago
|
||
(In reply to Hsin-Yi Tsai (she/her) [:hsinyi] from comment #6)
Masayuki, I think this is worth being mentioned in release note. Could you please nominate relnote-firefox? Thanks.
Oh, really? What scenarios do you expect? This is useful for Gecko developers to get hints of what minified JS code does, however, I'm not sure whether this is useful for web developers to debug their products because the other information is also required for example, DOM mutation, etc. Once the logging is enabled, breaking in the debugger of devtools shows the last Selection API call though.
Comment 8•3 years ago
|
||
(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #5)
Well, I didn't know it has the UI. However, I'm not sure the rules of adding a log to it...
According to this about:logging introduction I don't see particular rules that we should concern too much .
(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #7)
(In reply to Hsin-Yi Tsai (she/her) [:hsinyi] from comment #6)
Masayuki, I think this is worth being mentioned in release note. Could you please nominate relnote-firefox? Thanks.
Oh, really? What scenarios do you expect? This is useful for Gecko developers to get hints of what minified JS code does, however, I'm not sure whether this is useful for web developers to debug their products because the other information is also required for example, DOM mutation, etc. Once the logging is enabled, breaking in the debugger of devtools shows the last Selection API call though.
I agreed that the audience for this logging improvement may be restricted to a certain group of people. However, I was thinking it's worthwhile promoting this enhancement, because it could be helpful to some extent when users, especially web developers, are reproducing editor issues and they know they can have the much better logs for us. Did I misunderstand something?
Description
•