Changeset 207726 in webkit


Ignore:
Timestamp:
Oct 23, 2016 12:23:28 AM (8 years ago)
Author:
mmaxfield@apple.com
Message:

ASSERTION FAILED: m_fonts in &WebCore::FontCascade::primaryFont
https://bugs.webkit.org/show_bug.cgi?id=163459

Reviewed by Darin Adler.

Source/WebCore:

The CSS Units and Values spec states that font-relative units, when used
in the font-size property, are resolved against the parent element. When
calc() is specified, we were trying to resolve them against the current
element, which is impossible because of the circular dependency. Instead,
we should resolve against the parent style the same way as when calc()
isn't specified.

Test: fast/text/font-size-calc.html

  • css/StyleBuilderCustom.h:

(WebCore::StyleBuilderCustom::applyValueFontSize):

LayoutTests:

  • fast/text/font-size-calc-expected.txt: Added.
  • fast/text/font-size-calc.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207723 r207726  
     12016-10-22  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        ASSERTION FAILED: m_fonts in &WebCore::FontCascade::primaryFont
     4        https://bugs.webkit.org/show_bug.cgi?id=163459
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/text/font-size-calc-expected.txt: Added.
     9        * fast/text/font-size-calc.html: Added.
     10
    1112016-10-22  Dan Bernstein  <mitz@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r207725 r207726  
     12016-10-22  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        ASSERTION FAILED: m_fonts in &WebCore::FontCascade::primaryFont
     4        https://bugs.webkit.org/show_bug.cgi?id=163459
     5
     6        Reviewed by Darin Adler.
     7
     8        The CSS Units and Values spec states that font-relative units, when used
     9        in the font-size property, are resolved against the parent element. When
     10        calc() is specified, we were trying to resolve them against the current
     11        element, which is impossible because of the circular dependency. Instead,
     12        we should resolve against the parent style the same way as when calc()
     13        isn't specified.
     14
     15        Test: fast/text/font-size-calc.html
     16
     17        * css/StyleBuilderCustom.h:
     18        (WebCore::StyleBuilderCustom::applyValueFontSize):
     19
    1202016-10-22  Chris Dumez  <cdumez@apple.com>
    221
  • trunk/Source/WebCore/css/StyleBuilderCustom.h

    r207396 r207726  
    15881588        } else if (primitiveValue.isPercentage())
    15891589            size = (primitiveValue.floatValue() * parentSize) / 100.0f;
    1590         else if (primitiveValue.isCalculatedPercentageWithLength())
    1591             size = primitiveValue.cssCalcValue()->createCalculationValue(styleResolver.state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f))->evaluate(parentSize);
    1592         else
     1590        else if (primitiveValue.isCalculatedPercentageWithLength()) {
     1591            const auto& conversionData = styleResolver.state().cssToLengthConversionData();
     1592            CSSToLengthConversionData parentConversionData { styleResolver.parentStyle(), conversionData.rootStyle(), styleResolver.document().renderView(), 1.0f, true };
     1593            size = primitiveValue.cssCalcValue()->createCalculationValue(parentConversionData)->evaluate(parentSize);
     1594        } else
    15931595            return;
    15941596    }
Note: See TracChangeset for help on using the changeset viewer.