diff --git a/nel/include/nel/gui/group_html.h b/nel/include/nel/gui/group_html.h
index 4315d8059..8b6ad19b6 100644
--- a/nel/include/nel/gui/group_html.h
+++ b/nel/include/nel/gui/group_html.h
@@ -391,6 +391,9 @@ namespace NLGUI
CSSBackgroundRenderer m_HtmlBackground;
CSSBackgroundRenderer m_BodyBackground;
+ // active table.tr background color from css or from bgcolor attribute
+ std::vector m_TableRowBackgroundColor;
+
// Valid base href was found
bool _IgnoreBaseUrlTag;
// Fragment from loading url
diff --git a/nel/src/gui/group_html.cpp b/nel/src/gui/group_html.cpp
index 021a3691a..10472851c 100644
--- a/nel/src/gui/group_html.cpp
+++ b/nel/src/gui/group_html.cpp
@@ -3076,6 +3076,7 @@ namespace NLGUI
_IgnoreHeadTag = false;
_IgnoreBaseUrlTag = false;
_AutoIdSeq = 0;
+ m_TableRowBackgroundColor.clear();
paragraphChange ();
@@ -6607,20 +6608,11 @@ namespace NLGUI
// ***************************************************************************
void CGroupHTML::htmlTD(const CHtmlElement &elm)
{
- CRGBA rowColor = CRGBA::Transparent;
- // remember row color so we can blend it with cell color
- if (!_CellParams.empty())
- rowColor = _CellParams.back().BgColor;
-
// Get cells parameters
getCellsParameters(elm, true);
- // if cell has own background,then it must be blended with row
- if (rowColor.A > 0 && _Style.Current.Background.color.A < 255)
- {
- _Style.Current.Background.color.blendFromui(rowColor,
- _Style.Current.Background.color, _Style.Current.Background.color.A);
- }
+ if (!m_TableRowBackgroundColor.empty() && m_TableRowBackgroundColor.back().A > 0)
+ _Style.Current.Background.color.blendFromui(m_TableRowBackgroundColor.back(), _Style.Current.Background.color, _Style.Current.Background.color.A);
if (elm.ID == HTML_TH)
{
@@ -6836,6 +6828,9 @@ namespace NLGUI
// Get cells parameters
getCellsParameters(elm, true);
+ m_TableRowBackgroundColor.push_back(_CellParams.back().BgColor);
+ _CellParams.back().BgColor = CRGBA::Transparent;
+
// TODO: this probably ends up in first cell
renderPseudoElement(":before", elm);
@@ -6850,6 +6845,7 @@ namespace NLGUI
renderPseudoElement(":after", elm);
popIfNotEmpty(_CellParams);
+ popIfNotEmpty(m_TableRowBackgroundColor);
}
// ***************************************************************************