Backed out changeset 0bec9af94668 (bug 1913382) because of the performance regression introduced Bug 1917623. CLOSED TREE

This commit is contained in:
Cristian Tuns 2024-09-09 13:20:53 -04:00
Родитель d0cd6e6f04
Коммит cdb47e79cd
4 изменённых файлов: 0 добавлений и 50 удалений

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

@ -1,24 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Adding a new metric? We have docs for that!
# https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html
---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
$tags:
- 'Core :: DOM: HTML Parser'
parsing:
svg_unusual_pcdata:
type: rate
description: |
The rate of svg elements that have child elements during parsing, where their HTML counterpart would not have children.
notification_emails:
- seceng-telemetry@mozilla.com
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1913382
data_reviews:
- https://phabricator.services.mozilla.com/D219290#7592177
expires: 136

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

@ -13,7 +13,6 @@
#include "mozilla/dom/FetchPriority.h"
#include "mozilla/dom/ShadowRoot.h"
#include "mozilla/dom/ShadowRootBinding.h"
#include "mozilla/glean/GleanMetrics.h"
#include "mozilla/CheckedInt.h"
#include "mozilla/Likely.h"
#include "mozilla/StaticPrefs_dom.h"
@ -1140,8 +1139,6 @@ void nsHtml5TreeBuilder::markMalformedIfScript(nsIContentHandle* aElement) {
void nsHtml5TreeBuilder::start(bool fragment) {
mCurrentHtmlScriptCannotDocumentWriteOrBlock = false;
mozilla::glean::parsing::svg_unusual_pcdata.AddToDenominator(1);
#ifdef DEBUG
mActive = true;
#endif
@ -1209,19 +1206,6 @@ void nsHtml5TreeBuilder::elementPushed(int32_t aNamespace, nsAtom* aName,
* table elements shouldn't be used as surrogate parents for user experience
* reasons.
*/
if (isInSVGOddPCData) {
// We are seeing an element that has children, which could not have child
// elements in HTML, i.e., is parsed as PCDATA in SVG but CDATA in HTML.
mozilla::glean::parsing::svg_unusual_pcdata.AddToNumerator(1);
}
if ((aName == nsGkAtoms::style) || (aName == nsGkAtoms::xmp) ||
(aName == nsGkAtoms::iframe) || (aName == nsGkAtoms::noembed) ||
(aName == nsGkAtoms::noframes) || (aName == nsGkAtoms::noscript) ||
(aName == nsGkAtoms::script)) {
isInSVGOddPCData++;
}
if (aNamespace != kNameSpaceID_XHTML) {
return;
}
@ -1271,14 +1255,6 @@ void nsHtml5TreeBuilder::elementPopped(int32_t aNamespace, nsAtom* aName,
if (aNamespace == kNameSpaceID_MathML) {
return;
}
if (aNamespace == kNameSpaceID_SVG) {
if ((aName == nsGkAtoms::style) || (aName == nsGkAtoms::xmp) ||
(aName == nsGkAtoms::iframe) || (aName == nsGkAtoms::noembed) ||
(aName == nsGkAtoms::noframes) || (aName == nsGkAtoms::noscript) ||
(aName == nsGkAtoms::script)) {
isInSVGOddPCData--;
}
}
// we now have only SVG and HTML
if (aName == nsGkAtoms::script) {
if (mPreventScriptExecution) {

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

@ -23,7 +23,6 @@ int32_t mHandlesUsed;
nsTArray<mozilla::UniquePtr<nsIContent*[]>> mOldHandles;
nsHtml5TreeOpStage* mSpeculativeLoadStage;
nsresult mBroken;
int32_t isInSVGOddPCData = 0;
// Controls whether the current HTML script goes through the more complex
// path that accommodates the possibility of the script becoming a
// parser-blocking script and the possibility of the script inserting

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

@ -28,7 +28,6 @@ gecko_metrics = [
"dom/security/metrics.yaml",
"dom/webauthn/metrics.yaml",
"gfx/metrics.yaml",
"parser/html/metrics.yaml",
"image/decoders/metrics.yaml",
"js/xpconnect/metrics.yaml",
"layout/base/metrics.yaml",