mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
style: Better debugging for media-query related code and ua-cache.
Bug: 1470145 Reviewed-by: xidorn MozReview-Commit-ID: 3XHAxK2BOTS
This commit is contained in:
parent
f564b32b75
commit
82db42390d
4 changed files with 49 additions and 11 deletions
|
@ -64,6 +64,27 @@ pub struct Device {
|
|||
used_viewport_size: AtomicBool,
|
||||
}
|
||||
|
||||
impl fmt::Debug for Device {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
use nsstring::nsCString;
|
||||
|
||||
let mut doc_uri = nsCString::new();
|
||||
unsafe {
|
||||
let doc =
|
||||
&*self.pres_context().mDocument.raw::<structs::nsIDocument>();
|
||||
|
||||
bindings::Gecko_nsIURI_Debug(
|
||||
doc.mDocumentURI.raw::<structs::nsIURI>(),
|
||||
&mut doc_uri,
|
||||
)
|
||||
};
|
||||
|
||||
f.debug_struct("Device")
|
||||
.field("document_url", &doc_uri)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Sync for Device {}
|
||||
unsafe impl Send for Device {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue