Changeset 74401 in webkit


Ignore:
Timestamp:
Dec 20, 2010 11:30:09 PM (13 years ago)
Author:
yuzo@google.com
Message:

2010-12-20 Yuzo Fujishima <yuzo@google.com>

Reviewed by Eric Seidel.

Fix for Bug 26183 - [@font-face] font-family descriptor with multiple names should be discarded
https://bugs.webkit.org/show_bug.cgi?id=26183

  • fast/css/font-face-font-family-descriptor-expected.txt: Added.
  • fast/css/font-face-font-family-descriptor.html: Added.
  • platform/win/css2.1/resources/Mac-compatible-font-fallback.css: (@font-face): Rewrote @font-face rules that specify multiple font families.

2010-12-20 Yuzo Fujishima <yuzo@google.com>

Reviewed by Eric Seidel.

Fix for Bug 26183 - [@font-face] font-family descriptor with multiple names should be discarded
https://bugs.webkit.org/show_bug.cgi?id=26183

Test: fast/css/font-face-font-family-descriptor.html

  • css/CSSParser.cpp: (WebCore::CSSParser::createFontFaceRule): Consider @font-face rule invalid if its font-family descriptor has multiple (or zero) families.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r74400 r74401  
     12010-12-20  Yuzo Fujishima  <yuzo@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Fix for Bug 26183 - [@font-face] font-family descriptor with multiple names should be discarded
     6        https://bugs.webkit.org/show_bug.cgi?id=26183
     7
     8        * fast/css/font-face-font-family-descriptor-expected.txt: Added.
     9        * fast/css/font-face-font-family-descriptor.html: Added.
     10        * platform/win/css2.1/resources/Mac-compatible-font-fallback.css:
     11        (@font-face): Rewrote @font-face rules that specify multiple font families.
     12
    1132010-12-20  Yuta Kitamura  <yutak@chromium.org>
    214
  • trunk/LayoutTests/platform/win/css2.1/resources/Mac-compatible-font-fallback.css

    r62530 r74401  
    1010
    1111@font-face {
    12     font-family: 'times' '-webkit-serif';
     12    font-family: '-webkit-serif';
    1313    src: local('WebKit Layout Tests');
    1414    unicode-range: U+25FE, U+262F, U+2798-279A;
     
    1616
    1717@font-face {
    18     font-family: 'times' '-webkit-serif';
     18    font-family: '-webkit-serif';
     19    src: local('WebKit Layout Tests 2');
     20    unicode-range: U+21E6-21E9;
     21}
     22
     23@font-face {
     24    font-family: 'times';
     25    src: local('WebKit Layout Tests');
     26    unicode-range: U+25FE, U+262F, U+2798-279A;
     27}
     28
     29@font-face {
     30    font-family: 'times';
    1931    src: local('WebKit Layout Tests 2');
    2032    unicode-range: U+21E6-21E9;
  • trunk/WebCore/ChangeLog

    r74399 r74401  
     12010-12-20  Yuzo Fujishima  <yuzo@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Fix for Bug 26183 - [@font-face] font-family descriptor with multiple names should be discarded
     6        https://bugs.webkit.org/show_bug.cgi?id=26183
     7
     8        Test: fast/css/font-face-font-family-descriptor.html
     9
     10        * css/CSSParser.cpp:
     11        (WebCore::CSSParser::createFontFaceRule): Consider @font-face rule
     12        invalid if its font-family descriptor has multiple (or zero) families.
     13
    1142010-12-20  Pavel Feldman  <pfeldman@chromium.org>
    215
  • trunk/WebCore/css/CSSParser.cpp

    r74156 r74401  
    55755575{
    55765576    m_allowImportRules = m_allowNamespaceDeclarations = false;
    5577     RefPtr<CSSFontFaceRule> rule = CSSFontFaceRule::create(m_styleSheet);
    55785577    for (unsigned i = 0; i < m_numParsedProperties; ++i) {
    55795578        CSSProperty* property = m_parsedProperties[i];
     
    55835582            property->m_value = CSSValueList::createCommaSeparated();
    55845583            static_cast<CSSValueList*>(property->m_value.get())->append(value.release());
    5585         }
    5586     }
     5584        } else if (id == CSSPropertyFontFamily && static_cast<CSSValueList*>(property->m_value.get())->length() != 1) {
     5585            // Unlike font-family property, font-family descriptor in @font-face rule can take only one family name.
     5586            // See http://dev.w3.org/csswg/css3-fonts/#font-family-desc
     5587            clearProperties();
     5588            return 0;
     5589        }
     5590    }
     5591    RefPtr<CSSFontFaceRule> rule = CSSFontFaceRule::create(m_styleSheet);
    55875592    rule->setDeclaration(CSSMutableStyleDeclaration::create(rule.get(), m_parsedProperties, m_numParsedProperties));
    55885593    clearProperties();
Note: See TracChangeset for help on using the changeset viewer.