Bug 1088467 - Avoid adding space for bullet with list-style: none. r=surkov

This commit is contained in:
Xidorn Quan 2014-10-24 01:10:00 +02:00
parent 31721c289d
commit 2ad377ab01
2 changed files with 16 additions and 4 deletions

View File

@ -6,6 +6,9 @@
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<style>
#listitemnone {
list-style-type: none;
}
h6.gencontent:before {
content: "aga"
}
@ -67,13 +70,17 @@
//////////////////////////////////////////////////////////////////////////
IDs = [ "list" ];
testCharacterCount(IDs, 1);
testText(IDs, 0, 1, kEmbedChar);
testCharacterCount(IDs, 2);
testText(IDs, 0, 2, kEmbedChar + kEmbedChar);
IDs = [ "listitem" ];
testCharacterCount(IDs, 6);
testText(IDs, 0, 6, "1. foo");
IDs = [ "listitemnone" ];
testCharacterCount(IDs, 3);
testText(IDs, 0, 3, "bar");
testText(["testbr"], 0, 3, "foo");
testTextAtOffset(2, nsIAccessibleText.BOUNDARY_CHAR, "o", 2, 3, "testbr",
@ -117,7 +124,10 @@
<div id="hypertext">hello <a>friend</a> see <img></div>
<div id="hypertext2">hello <a>friend</a> see <input></div>
<ol id="list"><li id="listitem">foo</li></ol>
<ol id="list">
<li id="listitem">foo</li>
<li id="listitemnone">bar</li>
</ol>
<div id="hypertext3">line
<!-- haha -->

View File

@ -862,7 +862,9 @@ nsBulletFrame::GetSpokenText(nsAString& aText)
bool isBullet;
style->GetSpokenCounterText(mOrdinal, GetWritingMode(), aText, isBullet);
if (isBullet) {
aText.Append(' ');
if (!style->IsNone()) {
aText.Append(' ');
}
} else {
nsAutoString prefix, suffix;
style->GetPrefix(prefix);