aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/main/layout/box.rs4
-rw-r--r--src/test/html/inline_bg_color_simple.html11
2 files changed, 15 insertions, 0 deletions
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 @@
+<html>
+ <head></head>
+ <body>
+ [block background color test]
+ <p style="background-color:yellow">paragraph yellow</p>
+
+ [inline background color test]
+ <span style="background-color:blue;">span blue</span>texttexttext<span style="background-color:yellow;">span yellow<span style="background-color:red">nested-span red</span>test finishes</span>
+
+ </body>
+</html>