From cd84ab2ddc30f7b9453e7ce004d9ed33af44d981 Mon Sep 17 00:00:00 2001 From: Diego Marcos Date: Sun, 15 Mar 2015 03:02:33 -0700 Subject: Fixes the problem with canvas not being rendered when displayed as block level elements --- components/layout/block.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'components/layout') diff --git a/components/layout/block.rs b/components/layout/block.rs index 7fb63c0045d..355c76aa473 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -732,11 +732,15 @@ impl BlockFlow { /// Return true if this has a replaced fragment. /// - /// The only two types of replaced fragments currently are text fragments - /// and image fragments. + /// Text, Images, Inline Block and + // Canvas (https://html.spec.whatwg.org/multipage/rendering.html#replaced-elements) + // fragments are considered as replaced fragments fn is_replaced_content(&self) -> bool { match self.fragment.specific { - SpecificFragmentInfo::ScannedText(_) | SpecificFragmentInfo::Image(_) | SpecificFragmentInfo::InlineBlock(_) => true, + SpecificFragmentInfo::ScannedText(_) | + SpecificFragmentInfo::Image(_) | + SpecificFragmentInfo::Canvas(_) | + SpecificFragmentInfo::InlineBlock(_) => true, _ => false, } } -- cgit v1.2.3