Lots of warnings triggered with mouse events on pseudo-elements

RESOLVED FIXED in Firefox 51

Status

()

Core
DOM: Events
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: emilio, Assigned: emilio)

Tracking

unspecified
mozilla51
Points:
---

Firefox Tracking Flags

(firefox51 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

a year ago
So when doing a simple test with pseudo-elements, I trigger tons of assertions when hovering over this.

```
<!doctype html>
<style>
  div::before {
    background: red;
    content: "(test)";
  }
  div {
    background: blue;
  }
  div:hover::before {
    background: green;
  }
</style>
<div></div>
```

The assertion triggered is in EventStateManager::PreHandleEvent, that one that says that nodes and content should be related: http://searchfox.org/mozilla-central/source/dom/events/EventStateManager.cpp#513

The culprit is the call that the pres shell uses to get the content from the generated content frame, that is, mCurrentEventFrame->GetContentForEvent(..), which explicitly discards generated content frames.

I can certainly relax the assertion so it doesn't hit on generated content, I guess, but I also think we might want to not skip generated content, since this might be one of the underlying causes of bugs like bug 1122965 or bug 1177528.
(Assignee)

Updated

a year ago
See Also: → bug 1122965, bug 1177528
(Assignee)

Updated

a year ago
Summary: Lots of assertions triggered with mouse events on pseudo-elements → Lots of warnings triggered with mouse events on pseudo-elements
(Assignee)

Comment 1

a year ago
After digging a bit more, I understand why the target is the non-generated content, I'll post a patch with the warning condition fixed.
Comment hidden (mozreview-request)
(Assignee)

Comment 3

a year ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6a862594cbec

Comment 4

a year ago
mozreview-review
Comment on attachment 8786202 [details]
Bug 1299046: Take into account generated content in EventStateManager::PreHandleEvent.

https://reviewboard.mozilla.org/r/75176/#review73160

::: dom/events/EventStateManager.cpp:533
(Diff revision 1)
>                     aTargetFrame->GetContent() == aTargetContent ||
> -                   aTargetFrame->GetContent()->GetFlattenedTreeParent() == aTargetContent,
> +                   aTargetFrame->GetContent()->GetFlattenedTreeParent() == aTargetContent ||
> +                   aTargetFrame->IsGeneratedContentFrame(),
>                     "aTargetFrame should be related with aTargetContent");
> +#if DEBUG
> +  if (aTargetFrame && aTargetFrame->IsGeneratedContentFrame()) {

Make sure to push this to tryserver (debug builds) before landing.
Attachment #8786202 - Flags: review?(bugs) → review+
(Assignee)

Updated

a year ago
Assignee: nobody → ecoal95
(Assignee)

Comment 5

a year ago
Try is green modulo unrelated intermittent failures.

Comment 6

a year ago
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/b0cad82d939e
Take into account generated content in EventStateManager::PreHandleEvent. r=smaug
https://hg.mozilla.org/mozilla-central/rev/b0cad82d939e
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox51: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.