[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
yuzo at google.com
yuzo at google.com
Wed Dec 22 11:20:41 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit e704527aaf4f3b4c9e588821577c42fcf6d8e83b
Author: yuzo at google.com <yuzo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jul 20 05:10:08 2010 +0000
2010-07-15 Yuzo Fujishima <yuzo at google.com>
Reviewed by Dan Bernstein.
Fix for Bug 42342 - Font download error for an @font-face rule invalidates other @font-face rules for the same font-family
https://bugs.webkit.org/show_bug.cgi?id=42342
* fast/css/font-face-download-error-expected.txt: Added.
* fast/css/font-face-download-error.html: Added.
2010-07-15 Yuzo Fujishima <yuzo at google.com>
Reviewed by Dan Bernstein.
Fix for Bug 42342 - Font download error for an @font-face rule invalidates other @font-face rules for the same font-family
https://bugs.webkit.org/show_bug.cgi?id=42342
Test: fast/css/font-face-download-error.html
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::isValid): Valid if at least one font
face is valid.
(WebCore::CSSSegmentedFontFace::getFontData): Check validity for each
font face.
* css/CSSSegmentedFontFace.h: Make isValid private.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 57cf8a2..9a9fb70 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-15 Yuzo Fujishima <yuzo at google.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix for Bug 42342 - Font download error for an @font-face rule invalidates other @font-face rules for the same font-family
+ https://bugs.webkit.org/show_bug.cgi?id=42342
+
+ * fast/css/font-face-download-error-expected.txt: Added.
+ * fast/css/font-face-download-error.html: Added.
+
2010-07-19 Anders Carlsson <andersca at apple.com>
Reviewed by Maciej Stachowiak.
diff --git a/LayoutTests/fast/css/font-face-download-error-expected.txt b/LayoutTests/fast/css/font-face-download-error-expected.txt
new file mode 100644
index 0000000..9377d04
--- /dev/null
+++ b/LayoutTests/fast/css/font-face-download-error-expected.txt
@@ -0,0 +1,36 @@
+If no font resources are available for an @font-face rule due to download errors, the rule must be ignored but others must remain in effect.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+iiiiiiiiii test_0_0
+iiiiiiiiii ref_0_0
+jjjjjjjjjj test_0_1
+jjjjjjjjjj ref_0_1
+
+iiiiiiiiii test_1_0
+iiiiiiiiii ref_1_0
+jjjjjjjjjj test_1_1
+jjjjjjjjjj ref_1_1
+
+iiiiiiiiii test_2_0
+iiiiiiiiii ref_2_0
+jjjjjjjjjj test_2_1
+jjjjjjjjjj ref_2_1
+
+iiiiiiiiii test_3_0
+iiiiiiiiii ref_3_0
+jjjjjjjjjj test_3_1
+jjjjjjjjjj ref_3_1
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS document.getElementById('test_0_0').offsetWidth is document.getElementById('ref_0_0').offsetWidth
+PASS document.getElementById('test_0_1').offsetWidth is document.getElementById('ref_0_1').offsetWidth
+PASS document.getElementById('test_1_0').offsetWidth is document.getElementById('ref_1_0').offsetWidth
+PASS document.getElementById('test_1_1').offsetWidth is document.getElementById('ref_1_1').offsetWidth
+PASS document.getElementById('test_2_0').offsetWidth is document.getElementById('ref_2_0').offsetWidth
+PASS document.getElementById('test_2_1').offsetWidth is document.getElementById('ref_2_1').offsetWidth
+PASS document.getElementById('test_3_0').offsetWidth is document.getElementById('ref_3_0').offsetWidth
+PASS document.getElementById('test_3_1').offsetWidth is document.getElementById('ref_3_1').offsetWidth
+
diff --git a/LayoutTests/fast/css/font-face-download-error.html b/LayoutTests/fast/css/font-face-download-error.html
new file mode 100644
index 0000000..c47faae
--- /dev/null
+++ b/LayoutTests/fast/css/font-face-download-error.html
@@ -0,0 +1,136 @@
+<!doctype html>
+<html>
+<head>
+<title>Test for Bug 42342 - Font download error for an @font-face rule invalidates other @font-face rules for the same font-family</title>
+<style>
+.test {
+ font-family: Times;
+ border: solid 1px;
+}
+
+/* Test 0: Download sucess */
+ at font-face {
+ font-family:myfont_0;
+ src: local('Courier');
+}
+ at font-face {
+ font-family:myfont_0;
+ src: url('resources/Ahem.otf');
+ unicode-range: u+69; /* 'i' */
+}
+
+/* Test 1: Download error */
+ at font-face {
+ font-family:myfont_1;
+ src: local('Courier');
+}
+ at font-face {
+ font-family:myfont_1;
+ src: url('resources/DownLoadErrorAhem.otf');
+ unicode-range: u+69; /* 'i' */
+}
+
+/* Test 2: Download error followed by success */
+ at font-face {
+ font-family:myfont_2;
+ src: local('Courier');
+}
+ at font-face {
+ font-family:myfont_2;
+ src: url('resources/DownLoadErrorAhem.otf'), url('resources/Ahem.otf');
+ unicode-range: u+69; /* 'i' */
+}
+
+/* Test 3: Download error followed by existing local font */
+ at font-face {
+ font-family:myfont_3;
+ src: local('Courier');
+}
+ at font-face {
+ font-family:myfont_3;
+ src: url('resources/DownLoadErrorAhem.otf'), local(Arial);
+ unicode-range: u+69; /* 'i' */
+}
+
+</style>
+<link rel="stylesheet" href="../js/resources/js-test-style.css"/>
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="tests"></div>
+
+<div id="console"></div>
+<div id="out"></div>
+<script>
+if (window.layoutTestController)
+ window.layoutTestController.waitUntilDone();
+
+description("If no font resources are available for an @font-face rule due to download errors, the rule must be ignored but others must remain in effect.");
+
+var testsElement = document.getElementById("tests");
+var testStrings = [
+ "iiiiiiiiii",
+ "jjjjjjjjjj"
+];
+var expectedResults = [
+ // Effective font family for "i" and "j"
+ ["Ahem", "Courier"],
+ ["Courier", "Courier"],
+ ["Ahem", "Courier"],
+ ["Arial", "Courier"]
+];
+
+function createAndAppendSpan(id, subId, fontFamily)
+{
+ var span = document.createElement("span");
+ span.id = id;
+ span.className = "test";
+ span.style.fontFamily = fontFamily;
+ span.innerHTML = testStrings[subId];
+ testsElement.appendChild(span);
+ testsElement.appendChild(document.createTextNode(" " + id));
+ testsElement.appendChild(document.createElement("br"));
+}
+
+function testId(mainTestId, subTestId)
+{
+ return "test_" + mainTestId + "_" + subTestId;
+}
+
+function refId(mainTestId, subTestId)
+{
+ return "ref_" + mainTestId + "_" + subTestId;
+}
+
+function test()
+{
+ for (var mainTestId = 0; mainTestId < expectedResults.length; mainTestId++) {
+ for (var subTestId = 0; subTestId < testStrings.length; subTestId++) {
+ shouldBe("document.getElementById('" + testId(mainTestId, subTestId) + "').offsetWidth", "document.getElementById('" + refId(mainTestId, subTestId) + "').offsetWidth");
+ }
+ }
+ if (window.layoutTestController)
+ window.layoutTestController.notifyDone();
+}
+
+for (var mainTestId = 0; mainTestId < expectedResults.length; mainTestId++) {
+ for (var subTestId = 0; subTestId < testStrings.length; subTestId++) {
+ var testFontFamily = "myfont_" + mainTestId;
+ createAndAppendSpan(testId(mainTestId, subTestId), subTestId, testFontFamily);
+ var refFontFamily = expectedResults[mainTestId][subTestId];
+ createAndAppendSpan(refId(mainTestId, subTestId), subTestId, refFontFamily);
+ }
+ testsElement.appendChild(document.createElement("br"));
+}
+
+// We need to run tests after the font downloading succeeded or failed.
+// Using a timer is not ideal, but there seems to be no better options.
+window.setTimeout(test, 100);
+
+var successfullyParsed = true;
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4d73754..cab8416 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-07-15 Yuzo Fujishima <yuzo at google.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix for Bug 42342 - Font download error for an @font-face rule invalidates other @font-face rules for the same font-family
+ https://bugs.webkit.org/show_bug.cgi?id=42342
+
+ Test: fast/css/font-face-download-error.html
+
+ * css/CSSSegmentedFontFace.cpp:
+ (WebCore::CSSSegmentedFontFace::isValid): Valid if at least one font
+ face is valid.
+ (WebCore::CSSSegmentedFontFace::getFontData): Check validity for each
+ font face.
+ * css/CSSSegmentedFontFace.h: Make isValid private.
+
2010-07-19 Kent Tamura <tkent at chromium.org>
Reviewed by Shinichiro Hamaji.
diff --git a/WebCore/css/CSSSegmentedFontFace.cpp b/WebCore/css/CSSSegmentedFontFace.cpp
index 075d881..bda29f0 100644
--- a/WebCore/css/CSSSegmentedFontFace.cpp
+++ b/WebCore/css/CSSSegmentedFontFace.cpp
@@ -61,12 +61,13 @@ void CSSSegmentedFontFace::pruneTable()
bool CSSSegmentedFontFace::isValid() const
{
+ // Valid if at least one font face is valid.
unsigned size = m_fontFaces.size();
for (unsigned i = 0; i < size; i++) {
- if (!m_fontFaces[i]->isValid())
- return false;
+ if (m_fontFaces[i]->isValid())
+ return true;
}
- return true;
+ return false;
}
void CSSSegmentedFontFace::fontLoaded(CSSFontFace*)
@@ -97,6 +98,8 @@ FontData* CSSSegmentedFontFace::getFontData(const FontDescription& fontDescripti
unsigned size = m_fontFaces.size();
for (unsigned i = 0; i < size; i++) {
+ if (!m_fontFaces[i]->isValid())
+ continue;
FontTraitsMask traitsMask = m_fontFaces[i]->traitsMask();
bool syntheticBold = !(traitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask)) && (desiredTraitsMask & (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask));
bool syntheticItalic = !(traitsMask & FontStyleItalicMask) && (desiredTraitsMask & FontStyleItalicMask);
diff --git a/WebCore/css/CSSSegmentedFontFace.h b/WebCore/css/CSSSegmentedFontFace.h
index d44ddba..03ebe4a 100644
--- a/WebCore/css/CSSSegmentedFontFace.h
+++ b/WebCore/css/CSSSegmentedFontFace.h
@@ -45,7 +45,6 @@ public:
static PassRefPtr<CSSSegmentedFontFace> create(CSSFontSelector* selector) { return adoptRef(new CSSSegmentedFontFace(selector)); }
~CSSSegmentedFontFace();
- bool isValid() const;
CSSFontSelector* fontSelector() const { return m_fontSelector; }
void fontLoaded(CSSFontFace*);
@@ -58,6 +57,7 @@ private:
CSSSegmentedFontFace(CSSFontSelector*);
void pruneTable();
+ bool isValid() const;
CSSFontSelector* m_fontSelector;
HashMap<unsigned, SegmentedFontData*> m_fontDataTable;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list