mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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:
commit
a9b6eb8ff1
2 changed files with 15 additions and 0 deletions
|
@ -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();
|
||||
|
||||
|
|
11
src/test/html/inline_bg_color_simple.html
Normal file
11
src/test/html/inline_bg_color_simple.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue