mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Don't force ComputedValues to derive Debug.
The code that uses it is of dubious utility, fwiw, but some of it is used on Servo, so I'll kill that separately. Bug: 1412486 Reviewed-by: xidorn MozReview-Commit-ID: KauvXX32zLM
This commit is contained in:
parent
b74f52d6df
commit
480d2267e6
2 changed files with 3 additions and 19 deletions
|
@ -243,24 +243,6 @@ pub trait TNode : Sized + Copy + Clone + Debug + NodeInfo + PartialEq {
|
|||
unsafe fn set_can_be_fragmented(&self, value: bool);
|
||||
}
|
||||
|
||||
/// Wrapper to output the ElementData along with the node when formatting for
|
||||
/// Debug.
|
||||
pub struct ShowData<N: TNode>(pub N);
|
||||
impl<N: TNode> Debug for ShowData<N> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fmt_with_data(f, self.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Wrapper to output the primary computed values along with the node when
|
||||
/// formatting for Debug. This is very verbose.
|
||||
pub struct ShowDataAndPrimaryValues<N: TNode>(pub N);
|
||||
impl<N: TNode> Debug for ShowDataAndPrimaryValues<N> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fmt_with_data_and_primary_values(f, self.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Wrapper to output the subtree rather than the single node when formatting
|
||||
/// for Debug.
|
||||
pub struct ShowSubtree<N: TNode>(pub N);
|
||||
|
@ -283,7 +265,9 @@ impl<N: TNode> Debug for ShowSubtreeData<N> {
|
|||
|
||||
/// Wrapper to output the subtree along with the ElementData and primary
|
||||
/// ComputedValues when formatting for Debug. This is extremely verbose.
|
||||
#[cfg(feature = "servo")]
|
||||
pub struct ShowSubtreeDataAndPrimaryValues<N: TNode>(pub N);
|
||||
#[cfg(feature = "servo")]
|
||||
impl<N: TNode> Debug for ShowSubtreeDataAndPrimaryValues<N> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
writeln!(f, "DOM Subtree:")?;
|
||||
|
@ -305,6 +289,7 @@ fn fmt_with_data<N: TNode>(f: &mut fmt::Formatter, n: N) -> fmt::Result {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
fn fmt_with_data_and_primary_values<N: TNode>(f: &mut fmt::Formatter, n: N) -> fmt::Result {
|
||||
if let Some(el) = n.as_element() {
|
||||
let dd = el.has_dirty_descendants();
|
||||
|
|
|
@ -71,7 +71,6 @@ pub mod style_structs {
|
|||
/// FIXME(emilio): This is completely duplicated with the other properties code.
|
||||
pub type ComputedValuesInner = ::gecko_bindings::structs::ServoComputedData;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[repr(C)]
|
||||
pub struct ComputedValues(::gecko_bindings::structs::mozilla::ServoStyleContext);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue