Backed out changeset 18ff1472dae9 (bug 1312742) for not updating the expected results of wpt test /html/dom/reflection-embedded.html and more. r=backout

This commit is contained in:
Sebastian Hengst 2016-10-30 02:12:53 +02:00
Родитель 87a5bde3a6
Коммит e78e4865d7
4 изменённых файлов: 80 добавлений и 6 удалений

Просмотреть файл

@ -347,11 +347,10 @@ HTMLAnchorElement::ToString(nsAString& aSource)
return GetHref(aSource);
}
NS_IMETHODIMP
NS_IMETHODIMP
HTMLAnchorElement::GetPing(nsAString& aValue)
{
GetAttr(kNameSpaceID_None, nsGkAtoms::ping, aValue);
return NS_OK;
return GetURIListAttr(nsGkAtoms::ping, aValue);
}
NS_IMETHODIMP

Просмотреть файл

@ -221,11 +221,10 @@ HTMLAreaElement::ToString(nsAString& aSource)
return GetHref(aSource);
}
NS_IMETHODIMP
NS_IMETHODIMP
HTMLAreaElement::GetPing(nsAString& aValue)
{
GetAttr(kNameSpaceID_None, nsGkAtoms::ping, aValue);
return NS_OK;
return GetURIListAttr(nsGkAtoms::ping, aValue);
}
NS_IMETHODIMP

Просмотреть файл

@ -1679,6 +1679,68 @@ nsGenericHTMLElement::IsScrollGrabAllowed(JSContext*, JSObject*)
return nsContentUtils::IsSystemPrincipal(prin);
}
nsresult
nsGenericHTMLElement::GetURIListAttr(nsIAtom* aAttr, nsAString& aResult)
{
aResult.Truncate();
nsAutoString value;
if (!GetAttr(kNameSpaceID_None, aAttr, value))
return NS_OK;
nsIDocument* doc = OwnerDoc();
nsCOMPtr<nsIURI> baseURI = GetBaseURI();
nsString::const_iterator end;
value.EndReading(end);
nsAString::const_iterator iter;
value.BeginReading(iter);
while (iter != end) {
while (*iter == ' ' && iter != end) {
++iter;
}
if (iter == end) {
break;
}
nsAString::const_iterator start = iter;
while (iter != end && *iter != ' ') {
++iter;
}
if (!aResult.IsEmpty()) {
aResult.Append(NS_LITERAL_STRING(" "));
}
const nsSubstring& uriPart = Substring(start, iter);
nsCOMPtr<nsIURI> attrURI;
nsresult rv =
nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(attrURI),
uriPart, doc, baseURI);
if (NS_FAILED(rv)) {
aResult.Append(uriPart);
continue;
}
MOZ_ASSERT(attrURI);
nsAutoCString spec;
rv = attrURI->GetSpec(spec);
if (NS_WARN_IF(NS_FAILED(rv))) {
aResult.Append(uriPart);
continue;
}
AppendUTF8toUTF16(spec, aResult);
}
return NS_OK;
}
HTMLMenuElement*
nsGenericHTMLElement::GetContextMenu() const
{

Просмотреть файл

@ -1062,6 +1062,20 @@ protected:
SetHTMLAttr(aAttr, value, aRv);
}
/**
* This method works like GetURIAttr, except that it supports multiple
* URIs separated by whitespace (one or more U+0020 SPACE characters).
*
* Gets the absolute URI values of an attribute, by resolving any relative
* URIs in the attribute against the baseuri of the element. If a substring
* isn't a relative URI, the substring is returned as is. Only works for
* attributes in null namespace.
*
* @param aAttr name of attribute.
* @param aResult result value [out]
*/
nsresult GetURIListAttr(nsIAtom* aAttr, nsAString& aResult);
/**
* Locates the nsIEditor associated with this node. In general this is
* equivalent to GetEditorInternal(), but for designmode or contenteditable,