Skip to content

Commit

Permalink
LayoutNG: Remove kLegacyLayout* UseCounters
Browse files Browse the repository at this point in the history
We added these counters for prioritization. We don't need to
prioritize any longer.

This CL has no user-visible behavior changes.

Bug: 591099
Change-Id: I7f0825a085dea287a9131a937a0e71b1580b598e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3932272
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1054047}
  • Loading branch information
tkent-google authored and Chromium LUCI CQ committed Oct 3, 2022
1 parent 8218bb2 commit acb25f9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 42 deletions.
Expand Up @@ -2523,18 +2523,18 @@ enum WebFeature {

kV8Document_HasTrustToken_Method = 3202,
kForceLoadAtTop = 3203,
kLegacyLayoutByDetailsMarker = 3206,
kLegacyLayoutByEditing = 3207,
kLegacyLayoutByFrameSet = 3211,
kLegacyLayoutByGrid = 3212,
kLegacyLayoutByMultiCol = 3214,
kLegacyLayoutByPrinting = 3215,
kLegacyLayoutBySVG = 3217,
kLegacyLayoutByTable = 3219,
kLegacyLayoutByTextCombine = 3220,
kLegacyLayoutByTextControl = 3221,
kLegacyLayoutByVTTCue = 3222,
kLegacyLayoutByTableFlexGridBlockInNGFragmentationContext = 3224,
kOBSOLETE_LegacyLayoutByDetailsMarker = 3206,
kOBSOLETE_LegacyLayoutByEditing = 3207,
kOBSOLETE_LegacyLayoutByFrameSet = 3211,
kOBSOLETE_LegacyLayoutByGrid = 3212,
kOBSOLETE_LegacyLayoutByMultiCol = 3214,
kOBSOLETE_LegacyLayoutByPrinting = 3215,
kOBSOLETE_LegacyLayoutBySVG = 3217,
kOBSOLETE_LegacyLayoutByTable = 3219,
kOBSOLETE_LegacyLayoutByTextCombine = 3220,
kOBSOLETE_LegacyLayoutByTextControl = 3221,
kOBSOLETE_LegacyLayoutByVTTCue = 3222,
kOBSOLETE_LegacyLayoutByTableFlexGridBlockInNGFragmentationContext = 3224,
kDocumentPolicyHeader = 3225,
kDocumentPolicyReportOnlyHeader = 3226,
kRequireDocumentPolicyHeader = 3227,
Expand Down
20 changes: 4 additions & 16 deletions third_party/blink/renderer/core/dom/element.cc
Expand Up @@ -433,13 +433,8 @@ bool NeedsLegacyLayoutForEntireDocument(Document& document) {
// layout (because of the above check), which would re-attach all layout
// objects, which would cause the frameset to lose state of some sort, leaving
// everything blank when printed.
if (document.IsFrameSet() &&
!RuntimeEnabledFeatures::LayoutNGFrameSetEnabled()) {
UseCounter::Count(document, WebFeature::kLegacyLayoutByFrameSet);
return true;
}

return false;
return document.IsFrameSet() &&
!RuntimeEnabledFeatures::LayoutNGFrameSetEnabled();
}

bool CalculateStyleShouldForceLegacyLayout(const Element& element,
Expand All @@ -452,27 +447,20 @@ bool CalculateStyleShouldForceLegacyLayout(const Element& element,
if (!RuntimeEnabledFeatures::LayoutNGBlockFragmentationEnabled()) {
// Disable NG for the entire subtree if we're establishing a multicol
// container.
if (style.SpecifiesColumns()) {
UseCounter::Count(document, WebFeature::kLegacyLayoutByMultiCol);
if (style.SpecifiesColumns())
return true;
}
}

if (document.Printing() && element == document.documentElement() &&
!RuntimeEnabledFeatures::LayoutNGPrintingEnabled()) {
UseCounter::Count(document, WebFeature::kLegacyLayoutByPrinting);
return true;
}

if (NeedsLegacyLayoutForEntireDocument(document))
return true;

if (NeedsLegacyBlockFragmentation(element, style)) {
UseCounter::Count(
document,
WebFeature::kLegacyLayoutByTableFlexGridBlockInNGFragmentationContext);
if (NeedsLegacyBlockFragmentation(element, style))
return true;
}

return false;
}
Expand Down
Expand Up @@ -157,7 +157,6 @@ LayoutObject* VTTCueBox::CreateLayoutObject(const ComputedStyle& style,
if (RuntimeEnabledFeatures::LayoutNGVTTCueEnabled())
return LayoutObjectFactory::CreateBlockFlow(*this, style, legacy);

UseCounter::Count(GetDocument(), WebFeature::kLegacyLayoutByVTTCue);
return MakeGarbageCollected<LayoutVTTCue>(this, snap_to_lines_position_);
}

Expand Down
1 change: 0 additions & 1 deletion third_party/blink/renderer/core/svg/svg_svg_element.cc
Expand Up @@ -518,7 +518,6 @@ void SVGSVGElement::AttachLayoutTree(AttachContext& context) {

LayoutObject* SVGSVGElement::CreateLayoutObject(const ComputedStyle&,
LegacyLayout) {
UseCounter::Count(GetDocument(), WebFeature::kLegacyLayoutBySVG);
if (IsOutermostSVGSVGElement())
return MakeGarbageCollected<LayoutSVGRoot>(this);

Expand Down
24 changes: 12 additions & 12 deletions tools/metrics/histograms/enums.xml
Expand Up @@ -40270,27 +40270,27 @@ Called by update_use_counter_feature_enum.py.-->
<int value="3203" label="ForceLoadAtTop"/>
<int value="3204" label="OBSOLETE_LegacyLayoutByButton"/>
<int value="3205" label="OBSOLETE_LegacyLayoutByDeprecatedFlexBox"/>
<int value="3206" label="LegacyLayoutByDetailsMarker"/>
<int value="3207" label="LegacyLayoutByEditing"/>
<int value="3206" label="OBSOLETE_LegacyLayoutByDetailsMarker"/>
<int value="3207" label="OBSOLETE_LegacyLayoutByEditing"/>
<int value="3208" label="OBSOLETE_LegacyLayoutByFieldSet"/>
<int value="3209" label="OBSOLETE_LegacyLayoutByFileUploadControl"/>
<int value="3210" label="OBSOLETE_LegacyLayoutByFlexBox"/>
<int value="3211" label="LegacyLayoutByFrameSet"/>
<int value="3212" label="LegacyLayoutByGrid"/>
<int value="3211" label="OBSOLETE_LegacyLayoutByFrameSet"/>
<int value="3212" label="OBSOLETE_LegacyLayoutByGrid"/>
<int value="3213" label="OBSOLETE_LegacyLayoutByMenuList"/>
<int value="3214" label="LegacyLayoutByMultiCol"/>
<int value="3215" label="LegacyLayoutByPrinting"/>
<int value="3214" label="OBSOLETE_LegacyLayoutByMultiCol"/>
<int value="3215" label="OBSOLETE_LegacyLayoutByPrinting"/>
<int value="3216" label="OBSOLETE_LegacyLayoutByRuby"/>
<int value="3217" label="LegacyLayoutBySVG"/>
<int value="3217" label="OBSOLETE_LegacyLayoutBySVG"/>
<int value="3218" label="OBSOLETE_LegacyLayoutBySlider"/>
<int value="3219" label="LegacyLayoutByTable"/>
<int value="3220" label="LegacyLayoutByTextCombine"/>
<int value="3221" label="LegacyLayoutByTextControl"/>
<int value="3222" label="LegacyLayoutByVTTCue"/>
<int value="3219" label="OBSOLETE_LegacyLayoutByTable"/>
<int value="3220" label="OBSOLETE_LegacyLayoutByTextCombine"/>
<int value="3221" label="OBSOLETE_LegacyLayoutByTextControl"/>
<int value="3222" label="OBSOLETE_LegacyLayoutByVTTCue"/>
<int value="3223"
label="OBSOLETE_LegacyLayoutByWebkitBoxWithoutVerticalLineClamp"/>
<int value="3224"
label="LegacyLayoutByTableFlexGridBlockInNGFragmentationContext"/>
label="OBSOLETE_LegacyLayoutByTableFlexGridBlockInNGFragmentationContext"/>
<int value="3225" label="DocumentPolicyHeader"/>
<int value="3226" label="DocumentPolicyReportOnlyHeader"/>
<int value="3227" label="RequireDocumentPolicyHeader"/>
Expand Down

0 comments on commit acb25f9

Please sign in to comment.