[Webkit-unassigned] [Bug 76816] Implement the URL decomposition IDL attributes
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Feb 23 11:42:56 PST 2012
https://bugs.webkit.org/show_bug.cgi?id=76816
Adam Barth <abarth at webkit.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #128459|review?, commit-queue? |review-
Flag| |
--- Comment #22 from Adam Barth <abarth at webkit.org> 2012-02-23 11:42:55 PST ---
(From update of attachment 128459)
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.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list