mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Issue 13363 - Step 1.2 of compiling event handler
When compiling event handlers, check whether scripting is enabled and early return None/null if not. https://html.spec.whatwg.org/multipage/ webappapis.html#getting-the-current-value-of-the-event-handler Issue 13363 - Fix spec for disabled scripting The original spec for this PR was bad because it depended on the DOM without scripting enabled to use Javascript to signal the test's failure, so it could never fail. Use an onerror handler on `window` where scripting is enabled, and use an invalid string of JavaScript for the handler, to detect whether or not the event handler is *really* being compiled or not. Condense tests into a single HTML file Yup, didn't even realize I could do that at the time. Remove an unnecessary test
This commit is contained in:
parent
759185abe0
commit
4f0ffbd1f6
3 changed files with 31 additions and 1 deletions
|
@ -373,7 +373,10 @@ impl EventTarget {
|
|||
None => self.downcast::<Window>().unwrap().Document(),
|
||||
};
|
||||
|
||||
// TODO step 1.2 (browsing context/scripting enabled)
|
||||
// Step 1.2
|
||||
if !document.is_scripting_enabled() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Step 1.3
|
||||
let body: Vec<u16> = handler.source.encode_utf16().collect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue