Closed Bug 278025 Opened 20 years ago Closed 20 years ago

nsHTMLLinkElement::CreateAndDispatchEvent should call SetTrusted otherwise events *DO* get improperly dispatched untrusted

Categories

(Core :: DOM: Events, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.8beta1

People

(Reporter: timeless, Assigned: bzbarsky)

Details

(Keywords: regression)

Attachments

(2 files)

steps: 1. build mozilla18a5 2. run mozilla 3. attach w/ devenv 4. breakpoint privEvt->SetTrusted(NS_SUCCEEDED(res) && enabled); in nsEventStateManager::DispatchNewEvent condition: !enabled 5. browse the web 6. sanity check stacks expected results: only events dispatched from content should appear. actual results: system generated events appear.
So the point is, the events <link> elements dispatch on SetDocument() are ending up untrusted if you document.write the <link> (since there's content JS on the stack). We should be setting the trusted flag here after we createEvent, no?
Attached patch Like so, saySplinter Review
Assignee: events → bzbarsky
Status: NEW → ASSIGNED
Attachment #173106 - Flags: superreview?(jst)
Attachment #173106 - Flags: review?(jst)
Comment on attachment 173106 [details] [diff] [review] Like so, say Yeah, makes sense.
Attachment #173106 - Flags: superreview?(jst)
Attachment #173106 - Flags: superreview+
Attachment #173106 - Flags: review?(jst)
Attachment #173106 - Flags: review+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8beta
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: