Make IPv6-embedded IPv4 addresses parse only if they have 4 parts

The URL standard requires the IPv6-embedded IPv4 address to be consicely
composed of 4 parts. A check is added in the URL host parser to fix the
WPT test failures.
The feature is implemented behind the StrictIPv6EmbeddedIPv4AddressParsing flag.

Bug: 1411619
Change-Id: I9062aef7279b899db961613b6e42f6095d2101d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4206417
Reviewed-by: Tommy Li <[email protected]>
Reviewed-by: Charlie Harrison <[email protected]>
Reviewed-by: Tom Sepez <[email protected]>
Commit-Queue: Jiacheng Guo <[email protected]>
Reviewed-by: Weizhong Xia <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1106646}
diff --git a/url/url_features.cc b/url/url_features.cc
index 25132d1..0cffe3d2 100644
--- a/url/url_features.cc
+++ b/url/url_features.cc
@@ -15,6 +15,10 @@
              "RecordIDNA2008Metrics",
              base::FEATURE_ENABLED_BY_DEFAULT);
 
+BASE_FEATURE(kStrictIPv4EmbeddedIPv6AddressParsing,
+             "StrictIPv4EmbeddedIPv6AddressParsing",
+             base::FEATURE_DISABLED_BY_DEFAULT);
+
 bool IsUsingIDNA2008NonTransitional() {
   return base::FeatureList::IsEnabled(kUseIDNA2008NonTransitional);
 }