From 8bbdf5e96720632b89e48ea8fe23d2969f780eea Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Fri, 26 Aug 2022 03:31:26 +0000 Subject: [PATCH] Bug 1784192 - part 9: Rename `TypeInState` to `PendingStyles` r=m_kato Additionally, * `PropItem` -> `PendingStyle` * `StyleCache` -> `PendingStyleCache` * `AutoStyleCacheArray` -> `AutoPendingStyleCacheArray` And finally, `PendingStyle` (formally `PropItem`) is changed to `class` and its members are encapsuled. Differential Revision: https://phabricator.services.mozilla.com/D155318 --- editor/libeditor/EditorBase.cpp | 2 +- editor/libeditor/EditorBase.h | 27 ++--- editor/libeditor/EditorForwards.h | 32 +++--- editor/libeditor/HTMLEditSubActionHandler.cpp | 104 ++++++++++-------- editor/libeditor/HTMLEditor.cpp | 50 +++++---- editor/libeditor/HTMLEditor.h | 26 +++-- editor/libeditor/HTMLEditorDataTransfer.cpp | 2 +- editor/libeditor/HTMLStyleEditor.cpp | 16 +-- .../{TypeInState.cpp => PendingStyles.cpp} | 95 +++++++--------- .../{TypeInState.h => PendingStyles.h} | 97 +++++++++------- editor/libeditor/moz.build | 4 +- 11 files changed, 238 insertions(+), 217 deletions(-) rename editor/libeditor/{TypeInState.cpp => PendingStyles.cpp} (85%) rename editor/libeditor/{TypeInState.h => PendingStyles.h} (79%) diff --git a/editor/libeditor/EditorBase.cpp b/editor/libeditor/EditorBase.cpp index e51ea2a68f84..c0bf59b3a6c6 100644 --- a/editor/libeditor/EditorBase.cpp +++ b/editor/libeditor/EditorBase.cpp @@ -6168,7 +6168,7 @@ EditorBase::AutoEditActionDataSetter::AutoEditActionDataSetter( ->GetSelectedRangeItemForTopLevelEditSubAction(); mTopLevelEditSubActionData.mChangedRange = mEditorBase.AsHTMLEditor()->GetChangedRangeForTopLevelEditSubAction(); - mTopLevelEditSubActionData.mCachedInlineStyles.emplace(); + mTopLevelEditSubActionData.mCachedPendingStyles.emplace(); } } mEditorBase.mEditActionData = this; diff --git a/editor/libeditor/EditorBase.h b/editor/libeditor/EditorBase.h index b1a1294155fd..9cd575086d87 100644 --- a/editor/libeditor/EditorBase.h +++ b/editor/libeditor/EditorBase.h @@ -15,7 +15,7 @@ #include "mozilla/Likely.h" // for MOZ_UNLIKELY, MOZ_LIKELY #include "mozilla/Maybe.h" // for Maybe #include "mozilla/OwningNonNull.h" // for OwningNonNull -#include "mozilla/TypeInState.h" // for PropItem, StyleCache +#include "mozilla/PendingStyles.h" // for PendingStyle, PendingStyleCache #include "mozilla/RangeBoundary.h" // for RawRangeBoundary, RangeBoundary #include "mozilla/SelectionState.h" // for RangeUpdater, etc. #include "mozilla/StyleSheet.h" // for StyleSheet @@ -797,14 +797,14 @@ class EditorBase : public nsIEditor, // Computing changed range while we're handling sub actions. RefPtr mChangedRange; - // XXX In strict speaking, mCachedInlineStyles isn't enough to cache inline - // styles because inline style can be specified with "style" attribute - // and/or CSS in