Skip to content
Permalink
Browse files

Paint background-color in text box

  • Loading branch information...
june0cho committed Aug 28, 2013
1 parent bc3cd8c commit d78e1099278cf8b8117103555bd98f230bf82587
Showing with 15 additions and 0 deletions.
  1. +4 −0 src/components/main/layout/box.rs
  2. +11 −0 src/test/html/inline_bg_color_simple.html
@@ -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();

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

This comment has been minimized.

Copy link
Contributor

replied Aug 30, 2013

saw approval from metajack
at june0cho@d78e109

@bors-servo

This comment has been minimized.

Copy link
Contributor

replied Aug 30, 2013

merging june0cho/servo/inline_bgcolor = d78e109 into auto

@bors-servo

This comment has been minimized.

Copy link
Contributor

replied Aug 30, 2013

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

@bors-servo

This comment has been minimized.

Copy link
Contributor

replied Aug 30, 2013

fast-forwarding master to auto = a9b6eb8

Please sign in to comment.
You can’t perform that action at this time.