Bug 1344102 - Add a telemetry for xml:base on styled element. r=bz draft
authorXidorn Quan <me@upsuper.org>
Fri, 03 Mar 2017 14:32:11 +1100
changeset 492720 70598eecff0c25e82d25a9bf9f2e36d26bf35648
parent 491806 29dcc5c6807852c1b3a5874c610bd477a81f73f6
child 547731 5cae5c045b2530d701b8a347e93865470a09f312
push id47616
push userxquan@mozilla.com
push dateFri, 03 Mar 2017 03:40:54 +0000
reviewersbz
bugs1344102
milestone54.0a1
Bug 1344102 - Add a telemetry for xml:base on styled element. r=bz MozReview-Commit-ID: 9vqlxDi5KB8
dom/base/FragmentOrElement.cpp
dom/base/nsDeprecatedOperationList.h
--- 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)