mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
auto merge of #3833 : pcwalton/servo/display-list-debugging, r=mrobinson
r? @mrobinson
This commit is contained in:
commit
b116a6fce6
1 changed files with 6 additions and 7 deletions
|
@ -141,7 +141,7 @@ impl ScaledFontExtensionMethods for ScaledFont {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// "Steps" as defined by CSS 2.1 § E.2.
|
/// "Steps" as defined by CSS 2.1 § E.2.
|
||||||
#[deriving(Clone, PartialEq)]
|
#[deriving(Clone, PartialEq, Show)]
|
||||||
pub enum StackingLevel {
|
pub enum StackingLevel {
|
||||||
/// The border and backgrounds for the root of this stacking context: steps 1 and 2.
|
/// The border and backgrounds for the root of this stacking context: steps 1 and 2.
|
||||||
BackgroundAndBordersStackingLevel,
|
BackgroundAndBordersStackingLevel,
|
||||||
|
@ -287,12 +287,10 @@ impl DisplayList {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn debug(&self) {
|
pub fn debug(&self) {
|
||||||
if log_enabled!(::log::DEBUG) {
|
|
||||||
for item in self.list.iter() {
|
for item in self.list.iter() {
|
||||||
item.debug_with_level(0);
|
item.debug_with_level(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// Draws the display list into the given render context. The display list must be flattened
|
/// Draws the display list into the given render context. The display list must be flattened
|
||||||
/// first for correct painting.
|
/// first for correct painting.
|
||||||
|
@ -665,13 +663,13 @@ impl DisplayItem {
|
||||||
for _ in range(0, level) {
|
for _ in range(0, level) {
|
||||||
indent.push_str("| ")
|
indent.push_str("| ")
|
||||||
}
|
}
|
||||||
debug!("{}+ {}", indent, self);
|
println!("{}+ {}", indent, self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Show for DisplayItem {
|
impl fmt::Show for DisplayItem {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "{} @ {} ({:x})",
|
write!(f, "{} @ {} ({:x}) [{}]",
|
||||||
match *self {
|
match *self {
|
||||||
SolidColorDisplayItemClass(_) => "SolidColor",
|
SolidColorDisplayItemClass(_) => "SolidColor",
|
||||||
TextDisplayItemClass(_) => "Text",
|
TextDisplayItemClass(_) => "Text",
|
||||||
|
@ -682,6 +680,7 @@ impl fmt::Show for DisplayItem {
|
||||||
},
|
},
|
||||||
self.base().bounds,
|
self.base().bounds,
|
||||||
self.base().node.id(),
|
self.base().node.id(),
|
||||||
|
self.base().level
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue