Title: [109382] trunk
Revision
109382
Author
[email protected]
Date
2012-03-01 11:47:44 -0800 (Thu, 01 Mar 2012)

Log Message

REGRESSION: Outlook 2007 doesn't display fonts correctly on emails composed by WebKit
https://bugs.webkit.org/show_bug.cgi?id=79448

Reviewed by Ryosuke Niwa.

Source/WebCore:

Don't produce single quotes around face attribute of font elements.

Test: editing/style/font-face-unquote.html

* editing/EditingStyle.cpp:
(WebCore::StyleChange::extractTextStyles): Remove single quotes from m_applyFontFace.

LayoutTests:

Add a test that makes sure WebKit doesn't produce single quotes around
face attribute of font element.

* editing/style/font-face-unquote-expected.txt: Added.
* editing/style/font-face-unquote.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (109381 => 109382)


--- trunk/LayoutTests/ChangeLog	2012-03-01 19:40:43 UTC (rev 109381)
+++ trunk/LayoutTests/ChangeLog	2012-03-01 19:47:44 UTC (rev 109382)
@@ -1,3 +1,16 @@
+2012-03-01  Kenichi Ishibashi  <[email protected]>
+
+        REGRESSION: Outlook 2007 doesn't display fonts correctly on emails composed by WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=79448
+
+        Reviewed by Ryosuke Niwa.
+
+        Add a test that makes sure WebKit doesn't produce single quotes around
+        face attribute of font element.
+
+        * editing/style/font-face-unquote-expected.txt: Added.
+        * editing/style/font-face-unquote.html: Added.
+
 2012-03-01  Adam Klein  <[email protected]>
 
         Mark use-same-database-in-page-and-workers.html as a TEXT failure.

Added: trunk/LayoutTests/editing/style/font-face-unquote-expected.txt (0 => 109382)


--- trunk/LayoutTests/editing/style/font-face-unquote-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/editing/style/font-face-unquote-expected.txt	2012-03-01 19:47:44 UTC (rev 109382)
@@ -0,0 +1,10 @@
+Test to make sure WebKit doesn't quote face attribute of font elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Font face is unquoted.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/editing/style/font-face-unquote.html (0 => 109382)


--- trunk/LayoutTests/editing/style/font-face-unquote.html	                        (rev 0)
+++ trunk/LayoutTests/editing/style/font-face-unquote.html	2012-03-01 19:47:44 UTC (rev 109382)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script>
+description('Test to make sure WebKit doesn\'t quote face attribute of font elements.');
+
+var testContainer = document.createElement('div');
+testContainer.contentEditable = true;
+document.body.appendChild(testContainer);
+
+testContainer.innerHTML = 'Hello WebKit';
+window.getSelection().selectAllChildren(testContainer);
+document.execCommand('fontName', false, 'courier new');
+
+var expected = '<font face="courier new">Hello WebKit</font>';
+if (expected == testContainer.innerHTML)
+    testPassed('Font face is unquoted.');
+else
+    testFailed('Font face is quoted, expected: ' + expected + ', actual: ' + testContainer.innerHTML);
+
+document.body.removeChild(testContainer);
+var successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (109381 => 109382)


--- trunk/Source/WebCore/ChangeLog	2012-03-01 19:40:43 UTC (rev 109381)
+++ trunk/Source/WebCore/ChangeLog	2012-03-01 19:47:44 UTC (rev 109382)
@@ -1,3 +1,17 @@
+2012-03-01  Kenichi Ishibashi  <[email protected]>
+
+        REGRESSION: Outlook 2007 doesn't display fonts correctly on emails composed by WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=79448
+
+        Reviewed by Ryosuke Niwa.
+
+        Don't produce single quotes around face attribute of font elements.
+
+        Test: editing/style/font-face-unquote.html
+
+        * editing/EditingStyle.cpp:
+        (WebCore::StyleChange::extractTextStyles): Remove single quotes from m_applyFontFace.
+
 2012-03-01  Beth Dakin  <[email protected]>
 
         Reviewed by Kevin Decker.

Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (109381 => 109382)


--- trunk/Source/WebCore/editing/EditingStyle.cpp	2012-03-01 19:40:43 UTC (rev 109381)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp	2012-03-01 19:47:44 UTC (rev 109382)
@@ -1379,6 +1379,8 @@
     }
 
     m_applyFontFace = style->getPropertyValue(CSSPropertyFontFamily);
+    // Remove single quotes for Outlook 2007 compatibility. See https://bugs.webkit.org/show_bug.cgi?id=79448
+    m_applyFontFace.replace('\'', "");
     style->removeProperty(CSSPropertyFontFamily);
 
     if (RefPtr<CSSValue> fontSize = style->getPropertyCSSValue(CSSPropertyFontSize)) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to