Skip to content

Commit

Permalink
Add use counter for <param> with a URL parameter
Browse files Browse the repository at this point in the history
See [1] for context, but there is interest in deprecating the
ability to specify an <object> containing a <param> element
that specifies the URL (via a name in {"code","data","movie",
"src", or "url"}). This CL adds a use counter for that
feature.

[1] whatwg/html#387

Bug: 572908
Change-Id: I7f152d05d992606224fb895bca6cd65a4bca15ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3139401
Commit-Queue: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Auto-Submit: Mason Freed <[email protected]>
Reviewed-by: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#918305}
  • Loading branch information
mfreed7 authored and Chromium LUCI CQ committed Sep 3, 2021
1 parent ca16d64 commit 8d40b33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3318,6 +3318,7 @@ enum WebFeature {
kCSSCascadeLayers = 4007,
kCanvasRenderingContext2DConicGradient = 4008,
kCanvasRenderingContext2DCanvasFilter = 4009,
kHTMLParamElementURLParameter = 4010,

// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
Expand Down
2 changes: 2 additions & 0 deletions third_party/blink/renderer/core/html/html_object_element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ void HTMLObjectElement::ParametersForPlugin(PluginParameters& plugin_params) {
// to a plugin.
if (url_.IsEmpty() && !EqualIgnoringASCIICase(name, "data") &&
HTMLParamElement::IsURLParameter(name)) {
UseCounter::Count(GetDocument(),
WebFeature::kHTMLParamElementURLParameter);
SetUrl(StripLeadingAndTrailingHTMLSpaces(p->Value()));
}
// TODO(schenney): crbug.com/572908 serviceType calculation does not belong
Expand Down
1 change: 1 addition & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34435,6 +34435,7 @@ Called by update_use_counter_feature_enum.py.-->
<int value="4007" label="CSSCascadeLayers"/>
<int value="4008" label="CanvasRenderingContext2DConicGradient"/>
<int value="4009" label="CanvasRenderingContext2DCanvasFilter"/>
<int value="4010" label="HTMLParamElementURLParameter"/>
</enum>

<enum name="FeaturePolicyAllowlistType">
Expand Down

0 comments on commit 8d40b33

Please sign in to comment.