Closed Bug 597316 Opened 14 years ago Closed 3 years ago

overwrite wmode in object parameters when plugins.force.wmode is set

Categories

(Core Graveyard :: Plug-ins, defect, P4)

x86
Linux
defect

Tracking

(fennec-)

RESOLVED WONTFIX
Tracking Status
fennec - ---

People

(Reporter: roger.wang, Assigned: roger.wang)

References

Details

Attachments

(2 files, 6 obsolete files)

Attached patch overwrite wmode parameter (obsolete) — Splinter Review
plugins.force.wmode doesn't work in some cases: the flash video near the top left corner of http://video.sina.com.cn doesn't show in fennec. There're 2 places specifying the wmode parameter in the webpage and they need to be overwritten properly.
Attachment #476171 - Flags: review?(joshmoz)
Blocks: 583135
Comment on attachment 476171 [details] [diff] [review] overwrite wmode parameter We add a wmode attribute if the pref forces it, is the issue that the web page is also specifying attributes and those are getting read instead of our forced entry?
(In reply to comment #1) > We add a wmode attribute if the pref forces it, is the issue that the web page > is also specifying attributes and those are getting read instead of our forced > entry? yes
Comment on attachment 476171 [details] [diff] [review] overwrite wmode parameter Looks good, just compare the result of "strcmp" to "0" instead of using "!" - the latter incorrectly implies that we're testing a boolean value.
Attachment #476171 - Flags: review?(joshmoz) → review+
Attached patch patch v2 (obsolete) — Splinter Review
thanks, here is the updated patch. ( will it lost the previous r+? )
Assignee: nobody → roger.wang
Attachment #476171 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #476503 - Flags: review?(joshmoz)
Comment on attachment 476503 [details] [diff] [review] patch v2 >+ if (!wmodeType.IsEmpty() && >+ !strcmp(mCachedAttrParamNames[nextAttrParamIndex], "wmode") == 0) { You forgot to remove the "!" before strcmp.
Attachment #476503 - Flags: review?(joshmoz) → review-
Attached patch patch v3 (obsolete) — Splinter Review
oops, my bad, update again.
Attachment #476503 - Attachment is obsolete: true
Attachment #476506 - Flags: review?(joshmoz)
Comment on attachment 476506 [details] [diff] [review] patch v3 >+ ToNewUTF8String(NS_ConvertUTF8toUTF16(wmodeType)); Why are you starting with a UTF8 string, converting it to UTF16, and then converting it back to UTF8?
Attached patch patch v4 (obsolete) — Splinter Review
Not sure on this. It was written like that in the unpatched version in line ~3671, and it was copied. update it since it's not necessary.
Attachment #476506 - Attachment is obsolete: true
Attachment #476577 - Flags: review?(joshmoz)
Attachment #476506 - Flags: review?(joshmoz)
Comment on attachment 476577 [details] [diff] [review] patch v4 Looks good, I'd also like to have jst look at this since we've had problems with this code before.
Attachment #476577 - Flags: review?(jst)
Attachment #476577 - Flags: review?(joshmoz)
Attachment #476577 - Flags: review+
Comment on attachment 476577 [details] [diff] [review] patch v4 mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(name); mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(value); + if (!wmodeType.IsEmpty() && + strcmp(mCachedAttrParamNames[nextAttrParamIndex], "wmode") == 0) { + mCachedAttrParamValues[nextAttrParamIndex] = ToNewCString(wmodeType); + } This will overwrite the old value in mCachedAttrParamValues[nextAttrParamIndex], which we allocated above, and thus will now leak. @@ -3731,6 +3735,10 @@ value.Trim(" \n\r\t\b", PR_TRUE, PR_TRUE, PR_FALSE); mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(name); mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(value); + if (!wmodeType.IsEmpty() && + strcmp(mCachedAttrParamNames[nextAttrParamIndex], "wmode") == 0) { + mCachedAttrParamValues[nextAttrParamIndex] = ToNewCString(wmodeType); + } Same thing here. sr- due to the memory leaks.
Attachment #476577 - Flags: review?(jst) → review-
Attached patch patch v5 (obsolete) — Splinter Review
Thanks for pointing out that. Patch is updated. Please have a review.
Attachment #476577 - Attachment is obsolete: true
Attachment #476984 - Flags: review?(jst)
Comment on attachment 476984 [details] [diff] [review] patch v5 mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(name); mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(value); + if (!wmodeType.IsEmpty() && + strcmp(mCachedAttrParamNames[nextAttrParamIndex], "wmode") == 0) { + NS_Free(mCachedAttrParamValues[nextAttrParamIndex]); + mCachedAttrParamValues[nextAttrParamIndex] = ToNewCString(wmodeType); + } Much better, but would it not be better yet to change this to something along the lines of: mCachedAttrParamNames [nextAttrParamIndex] = ToNewUTF8String(name); if (!wmodeType.IsEmpty() && strcmp(mCachedAttrParamNames[nextAttrParamIndex], "wmode") == 0) { mCachedAttrParamValues[nextAttrParamIndex] = ToNewCString(wmodeType); } else { mCachedAttrParamValues[nextAttrParamIndex] = ToNewUTF8String(value); } Less allocator traffic, less code...?
Attached patch patch v6 (obsolete) — Splinter Review
of course. thanks
Attachment #476984 - Attachment is obsolete: true
Attachment #476991 - Flags: review?(jst)
Attachment #476984 - Flags: review?(jst)
Comment on attachment 476991 [details] [diff] [review] patch v6 sorry, there is an error in it
Attachment #476991 - Flags: review?(jst)
Attached patch patch v7Splinter Review
this is the correct patch. thanks
Attachment #476991 - Attachment is obsolete: true
Attachment #476994 - Flags: review?(jst)
Comment on attachment 476994 [details] [diff] [review] patch v7 Looks good, thanks for fixing this!
Attachment #476994 - Flags: review?(jst) → review+
Keywords: checkin-needed
proposed for fenenc 2.0b1 since it will affect flash on many sites
tracking-fennec: --- → ?
tracking-fennec: ? → 2.0-
Comment on attachment 476994 [details] [diff] [review] patch v7 are there any tests for this?
(In reply to comment #18) > Comment on attachment 476994 [details] [diff] [review] > patch v7 > > are there any tests for this? I think not, and I'll write one. btw, should the test be ready before the check-in of this patch? TIA.
Yes. Test and then approval and then push. Thanks!
Roger, any news on the tests for this? :)
(In reply to comment #21) > Roger, any news on the tests for this? :) not yet. Just start figuring out how to write test for it after a long PRC national holiday :)
I'm trying to set the pref in the same way as layout/generic/test/test_bug263683.html, but it always failed with: ###!!! ASSERTION: cannot set pref from content process: 'Error', file /home/wwang29/mozilla-central/modules/libpref/src/nsPrefBranch.cpp, line 191 Note that when I try to run the case layout/generic/test/test_bug263683.html it's also fails with the same error. Is it a limitation for those cases?
Keywords: checkin-needed
Attached patch test caseSplinter Review
firefox is not IPC enabled, so setting the param works. attached is the case, please review, thanks.
Attachment #483068 - Flags: review?(jst)
Adding checkin-needed.
Keywords: checkin-needed
Please wait for the test to be reviewed as well. This can be marked as checkin-needed then.
Keywords: checkin-needed
Comment on attachment 483068 [details] [diff] [review] test case Sorry this review request fell through the cracks :(. r=jst, assuming this still passes.
Attachment #483068 - Flags: review?(jst) → review+
Priority: -- → P4
Resolving as wont fix, plugin support deprecated in Firefox 85.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: