Skip to content

Commit 5507107

Browse files
committed
fix font size on wikipedia
page: https://en.wikipedia.org/wiki/Obama problem: font is too small culprit: font-size:calc(1em * 0.875); This is a partial fix: calc is unsupported, so the above declaration should be ignored completely, but instead it sets font-size to that of a parent, so this code doesn't work as intended: font-size:0.875em;font-size:calc(1em * 0.875);
1 parent 6b55a1b commit 5507107

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/css_length.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ void litehtml::css_length::fromString( const tstring& str, const tstring& predef
77
if(str.substr(0, 4) == _t("calc"))
88
{
99
m_is_predefined = true;
10-
m_predef = 0;
10+
m_predef = defValue;
1111
return;
1212
}
1313

src/html_tag.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,7 @@ void litehtml::html_tag::init_font()
19501950
m_font_size = parent_sz;
19511951

19521952
css_length sz;
1953-
sz.fromString(str, font_size_strings);
1953+
sz.fromString(str, font_size_strings, -1);
19541954
if(sz.is_predefined())
19551955
{
19561956
int idx_in_table = doc_font_size - 9;
@@ -1961,7 +1961,7 @@ void litehtml::html_tag::init_font()
19611961
m_font_size = font_size_table[idx_in_table][sz.predef()];
19621962
} else
19631963
{
1964-
m_font_size = doc_font_size;
1964+
m_font_size = parent_sz;
19651965
}
19661966
} else
19671967
{
@@ -1986,7 +1986,7 @@ void litehtml::html_tag::init_font()
19861986
m_font_size = doc_font_size * 2;
19871987
break;
19881988
default:
1989-
m_font_size = doc_font_size;
1989+
m_font_size = parent_sz;
19901990
break;
19911991
}
19921992
}

0 commit comments

Comments
 (0)