From d78e1099278cf8b8117103555bd98f230bf82587 Mon Sep 17 00:00:00 2001 From: Junyoung Cho Date: Wed, 28 Aug 2013 18:57:06 +0900 Subject: [PATCH] Paint background-color in text box --- src/components/main/layout/box.rs | 4 ++++ src/test/html/inline_bg_color_simple.html | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 src/test/html/inline_bg_color_simple.html diff --git a/src/components/main/layout/box.rs b/src/components/main/layout/box.rs index 844e37954f5..a8e5177a155 100644 --- a/src/components/main/layout/box.rs +++ b/src/components/main/layout/box.rs @@ -599,6 +599,10 @@ impl RenderBox { match *self { UnscannedTextRenderBoxClass(*) => fail!(~"Shouldn't see unscanned boxes here."), TextRenderBoxClass(text_box) => { + + // Add the background to the list, if applicable. + self.paint_background_if_applicable(list, &absolute_box_bounds); + let nearest_ancestor_element = self.nearest_ancestor_element(); let color = nearest_ancestor_element.style().color().to_gfx_color(); diff --git a/src/test/html/inline_bg_color_simple.html b/src/test/html/inline_bg_color_simple.html new file mode 100644 index 00000000000..5f145e64e96 --- /dev/null +++ b/src/test/html/inline_bg_color_simple.html @@ -0,0 +1,11 @@ + + + + [block background color test] +

paragraph yellow

+ + [inline background color test] + span bluetexttexttextspan yellownested-span redtest finishes + + +