Changeset 111132 in webkit


Ignore:
Timestamp:
Mar 18, 2012 4:33:04 AM (12 years ago)
Author:
robert@webkit.org
Message:

CSS 2.1 failure: eof-003.htm fails
https://bugs.webkit.org/show_bug.cgi?id=78538

Reviewed by Antti Koivisto.

Source/WebCore:

Tests: css2.1/20110323/eof-001.htm

css2.1/20110323/eof-003.htm
css2.1/20110323/eof-004.htm
css2.1/20110323/eof-005.htm
css2.1/20110323/eof-006.htm
css2.1/20110323/eof-007.htm

This patch fixes eof-003.htm, eof-005.htm and eof-006.htm. The other eof-* tests already pass.

  • css/CSSGrammar.y: Allow EOF as well as ';' to terminate import rules.

This should probably be done for other rules in a separate patch.

  • css/CSSParser.cpp:

(WebCore::CSSParser::checkAndSkipString): Allow strings to end with EOF.
(WebCore::CSSParser::parseString): ditto

LayoutTests:

  • css2.1/20110323/eof-001-expected.html: Added.
  • css2.1/20110323/eof-001.htm: Added.
  • css2.1/20110323/eof-003-expected.html: Added.
  • css2.1/20110323/eof-003.htm: Added.
  • css2.1/20110323/eof-004-expected.html: Added.
  • css2.1/20110323/eof-004.htm: Added.
  • css2.1/20110323/eof-005-expected.html: Added.
  • css2.1/20110323/eof-005.htm: Added.
  • css2.1/20110323/eof-006-expected.html: Added.
  • css2.1/20110323/eof-006.htm: Added.
  • css2.1/20110323/eof-007-expected.html: Added.
  • css2.1/20110323/eof-007.htm: Added.
  • css2.1/20110323/support/eof-green.css: Added.
Location:
trunk
Files:
13 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r111120 r111132  
     12012-02-13  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: eof-003.htm fails
     4        https://bugs.webkit.org/show_bug.cgi?id=78538
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * css2.1/20110323/eof-001-expected.html: Added.
     9        * css2.1/20110323/eof-001.htm: Added.
     10        * css2.1/20110323/eof-003-expected.html: Added.
     11        * css2.1/20110323/eof-003.htm: Added.
     12        * css2.1/20110323/eof-004-expected.html: Added.
     13        * css2.1/20110323/eof-004.htm: Added.
     14        * css2.1/20110323/eof-005-expected.html: Added.
     15        * css2.1/20110323/eof-005.htm: Added.
     16        * css2.1/20110323/eof-006-expected.html: Added.
     17        * css2.1/20110323/eof-006.htm: Added.
     18        * css2.1/20110323/eof-007-expected.html: Added.
     19        * css2.1/20110323/eof-007.htm: Added.
     20        * css2.1/20110323/support/eof-green.css: Added.
     21
    1222012-03-17  Nikolas Zimmermann  <nzimmermann@rim.com>
    223
  • trunk/Source/WebCore/ChangeLog

    r111131 r111132  
     12012-02-13  Robert Hogan  <robert@webkit.org>
     2
     3        CSS 2.1 failure: eof-003.htm fails
     4        https://bugs.webkit.org/show_bug.cgi?id=78538
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Tests: css2.1/20110323/eof-001.htm
     9               css2.1/20110323/eof-003.htm
     10               css2.1/20110323/eof-004.htm
     11               css2.1/20110323/eof-005.htm
     12               css2.1/20110323/eof-006.htm
     13               css2.1/20110323/eof-007.htm
     14
     15        This patch fixes eof-003.htm, eof-005.htm and eof-006.htm. The other eof-* tests already pass.
     16
     17        * css/CSSGrammar.y: Allow EOF as well as ';' to terminate import rules.
     18                            This should probably be done for other rules in a separate patch.
     19        * css/CSSParser.cpp:
     20        (WebCore::CSSParser::checkAndSkipString): Allow strings to end with EOF.
     21        (WebCore::CSSParser::parseString): ditto
     22
    1232012-03-17  David Reveman  <reveman@chromium.org>
    224
  • trunk/Source/WebCore/css/CSSGrammar.y

    r110305 r111132  
    458458        $$ = static_cast<CSSParser*>(parser)->createImportRule($3, $5);
    459459    }
     460  | IMPORT_SYM maybe_space string_or_uri maybe_space maybe_media_list TOKEN_EOF {
     461        $$ = static_cast<CSSParser*>(parser)->createImportRule($3, $5);
     462    }
    460463  | IMPORT_SYM maybe_space string_or_uri maybe_space maybe_media_list invalid_block {
    461464        $$ = 0;
  • trunk/Source/WebCore/css/CSSParser.cpp

    r110588 r111132  
    77157715            return currentCharacter + 1;
    77167716        }
    7717         if (UNLIKELY(*currentCharacter <= '\r' && (!*currentCharacter || *currentCharacter == '\n' || (*currentCharacter | 0x1) == '\r'))) {
    7718             // String parsing is failed for character '\0', '\n', '\f' or '\r'.
     7717        if (UNLIKELY(!*currentCharacter)) {
     7718            // String parsing is successful up to end of input.
     7719            return currentCharacter;
     7720        }
     7721        if (UNLIKELY(*currentCharacter <= '\r' && (*currentCharacter == '\n' || (*currentCharacter | 0x1) == '\r'))) {
     7722            // String parsing is failed for character '\n', '\f' or '\r'.
    77197723            return 0;
    77207724        }
     
    77827786            // String parsing is done.
    77837787            ++m_currentCharacter;
     7788            return;
     7789        }
     7790        if (UNLIKELY(!*m_currentCharacter)) {
     7791            // String parsing is done, but don't advance pointer if at the end of input.
    77847792            return;
    77857793        }
Note: See TracChangeset for help on using the changeset viewer.