Closed Bug 2045219 Opened 4 months ago Closed 4 months ago

Improve the dump result of `nsINode`

Categories

(Core :: DOM: Core & HTML, task)

task

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(1 file)

The current result is not enough for me and its reference cannot be used with fmt::format directly.

Currently, operator<<(std::ostram&, const nsINode&) prints the path
of the node with some attribute information of each node. However, there
are some issues:

  1. It's unclear if the reached root is a DocumentFragment or
    ShadowRoot due to the same node name, #document-fragment.
  2. Do not print the host's path.
  3. Cannot print only in a specific node such as a contenteditable.
  4. It's hard to consider which Text if a node has multiple Text
    nodes.
  5. No information about the assigned <slot>.
  6. No information about EditContext.

This patch appends these information to each node. Additionally, adding
format_as() for avoiding to use mozilla::ToString for fmt::format
and MOZ_LOG_FMT.

Finally, to test the new data, this makes Selection and SelectionAPI
log use MOZ_LOG_FMT.

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
QA Whiteboard: [qa-triage-done-c154/b153]
Regressions: 2048701
Regressions: 2050618
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: