Record consumption of nested inheritance selectors
This commit is contained in:
@@ -65,22 +65,26 @@ func (builder *historyBuilder) observeInheritanceControl(payload historyPayloadR
|
||||
node, before := builder.scratchAt(control.path)
|
||||
selections := resolveInheritanceAttribution(operation, control.path)
|
||||
var attributionRef historyAttributionRef = noHistoryAttribution
|
||||
var sensitive bool
|
||||
if before && node != nil {
|
||||
sensitive = node.Sensitive
|
||||
}
|
||||
if len(selections) != 0 {
|
||||
selection := selections[0]
|
||||
attributionRef = builder.addAttribution(selection.origin, nil, selection.dependencies)
|
||||
}
|
||||
ref := payload
|
||||
ref.substep = operationIndex * 2
|
||||
builder.addObservation(historyObservation{
|
||||
path: control.path, phase: historyPhaseInheritance, payload: ref,
|
||||
reportedPath: control.path, role: historyRoleControl,
|
||||
beforePresent: before, sensitive: sensitive,
|
||||
attributionRef: attributionRef,
|
||||
})
|
||||
observe := func(path Path, value *document.Node) {
|
||||
builder.addObservation(historyObservation{
|
||||
path: path, phase: historyPhaseInheritance, payload: ref,
|
||||
reportedPath: control.path, role: historyRoleControl,
|
||||
beforePresent: before, sensitive: value != nil && value.Sensitive,
|
||||
attributionRef: attributionRef,
|
||||
})
|
||||
}
|
||||
if before {
|
||||
walkDocument(node, control.path, observe)
|
||||
} else {
|
||||
observe(control.path, nil)
|
||||
}
|
||||
|
||||
replaceHistoryPath(&builder.scratch, control.path, nil)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user