Changeset 114876 in webkit


Ignore:
Timestamp:
Apr 23, 2012 12:47:39 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore: Incorrect handling of CSS escape sequences that encode surrogates
https://bugs.webkit.org/show_bug.cgi?id=76152

Patch by Szilard Ledan <Szilárd LEDÁN> on 2012-04-23
Reviewed by Kent Tamura.

Test: fast/css/parsing-css-surrogate-pairs.html

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseEscape):

LayoutTests: Added a test for css surrogate pairs parser
https://bugs.webkit.org/show_bug.cgi?id=76152

Patch by Szilard Ledan <Szilárd LEDÁN> on 2012-04-23
Reviewed by Kent Tamura.

  • fast/css/parsing-css-surrogate-pairs-expected.txt: Added.
  • fast/css/parsing-css-surrogate-pairs.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r114874 r114876  
     12012-04-23  Szilard Ledan  <szledan@inf.u-szeged.hu>
     2
     3        Added a test for css surrogate pairs parser
     4        https://bugs.webkit.org/show_bug.cgi?id=76152
     5
     6        Reviewed by Kent Tamura.
     7
     8        * fast/css/parsing-css-surrogate-pairs-expected.txt: Added.
     9        * fast/css/parsing-css-surrogate-pairs.html: Added.
     10
    1112012-04-22  Csaba Osztrogonác  <ossy@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r114872 r114876  
     12012-04-23  Szilard Ledan  <szledan@inf.u-szeged.hu>
     2
     3        Incorrect handling of CSS escape sequences that encode surrogates
     4        https://bugs.webkit.org/show_bug.cgi?id=76152
     5
     6        Reviewed by Kent Tamura.
     7
     8        Test: fast/css/parsing-css-surrogate-pairs.html
     9
     10        * css/CSSParser.cpp:
     11        (WebCore::CSSParser::parseEscape):
     12
    1132012-04-22  Yury Semikhatsky  <yurys@chromium.org>
    214
  • trunk/Source/WebCore/css/CSSParser.cpp

    r114699 r114876  
    79707970        } while (--length && isASCIIHexDigit(*m_currentCharacter));
    79717971
    7972         // Characters above 0xffff are not handled.
    7973         if (unicode > 0xffff)
     7972        // Characters above 0x10ffff are not handled.
     7973        if (unicode > 0x10ffff)
    79747974            unicode = 0xfffd;
    79757975
     
    79777977        if (isHTMLSpace(*m_currentCharacter))
    79787978            ++m_currentCharacter;
    7979         *result = unicode;
     7979
     7980        // Replace unicode with a surrogate pairs when it is bigger than 0xffff
     7981        if (U16_LENGTH(unicode) == 2) {
     7982            *result++ = U16_LEAD(unicode);
     7983            *result = U16_TRAIL(unicode);
     7984        } else
     7985            *result = unicode;
    79807986    } else
    79817987        *result = *m_currentCharacter++;
Note: See TracChangeset for help on using the changeset viewer.