Bug 1297993 - Include the ID of the offending <key> element in the key conflict message. r=masayuki

MozReview-Commit-ID: 7hZLCZqfHAy
This commit is contained in:
Jared Wein 2016-08-31 12:53:24 -04:00
Родитель a182a61bce
Коммит b2e0fdce56
2 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -3,9 +3,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
UnexpectedElement=Unexpected <%1$S> element.
# LOCALIZATION NOTE: do not localize key=“%S” modifiers=“%S”
GTK2Conflict=Key event not available on GTK2: key=“%S” modifiers=“%S”
WinConflict=Key event not available on some keyboard layouts: key=“%S” modifiers=“%S”
# LOCALIZATION NOTE: do not localize key=“%S” modifiers=“%S” id=“%S”
GTK2Conflict2=Key event not available on GTK2: key=“%S” modifiers=“%S” id=“%S”
WinConflict2=Key event not available on some keyboard layouts: key=“%S” modifiers=“%S” id=“%S”
TooDeepBindingRecursion=The XBL binding “%S” is already used by too many ancestor elements; not applying it to prevent infinite recursion.
CircularExtendsBinding=Extending the XBL binding “%S” with “%S” would lead to it extending itself
# LOCALIZATION NOTE: do not localize <handler command="…">

Просмотреть файл

@ -839,13 +839,13 @@ nsXBLPrototypeHandler::ConstructPrototype(nsIContent* aKeyElement,
if ((mKeyMask & GTK2Modifiers) == GTK2Modifiers &&
modifiers.First() != char16_t(',') &&
(mDetail == 'u' || mDetail == 'U'))
ReportKeyConflict(key.get(), modifiers.get(), aKeyElement, "GTK2Conflict");
ReportKeyConflict(key.get(), modifiers.get(), aKeyElement, "GTK2Conflict2");
const uint8_t WinModifiers = cControl | cAlt | cControlMask | cAltMask;
if ((mKeyMask & WinModifiers) == WinModifiers &&
modifiers.First() != char16_t(',') &&
(('A' <= mDetail && mDetail <= 'Z') ||
('a' <= mDetail && mDetail <= 'z')))
ReportKeyConflict(key.get(), modifiers.get(), aKeyElement, "WinConflict");
ReportKeyConflict(key.get(), modifiers.get(), aKeyElement, "WinConflict2");
}
else {
key.Assign(aKeyCode);
@ -889,7 +889,9 @@ nsXBLPrototypeHandler::ReportKeyConflict(const char16_t* aKey, const char16_t* a
doc = aKeyElement->OwnerDoc();
}
const char16_t* params[] = { aKey, aModifiers };
nsAutoString id;
aKeyElement->GetAttr(kNameSpaceID_None, nsGkAtoms::id, id);
const char16_t* params[] = { aKey, aModifiers, id.get() };
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("XBL Prototype Handler"), doc,
nsContentUtils::eXBL_PROPERTIES,