зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1803044 - part 4: Make `HTMLEditor::SetAttributeOrEquivalent` insert a white-space only when old value is empty r=m_kato
This causes some new failures after applying the following patches. Depends on D163998 Differential Revision: https://phabricator.services.mozilla.com/D163999
This commit is contained in:
Родитель
3cc09e2ecd
Коммит
29bc09a466
|
@ -5818,9 +5818,12 @@ nsresult HTMLEditor::SetAttributeOrEquivalent(Element* aElement,
|
|||
if (aAttribute == nsGkAtoms::style) {
|
||||
// if it is the style attribute, just add the new value to the existing
|
||||
// style attribute's value
|
||||
nsAutoString existingValue;
|
||||
nsString existingValue; // Use nsString to avoid copying the string
|
||||
// buffer at setting the attribute below.
|
||||
aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::style, existingValue);
|
||||
existingValue.Append(HTMLEditUtils::kSpace);
|
||||
if (!existingValue.IsEmpty()) {
|
||||
existingValue.Append(HTMLEditUtils::kSpace);
|
||||
}
|
||||
existingValue.Append(aValue);
|
||||
if (aSuppressTransaction) {
|
||||
nsresult rv = aElement->SetAttr(kNameSpaceID_None, nsGkAtoms::style,
|
||||
|
|
Загрузка…
Ссылка в новой задаче