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`. Differential Revision: https://phabricator.services.mozilla.com/D304964
19 lines
513 B
C++
19 lines
513 B
C++
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef nsDirection_h_
|
|
#define nsDirection_h_
|
|
|
|
#include <ostream>
|
|
|
|
// This file makes the nsDirection enum present both in nsIFrame.h and
|
|
// Selection.h.
|
|
|
|
enum nsDirection { eDirNext = 0, eDirPrevious = 1 };
|
|
|
|
std::string format_as(nsDirection);
|
|
std::ostream& operator<<(std::ostream&, nsDirection);
|
|
|
|
#endif
|