Code-Review | +1 |
First, sorry for the huge delay - it's been busy.
LGTM, just a few small questions and nits.
EventTarget* RawTarget() const { return target_.Get(); }
The `Raw` prefix - I'm not sure I love it. I was thinking I wanted to say `TargetIncludingPseudos` or something, but that's pretty long. I guess it's ok. Just wondering if there were any other options considered?
// For ::scroll-marker, the target should be the ultimate originating element
Since this function might be kind of hot on benchmarks, perhaps you could short-circuit the faster case right here?
```
if (!node || !node->IsPseudoElement()) {
return target;
}
```
<< "target can't be pseudo element! found " << node;
nit: `can't be a pseudo`
EventTarget* retarget_against =
raw_current_target ? raw_current_target : RawTarget();
nit:
```
if (!retarget_against) {
retarget_against = RawTarget();
}
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +1 |
First, sorry for the huge delay - it's been busy.
LGTM, just a few small questions and nits.
Thanks for taking a look!
EventTarget* RawTarget() const { return target_.Get(); }
The `Raw` prefix - I'm not sure I love it. I was thinking I wanted to say `TargetIncludingPseudos` or something, but that's pretty long. I guess it's ok. Just wondering if there were any other options considered?
UnretargetedTarget? :) what about OriginalTarget?
// For ::scroll-marker, the target should be the ultimate originating element
Since this function might be kind of hot on benchmarks, perhaps you could short-circuit the faster case right here?
```
if (!node || !node->IsPseudoElement()) {
return target;
}
```
Done
nit: `can't be a pseudo`
Done
EventTarget* retarget_against =
raw_current_target ? raw_current_target : RawTarget();
nit:
```
if (!retarget_against) {
retarget_against = RawTarget();
}
```
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
EventTarget* RawTarget() const { return target_.Get(); }
Daniil SakhapovThe `Raw` prefix - I'm not sure I love it. I was thinking I wanted to say `TargetIncludingPseudos` or something, but that's pretty long. I guess it's ok. Just wondering if there were any other options considered?
UnretargetedTarget? :) what about OriginalTarget?
Of those two, I think I prefer `RawTarget`. It's ok - let's just leave it as you have it here.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
EventTarget* RawTarget() const { return target_.Get(); }
Daniil SakhapovThe `Raw` prefix - I'm not sure I love it. I was thinking I wanted to say `TargetIncludingPseudos` or something, but that's pretty long. I guess it's ok. Just wondering if there were any other options considered?
Mason FreedUnretargetedTarget? :) what about OriginalTarget?
Of those two, I think I prefer `RawTarget`. It's ok - let's just leave it as you have it here.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Don't expose pseudo element to web via event.target and .currentTarget
The only possible cases now are ::scroll-marker and ::scroll-button().
Also, this CL changes internal call sites of target() to RawTarget(),
as internally we need to work with pseudo elements.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/53317
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
This is a retry of https://chromium-review.googlesource.com/c/chromium/src/+/6633705, but this time targets are cached at setter, instead of dynamically being calculated at getter to avoid detached pseudos crashes.
Also, this time there is no NOTREACHED on pseudos that are not ::scroll-button or ::scroll-marker. I don't know what other pseudos we potentially expose to the web now, but I'll investiage it.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
This is a retry of https://chromium-review.googlesource.com/c/chromium/src/+/6633705, but this time targets are cached at setter, instead of dynamically being calculated at getter to avoid detached pseudos crashes.
Also, this time there is no NOTREACHED on pseudos that are not ::scroll-button or ::scroll-marker. I don't know what other pseudos we potentially expose to the web now, but I'll investiage it.
Could you upload the previous attempt first, and then apply the latest patch set on top? I suspect that it would be easier to review the diff.
Rune LillesveenThis is a retry of https://chromium-review.googlesource.com/c/chromium/src/+/6633705, but this time targets are cached at setter, instead of dynamically being calculated at getter to avoid detached pseudos crashes.
Also, this time there is no NOTREACHED on pseudos that are not ::scroll-button or ::scroll-marker. I don't know what other pseudos we potentially expose to the web now, but I'll investiage it.
Could you upload the previous attempt first, and then apply the latest patch set on top? I suspect that it would be easier to review the diff.
+1, thank you!
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |