Paint background-color in text box

This commit is contained in:
Junyoung Cho 2013-08-28 18:57:06 +09:00
parent bc3cd8c1c1
commit d78e109927
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>