[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9
eric at webkit.org
eric at webkit.org
Thu Feb 4 21:24:27 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 0faab13ef37f471e28e4032d59472d2e40262bd0
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 22 06:53:14 2010 +0000
2010-01-21 Tony Chang <tony at chromium.org>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=25501
Remove empty font tags when applying a style to a content editable
region.
* editing/execCommand/change-font.html: Added.
* editing/execCommand/change-font-expected.txt: Added.
2010-01-21 Tony Chang <tony at chromium.org>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=25501
Remove empty font tags when applying a style to a content editable
region.
Test: editing/execCommand/change-font.html
* editing/ApplyStyleCommand.cpp:
(WebCore::isEmptyFontTag):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5554559..5b5bbcd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-01-21 Tony Chang <tony at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=25501
+ Remove empty font tags when applying a style to a content editable
+ region.
+
+ * editing/execCommand/change-font.html: Added.
+ * editing/execCommand/change-font-expected.txt: Added.
+
2010-01-21 Fumitoshi Ukai <ukai at chromium.org>
Reviewed by Shinichiro Hamaji.
diff --git a/LayoutTests/editing/execCommand/change-font-expected.txt b/LayoutTests/editing/execCommand/change-font-expected.txt
new file mode 100644
index 0000000..3ae3b62
--- /dev/null
+++ b/LayoutTests/editing/execCommand/change-font-expected.txt
@@ -0,0 +1,2 @@
+There should only be one font tag.
+SUCCESS
diff --git a/LayoutTests/editing/execCommand/change-font.html b/LayoutTests/editing/execCommand/change-font.html
new file mode 100644
index 0000000..afbae33
--- /dev/null
+++ b/LayoutTests/editing/execCommand/change-font.html
@@ -0,0 +1,13 @@
+<body contentEditable="true"><font face="Arial">There should only be one font tag.</font></body>
+<script src="../editing.js"></script>
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+ var fontNode = document.getElementsByTagName("font")[0];
+ setSelectionCommand(fontNode, 0, fontNode, 0);
+ execExtendSelectionForwardBySentenceCommand();
+ document.execCommand("fontname", false, "Courier");
+ var numFontNodes = document.getElementsByTagName("font").length;
+ var result = numFontNodes == 1 ? "SUCCESS" : "FAILED";
+ document.body.innerHTML += "<p>" + result + "</p>";
+</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index da5ee2a..1ebc6ad 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-21 Tony Chang <tony at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=25501
+ Remove empty font tags when applying a style to a content editable
+ region.
+
+ Test: editing/execCommand/change-font.html
+
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::isEmptyFontTag):
+
2010-01-21 Joe Mason <jmason at rim.com>
Reviewed by Darin Adler.
diff --git a/WebCore/editing/ApplyStyleCommand.cpp b/WebCore/editing/ApplyStyleCommand.cpp
index 7a8f025..5c23604 100644
--- a/WebCore/editing/ApplyStyleCommand.cpp
+++ b/WebCore/editing/ApplyStyleCommand.cpp
@@ -302,7 +302,9 @@ static bool isEmptyFontTag(const Node *node)
const Element *elem = static_cast<const Element *>(node);
NamedNodeMap *map = elem->attributes(true); // true for read-only
- return (!map || map->length() == 1) && elem->getAttribute(classAttr) == styleSpanClassString();
+ if (!map)
+ return true;
+ return map->isEmpty() || (map->length() == 1 && elem->getAttribute(classAttr) == styleSpanClassString());
}
static PassRefPtr<Element> createFontElement(Document* document)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list