MutationObserverInit
dictionary's optional
characterDataOldValue
property is used to specify whether or not the
MutationRecord.oldValue
property for DOM mutations should be set to the previous value of text nodes which changed.
If you set the
MutationObserverInit.characterData
特性到
true
but don't set
characterDataOldValue
to
true
as well, the
MutationRecord
will not include information describing the prior state of the text node's contents.
Character data changes are detectable on any text node, including nodes based on the
文本
,
ProcessingInstruction
,和
注释
接口。
var options = {
characterDataOldValue: true | false
}
A Boolean value indicating whether or not to set the
MutationRecord
's
oldValue
property to be a string containing the value of the character node's contents prior to the change represented by the mutation record.
By default, only changes to the text of the node specified as the
target
parameter when you called
observe()
are monitored. To watch for changes to the text contents of all descendants of
target
, set the
subtree
选项到
true
.
若设置
characterDataOldValue
to
true
,
characterData
is automatically assumed to be
true
, even if you don't expressly set it as such.
| 规范 | 状态 | 注释 |
|---|---|---|
|
DOM
The definition of 'MutationObserverInit.characterDataOldValue' in that specification. |
实时标准 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
characterDataOldValue
|
Chrome
26
|
Edge 12 |
Firefox
14
注意事项
|
IE 11 | Opera 15 |
Safari
7
|
WebView Android ? |
Chrome Android
26
|
Firefox Android
14
注意事项
|
Opera Android 14 |
Safari iOS
7
|
Samsung Internet Android
1.5
|
完整支持
兼容性未知
见实现注意事项。
要求使用供应商前缀或不同名称。