Commit 9c49a28a authored by Andrea Iacovitti's avatar Andrea Iacovitti

Follow up of commit c518ab9b

parent c518ab9b
......@@ -366,8 +366,8 @@ void HTMLIFrameElement::setScrolling( const DOMString &value )
DOMString HTMLIFrameElement::src() const
{
if(!impl) return DOMString();
DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
return !s.isNull() ? impl->document()->completeURL( s.string() ) : s;
const QString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC).string().trimmed();
return !s.isNull() ? impl->document()->completeURL(s) : DOMString();
}
void HTMLIFrameElement::setSrc( const DOMString &value )
......
......@@ -504,8 +504,8 @@ void HTMLInputElement::setSize( long value )
DOMString HTMLInputElement::src() const
{
if(!impl) return DOMString();
DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SRC);
return !s.isNull() ? impl->document()->completeURL( s.string() ) : s;
const QString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SRC).string().trimmed();
return !s.isNull() ? impl->document()->completeURL(s) : DOMString();
}
void HTMLInputElement::setSrc( const DOMString &value )
......
......@@ -58,8 +58,8 @@ HTMLBaseElement::~HTMLBaseElement()
DOMString HTMLBaseElement::href() const
{
if(!impl) return DOMString();
DOMString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF);
return !href.isNull() ? impl->document()->completeURL(href.string()) : href;
const QString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF).string().trimmed();
return !href.isNull() ? impl->document()->completeURL(href) : DOMString();
}
void HTMLBaseElement::setHref( const DOMString &value )
......@@ -134,8 +134,8 @@ void HTMLLinkElement::setCharset( const DOMString &value )
DOMString HTMLLinkElement::href() const
{
if(!impl) return DOMString();
DOMString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF);
return !href.isNull() ? impl->document()->completeURL(href.string()) : href;
const QString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF).string().trimmed();
return !href.isNull() ? impl->document()->completeURL(href) : DOMString();
}
void HTMLLinkElement::setHref( const DOMString &value )
......@@ -379,8 +379,8 @@ void HTMLScriptElement::setDefer( bool _defer )
DOMString HTMLScriptElement::src() const
{
if(!impl) return DOMString();
DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
return !s.isNull() ? impl->document()->completeURL(s.string()) : s;
const QString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC).string().trimmed();
return !s.isNull() ? impl->document()->completeURL(s) : DOMString();
}
void HTMLScriptElement::setSrc( const DOMString &value )
......
......@@ -95,8 +95,8 @@ void HTMLAreaElement::setCoords( const DOMString &value )
DOMString HTMLAreaElement::href() const
{
if(!impl) return DOMString();
DOMString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF);
return !href.isNull() ? impl->document()->completeURL(href.string()) : href;
const QString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF).string().trimmed();
return !href.isNull() ? impl->document()->completeURL(href) : DOMString();
}
void HTMLAreaElement::setHref( const DOMString &value )
......@@ -302,8 +302,8 @@ void HTMLImageElement::setLongDesc( const DOMString &value )
DOMString HTMLImageElement::src() const
{
if(!impl) return DOMString();
DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
return !s.isNull() ? impl->document()->completeURL( s.string() ) : s;
const QString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC).string().trimmed();
return !s.isNull() ? impl->document()->completeURL(s) : DOMString();
}
void HTMLImageElement::setSrc( const DOMString &value )
......
......@@ -95,8 +95,8 @@ void HTMLAnchorElement::setCoords( const DOMString &value )
DOMString HTMLAnchorElement::href() const
{
if(!impl) return DOMString();
DOMString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF);
return !href.isNull() ? impl->document()->completeURL(href.string()) : href;
const QString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF).string().trimmed();
return !href.isNull() ? impl->document()->completeURL(href) : DOMString();
}
void HTMLAnchorElement::setHref( const DOMString &value )
......
......@@ -385,7 +385,7 @@ void HTMLScriptElementImpl::parseAttribute(AttributeImpl *attr)
// we'll only start doing things once we get insertedIntoDocument()
if (m_evaluated || m_cachedScript || m_createdByParser || !inDocument())
return;
DOMString url = attr->value();
QString url = attr->value().string().trimmed();
if (!url.isEmpty())
loadFromUrl(url);
break;
......@@ -490,7 +490,7 @@ void HTMLScriptElementImpl::insertedIntoDocument()
if (m_createdByParser)
return;
DOMString url = getAttribute(ATTR_SRC).string();
QString url = getAttribute(ATTR_SRC).string().trimmed();
if (!url.isEmpty()) {
loadFromUrl(url);
return;
......@@ -622,7 +622,7 @@ void HTMLScriptElementImpl::setDefer(bool defer)
DOMString HTMLScriptElementImpl::src() const
{
return document()->completeURL(getAttribute(ATTR_SRC).string());
return document()->completeURL(getAttribute(ATTR_SRC).string().trimmed());
}
void HTMLScriptElementImpl::setSrc(const DOMString &value)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment