Closed Bug 1484110 Opened Last year Closed Last year

Split HTMLEditor::CheckSelectionStateForAnonymousButtons() for internal use

Categories

(Core :: DOM: Editor, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(3 files)

No description provided.
No longer depends on: 1484111
HTMLEditor::CheckSelectionStateForAnonymousButtons() is called a lot internally.
Especially, its virtual call cost may make damage to our performance since
it's called from a selection listener.

So, we should create non-virtual method, RefereshEditingUI() for internal use.
First, HTMLEditor::HideInlineTableEditingUI() always returns NS_OK.  So, we
can change its return type to void.

Additionally, it removes each UI from the DOM tree one by one.  However, each
mutation could cause showing same UI again.  In such case,
ShowInlineTableEditingUI() overwrites each UI with newly created element.
Then, HTMLEditor cannot remove the old UI anymore.  Therefore, this patch
moves all members of the UI into local variables first.
HTMLEditor::RefereshEditingUI() works only with enabled UIs.  Therefore, if
UI is disabled while it's visible, it keeps shown.  This is too bad if web
apps tries to disable the Gecko specific UIs after we show some of them.

This patch adds HTMLEditor::HideAnonymousEditingUIsIfUnnecessary() to hide
unnecessary UIs and makes RefereshEditingUI() call it always.
Comment on attachment 9002435 [details]
Bug 1484110 - part 1: Create HTMLEditor::RefereshEditingUI() for internal use of nsIHTMLEditor::CheckSelectionStateForAnonymousButtons()

Makoto Kato [:m_kato] has approved the revision.
Attachment #9002435 - Flags: review+
Comment on attachment 9002436 [details]
Bug 1484110 - part 2: Rewrite HTMLEditor::HideInlineTableEditingUI()

Makoto Kato [:m_kato] has approved the revision.
Attachment #9002436 - Flags: review+
Comment on attachment 9002437 [details]
Bug 1484110 - part 3: HTMLEditor::RefereshEditingUI() should refresh UIs when one of them is changed to enabled or disabled

Makoto Kato [:m_kato] has approved the revision.
Attachment #9002437 - Flags: review+
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/08d0e0c32a53
part 1: Create HTMLEditor::RefereshEditingUI() for internal use of nsIHTMLEditor::CheckSelectionStateForAnonymousButtons() r=m_kato
https://hg.mozilla.org/integration/mozilla-inbound/rev/6a6a79e2c19b
part 2: Rewrite HTMLEditor::HideInlineTableEditingUI() r=m_kato
https://hg.mozilla.org/integration/mozilla-inbound/rev/4f0a12bcb401
part 3: HTMLEditor::RefereshEditingUI() should refresh UIs when one of them is changed to enabled or disabled r=m_kato
Regressions: 1574544
You need to log in before you can comment on or make changes to this bug.