tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit a7daa8148837c6f74578f5743242e16d031ae2bc
parent 62f36d18a9eb6f6bf63e5e22109f0c0d43296033
Author: Olli Pettay <Olli.Pettay@helsinki.fi>
Date:   Tue, 18 Nov 2025 19:21:44 +0000

Bug 1993933 - Add a console warning that XSLT may be removed, r=hsivonen

Differential Revision: https://phabricator.services.mozilla.com/D273017

Diffstat:
Mdom/base/nsDeprecatedOperationList.h | 1+
Mdom/base/use_counter_metrics.yaml | 42++++++++++++++++++++++++++++++++++++++----
Mdom/locales/en-US/chrome/dom/dom.properties | 2++
Mdom/xml/nsXMLContentSink.cpp | 1+
Mdom/xslt/xslt/txMozillaXSLTProcessor.cpp | 7++++++-
5 files changed, 48 insertions(+), 5 deletions(-)

diff --git a/dom/base/nsDeprecatedOperationList.h b/dom/base/nsDeprecatedOperationList.h @@ -58,3 +58,4 @@ DEPRECATED_OPERATION(OffscreenCanvasToBlob) DEPRECATED_OPERATION(SVGDeselectAll) DEPRECATED_OPERATION(IDBObjectStoreCreateIndexLocale) DEPRECATED_OPERATION(FullscreenAttribute) +DEPRECATED_OPERATION(XSLTDeprecated) diff --git a/dom/base/use_counter_metrics.yaml b/dom/base/use_counter_metrics.yaml @@ -108,7 +108,7 @@ use.counter: send_in_pings: - use-counters -# Total of 2374 use counter metrics (excludes denominators). +# Total of 2382 use counter metrics (excludes denominators). # Total of 357 'page' use counters. use.counter.page: svgsvgelement_getelementbyid: @@ -15011,7 +15011,7 @@ use.counter.worker.service: send_in_pings: - use-counters -# Total of 45 'deprecated operations (page)' use counters. +# Total of 49 'deprecated operations (page)' use counters. use.counter.deprecated_ops.page: components: type: counter @@ -15829,7 +15829,24 @@ use.counter.deprecated_ops.page: send_in_pings: - use-counters -# Total of 45 'deprecated operations (document)' use counters. + xsltdeprecated: + type: counter + description: > + Whether a page used XSLTDeprecated. + Compare against `use.counter.top_level_content_documents_destroyed` + to calculate the rate. + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098 + notification_emails: + - dom-core@mozilla.com + - emilio@mozilla.com + expires: never + send_in_pings: + - use-counters + +# Total of 49 'deprecated operations (document)' use counters. use.counter.deprecated_ops.doc: components: type: counter @@ -16463,7 +16480,7 @@ use.counter.deprecated_ops.doc: math_ml__deprecated_mo_explicit_accent: type: counter description: > - Whether a document used MathML_DeprecateMoExplicitAccent. + Whether a document used MathML_DeprecatedMoExplicitAccent. Compare against `use.counter.content_documents_destroyed` to calculate the rate. bugs: @@ -16647,6 +16664,23 @@ use.counter.deprecated_ops.doc: send_in_pings: - use-counters + xsltdeprecated: + type: counter + description: > + Whether a document used XSLTDeprecated. + Compare against `use.counter.content_documents_destroyed` + to calculate the rate. + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1852098 + notification_emails: + - dom-core@mozilla.com + - emilio@mozilla.com + expires: never + send_in_pings: + - use-counters + # Total of 704 'CSS (page)' use counters. use.counter.css.page: css_align_items: diff --git a/dom/locales/en-US/chrome/dom/dom.properties b/dom/locales/en-US/chrome/dom/dom.properties @@ -480,3 +480,5 @@ FullscreenAttributeWarning=Window.fullScreen attribute is deprecated and will be # LOCALIZATION NOTE: Wake lock related strings for system notifications WakeLockVideoPlaying=Playing video WakeLockAudioPlaying=Playing audio + +XSLTDeprecatedWarning=XSLT will be removed from this web browser soon. See https://github.com/mozilla/standards-positions/issues/1287 diff --git a/dom/xml/nsXMLContentSink.cpp b/dom/xml/nsXMLContentSink.cpp @@ -708,6 +708,7 @@ nsresult nsXMLContentSink::AddContentAsLeaf(nsIContent* aContent) { nsresult nsXMLContentSink::LoadXSLStyleSheet(nsIURI* aUrl) { nsCOMPtr<nsIDocumentTransformer> processor = new txMozillaXSLTProcessor(); mDocument->SetUseCounter(eUseCounter_custom_XSLStylesheet); + mDocument->WarnOnceAbout(DeprecatedOperations::eXSLTDeprecated); processor->SetTransformObserver(this); diff --git a/dom/xslt/xslt/txMozillaXSLTProcessor.cpp b/dom/xslt/xslt/txMozillaXSLTProcessor.cpp @@ -1261,8 +1261,13 @@ DocGroup* txMozillaXSLTProcessor::GetDocGroup() const { /* static */ already_AddRefed<txMozillaXSLTProcessor> txMozillaXSLTProcessor::Constructor( const GlobalObject& aGlobal) { + nsISupports* supports = aGlobal.GetAsSupports(); + nsCOMPtr<nsPIDOMWindowInner> win = do_QueryInterface(supports); + if (win && win->GetExtantDoc()) { + win->GetExtantDoc()->WarnOnceAbout(DeprecatedOperations::eXSLTDeprecated); + } RefPtr<txMozillaXSLTProcessor> processor = - new txMozillaXSLTProcessor(aGlobal.GetAsSupports()); + new txMozillaXSLTProcessor(supports); return processor.forget(); }