Changeset 202127 in webkit


Ignore:
Timestamp:
Jun 16, 2016 10:10:38 AM (8 years ago)
Author:
mmaxfield@apple.com
Message:

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.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202125 r202127  
     12016-06-16  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Sporadic crash in HashTableAddResult following CSSValuePool::createFontFamilyValue
     4        https://bugs.webkit.org/show_bug.cgi?id=158297
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/text/placeholder-renderstyle-null-font-expected.txt: Added.
     9        * fast/text/placeholder-renderstyle-null-font.html: Added.
     10
    1112016-06-15  Keith Miller  <keith_miller@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r202126 r202127  
     12016-06-16  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Sporadic crash in HashTableAddResult following CSSValuePool::createFontFamilyValue
     4        https://bugs.webkit.org/show_bug.cgi?id=158297
     5
     6        Reviewed by Darin Adler.
     7
     8        In an effort to reduce the flash of unstyled content, we force all elements
     9        to have display: none during an external stylesheet load. We do this by
     10        ignoring the CSS cascade and forcing all elements to have a placeholder style
     11        which hardcodes display: none. (This is necessary to make elements created by
     12        script during the stylesheet load not flash.)
     13
     14        This style is exposed to web content via getComputedStyle(), which means it
     15        needs to maintain the invariant that font-families can never be null strings.
     16        We enforce this by forcing the font-family to be the standard font name.
     17
     18        Test: fast/text/placeholder-renderstyle-null-font.html
     19
     20        * style/StyleTreeResolver.cpp:
     21        (WebCore::Style::ensurePlaceholderStyle):
     22
    1232016-06-16  Chris Dumez  <cdumez@apple.com>
    224
  • trunk/Source/WebCore/style/StyleTreeResolver.cpp

    r202091 r202127  
    4444#include "Settings.h"
    4545#include "ShadowRoot.h"
     46#include "StyleFontSizeFunctions.h"
    4647#include "StyleResolver.h"
    4748#include "Text.h"
     
    6465    placeholderStyle->setDisplay(NONE);
    6566    placeholderStyle->setIsPlaceholderStyle();
     67
     68    FontCascadeDescription fontDescription;
     69    fontDescription.setOneFamily(standardFamily);
     70    fontDescription.setKeywordSizeFromIdentifier(CSSValueMedium);
     71    float size = Style::fontSizeForKeyword(CSSValueMedium, false, document);
     72    fontDescription.setSpecifiedSize(size);
     73    fontDescription.setComputedSize(size);
     74    placeholderStyle->setFontDescription(fontDescription);
     75
    6676    placeholderStyle->fontCascade().update(&document.fontSelector());
    6777}
Note: See TracChangeset for help on using the changeset viewer.