style: Improve logging for attribute changes.

And general Element logging. We now print all the attributes for comparison.

If this turns out to be too verbose we can change it to diff them or something.

Differential Revision: https://phabricator.services.mozilla.com/D2471
This commit is contained in:
Emilio Cobos Álvarez 2018-07-27 17:44:48 +02:00
parent 2e3aacdf80
commit c3289ad46e
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
4 changed files with 47 additions and 34 deletions

View file

@ -156,6 +156,15 @@ impl GeckoElementSnapshot {
}
impl ElementSnapshot for GeckoElementSnapshot {
fn debug_list_attributes(&self) -> String {
use nsstring::nsCString;
let mut string = nsCString::new();
unsafe {
bindings::Gecko_Snapshot_DebugListAttributes(self, &mut string);
}
String::from_utf8_lossy(&*string).into_owned()
}
fn state(&self) -> Option<ElementState> {
if self.has_any(Flags::State) {
Some(ElementState::from_bits_truncate(self.mState))