/* -*- 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 "nsTextFragment.h"
#include "nsError.h"
#include "mozilla/dom/Element.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/dom/ShadowRoot.h"
namespace mozilla {
namespace dom {
class HTMLSlotElement;
} // namespace dom
} // namespace mozilla
#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