Bug 780035 - Don't cache font-style as CSS; r=ehsan

This commit is contained in:
Aryeh Gregor 2012-08-14 12:10:43 +03:00
parent 12a886bcb1
commit 76825e9b05
3 changed files with 26 additions and 2 deletions

View File

@ -7107,8 +7107,9 @@ nsHTMLEditRules::CacheInlineStyles(nsIDOMNode *aNode)
{
bool isSet = false;
nsAutoString outValue;
if (!useCSS)
{
// Don't use CSS for <font size>, we don't support it usefully (bug 780035)
if (!useCSS || (mCachedStyles[j].tag == nsGkAtoms::font &&
mCachedStyles[j].attr.EqualsLiteral("size"))) {
mHTMLEditor->IsTextPropertySetByContent(aNode, mCachedStyles[j].tag,
&(mCachedStyles[j].attr), nullptr,
isSet, &outValue);

View File

@ -79,6 +79,7 @@ MOCHITEST_FILES = \
test_bug738366.html \
test_bug757371.html \
test_bug767684.html \
test_bug780035.html \
$(NULL)
ifneq (mobile,$(MOZ_BUILD_APP))

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=780035
-->
<title>Test for Bug 780035</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=780035">Mozilla Bug 780035</a>
<div contenteditable style="font-size: 13.3333px"></div>
<script>
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(function() {
document.querySelector("div").focus();
document.execCommand("stylewithcss", false, true);
sendKey("ENTER");
sendChar("x");
is(document.querySelector("div").innerHTML, "x<br>",
"No <font> tag should be generated");
SimpleTest.finish();
});
</script>