| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
// To avoid unnecessary filter invalidations, preserve the filter pointer
// from the old style if the URL and resource match.
const AtomicString& url = url_value->ValueForSerialization();
SVGResource* resource = state.GetSVGResource(property_id, *url_value);
Filter* filter = nullptr;
if (state.OldStyle() && state.OldStyle()->HasFilter()) {
const auto& old_ops = state.OldStyle()->Filter().Operations();
size_t index = operations.size();
if (index < old_ops.size()) {
if (auto* old_ref =
DynamicTo<ReferenceFilterOperation>(old_ops[index].Get())) {
if (old_ref->Url() == url && old_ref->Resource() == resource) {
filter = old_ref->GetFilter();
}
}
}
}
auto* new_op =
MakeGarbageCollected<ReferenceFilterOperation>(url, resource);
new_op->SetFilter(filter);
operations.Operations().push_back(new_op);Could you perhaps restructure this a bit given that we always want to create a new `ReferenceFilterOperation` (although technically I guess we don't need to...). Something like:
```
Filter* GetFilterFromOldStyle(const ComputedStyle* old_style, const ReferenceFilterOperation* new_ref, size_t index, ...) {
...
}
...
SVGResource* resource = state.GetSVGResource(property_id, *url_value);
auto* new_op =
MakeGarbageCollected<ReferenceFilterOperation>(url_value->ValueForSerialization(), resource);
new_op->SetFilter(GetFilterFromOldStyle(state.OldStyle(), ...);
operations.Operations().push_back(new_op);
```
WDYT?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +1 |
// To avoid unnecessary filter invalidations, preserve the filter pointer
// from the old style if the URL and resource match.
const AtomicString& url = url_value->ValueForSerialization();
SVGResource* resource = state.GetSVGResource(property_id, *url_value);
Filter* filter = nullptr;
if (state.OldStyle() && state.OldStyle()->HasFilter()) {
const auto& old_ops = state.OldStyle()->Filter().Operations();
size_t index = operations.size();
if (index < old_ops.size()) {
if (auto* old_ref =
DynamicTo<ReferenceFilterOperation>(old_ops[index].Get())) {
if (old_ref->Url() == url && old_ref->Resource() == resource) {
filter = old_ref->GetFilter();
}
}
}
}
auto* new_op =
MakeGarbageCollected<ReferenceFilterOperation>(url, resource);
new_op->SetFilter(filter);
operations.Operations().push_back(new_op);Could you perhaps restructure this a bit given that we always want to create a new `ReferenceFilterOperation` (although technically I guess we don't need to...). Something like:
```
Filter* GetFilterFromOldStyle(const ComputedStyle* old_style, const ReferenceFilterOperation* new_ref, size_t index, ...) {
...
}
...
SVGResource* resource = state.GetSVGResource(property_id, *url_value);
auto* new_op =
MakeGarbageCollected<ReferenceFilterOperation>(url_value->ValueForSerialization(), resource);
new_op->SetFilter(GetFilterFromOldStyle(state.OldStyle(), ...);
operations.Operations().push_back(new_op);
```
WDYT?
Good idea; done.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |