[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-142-g786665c

yuzo at google.com yuzo at google.com
Mon Dec 27 16:26:52 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9207843a2be19e8da47a17e47318dd80a174068c
Author: yuzo at google.com <yuzo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 21 07:30:09 2010 +0000

    2010-12-20  Yuzo Fujishima  <yuzo at 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 at 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.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74401 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 58581fd..e5be2ae 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-20  Yuzo Fujishima  <yuzo at 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  Yuta Kitamura  <yutak at chromium.org>
 
         Unreviewed.
diff --git a/LayoutTests/fast/css/font-face-font-family-descriptor-expected.txt b/LayoutTests/fast/css/font-face-font-family-descriptor-expected.txt
new file mode 100644
index 0000000..8a89790
--- /dev/null
+++ b/LayoutTests/fast/css/font-face-font-family-descriptor-expected.txt
@@ -0,0 +1,16 @@
+font-family descriptor in @font-face rule can take only one family. Hence the @font-face rule in this test must be ignored.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+Test:
+Text iii
+Must match:
+Text iii
+Must not match:
+Text iii
+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS document.getElementById('testText').offsetWidth == document.getElementById('mustMatch').offsetWidth is true
+PASS document.getElementById('testText').offsetWidth != document.getElementById('mustNotMatch').offsetWidth is true
+
diff --git a/LayoutTests/fast/css/font-face-font-family-descriptor.html b/LayoutTests/fast/css/font-face-font-family-descriptor.html
new file mode 100644
index 0000000..3abb79b
--- /dev/null
+++ b/LayoutTests/fast/css/font-face-font-family-descriptor.html
@@ -0,0 +1,45 @@
+<!doctype html>
+<html>
+<head>
+<title>Test for Bug 26183 - [@font-face] font-family descriptor with multiple names should be discarded</title>
+<style>
+.testtext {
+    font-size: 64px;
+    font-family: Arial;
+    border: solid 1px;
+}
+ at font-face {
+    font-family: myfont1, myfont2;
+    src: local(Courier);
+}
+</style>
+<link rel="stylesheet" href="../js/resources/js-test-style.css"/>
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body onload="test()">
+<div id="description"></div>
+Test:<br/>
+<span id="testText" class="testtext" style="font-family: myfont1, Arial">Text iii</span><br/>
+Must match:<br/>
+<span id="mustMatch" class="testtext" style="font-family: Arial">Text iii</span><br/>
+Must not match:<br/>
+<span id="mustNotMatch" class="testtext" style="font-family: Courier">Text iii</span><br/>
+<div id="console"></div>
+<script>
+if (window.layoutTestController)
+    window.layoutTestController.dumpAsText();
+
+description("font-family descriptor in @font-face rule can take only one family. Hence the @font-face rule in this test must be ignored.");
+
+function test()
+{
+    shouldBeTrue("document.getElementById('testText').offsetWidth == document.getElementById('mustMatch').offsetWidth");
+    shouldBeTrue("document.getElementById('testText').offsetWidth != document.getElementById('mustNotMatch').offsetWidth");
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/LayoutTests/platform/win/css2.1/resources/Mac-compatible-font-fallback.css b/LayoutTests/platform/win/css2.1/resources/Mac-compatible-font-fallback.css
index 1882776..f629493 100644
--- a/LayoutTests/platform/win/css2.1/resources/Mac-compatible-font-fallback.css
+++ b/LayoutTests/platform/win/css2.1/resources/Mac-compatible-font-fallback.css
@@ -9,13 +9,25 @@
    heavy north east arrow */
 
 @font-face {
-    font-family: 'times' '-webkit-serif';
+    font-family: '-webkit-serif';
+    src: local('WebKit Layout Tests');
+    unicode-range: U+25FE, U+262F, U+2798-279A;
+}
+
+ at font-face {
+    font-family: '-webkit-serif';
+    src: local('WebKit Layout Tests 2');
+    unicode-range: U+21E6-21E9;
+}
+
+ at font-face {
+    font-family: 'times';
     src: local('WebKit Layout Tests');
     unicode-range: U+25FE, U+262F, U+2798-279A;
 }
 
 @font-face {
-    font-family: 'times' '-webkit-serif';
+    font-family: 'times';
     src: local('WebKit Layout Tests 2');
     unicode-range: U+21E6-21E9;
 }
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index be98e01..e10d60a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-20  Yuzo Fujishima  <yuzo at 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.
+
 2010-12-20  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index 1fb38d7..744d9b7 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -5574,7 +5574,6 @@ CSSRule* CSSParser::createStyleRule(Vector<CSSSelector*>* selectors)
 CSSRule* CSSParser::createFontFaceRule()
 {
     m_allowImportRules = m_allowNamespaceDeclarations = false;
-    RefPtr<CSSFontFaceRule> rule = CSSFontFaceRule::create(m_styleSheet);
     for (unsigned i = 0; i < m_numParsedProperties; ++i) {
         CSSProperty* property = m_parsedProperties[i];
         int id = property->id();
@@ -5582,8 +5581,14 @@ CSSRule* CSSParser::createFontFaceRule()
             RefPtr<CSSValue> value = property->m_value.release();
             property->m_value = CSSValueList::createCommaSeparated();
             static_cast<CSSValueList*>(property->m_value.get())->append(value.release());
+        } else if (id == CSSPropertyFontFamily && static_cast<CSSValueList*>(property->m_value.get())->length() != 1) {
+            // Unlike font-family property, font-family descriptor in @font-face rule can take only one family name.
+            // See http://dev.w3.org/csswg/css3-fonts/#font-family-desc
+            clearProperties();
+            return 0;
         }
     }
+    RefPtr<CSSFontFaceRule> rule = CSSFontFaceRule::create(m_styleSheet);
     rule->setDeclaration(CSSMutableStyleDeclaration::create(rule.get(), m_parsedProperties, m_numParsedProperties));
     clearProperties();
     CSSFontFaceRule* result = rule.get();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list