diff --git a/content/html/style/src/nsCSSStyleRule.cpp b/content/html/style/src/nsCSSStyleRule.cpp
index 0debe8957bb..752992c60a3 100644
--- a/content/html/style/src/nsCSSStyleRule.cpp
+++ b/content/html/style/src/nsCSSStyleRule.cpp
@@ -1005,8 +1005,8 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
// text-decoration: none, enum (bit field), inherit
if (eCSSUnit_Enumerated == ourText->mDecoration.GetUnit()) {
PRInt32 td = ourText->mDecoration.GetIntValue();
- font->mFont.decorations |= td;
- font->mFixedFont.decorations |= td;
+ font->mFont.decorations = (parentFont->mFont.decorations | td);
+ font->mFixedFont.decorations = (parentFont->mFixedFont.decorations | td);
text->mTextDecoration = td;
}
else if (eCSSUnit_None == ourText->mDecoration.GetUnit()) {
diff --git a/layout/html/style/src/nsCSSStyleRule.cpp b/layout/html/style/src/nsCSSStyleRule.cpp
index 0debe8957bb..752992c60a3 100644
--- a/layout/html/style/src/nsCSSStyleRule.cpp
+++ b/layout/html/style/src/nsCSSStyleRule.cpp
@@ -1005,8 +1005,8 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
// text-decoration: none, enum (bit field), inherit
if (eCSSUnit_Enumerated == ourText->mDecoration.GetUnit()) {
PRInt32 td = ourText->mDecoration.GetIntValue();
- font->mFont.decorations |= td;
- font->mFixedFont.decorations |= td;
+ font->mFont.decorations = (parentFont->mFont.decorations | td);
+ font->mFixedFont.decorations = (parentFont->mFixedFont.decorations | td);
text->mTextDecoration = td;
}
else if (eCSSUnit_None == ourText->mDecoration.GetUnit()) {
diff --git a/layout/style/nsCSSStyleRule.cpp b/layout/style/nsCSSStyleRule.cpp
index 0debe8957bb..752992c60a3 100644
--- a/layout/style/nsCSSStyleRule.cpp
+++ b/layout/style/nsCSSStyleRule.cpp
@@ -1005,8 +1005,8 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration,
// text-decoration: none, enum (bit field), inherit
if (eCSSUnit_Enumerated == ourText->mDecoration.GetUnit()) {
PRInt32 td = ourText->mDecoration.GetIntValue();
- font->mFont.decorations |= td;
- font->mFixedFont.decorations |= td;
+ font->mFont.decorations = (parentFont->mFont.decorations | td);
+ font->mFixedFont.decorations = (parentFont->mFixedFont.decorations | td);
text->mTextDecoration = td;
}
else if (eCSSUnit_None == ourText->mDecoration.GetUnit()) {