Sync for validator/cpp/htmlparser (#31322)
Sync for validator/cpp/htmlparser (#31322)

* Automated g4 rollback of changelist 334230733.

*** Reason for rollback ***

I believe this is causing crashes in multiple AMP servers:
https://coroner.corp.google.com/#/crash/5f8c675d-0000-2876-a182-2405887bfb78
http://coroner/5f8ba114-0000-2e57-b746-3c286d331a12

*** Original change description ***

Remove webutil/url references and replace it with htmlparser/url library.

PiperOrigin-RevId: 334695233

* Automated g4 rollback of changelist 334695233.

*** Reason for rollback ***

Fix segfault in parsing port numbers. Some port numbers were too big and URL
parser assumed port numbers will not be larger than 5 characters, forgot this
is world wild web.

FYI: This caused segfault: https://source.corp.google.com/piper///depot/google3/third_party/llvm/llvm-project/libcxx/src/string.cpp;l=97;rcl=334475283?q=

*** Original change description ***

Automated g4 rollback of changelist 334230733.

*** Reason for rollback ***

I believe this is causing crashes in multiple AMP servers:
https://coroner.corp.google.com/#/crash/5f8c675d-0000-2876-a182-2405887bfb78
http://coroner/5f8ba114-0000-2e57-b746-3c286d331a12

*** Original change description ***

Remove webutil/url references and replace it with htmlparser/url library.

PiperOrigin-RevId: 334844812

* Fix some typos, use uint8_t explicitly instead of char.

PiperOrigin-RevId: 334892672

* Use left shift for max int value declaraiton.

PiperOrigin-RevId: 343582761

Co-authored-by: Googler <1505422b2465e9a84f6fdfaa161078890c593f06@google.com>
Co-authored-by: Amaltas Bohra <9e14fab885103d6caa53b2e278784a49dd77d7b9@google.com>
honeybadgerdontcare/amphtml,voyagegroup/amphtml,danielrozenberg/amphtml,lannka/amphtml,smartadserver/amphtml,mhc-gh/amphtml,lannka/amphtml,jmadler/amphtml,sharethrough/amphtml,nexxtv/amphtml,prateekbh/amphtml,sharethrough/amphtml,nexxtv/amphtml,jpettitt/amphtml,ampproject/amphtml,Gregable/amphtml,Gregable/amphtml,smartadserver/amphtml,rsimha-amp/amphtml,ampproject/amphtml,media-net/amphtml,mhc-gh/amphtml,Gregable/amphtml,ampproject/amphtml,sharethrough/amphtml,lannka/amphtml,media-net/amphtml,alanorozco/amphtml,media-net/amphtml,media-net/amphtml,danielrozenberg/amphtml,zhouyx/amphtml,smartadserver/amphtml,lannka/amphtml,mhc-gh/amphtml,jridgewell/amphtml,danielrozenberg/amphtml,mhc-gh/amphtml,voyagegroup/amphtml,prateekbh/amphtml,smartadserver/amphtml,honeybadgerdontcare/amphtml,jpettitt/amphtml,danielrozenberg/amphtml,voyagegroup/amphtml,jpettitt/amphtml,danielrozenberg/amphtml,jridgewell/amphtml,mhc-gh/amphtml,jpettitt/amphtml,smartadserver/amphtml,nexxtv/amphtml,prateekbh/amphtml,rsimha-amp/amphtml,jridgewell/amphtml,voyagegroup/amphtml,danielrozenberg/amphtml,jridgewell/amphtml,zhouyx/amphtml,zhouyx/amphtml,mhc-gh/amphtml,nexxtv/amphtml,honeybadgerdontcare/amphtml,jpettitt/amphtml,nexxtv/amphtml,lannka/amphtml,jridgewell/amphtml,zhouyx/amphtml,ampproject/amphtml,sharethrough/amphtml,mhc-gh/amphtml,Gregable/amphtml,alanorozco/amphtml,jridgewell/amphtml,voyagegroup/amphtml,jridgewell/amphtml,rsimha-amp/amphtml,alanorozco/amphtml,prateekbh/amphtml,voyagegroup/amphtml,lannka/amphtml,zhouyx/amphtml,jmadler/amphtml,honeybadgerdontcare/amphtml,Gregable/amphtml,rsimha-amp/amphtml,alanorozco/amphtml,media-net/amphtml,Gregable/amphtml,prateekbh/amphtml,media-net/amphtml,nexxtv/amphtml,nexxtv/amphtml,Gregable/amphtml,ampproject/amphtml,rsimha-amp/amphtml,ampproject/amphtml,zhouyx/amphtml,alanorozco/amphtml,sharethrough/amphtml,Gregable/amphtml,smartadserver/amphtml,lannka/amphtml,jpettitt/amphtml,media-net/amphtml,media-net/amphtml,jmadler/amphtml,jmadler/amphtml,danielrozenberg/amphtml,ampproject/amphtml,alanorozco/amphtml,alanorozco/amphtml,honeybadgerdontcare/amphtml,rsimha-amp/amphtml,rsimha-amp/amphtml,honeybadgerdontcare/amphtml,jpettitt/amphtml,honeybadgerdontcare/amphtml,prateekbh/amphtml,zhouyx/amphtml,jmadler/amphtml,ampproject/amphtml,jmadler/amphtml,prateekbh/amphtml,sharethrough/amphtml,alanorozco/amphtml,danielrozenberg/amphtml,mhc-gh/amphtml,voyagegroup/amphtml,jpettitt/amphtml