Closed
Bug 616672
Opened 14 years ago
Closed 13 years ago
Warn on access of LSProgressEvent.position, LSProgressEvent.totalSize
Categories
(Core :: DOM: Core & HTML, defect, P1)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla10
People
(Reporter: Ms2ger, Assigned: Ms2ger)
References
Details
Attachments
(1 file, 3 obsolete files)
6.88 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Updated•14 years ago
|
Target Milestone: --- → mozilla2.0
Comment 2•14 years ago
|
||
Comment on attachment 495288 [details] [diff] [review] Patch v1 >+static void >+ReportUseOfDeprecatedMethod(nsDOMProgressEvent* aPresContext, const char* aWarning) Strangely named parameter. >+{ >+ nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES, >+ aWarning, >+ nsnull, 0, >+ aInner->PresContext()->Document()->GetDocumentURI(), >+ EmptyString(), 0, 0, >+ nsIScriptError::warningFlag, >+ "DOM Events"); Does this really work? How do you guarantee that PresContext() doesn't return null. And I think we should report the warning only once per document. (We do that for nsDocument::GetBoxObjectFor) Perhaps you could use the target of the event to get the document?
Attachment #495288 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 3•13 years ago
|
||
I didn't even realize I already had a patch here...
Attachment #495288 -
Attachment is obsolete: true
Attachment #561217 -
Flags: review?(Olli.Pettay)
Comment 4•13 years ago
|
||
Comment on attachment 561217 [details] [diff] [review] Patch v2 >+nsXMLHttpProgressEvent::WarnAboutLSProgressEvent(nsIDocument::DeprecatedOperations aOperation) >+{ >+ nsPresContext* presContext = mInner->GetPresContext(); >+ if (!presContext) { >+ return; >+ } Is presContext actually ever set? I think it would be better to add something so that you could get document from the target of the event. (XHR's owner's document)
Attachment #561217 -
Flags: review?(Olli.Pettay) → review-
Assignee | ||
Comment 5•13 years ago
|
||
I found a Window... Does this look better?
Attachment #561217 -
Attachment is obsolete: true
Attachment #561506 -
Flags: review?(Olli.Pettay)
Assignee | ||
Updated•13 years ago
|
Target Milestone: mozilla2.0 → mozilla9
Assignee | ||
Comment 6•13 years ago
|
||
And now a try that builds...
Attachment #561506 -
Attachment is obsolete: true
Attachment #561547 -
Flags: review?(Olli.Pettay)
Attachment #561506 -
Flags: review?(Olli.Pettay)
Comment 7•13 years ago
|
||
Comment on attachment 561547 [details] [diff] [review] Patch v3.1 > // Use nsDOMProgressEvent so that we can forward > // most of the method calls easily. > nsRefPtr<nsDOMProgressEvent> mInner; >+ nsCOMPtr<nsPIDOMWindow> mWindow; You need to add this to cycle collection >diff --git a/content/events/src/nsDOMEvent.h b/content/events/src/nsDOMEvent.h >--- a/content/events/src/nsDOMEvent.h >+++ b/content/events/src/nsDOMEvent.h >@@ -218,16 +218,19 @@ public: > > static PopupControlState GetEventPopupControlState(nsEvent *aEvent); > > static void PopupAllowedEventsChanged(); > > static void Shutdown(); > > static const char* GetEventName(PRUint32 aEventType); >+ >+ nsPresContext* GetPresContext() { return mPresContext; } Leftover?
Attachment #561547 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 8•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/64eeb93a6ed4
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [strings]
Target Milestone: mozilla9 → mozilla10
Comment 9•13 years ago
|
||
PositionWarning=Use XMLHttpRequest's progress events' position attribute is deprecated. TotalSizeWarning=Use XMLHttpRequest's progress events' totalSize attribute is deprecated. I suppose it should be "Use of" instead of "Use", but honestly I have big problems translating this string. Could you please try to rephrase it or give an equivalent sentence?
Comment 10•13 years ago
|
||
flod, what this means is that: - XMLHttpRequest progress events have attributes called "position" and "totalSize". - Use of these attributes is now deprecated and they will be removed at a later time. - When a web developer uses these attributes, he'll get this warning telling them not to use these attributes. To rephrase this for you: 'Using the "position'/'totalSize' attributes of XMLHttpRequest progress events is deprecated' Hope this makes it clear for you. :)
Comment 11•13 years ago
|
||
(In reply to Marek Stępień :marcoos from comment #10) > Hope this makes it clear for you. :) Yes, a lot clearer. I already translated in this way, but now I'm sure that's right ;-)
Updated•11 years ago
|
Component: DOM: Mozilla Extensions → DOM
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•