From 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:47:29 +0200 Subject: Adding upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- dom/base/CharacterData.h | 226 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 dom/base/CharacterData.h (limited to 'dom/base/CharacterData.h') diff --git a/dom/base/CharacterData.h b/dom/base/CharacterData.h new file mode 100644 index 0000000000..8e008b134b --- /dev/null +++ b/dom/base/CharacterData.h @@ -0,0 +1,226 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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/. */ + +/* + * Base class for DOM Core's Comment, DocumentType, Text, + * CDATASection, and ProcessingInstruction nodes. + */ + +#ifndef mozilla_dom_CharacterData_h +#define mozilla_dom_CharacterData_h + +#include "mozilla/Attributes.h" +#include "nsIContent.h" +#include "nsIMutationObserver.h" + +#include "nsTextFragment.h" +#include "nsError.h" +#include "nsCycleCollectionParticipant.h" + +namespace mozilla::dom { +class Element; +class HTMLSlotElement; +} // namespace mozilla::dom + +#define CHARACTER_DATA_FLAG_BIT(n_) \ + NODE_FLAG_BIT(NODE_TYPE_SPECIFIC_BITS_OFFSET + (n_)) + +// Data node specific flags +enum { + // This bit is set to indicate that if the text node changes to + // non-whitespace, we may need to create a frame for it. This bit must + // not be set on nodes that already have a frame. + NS_CREATE_FRAME_IF_NON_WHITESPACE = CHARACTER_DATA_FLAG_BIT(0), + + // This bit is set to indicate that if the text node changes to + // whitespace, we may need to reframe it (or its ancestors). + NS_REFRAME_IF_WHITESPACE = CHARACTER_DATA_FLAG_BIT(1), + + // This bit is set to indicate that we have a cached + // TextIsOnlyWhitespace value + NS_CACHED_TEXT_IS_ONLY_WHITESPACE = CHARACTER_DATA_FLAG_BIT(2), + + // This bit is only meaningful if the NS_CACHED_TEXT_IS_ONLY_WHITESPACE + // bit is set, and if so it indicates whether we're only whitespace or + // not. + NS_TEXT_IS_ONLY_WHITESPACE = CHARACTER_DATA_FLAG_BIT(3), + + // This bit is set if there is a NewlineProperty attached to the node + // (used by nsTextFrame). + NS_HAS_NEWLINE_PROPERTY = CHARACTER_DATA_FLAG_BIT(4), + + // This bit is set if there is a FlowLengthProperty attached to the node + // (used by nsTextFrame). + NS_HAS_FLOWLENGTH_PROPERTY = CHARACTER_DATA_FLAG_BIT(5), + + // This bit is set if the node may be modified frequently. This is typically + // specified if the instance is in or