[Webkit-unassigned] [Bug 71968] Implement URL API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 23 10:21:19 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=71968





--- Comment #26 from Erik Arvidsson <arv at chromium.org>  2011-11-23 10:21:19 PST ---
(From update of attachment 116327)
View in context: https://bugs.webkit.org/attachment.cgi?id=116327&action=review

> Source/WebCore/html/DOMURL.cpp:145
> +    return m_href;

Move all the single statement functions to the .h file

> Source/WebCore/html/DOMURL.cpp:161
> +    if (value == "null")
> +        return;

Why are you comparing to the string "null"?

Did you want to do?

if (value.isNull())
    return;

But the question is, do we really need to do this? Doesn't KURL::setProtocol work correctly with this in mind already?

> Source/WebCore/html/DOMURL.cpp:165
> +    KURL url = href();
> +    url.setProtocol(value);
> +    setHref(url.string());

m_href is mutable so there should be no need to make a copy of it, serialize it and reparse it.

void DOMURL::setProtocol(const String& value)
{
  m_href.setProtocol(value);
}

> Source/WebCore/html/DOMURL.cpp:190
> +void DOMURL::setPassword(const String& value)
> +{
> +    KURL url = href();
> +    url.setPass(value);
> +    setHref(url.string());
> +}

void DOMURL::setPassword(const String& value)
{
  m_href.setPass(value);
}

> Source/WebCore/html/DOMURL.cpp:257
> +    KURL url = href();
> +    if (!url.canSetHostOrPort())
> +        return;

Maybe do this before the loop?

> LayoutTests/fast/dom/DOMURL/check-instanceof-domurl-functions.html:1
> +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

<!DOCTYPE html>

-- 
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