[webkit-reviews] review denied: [Bug 76816] Implement the URL decomposition IDL attributes : [Attachment 128459] Updated Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 23 11:42:55 PST 2012


Adam Barth <abarth at webkit.org> has denied Kaustubh Atrawalkar
<kaustubh at motorola.com>'s request for review:
Bug 76816: Implement the URL decomposition IDL attributes
https://bugs.webkit.org/show_bug.cgi?id=76816

Attachment 128459: Updated Patch
https://bugs.webkit.org/attachment.cgi?id=128459&action=review

------- Additional Comments from Adam Barth <abarth at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=128459&action=review


> Source/WebCore/html/DOMURL.cpp:166
> +void DOMURL::setHost(const String& value)
> +{
> +    if (value.isEmpty())
> +	   return;
> +
> +    if (!m_href.canSetHostOrPort())
> +	   return;
> +
> +    size_t colon = value.find(':');
> +    if (!colon)
> +	   return;
> +
> +    if (colon == notFound)
> +	   m_href.setHostAndPort(value);
> +    else {
> +	   unsigned portStart = colon + 1;
> +	   unsigned portEnd = portStart;
> +
> +	   while (isASCIIDigit(value[portEnd]))
> +	       ++portEnd;
> +
> +	   unsigned port = value.substring(portStart, portEnd -
portStart).toUInt();
> +	   if (!port)
> +	       m_href.setHostAndPort(value.substring(0, colon + 1) + "0");
> +	   else {
> +	       if (isDefaultPortForProtocol(port, m_href.protocol()))
> +		   m_href.setHostAndPort(value.substring(0, colon));
> +	       else
> +		   m_href.setHostAndPort(value.substring(0, portEnd));
> +	   }
> +    }
> +}

Why is this function so different from
http://trac.webkit.org/browser/trunk/Source/WebCore/page/Location.cpp#L155 ?

> Source/WebCore/html/DOMURL.cpp:202
> +void DOMURL::setPort(const String& value)
> +{
> +    if (!m_href.canSetHostOrPort())
> +	   return;
> +
> +    unsigned port = value.toUInt();
> +    if (isDefaultPortForProtocol(port, m_href.protocol()))
> +	   m_href.removePort();
> +    else
> +	   m_href.setPort(value.toUInt());
> +}

This function also seems different from
http://trac.webkit.org/browser/trunk/Source/WebCore/page/Location.cpp#L173 . 
For example, why does one check against 0xFFFF but the other doesn't?

> Source/WebCore/html/DOMURL.cpp:222
> +    newSearch.replace('#', "%23");

Why does this function make this change bug
http://trac.webkit.org/browser/trunk/Source/WebCore/page/Location.cpp#L195
doesn't.


More information about the webkit-reviews mailing list