Changeset 106251 in webkit


Ignore:
Timestamp:
Jan 30, 2012 9:31:52 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION (r82580): Reproducible crash in CSSPrimitiveValue::computeLengthDouble
https://bugs.webkit.org/show_bug.cgi?id=61989

Patch by Parag Radke <nrqv63@motorola.com> on 2012-01-30
Reviewed by Simon Fraser.

Source/WebCore:

According to css3 specs when font-size is specified in 'rems' for an element implies the font-size
of the root element. In this case as HTML element has a property 'display:none' and hence renderer
is NULL causes this crash.

Test: fast/css/fontsize-unit-rems-crash.html

  • css/CSSPrimitiveValue.cpp:

(WebCore::CSSPrimitiveValue::computeLengthDouble):
Added a null check for the root element's RenderStyle as it can be null in case of html has a property
hidden or display:none.

LayoutTests:

Added a test case to check rems unit (css3) with html property display:none.

  • fast/css/fontsize-unit-rems-crash-expected.txt: Added.
  • fast/css/fontsize-unit-rems-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106250 r106251  
     12012-01-30  Parag Radke  <nrqv63@motorola.com>
     2
     3        REGRESSION (r82580): Reproducible crash in CSSPrimitiveValue::computeLengthDouble
     4        https://bugs.webkit.org/show_bug.cgi?id=61989
     5
     6        Reviewed by Simon Fraser.
     7
     8        Added a test case to check rems unit (css3) with html property display:none.
     9
     10        * fast/css/fontsize-unit-rems-crash-expected.txt: Added.
     11        * fast/css/fontsize-unit-rems-crash.html: Added.
     12
    1132012-01-26  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r106250 r106251  
     12012-01-30  Parag Radke  <nrqv63@motorola.com>
     2
     3        REGRESSION (r82580): Reproducible crash in CSSPrimitiveValue::computeLengthDouble
     4        https://bugs.webkit.org/show_bug.cgi?id=61989
     5
     6        Reviewed by Simon Fraser.
     7
     8        According to css3 specs when font-size is specified in 'rems' for an element implies the font-size
     9        of the root element. In this case as HTML element has a property 'display:none' and hence renderer
     10        is NULL causes this crash.
     11
     12        Test: fast/css/fontsize-unit-rems-crash.html
     13
     14        * css/CSSPrimitiveValue.cpp:
     15        (WebCore::CSSPrimitiveValue::computeLengthDouble):
     16        Added a null check for the root element's RenderStyle as it can be null in case of html has a property
     17        hidden or display:none.
     18
    1192012-01-26  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
    220
  • trunk/Source/WebCore/css/CSSPrimitiveValue.cpp

    r105678 r106251  
    417417        case CSS_REMS:
    418418            applyZoomMultiplier = false;
    419             factor = computingFontSize ? rootStyle->fontDescription().specifiedSize() : rootStyle->fontDescription().computedSize();
     419            if (rootStyle)
     420                factor = computingFontSize ? rootStyle->fontDescription().specifiedSize() : rootStyle->fontDescription().computedSize();
    420421            break;
    421422        case CSS_PX:
Note: See TracChangeset for help on using the changeset viewer.