Bug 1344102 - Add a telemetry for xml:base on styled element. r=bz
MozReview-Commit-ID: 9vqlxDi5KB8
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -385,16 +385,19 @@ nsIContent::GetBaseURI(bool aTryUseXHRDo
if (!attr.IsEmpty()) {
baseAttrs.AppendElement(attr);
}
elem = elem->GetParent();
} while(elem);
if (!baseAttrs.IsEmpty()) {
doc->WarnOnceAbout(nsIDocument::eXMLBaseAttribute);
+ if (IsHTMLElement() || IsSVGElement() || IsXULElement()) {
+ doc->WarnOnceAbout(nsIDocument::eXMLBaseAttributeWithStyledElement);
+ }
// Now resolve against all xml:base attrs
for (uint32_t i = baseAttrs.Length() - 1; i != uint32_t(-1); --i) {
nsCOMPtr<nsIURI> newBase;
nsresult rv = NS_NewURI(getter_AddRefs(newBase), baseAttrs[i],
doc->GetDocumentCharacterSet().get(), base);
// Do a security check, almost the same as nsDocument::SetBaseURL()
// Only need to do this on the final uri
if (NS_SUCCEEDED(rv) && i == 0) {
--- a/dom/base/nsDeprecatedOperationList.h
+++ b/dom/base/nsDeprecatedOperationList.h
@@ -47,8 +47,9 @@ DEPRECATED_OPERATION(RTCPeerConnectionGe
DEPRECATED_OPERATION(AppCache)
DEPRECATED_OPERATION(PrefixedImageSmoothingEnabled)
DEPRECATED_OPERATION(PrefixedFullscreenAPI)
DEPRECATED_OPERATION(LenientSetter)
DEPRECATED_OPERATION(FileLastModifiedDate)
DEPRECATED_OPERATION(ImageBitmapRenderingContext_TransferImageBitmap)
DEPRECATED_OPERATION(URLCreateObjectURL_MediaStream)
DEPRECATED_OPERATION(XMLBaseAttribute)
+DEPRECATED_OPERATION(XMLBaseAttributeWithStyledElement)