Closed
Bug 1432528
Opened 7 years ago
Closed 7 years ago
Optimize EditorBase::NotifyEditorObservers() to reduce call of nsIEditorObserver methods
Categories
(Core :: DOM: Editor, enhancement)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla60
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Blocks 2 open bugs)
Details
Attachments
(5 files)
EditorBase::NotifyEditorObservers() calls methods of nsIEditorObserver. However, it's implemented by IMEContentObserver, nsTextEditorState and Bluegriffon, and only IMEContentObserver observes BeforeEditAction() and CancelEditAction(). So, we can make EditorBase store IMEContentObserver and nsTextEditorState instances directly and get rid of BeforeEditAction() and CancelEditAction() from nsIEditorObserver.
Assignee | ||
Comment 1•7 years ago
|
||
Assignee | ||
Comment 2•7 years ago
|
||
Assignee | ||
Comment 3•7 years ago
|
||
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 8•7 years ago
|
||
mozreview-review |
Comment on attachment 8945031 [details]
Bug 1432528 - part 1: Expose nsTextInputListener as mozilla::TextInputListener with independent header
https://reviewboard.mozilla.org/r/215242/#review220802
Static analysis found 1 defect in this patch.
- 1 defect found by clang-tidy
You can run this analysis locally with:
- `./mach static-analysis check path/to/file.cpp` (C/C++)
If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx
::: dom/html/nsTextEditorState.cpp:808
(Diff revision 1)
> -, mSettingValue(false)
> + , mSettingValue(false)
> -, mSetValueChanged(true)
> + , mSetValueChanged(true)
> {
> }
>
> -nsTextInputListener::~nsTextInputListener()
> +TextInputListener::~TextInputListener()
Warning: Use '= default' to define a trivial destructor [clang-tidy: modernize-use-equals-default]
Assignee | ||
Comment 9•7 years ago
|
||
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 14•7 years ago
|
||
Hmm, the diff in attachment 8945031 [details] (part 1) is really ugly. Here is the new header file which is copied from nsTextEditorState.cpp when |hg up| to part 1.
Assignee | ||
Updated•7 years ago
|
Attachment #8945118 -
Attachment is patch: false
Comment 15•7 years ago
|
||
mozreview-review |
Comment on attachment 8945031 [details]
Bug 1432528 - part 1: Expose nsTextInputListener as mozilla::TextInputListener with independent header
https://reviewboard.mozilla.org/r/215242/#review221120
::: dom/html/nsTextEditorState.cpp:825
(Diff revision 2)
> {
> bool collapsed;
> AutoWeakFrame weakFrame = mFrame;
>
> - if (!aDoc || !aSel || NS_FAILED(aSel->GetIsCollapsed(&collapsed)))
> + if (!aDOMDocument || !aSelection ||
> + NS_FAILED(aSelection->GetIsCollapsed(&collapsed))) {
We should repalce GetIsCollpased with AsSelection()->IsCollapsed. But I will handle it by anotehr bug.
Attachment #8945031 -
Flags: review?(m_kato) → review+
Comment 16•7 years ago
|
||
mozreview-review |
Comment on attachment 8945032 [details]
Bug 1432528 - part 2: Make EditorBase treat TextInputListener directly and make TextInputListener not derived from nsIEditorObserver
https://reviewboard.mozilla.org/r/215244/#review221126
Attachment #8945032 -
Flags: review?(m_kato) → review+
Comment 17•7 years ago
|
||
mozreview-review |
Comment on attachment 8945033 [details]
Bug 1432528 - part 3: Make EditorBase store IMEContentObserver directly and make it not derived from nsIEditorObserver
https://reviewboard.mozilla.org/r/215246/#review221134
Attachment #8945033 -
Flags: review?(m_kato) → review+
Comment 18•7 years ago
|
||
mozreview-review |
Comment on attachment 8945034 [details]
Bug 1432528 - part 4: Remove nsIEditorObserver::BeforeEditAction() and nsIEditorObserver::CancelEditAction() because nobody implements them
https://reviewboard.mozilla.org/r/215248/#review221136
bluegriffon uses nsIEditorObserver...
Attachment #8945034 -
Flags: review?(m_kato) → review+
Assignee | ||
Comment 19•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8945034 [details]
Bug 1432528 - part 4: Remove nsIEditorObserver::BeforeEditAction() and nsIEditorObserver::CancelEditAction() because nobody implements them
https://reviewboard.mozilla.org/r/215248/#review221136
Yeah, unfortunately. Could be replaced with an event, but perhaps, it's slower than nsIEditorObserver.
Comment 20•7 years ago
|
||
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/02c94b335609
part 1: Expose nsTextInputListener as mozilla::TextInputListener with independent header r=m_kato
https://hg.mozilla.org/integration/autoland/rev/39095009ebdd
part 2: Make EditorBase treat TextInputListener directly and make TextInputListener not derived from nsIEditorObserver r=m_kato
https://hg.mozilla.org/integration/autoland/rev/a356d22ebcce
part 3: Make EditorBase store IMEContentObserver directly and make it not derived from nsIEditorObserver r=m_kato
https://hg.mozilla.org/integration/autoland/rev/b1c58e1131b7
part 4: Remove nsIEditorObserver::BeforeEditAction() and nsIEditorObserver::CancelEditAction() because nobody implements them r=m_kato
Comment 21•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/02c94b335609
https://hg.mozilla.org/mozilla-central/rev/39095009ebdd
https://hg.mozilla.org/mozilla-central/rev/a356d22ebcce
https://hg.mozilla.org/mozilla-central/rev/b1c58e1131b7
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Assignee | ||
Updated•5 years ago
|
Blocks: redesign-editor-scriptable-API
You need to log in
before you can comment on or make changes to this bug.
Description
•