mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1399853 - Identify the ID of the elements involved in SVG reference loops in the Web Console error messages. r=longsonr
MozReview-Commit-ID: 7SOk2pMEezK
This commit is contained in:
parent
7aa80495f9
commit
6b07b2d402
@ -12,5 +12,5 @@
|
||||
|
||||
DOCUMENT_WARNING(IgnoringWillChangeOverBudget)
|
||||
DOCUMENT_WARNING(PreventDefaultFromPassiveListener)
|
||||
DOCUMENT_WARNING(SVGReferenceLoop)
|
||||
DOCUMENT_WARNING(SVGReferenceChainLengthExceeded)
|
||||
DOCUMENT_WARNING(SVGRefLoop)
|
||||
DOCUMENT_WARNING(SVGRefChainLengthExceeded)
|
||||
|
@ -332,10 +332,10 @@ MozNoiseSuppressionWarning=mozNoiseSuppression is deprecated. Use noiseSuppressi
|
||||
XMLBaseAttributeWarning=Use of xml:base attribute is deprecated and will be removed soon. Please remove any use of it.
|
||||
# LOCALIZATION NOTE: Do not translate "content", "Window", and "window.top"
|
||||
WindowContentUntrustedWarning=The ‘content’ attribute of Window objects is deprecated. Please use ‘window.top’ instead.
|
||||
# LOCALIZATION NOTE: %S is the tag name of the element that starts the loop
|
||||
SVGReferenceLoopWarning=There is an SVG <%S> reference loop in this document, which will prevent the document rendering correctly.
|
||||
# LOCALIZATION NOTE: %S is the tag name of the element that starts the chain
|
||||
SVGReferenceChainLengthExceededWarning=There is an SVG <%S> reference chain which is too long in this document, which will prevent the document rendering correctly.
|
||||
# LOCALIZATION NOTE: The first %S is the tag name of the element that starts the loop, the second %S is the element's ID.
|
||||
SVGRefLoopWarning=The SVG <%S> with ID “%S” has a reference loop.
|
||||
# LOCALIZATION NOTE: The first %S is the tag name of the element in the chain where the chain was broken, the second %S is the element's ID.
|
||||
SVGRefChainLengthExceededWarning=An SVG <%S> reference chain which is too long was abandoned at the element with ID “%S”.
|
||||
# LOCALIZATION NOTE: Do not translate "<script>".
|
||||
ScriptSourceEmpty=‘%S’ attribute of <script> element is empty.
|
||||
# LOCALIZATION NOTE: Do not translate "<script>".
|
||||
|
@ -151,13 +151,15 @@ public:
|
||||
|
||||
private:
|
||||
void ReportErrorToConsole() {
|
||||
nsAutoString tag;
|
||||
mFrame->GetContent()->AsElement()->GetTagName(tag);
|
||||
const char16_t* params[] = { tag.get() };
|
||||
nsAutoString tag, id;
|
||||
dom::Element* element = mFrame->GetContent()->AsElement();
|
||||
element->GetTagName(tag);
|
||||
element->GetId(id);
|
||||
const char16_t* params[] = { tag.get(), id.get() };
|
||||
auto doc = mFrame->GetContent()->OwnerDoc();
|
||||
auto warning = *mFrameInUse ?
|
||||
nsIDocument::eSVGReferenceLoop :
|
||||
nsIDocument::eSVGReferenceChainLengthExceeded;
|
||||
nsIDocument::eSVGRefLoop :
|
||||
nsIDocument::eSVGRefChainLengthExceeded;
|
||||
doc->WarnOnceAbout(warning, /* asError */ true,
|
||||
params, ArrayLength(params));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user