ContentData* content = pseudo_element->EnsureMutableAltContentData();"Ensure" should never return nullptr. Perhaps something like CreateMutableAltContentDataForCountersIfNeeded()?
Member<ContentData> content_data_;Does this happen often enough to justify an extra member on PseudoElement? Would adding it on rare-data be an option?
bool HasAltCounterContent(const ContentData* content) {Why not make this a function on ContentData?
builder.SetContent(const_cast<ContentData*>(style.GetContentData()));Does SetContent() need a mutable ContentData?
? const_cast<StyleImage*>(So ContentData actually needs to be mutable? Or is this a case of "let's stop here because it requires changes everywhere"?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
ContentData* content = pseudo_element->EnsureMutableAltContentData();"Ensure" should never return nullptr. Perhaps something like CreateMutableAltContentDataForCountersIfNeeded()?
Done
Does this happen often enough to justify an extra member on PseudoElement? Would adding it on rare-data be an option?
Done
bool HasAltCounterContent(const ContentData* content) {Why not make this a function on ContentData?
Done
builder.SetContent(const_cast<ContentData*>(style.GetContentData()));Does SetContent() need a mutable ContentData?
See the other comment + I couldn't easily change css_properties.json5 to make content immutable.
Can be a separate CL?
? const_cast<StyleImage*>(So ContentData actually needs to be mutable? Or is this a case of "let's stop here because it requires changes everywhere"?
The let's stop here case for my CL, but it seems like some image resource observer also abuses content mutability.
But to fix that sounds like a separate CL?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
builder.SetContent(const_cast<ContentData*>(style.GetContentData()));Daniil SakhapovDoes SetContent() need a mutable ContentData?
See the other comment + I couldn't easily change css_properties.json5 to make content immutable.
Can be a separate CL?
Yes. Then I'd prefer to remove the constness of the ContentData returned from ComputedStyle. I think that's better than having const_casts.
? const_cast<StyleImage*>(Daniil SakhapovSo ContentData actually needs to be mutable? Or is this a case of "let's stop here because it requires changes everywhere"?
The let's stop here case for my CL, but it seems like some image resource observer also abuses content mutability.
But to fix that sounds like a separate CL?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
builder.SetContent(const_cast<ContentData*>(style.GetContentData()));Daniil SakhapovDoes SetContent() need a mutable ContentData?
Rune LillesveenSee the other comment + I couldn't easily change css_properties.json5 to make content immutable.
Can be a separate CL?
Yes. Then I'd prefer to remove the constness of the ContentData returned from ComputedStyle. I think that's better than having const_casts.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
if (element->IsPseudoElement()) {Optional nit: could've used DynamicTo<> here and avoided the To<> below.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Optional nit: could've used DynamicTo<> here and avoided the To<> below.
| 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. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Fix counter() and counters() in alt content
Before that, the value of the counter text were saved in content data,
but content data was shared between the same pseudo-elements. This CL
clones content data so that each pseudo-element has its own copy.
Also, this CL only updates the counter text when attaching layout tree
from the root, as we do for regular counters.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/56524
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |