Changeset 124186 in webkit


Ignore:
Timestamp:
Jul 31, 2012 3:08:45 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Inspector crashes when trying to inspect a page with CSS region styling
https://bugs.webkit.org/show_bug.cgi?id=91503

Patch by Raul Hudea <rhudea@adobe.com> on 2012-07-31
Reviewed by Alexander Pavlov.

Source/WebCore:

Fix by making sure a CSSRuleSourceData is always created when parsing @-webkit-region rules.

Test: inspector/styles/region-style-crash.html

  • css/CSSGrammar.y: Made ruleset called explicitly markRuleBodyStart instead of depending on updateLastSelectorLineAndPosition to call it.
  • css/CSSParser.cpp:

(WebCore::CSSParser::updateLastSelectorLineAndPosition): markRuleBodyStart should be called via at_rule_body_start.

  • css/CSSPropertySourceData.h:

LayoutTests:

Test to make sure inspector is not crashing when having to parse @-webkit-region rules

  • inspector/styles/region-style-crash-expected.txt: Added.
  • inspector/styles/region-style-crash.html: Added.
  • platform/chromium/TestExpectations:
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r124176 r124186  
     12012-07-31  Raul Hudea  <rhudea@adobe.com>
     2
     3        Inspector crashes when trying to inspect a page with CSS region styling
     4        https://bugs.webkit.org/show_bug.cgi?id=91503
     5
     6        Reviewed by Alexander Pavlov.
     7
     8        Test to make sure inspector is not crashing when having to parse @-webkit-region rules
     9
     10        * inspector/styles/region-style-crash-expected.txt: Added.
     11        * inspector/styles/region-style-crash.html: Added.
     12        * platform/chromium/TestExpectations:
     13
    1142012-07-30  Keishi Hattori  <keishi@webkit.org>
    215
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r124176 r124186  
    26252625BUGWK49142 : fast/regions/style-scoped-in-flow.html = PASS IMAGE IMAGE+TEXT TEXT MISSING
    26262626
     2627BUGWK92131 SKIP : inspector/styles/region-style-crash.html = PASS
     2628
    26272629BUGCR85755 : fast/js/exception-properties.html = TEXT
    26282630
  • trunk/Source/WebCore/ChangeLog

    r124185 r124186  
     12012-07-31  Raul Hudea  <rhudea@adobe.com>
     2
     3        Inspector crashes when trying to inspect a page with CSS region styling
     4        https://bugs.webkit.org/show_bug.cgi?id=91503
     5
     6        Reviewed by Alexander Pavlov.
     7
     8        Fix by making sure a CSSRuleSourceData is always created when parsing @-webkit-region rules.
     9
     10        Test: inspector/styles/region-style-crash.html
     11
     12        * css/CSSGrammar.y: Made ruleset called explicitly markRuleBodyStart instead of depending on updateLastSelectorLineAndPosition to call it.
     13        * css/CSSParser.cpp:
     14        (WebCore::CSSParser::updateLastSelectorLineAndPosition): markRuleBodyStart should be called via at_rule_body_start.
     15        * css/CSSPropertySourceData.h:
     16
    1172012-07-31  Sheriff Bot  <webkit.review.bot@gmail.com>
    218
  • trunk/Source/WebCore/css/CSSGrammar.y

    r124099 r124186  
    870870;
    871871
     872before_region_rule:
     873    /* empty */ {
     874        static_cast<CSSParser*>(parser)->markRuleHeaderStart(CSSRuleSourceData::REGION_RULE);
     875    }
     876    ;
     877
    872878region:
    873     WEBKIT_REGION_RULE_SYM WHITESPACE region_selector '{' maybe_space block_rule_list save_block {
    874         if ($3)
    875             $$ = static_cast<CSSParser*>(parser)->createRegionRule($3, $6);
    876         else
    877             $$ = 0;
     879    before_region_rule WEBKIT_REGION_RULE_SYM WHITESPACE region_selector at_rule_header_end '{' at_rule_body_start maybe_space block_rule_list save_block {
     880        if ($4)
     881            $$ = static_cast<CSSParser*>(parser)->createRegionRule($4, $9);
     882        else {
     883            $$ = 0;
     884            static_cast<CSSParser*>(parser)->popRuleData();
     885        }
    878886    }
    879887;
     
    914922
    915923ruleset:
    916     before_selector_list selector_list at_rule_header_end '{' maybe_space_before_declaration declaration_list closing_brace {
     924    before_selector_list selector_list at_rule_header_end '{' at_rule_body_start maybe_space_before_declaration declaration_list closing_brace {
    917925        CSSParser* p = static_cast<CSSParser*>(parser);
    918926        $$ = p->createStyleRule($2);
  • trunk/Source/WebCore/css/CSSParser.cpp

    r124099 r124186  
    97489748{
    97499749    m_lastSelectorLineNumber = m_lineNumber;
    9750     markRuleBodyStart();
    97519750}
    97529751
  • trunk/Source/WebCore/css/CSSPropertySourceData.h

    r121551 r124186  
    9494        FONT_FACE_RULE,
    9595        PAGE_RULE,
    96         KEYFRAMES_RULE
     96        KEYFRAMES_RULE,
     97        REGION_RULE
    9798    };
    9899
Note: See TracChangeset for help on using the changeset viewer.