I believe this improves efficiency of the canvas and canvas subtree checks.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// Like `IsCanvasOrInCanvasSubtree()`, but includes <canvas> elements.Typo: IsCanvasOrInCanvasSubtree -> IsInCanvasSubtree.
bool IsParentOrOwnerCanvasOrInCanvasSubtree() const;WDYT of renaming this "ComputeIsInCanvasSubtree"?
if (IsA<HTMLCanvasElement>(element)) {Can you move the `DCHECK(element.IsCanvasOrInCanvasSubtree() == value);` check from line 4307 to line 4301? Now that `IsCanvasOrInCanvasSubtree` returns true for HTMLCanvasElements, setting the value to true on line 4305 means that the DCHECK is always true. Moving the DCHECK up above this lets VerifySubtreeIsInCanvas verify the flag on canvas elements.
if (!value && IsA<HTMLCanvasElement>(*this)) {WDYT of:
```
if (value_changed && !value && IsA<HTMLCanvasElement>(*this)) {
// When a canvas element transitions from inside a canvas subtree to
// outside, reset value to true for child propagation.
value = true;
}
```
// in the FlatTreeTraversal::ParentElement call inside SetIsInCanvasSubtree.Should "SetIsInCanvasSubtree" be "IsParentOrOwnerCanvasOrInCanvasSubtree"?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
// Like `IsCanvasOrInCanvasSubtree()`, but includes <canvas> elements.Stephen ChenneyTypo: IsCanvasOrInCanvasSubtree -> IsInCanvasSubtree.
Done
WDYT of renaming this "ComputeIsInCanvasSubtree"?
Actually what I had first, so I'[ll go back to that.
Can you move the `DCHECK(element.IsCanvasOrInCanvasSubtree() == value);` check from line 4307 to line 4301? Now that `IsCanvasOrInCanvasSubtree` returns true for HTMLCanvasElements, setting the value to true on line 4305 means that the DCHECK is always true. Moving the DCHECK up above this lets VerifySubtreeIsInCanvas verify the flag on canvas elements.
Yes, good point, but slightly more complex. Done.
WDYT of:
```
if (value_changed && !value && IsA<HTMLCanvasElement>(*this)) {
// When a canvas element transitions from inside a canvas subtree to
// outside, reset value to true for child propagation.
value = true;
}
```
Yes, in a better way with no need for value_changed.
// in the FlatTreeTraversal::ParentElement call inside SetIsInCanvasSubtree.Should "SetIsInCanvasSubtree" be "IsParentOrOwnerCanvasOrInCanvasSubtree"?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |