auto waiter = CreatePageLoadMetricsTestWaiter("waiter");
waiter->AddPageExpectation(TimingField::kLoadEvent);
ASSERT_TRUE(ui_test_utils::NavigateToURL(
browser(), embedded_test_server()->GetURL(
"/page_load_metrics/use_counter_features.html")));
We may want to test this in a way that loads one at a time to ensure that only the relevant use counter is fired when appropriate
// "hidden". This is to assess web compatibility risks, as the
will be used
// is triggered when the computed value for a width property is
This could get confused with "width". I would specify it is related to border-width, outline-width, and column-rule-width
// Records use counters for width/style properties. The use counter
I'd remove this sentence since it isn't a use counter for the property, but under specific circumstances, which is covered by the rest of the paragraph
// Records use counters for width/style properties. The use counter
There is more than one use counter, right?
const CSSValue* ComputedStylePropertyMap::GetProperty(
Why do we only for this on a Get instead of if it is set at all? Is this because we could only cause web compat issues if the author is querying the value since the rendering would be equivalent either way?
if (property.PropertyID() == CSSPropertyID::kBorderWidth) {
Likely worth adding a comment here, as well, for extra context at this callsite
return false;
Will we ever hit this? If not, should it be a NOT_REACHED instead and just be a void method?
auto ShouldCount = [](int width_value, EBorderStyle style_value) {
nit: ShouldRecordUseCounter
int width_value = 0;
EBorderStyle style_value = EBorderStyle::kNone;
I'd move these earlier since they can be used here and below
// Record once for the border-width shorthand
Missing punctuation. But it's also likely worth noting why we only record once in this case
friend class ComputedStylePropertyMap;
Why was this needed?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
auto waiter = CreatePageLoadMetricsTestWaiter("waiter");
waiter->AddPageExpectation(TimingField::kLoadEvent);
ASSERT_TRUE(ui_test_utils::NavigateToURL(
browser(), embedded_test_server()->GetURL(
"/page_load_metrics/use_counter_features.html")));
We may want to test this in a way that loads one at a time to ensure that only the relevant use counter is fired when appropriate
SO essentially having 7 different .html pages for each property? That seems a bit much no?
// "hidden". This is to assess web compatibility risks, as the
Sam Davis Omekarawill be used
Done
// is triggered when the computed value for a width property is
This could get confused with "width". I would specify it is related to border-width, outline-width, and column-rule-width
Done
// Records use counters for width/style properties. The use counter
There is more than one use counter, right?
Single one for each property so I used "property-specific". Let me know if you have better suggestions.
// Records use counters for width/style properties. The use counter
I'd remove this sentence since it isn't a use counter for the property, but under specific circumstances, which is covered by the rest of the paragraph
Done
Why do we only for this on a Get instead of if it is set at all? Is this because we could only cause web compat issues if the author is querying the value since the rendering would be equivalent either way?
Yes, It'll have to be queried via `ComputedStylePropertyMap` for us to notice observable change in behavior.
if (property.PropertyID() == CSSPropertyID::kBorderWidth) {
Likely worth adding a comment here, as well, for extra context at this callsite
Done
Will we ever hit this? If not, should it be a NOT_REACHED instead and just be a void method?
Done
auto ShouldCount = [](int width_value, EBorderStyle style_value) {
Sam Davis Omekaranit: ShouldRecordUseCounter
Done
int width_value = 0;
EBorderStyle style_value = EBorderStyle::kNone;
I'd move these earlier since they can be used here and below
Done
Missing punctuation. But it's also likely worth noting why we only record once in this case
I mean for all properties we record once, I took out "once" and added more context. The diff here is that because there multiple longhands associated, we could record 4 times instead of once.
friend class ComputedStylePropertyMap;
Sam Davis OmekaraWhy was this needed?
Needed to access the *Internal methods. The comment above applies.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
auto waiter = CreatePageLoadMetricsTestWaiter("waiter");
waiter->AddPageExpectation(TimingField::kLoadEvent);
ASSERT_TRUE(ui_test_utils::NavigateToURL(
browser(), embedded_test_server()->GetURL(
"/page_load_metrics/use_counter_features.html")));
Sam Davis OmekaraWe may want to test this in a way that loads one at a time to ensure that only the relevant use counter is fired when appropriate
SO essentially having 7 different .html pages for each property? That seems a bit much no?
I can't think of a better way to do it, but as it stands, we aren't really testing that these are firing in different scenarios
// Records use counters for width/style properties. The use counter
Sam Davis OmekaraThere is more than one use counter, right?
Single one for each property so I used "property-specific". Let me know if you have better suggestions.
Acknowledged
const CSSValue* ComputedStylePropertyMap::GetProperty(
Sam Davis OmekaraWhy do we only for this on a Get instead of if it is set at all? Is this because we could only cause web compat issues if the author is querying the value since the rendering would be equivalent either way?
Yes, It'll have to be queried via `ComputedStylePropertyMap` for us to notice observable change in behavior.
Will this go down the same path if you do window.getComputedStyle(element).borderWidth? Or element.style.borderWidth?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
auto waiter = CreatePageLoadMetricsTestWaiter("waiter");
waiter->AddPageExpectation(TimingField::kLoadEvent);
ASSERT_TRUE(ui_test_utils::NavigateToURL(
browser(), embedded_test_server()->GetURL(
"/page_load_metrics/use_counter_features.html")));
Sam Davis OmekaraWe may want to test this in a way that loads one at a time to ensure that only the relevant use counter is fired when appropriate
Alison MaherSO essentially having 7 different .html pages for each property? That seems a bit much no?
I can't think of a better way to do it, but as it stands, we aren't really testing that these are firing in different scenarios
Help me understand:
In the existing test, we set the seven different properties and query each of them and expect a hit count for the seven separate properties use counters.
So in my opinion, it's testing firing for different scenarios.
Is your worry that we might fire for border-left-width when we set and query border-width or vice versa?
@kbab...@microsoft.com any thoughts here?
const CSSValue* ComputedStylePropertyMap::GetProperty(
Sam Davis OmekaraWhy do we only for this on a Get instead of if it is set at all? Is this because we could only cause web compat issues if the author is querying the value since the rendering would be equivalent either way?
Alison MaherYes, It'll have to be queried via `ComputedStylePropertyMap` for us to notice observable change in behavior.
Will this go down the same path if you do window.getComputedStyle(element).borderWidth? Or element.style.borderWidth?
No because that's querying the resolved value and not computed value.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
auto waiter = CreatePageLoadMetricsTestWaiter("waiter");
waiter->AddPageExpectation(TimingField::kLoadEvent);
ASSERT_TRUE(ui_test_utils::NavigateToURL(
browser(), embedded_test_server()->GetURL(
"/page_load_metrics/use_counter_features.html")));
Sam Davis OmekaraWe may want to test this in a way that loads one at a time to ensure that only the relevant use counter is fired when appropriate
Alison MaherSO essentially having 7 different .html pages for each property? That seems a bit much no?
Sam Davis OmekaraI can't think of a better way to do it, but as it stands, we aren't really testing that these are firing in different scenarios
Help me understand:
In the existing test, we set the seven different properties and query each of them and expect a hit count for the seven separate properties use counters.
So in my opinion, it's testing firing for different scenarios.
Is your worry that we might fire for border-left-width when we set and query border-width or vice versa?
@kbab...@microsoft.com any thoughts here?
Yeah, essentially if your code fired all of them whenever one of these were queried, this test would still pass, which isn't what we want
const CSSValue* ComputedStylePropertyMap::GetProperty(
Sam Davis OmekaraWhy do we only for this on a Get instead of if it is set at all? Is this because we could only cause web compat issues if the author is querying the value since the rendering would be equivalent either way?
Alison MaherYes, It'll have to be queried via `ComputedStylePropertyMap` for us to notice observable change in behavior.
Sam Davis OmekaraWill this go down the same path if you do window.getComputedStyle(element).borderWidth? Or element.style.borderWidth?
No because that's querying the resolved value and not computed value.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
auto waiter = CreatePageLoadMetricsTestWaiter("waiter");
waiter->AddPageExpectation(TimingField::kLoadEvent);
ASSERT_TRUE(ui_test_utils::NavigateToURL(
browser(), embedded_test_server()->GetURL(
"/page_load_metrics/use_counter_features.html")));
Sam Davis OmekaraWe may want to test this in a way that loads one at a time to ensure that only the relevant use counter is fired when appropriate
Alison MaherSO essentially having 7 different .html pages for each property? That seems a bit much no?
Sam Davis OmekaraI can't think of a better way to do it, but as it stands, we aren't really testing that these are firing in different scenarios
Alison MaherHelp me understand:
In the existing test, we set the seven different properties and query each of them and expect a hit count for the seven separate properties use counters.
So in my opinion, it's testing firing for different scenarios.
Is your worry that we might fire for border-left-width when we set and query border-width or vice versa?
@kbab...@microsoft.com any thoughts here?
Yeah, essentially if your code fired all of them whenever one of these were queried, this test would still pass, which isn't what we want
I agree with Alison that it would be good to exercise each property in its own test. I'm unclear on why that would require 7 different html pages. For example, would it be possible for each test to inject a bit of JavaScript to exercise a specific property? There's examples of this elsewhere in the file; search for `EvalJs`.
I'm also wondering if it would be worth parameterizing these tests to reduce repetition among them.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
auto waiter = CreatePageLoadMetricsTestWaiter("waiter");
waiter->AddPageExpectation(TimingField::kLoadEvent);
ASSERT_TRUE(ui_test_utils::NavigateToURL(
browser(), embedded_test_server()->GetURL(
"/page_load_metrics/use_counter_features.html")));
Sam Davis OmekaraWe may want to test this in a way that loads one at a time to ensure that only the relevant use counter is fired when appropriate
Alison MaherSO essentially having 7 different .html pages for each property? That seems a bit much no?
Sam Davis OmekaraI can't think of a better way to do it, but as it stands, we aren't really testing that these are firing in different scenarios
Alison MaherHelp me understand:
In the existing test, we set the seven different properties and query each of them and expect a hit count for the seven separate properties use counters.
So in my opinion, it's testing firing for different scenarios.
Is your worry that we might fire for border-left-width when we set and query border-width or vice versa?
@kbab...@microsoft.com any thoughts here?
Kevin BabbittYeah, essentially if your code fired all of them whenever one of these were queried, this test would still pass, which isn't what we want
I agree with Alison that it would be good to exercise each property in its own test. I'm unclear on why that would require 7 different html pages. For example, would it be possible for each test to inject a bit of JavaScript to exercise a specific property? There's examples of this elsewhere in the file; search for `EvalJs`.
I'm also wondering if it would be worth parameterizing these tests to reduce repetition among them.
Just did something like this. Let me know if this is sufficient.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
R"JS(
document.getElementById('width-no-style')
.computedStyleMap()
.get('border-top-width');
)JS",
Can we reduce the repetition by having just the property name be in the test parameters, and having the test function splice that into the remainder of the script?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
LGTM % Kevin's feedback and merge conflict
auto waiter = CreatePageLoadMetricsTestWaiter("waiter");
waiter->AddPageExpectation(TimingField::kLoadEvent);
ASSERT_TRUE(ui_test_utils::NavigateToURL(
browser(), embedded_test_server()->GetURL(
"/page_load_metrics/use_counter_features.html")));
Sam Davis OmekaraWe may want to test this in a way that loads one at a time to ensure that only the relevant use counter is fired when appropriate
Alison MaherSO essentially having 7 different .html pages for each property? That seems a bit much no?
Sam Davis OmekaraI can't think of a better way to do it, but as it stands, we aren't really testing that these are firing in different scenarios
Alison MaherHelp me understand:
In the existing test, we set the seven different properties and query each of them and expect a hit count for the seven separate properties use counters.
So in my opinion, it's testing firing for different scenarios.
Is your worry that we might fire for border-left-width when we set and query border-width or vice versa?
@kbab...@microsoft.com any thoughts here?
Kevin BabbittYeah, essentially if your code fired all of them whenever one of these were queried, this test would still pass, which isn't what we want
Sam Davis OmekaraI agree with Alison that it would be good to exercise each property in its own test. I'm unclear on why that would require 7 different html pages. For example, would it be possible for each test to inject a bit of JavaScript to exercise a specific property? There's examples of this elsewhere in the file; search for `EvalJs`.
I'm also wondering if it would be worth parameterizing these tests to reduce repetition among them.
Just did something like this. Let me know if this is sufficient.
@sisid...@chromium.org: for c/b/p/page_load_metrics_browsertests.cc
R"JS(
document.getElementById('width-no-style')
.computedStyleMap()
.get('border-top-width');
)JS",
Can we reduce the repetition by having just the property name be in the test parameters, and having the test function splice that into the remainder of the script?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
page_load_metrics LGTM.
namespace {
struct DecoupleComputedWidthCase {
const char* property_name;
WebFeature feature;
};
static const DecoupleComputedWidthCase kDecoupleComputedWidthCases[] = {
{
"border-top-width",
WebFeature::kComputedBorderTopWidthWithNoneOrHiddenStyle,
},
{
"border-right-width",
WebFeature::kComputedBorderRightWidthWithNoneOrHiddenStyle,
},
{
"border-bottom-width",
WebFeature::kComputedBorderBottomWidthWithNoneOrHiddenStyle,
},
{
"border-left-width",
WebFeature::kComputedBorderLeftWidthWithNoneOrHiddenStyle,
},
{
"border-width",
WebFeature::kComputedBorderWidthWithNoneOrHiddenStyle,
},
{
"column-rule-width",
WebFeature::kComputedColumnRuleWidthWithNoneOrHiddenStyle,
},
{
"outline-width",
WebFeature::kComputedOutlineWidthWithNoneOrHiddenStyle,
},
};
} // namespace
Could you avoid having multiple anonymous namespaces? It would be better to move this to the existing namespace started from L133.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
namespace {
Could you avoid having multiple anonymous namespaces? It would be better to move this to the existing namespace started from L133.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
12 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom
Insertions: 8, Deletions: 7.
The diff is too large to show. Please review the diff.
```
```
The name of the file: tools/metrics/histograms/metadata/blink/enums.xml
Insertions: 8, Deletions: 7.
The diff is too large to show. Please review the diff.
```
```
The name of the file: chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc
Insertions: 36, Deletions: 39.
The diff is too large to show. Please review the diff.
```
[Gap Decorations]: Add UseCounter for Disentanglement change
This CL introduces granular use counters for the *-width CSS properties
affected by the disentanglement work in crrev.com/c/6489213. These
counters are property-specific to accurately measure usage and assess
potential web compatibility risks resulting from the CSS issue
resolution [1], which led to decoupling the *-width computed values from
their corresponding style values.
[1]:
https://github.com/w3c/csswg-drafts/issues/11494#issuecomment-2675800489
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |