Commit 11805d5f authored by tasak@google.com's avatar tasak@google.com

Should update FontFaceCache version when updating generic font-family settings.

BUG=381612
TEST=fast/text/update-sans-serif-and-recalc-style.html

Review URL: https://codereview.chromium.org/335393002

git-svn-id: svn://svn.chromium.org/blink/trunk@176327 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 63f7ebc4
<!DOCTYPE html>
<style>
body { font-family: sans-serif; }
</style>
<script>
if (window.internals)
window.internals.settings.setSansSerifFontFamily("Arial", "zyyy");
</script>
<body>
<div>
<p>This is a test for checking whether style recalc is correctly triggered or not<a href="#" title="dummy">when</a> updating <a href="#" title="dummy2">sans serif</a> font-family<a href="#" title="dummy3"> settings</a>.
</p>
</div>
</body>
<!DOCTYPE html>
<style>
body { font-family: sans-serif; }
</style>
<script>
if (window.internals)
window.internals.settings.setSansSerifFontFamily("Times", "zyyy");
onload = function() {
document.body.offsetLeft;
if (window.internals)
window.internals.settings.setSansSerifFontFamily("Arial", "zyyy");
}
</script>
<body>
<div>
<p>This is a test for checking whether style recalc is correctly triggered or not<a href="#" title="dummy">when</a> updating <a href="#" title="dummy2">sans serif</a> font-family<a href="#" title="dummy3"> settings</a>.
</p>
</div>
</body>
...@@ -170,6 +170,8 @@ void CSSFontSelector::updateGenericFontFamilySettings(Document& document) ...@@ -170,6 +170,8 @@ void CSSFontSelector::updateGenericFontFamilySettings(Document& document)
if (!document.settings()) if (!document.settings())
return; return;
m_genericFontFamilySettings = document.settings()->genericFontFamilySettings(); m_genericFontFamilySettings = document.settings()->genericFontFamilySettings();
// Need to increment FontFaceCache version to update RenderStyles.
m_fontFaceCache.incrementVersion();
} }
void CSSFontSelector::trace(Visitor* visitor) void CSSFontSelector::trace(Visitor* visitor)
......
...@@ -61,6 +61,7 @@ public: ...@@ -61,6 +61,7 @@ public:
const ListHashSet<RefPtrWillBeMember<FontFace> >& cssConnectedFontFaces() const { return m_cssConnectedFontFaces; } const ListHashSet<RefPtrWillBeMember<FontFace> >& cssConnectedFontFaces() const { return m_cssConnectedFontFaces; }
unsigned version() const { return m_version; } unsigned version() const { return m_version; }
void incrementVersion() { ++m_version; }
void trace(Visitor*); void trace(Visitor*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment