mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-24 17:37:30 +09:00
Issue #2388 - Part 2: move focus at every selection change when it's called by JS
This commit is contained in:
parent
a83e4b6a34
commit
681193a256
4 changed files with 202 additions and 16 deletions
|
|
@ -413,7 +413,7 @@ protected:
|
|||
// Assume that this is guaranteed that this is held by the caller when
|
||||
// this is used. (Note that we cannot use AutoRestore for mCalledByJS
|
||||
// due to a bit field.)
|
||||
class MOZ_RAII AutoCalledByJSSetter final
|
||||
class MOZ_RAII AutoCalledByJSRestore final
|
||||
{
|
||||
private:
|
||||
nsRange& mRange;
|
||||
|
|
@ -421,18 +421,18 @@ protected:
|
|||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
|
||||
public:
|
||||
explicit AutoCalledByJSSetter(nsRange& aRange
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
explicit AutoCalledByJSRestore(nsRange& aRange
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
: mRange(aRange)
|
||||
, mOldValue(aRange.mCalledByJS)
|
||||
{
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
mRange.mCalledByJS = true;
|
||||
}
|
||||
~AutoCalledByJSSetter()
|
||||
~AutoCalledByJSRestore()
|
||||
{
|
||||
mRange.mCalledByJS = mOldValue;
|
||||
}
|
||||
bool SavedValue() const { return mOldValue; }
|
||||
};
|
||||
|
||||
struct MOZ_STACK_CLASS AutoInvalidateSelection
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue