Skip to content

Commit

Permalink
Paint background-color in text box
Browse files Browse the repository at this point in the history
  • Loading branch information
june0cho committed Aug 30, 2013
1 parent bc3cd8c commit d78e109
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/main/layout/box.rs
Expand Up @@ -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();

Expand Down
11 changes: 11 additions & 0 deletions 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>

5 comments on commit d78e109

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from metajack
at june0cho@d78e109

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging june0cho/servo/inline_bgcolor = d78e109 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

june0cho/servo/inline_bgcolor = d78e109 merged ok, testing candidate = a9b6eb8

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = a9b6eb8

Please sign in to comment.