auto merge of #823 : june0cho/servo/inline_bgcolor, r=metajack

In case that inline element has `background-color`, bgcolor doesn't work.
Fix the error and add a test case.
This commit is contained in:
bors-servo 2013-08-30 07:27:37 -07:00
commit a9b6eb8ff1
2 changed files with 15 additions and 0 deletions

View file

@ -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();

View file

@ -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>