Closed Bug 1660378 Opened 1 year ago Closed 1 year ago

Fix debug warning spam of style editor

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox81 --- wontfix
firefox82 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug)

Details

Attachments

(9 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
No description provided.

The spam makes me harder to investigate test failures of my patches. And as I investigated, the QI timing is too late. They are performed in for loop for same instance so that fixing this must improve the response for changing style with editor API.

There are 2 different warnings which are logged too many.

Summary: Fix debug warning spam at QI from `Element` to `nsStyledElement` in `CSSEditUtils` → Fix debug warning spam of style editor

Okay, coming patch gets rid of 4000+ warnings when I run all tests under editing of WPT.

It should take nsStyledElement& instead of const Element&. Then, it
always returns NS_OK so that it can just return
already_AddRefed<nsICSSDeclaration> instead.

Depends on D87439

Although it starts to return error if it causes destroying the editor, but
it should not occur because it modifies new and orphan node and it shouldn't
kick any mutation event listeners. Therefore, this patch makes the callers
handle error as-is rather than ignoring errors except
NS_ERROR_EDITOR_DESTROYED.

Depends on D87988

The editor modules does QI too many times when it sets or removes some style
with execCommand or XPCOM API. Therefore, there should be an API to
retrieve nsStyledElement pointer from nsINode*.

Depends on D87989

Attachment #9171607 - Attachment description: Bug 1660378 - part 1: Redesign `CSSEditUtils::GetInlineStyles()` r=m_kato! → Bug 1660378 - part 1: Get rid of `CSSEditUtils::GetInlineStyles()` r=m_kato!
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/7ee8df5f9eb9
part 1: Get rid of `CSSEditUtils::GetInlineStyles()` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/ee82ab27ad02
part 2: Make `CSSEditUtils::RemoveCSSPoperty()` take `nsStyledElement&` instead of `Element&` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/ac6b4ebdf316
part 3: Make `CSSEditUtils::RemoveCSSEquivalentToHTMLStyle()` take `nsStyledElement&` instead of `Element*` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/c4e47e9e0e38
part 4: Make `CSSEditUtils::DoElementsHaveSameStyle()` take `nsStyledElement&` instead of `Element&` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/13c9b2ffe14c
part 5: Make `CSSEditUtils::RemoveCSSInlineStyle()` take `nsStyledElement&` instead of `nsINode&` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/5e5fa801260f
part 6: Make `CSSEditUtils::SetCSSProperty()` and its callers take `nsStyledElement&` instead of `Element&` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/06759e45f873
part 7: Make `CSSEditUtils::SetCSSEquivalentToHTMLStyle()` take `nsStyledElement&` instead of `Element*` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/ee4715363f70
part 8: Make `HTMLEditor::IsSimpleModifiableNode()` take `Element&` instead of `nsIContent*` r=m_kato
https://hg.mozilla.org/integration/autoland/rev/d1a42f86dd61
part 9: Avoid QI for getting `nsStyledElement` pointer r=smaug
You need to log in before you can comment on or make changes to this bug.