Currently on non-Cocoa, non-libsoup platforms, URL::hostIsIPAddress is just a stub: https://github.com/WebKit/webkit/blob/767a0672697c45f01acb22e3fe00ff1f5c97871c/Source/WebCore/platform/URL.cpp#L1064-L1070 Not sure why it lacks a "FIXME", but this ought to be a default implementation, so that Windows ports can use it.
Created attachment 345627 [details] Patch
Comment on attachment 345627 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345627&action=review > Source/WebCore/platform/URL.cpp:1082 > + if (digit > '9' || digit < (i ? '1' : '0')) This loop scans backward. If i == 0, it is the last number. You want to check the first number here. It should be "(i == length - 1 ? '1' : '0')" > Source/WebCore/platform/URL.cpp:1085 > + value += 10 * (digit - '0'); This is not correct. For example, a number '123' is given. value = 0; value += 10 * 3; value += 10 * 2; value += 10 * 1; Then value becomes 60, not 123.
Created attachment 345637 [details] Patch
Sorry, those really were some stupid mistakes on my part. It seems that ultimately forward iteration is the most straightforward here. I've also added a few extra test cases for IPv4 accordingly.
Comment on attachment 345637 [details] Patch Clearing flags on attachment: 345637 Committed r234147: <https://trac.webkit.org/changeset/234147>
All reviewed patches have been landed. Closing bug.
<rdar://problem/42541837>