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
vCard/JSON extraction #19443
vCard/JSON extraction #19443
Changes from 1 commit
eb2c7e0
015ef37
43aeb7c
f306835
0530512
f939632
3d68d2a
a4ed961
4628943
cbfc666
146dd58
9284187
dd4dc70
43650c2
19408a0
79d140d
aab6900
35468f8
8cafd64
87d1efa
c580c3f
3cd9731
d0cb12e
0ae2d08
7131823
a3e5b9f
0e5023d
37f70c6
543de1c
a781bba
04a043d
c740aab
File filter...
Jump to…
Partially updated the code based on reviews
- Loading branch information
| @@ -99,7 +99,7 @@ use ipc_channel::ipc::{self, IpcSender}; | ||
| use js::jsapi::{JSContext, JSRuntime}; | ||
| use js::jsapi::JS_GetRuntime; | ||
| use metrics::{InteractiveFlag, InteractiveMetrics, InteractiveWindow, ProfilerMetadataFactory, ProgressiveWebMetric}; | ||
| use microdata::Microdata; | ||
| use microdata; | ||
| use msg::constellation_msg::{BrowsingContextId, Key, KeyModifiers, KeyState, TopLevelBrowsingContextId}; | ||
| use net_traits::{FetchResponseMsg, IpcSend, ReferrerPolicy}; | ||
| use net_traits::CookieSource::NonHTTP; | ||
| @@ -1714,15 +1714,10 @@ impl Document { | ||
|
|
||
| // Step 13. | ||
CJ8664
Author
|
||
| let htmlelement = self.get_html_element(); | ||
| let result = Microdata::parse(self, htmlelement.unwrap().upcast::<Node>()); | ||
| if !result.get("vcard").unwrap().is_empty() { | ||
| let event = ScriptMsg::SendMicrodata(result.get("vcard").unwrap().to_string(), "vcard".to_string()); | ||
| let result = microdata::parse(self, htmlelement.unwrap().upcast::<Node>()); | ||
| if let Some(data) = result { | ||
| let event = ScriptMsg::SendMicrodata(data); | ||
| self.send_to_constellation(event); | ||
| self.SetTitle(DOMString::from("Extracted vCard".to_string())); | ||
| } else if !result.get("json").unwrap().is_empty() { | ||
| let event = ScriptMsg::SendMicrodata(result.get("json").unwrap().to_string(), "json".to_string()); | ||
| self.send_to_constellation(event); | ||
| self.SetTitle(DOMString::from("Extracted JSON".to_string())); | ||
| } | ||
| } | ||
|
|
||
The comments here refer to actual step numbers defined in the HTML specification. We should not add ones for steps that do not exist :)