| Auto-Submit | +1 |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Moving myself to cc as Mike is a blink owner.
It would be good to rebase this as a child branch of https://chromium-review.googlesource.com/c/chromium/src/+/7708601 so it only shows the diff from the parent branch.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +1 |
Moving myself to cc as Mike is a blink owner.
It would be good to rebase this as a child branch of https://chromium-review.googlesource.com/c/chromium/src/+/7708601 so it only shows the diff from the parent branch.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
rel_copy.Replace('\f', ' ');Hrm.
I'd like for us to find a way to reuse `RelList` (`DOMTokenList`) rather than re-parsing this, as we already encode the ASCII whitespace characters in too many disparate places. Making `LinkRelAttribute` a subclass of `RelList` with member functions that call `this->contains()` seems like a simpler design overall. That said, that's a larger change given usage in the codebase. Perhaps add a TODO? It'd be good cleanup.
For the moment, though, let's not scan the string 4 times. Consider using [`SplitOnASCIIWhitespace(...)`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/parser/html_parser_idioms.h;drc=d4203fb18d457eb93924af6bb2d24c954402978e;l=45) instead which already has the trimming behavior we want here and will only walk through the string once.
(We could also lowercase the string here to avoid it when matching all the `EqualIgnoringAsciiCase` below. Might be a simple optimization.)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +2 |
Hrm.
I'd like for us to find a way to reuse `RelList` (`DOMTokenList`) rather than re-parsing this, as we already encode the ASCII whitespace characters in too many disparate places. Making `LinkRelAttribute` a subclass of `RelList` with member functions that call `this->contains()` seems like a simpler design overall. That said, that's a larger change given usage in the codebase. Perhaps add a TODO? It'd be good cleanup.
For the moment, though, let's not scan the string 4 times. Consider using [`SplitOnASCIIWhitespace(...)`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/parser/html_parser_idioms.h;drc=d4203fb18d457eb93924af6bb2d24c954402978e;l=45) instead which already has the trimming behavior we want here and will only walk through the string once.
(We could also lowercase the string here to avoid it when matching all the `EqualIgnoringAsciiCase` below. Might be a simple optimization.)
This is good feedback! I've created crbug.com/505286910 for the clean-up work you called out, and lowercased the string as suggested. Thanks!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +2 |
| 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. |
[Connection-Allowlist] [Preload] Fix parsing enforcement
Enable previously-disabled Connection-Allowlist test:
1. WhitespaceInRelAttributeNormalized: verifies that <link rel>
attributes containing tabs, carriage returns, or form feeds are
correctly parsed for preconnect/dns-prefetch enforcement.
Supporting production fixes:
- link_rel_attribute.cc: normalize all ASCII whitespace (tab, CR, FF)
to spaces before splitting rel tokens, per the HTML spec.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |