<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Sporadic crash in HashTableAddResult following CSSValuePool::createFontFamilyValue"
href="https://bugs.webkit.org/show_bug.cgi?id=158297#c10">Comment # 10</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Sporadic crash in HashTableAddResult following CSSValuePool::createFontFamilyValue"
href="https://bugs.webkit.org/show_bug.cgi?id=158297">bug 158297</a>
from <span class="vcard"><a class="email" href="mailto:mmaxfield@apple.com" title="Myles C. Maxfield <mmaxfield@apple.com>"> <span class="fn">Myles C. Maxfield</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=158297#c9">comment #9</a>)
<span class="quote">> This is because of the following code in TreeResolver::styleForElement():
>
> if (!m_document.haveStylesheetsLoaded() && !element.renderer()) {
> m_document.setHasNodesWithPlaceholderStyle();
> return RenderStyle::clonePtr(*placeholderStyle);
> }
>
> This placeholder style does not have its font family set.</span >
This can be resolved by the following code in ensurePlaceholderStyle()
FontCascadeDescription fontDescription;
fontDescription.setOneFamily(standardFamily);
fontDescription.setKeywordSizeFromIdentifier(CSSValueMedium);
float size = Style::fontSizeForKeyword(CSSValueMedium, false, document);
fontDescription.setSpecifiedSize(size);
fontDescription.setComputedSize(size);
placeholderStyle->setFontDescription(fontDescription);</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>