Sporadic crash in HashTableAddResult following CSSValuePool::createFontFamilyValue
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jun 2016 17:10:38 +0000 (17:10 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jun 2016 17:10:38 +0000 (17:10 +0000)
commit1e476171e346e9e93f34e49715f3da2362eb7118
tree707e6a08c64614b1a67fc319f14ace471c55d1d4
parent5463fc96c21bcc9723505cd32ae5efd86df3fcf8
Sporadic crash in HashTableAddResult following CSSValuePool::createFontFamilyValue
https://bugs.webkit.org/show_bug.cgi?id=158297

Reviewed by Darin Adler.

Source/WebCore:

In an effort to reduce the flash of unstyled content, we force all elements
to have display: none during an external stylesheet load. We do this by
ignoring the CSS cascade and forcing all elements to have a placeholder style
which hardcodes display: none. (This is necessary to make elements created by
script during the stylesheet load not flash.)

This style is exposed to web content via getComputedStyle(), which means it
needs to maintain the invariant that font-families can never be null strings.
We enforce this by forcing the font-family to be the standard font name.

Test: fast/text/placeholder-renderstyle-null-font.html

* style/StyleTreeResolver.cpp:
(WebCore::Style::ensurePlaceholderStyle):

LayoutTests:

* fast/text/placeholder-renderstyle-null-font-expected.txt: Added.
* fast/text/placeholder-renderstyle-null-font.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/placeholder-renderstyle-null-font-expected.txt [new file with mode: 0644]
LayoutTests/fast/text/placeholder-renderstyle-null-font.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/style/StyleTreeResolver.cpp