New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mutation observer API #16190
Mutation observer API #16190
Changes from 1 commit
73f2c6e
bee1340
a5af9a2
4ec5d92
16c09d4
e162f8a
b0af820
8e6d4e9
4797cc3
dd9ea19
4db8c26
1a7e2d4
ef51869
2d10eb7
3dd78ed
0160982
eefb95b
2cce8c5
7115abd
2821def
a82e79d
3bd4438
c6739ef
File filter...
Jump to…
changes for constructor
- Loading branch information
| @@ -30,11 +30,8 @@ impl MutationObserver { | ||
|
|
||
| pub fn Constructor(global: &dom::bindings::js::Root<dom::window::Window>, callback: Rc<MutationCallback>) -> Result<Root<MutationObserver>, Error> { | ||
|
||
| let observer = MutationObserver::new(global, &callback); | ||
| match observer { | ||
| None => Err(Error::new()), | ||
| Some(_) => Ok(dom::bindings::js::Root<MutationObserver::new(global, callback)>), | ||
| } | ||
| } | ||
| ScriptThread.set_mutation_observer(observer) | ||
| } | ||
jdm
Member
|
||
|
|
||
| } | ||
|
|
||
| @@ -574,6 +574,14 @@ impl ScriptThreadFactory for ScriptThread { | ||
| } | ||
|
|
||
| impl ScriptThread { | ||
| pub fn set_mutation_observer(observer: &MutationObserver) { | ||
srivassumit
Author
Contributor
|
||
| SCRIPT_THREAD_ROOT.with(|root| { | ||
| let script_thread = unsafe { &*root.get().unwrap() }; | ||
| script_thread.mutation_observers | ||
| .push(*observer); | ||
| }) | ||
| } | ||
|
|
||
| pub fn mark_document_with_no_blocked_loads(doc: &Document) { | ||
| SCRIPT_THREAD_ROOT.with(|root| { | ||
| let script_thread = unsafe { &*root.get().unwrap() }; | ||
This should be
&Windowinstead of&Root<Window>.