Closed
Bug 597316
Opened 14 years ago
Closed 4 years ago
overwrite wmode in object parameters when plugins.force.wmode is set
Categories
(Core Graveyard :: Plug-ins, defect, P4)
Tracking
(fennec-)
RESOLVED
WONTFIX
Tracking | Status | |
---|---|---|
fennec | - | --- |
People
(Reporter: roger.wang, Assigned: roger.wang)
References
Details
Attachments
(2 files, 6 obsolete files)
2.19 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
2.25 KB,
patch
|
jst
:
review+
|
Details | Diff | 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.
Assignee | ||
Updated•14 years ago
|
Attachment #476171 -
Flags: review?(joshmoz)
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?
Assignee | ||
Comment 2•14 years ago
|
||
(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+
Assignee | ||
Comment 4•14 years ago
|
||
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
Assignee | ||
Updated•14 years ago
|
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-
Assignee | ||
Comment 6•14 years ago
|
||
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?
Assignee | ||
Comment 8•14 years ago
|
||
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 10•14 years ago
|
||
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-
Assignee | ||
Comment 11•14 years ago
|
||
Thanks for pointing out that. Patch is updated. Please have a review.
Attachment #476577 -
Attachment is obsolete: true
Attachment #476984 -
Flags: review?(jst)
Comment 12•14 years ago
|
||
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...?
Assignee | ||
Comment 13•14 years ago
|
||
of course. thanks
Attachment #476984 -
Attachment is obsolete: true
Attachment #476991 -
Flags: review?(jst)
Attachment #476984 -
Flags: review?(jst)
Assignee | ||
Comment 14•14 years ago
|
||
Comment on attachment 476991 [details] [diff] [review]
patch v6
sorry, there is an error in it
Attachment #476991 -
Flags: review?(jst)
Assignee | ||
Comment 15•14 years ago
|
||
this is the correct patch. thanks
Attachment #476991 -
Attachment is obsolete: true
Attachment #476994 -
Flags: review?(jst)
Comment 16•14 years ago
|
||
Comment on attachment 476994 [details] [diff] [review]
patch v7
Looks good, thanks for fixing this!
Attachment #476994 -
Flags: review?(jst) → review+
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 17•14 years ago
|
||
proposed for fenenc 2.0b1 since it will affect flash on many sites
tracking-fennec: --- → ?
Updated•14 years ago
|
tracking-fennec: ? → 2.0-
Comment 18•14 years ago
|
||
Comment on attachment 476994 [details] [diff] [review]
patch v7
are there any tests for this?
Assignee | ||
Comment 19•14 years ago
|
||
(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.
Comment 20•14 years ago
|
||
Yes. Test and then approval and then push. Thanks!
Comment 21•14 years ago
|
||
Roger, any news on the tests for this? :)
Assignee | ||
Comment 22•14 years ago
|
||
(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 :)
Assignee | ||
Comment 23•14 years ago
|
||
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?
Updated•14 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 24•14 years ago
|
||
firefox is not IPC enabled, so setting the param works.
attached is the case, please review, thanks.
Attachment #483068 -
Flags: review?(jst)
Comment 26•14 years ago
|
||
Please wait for the test to be reviewed as well. This can be marked as checkin-needed then.
Keywords: checkin-needed
Comment 27•12 years ago
|
||
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+
Updated•12 years ago
|
Priority: -- → P4
Comment 28•4 years ago
|
||
Resolving as wont fix, plugin support deprecated in Firefox 85.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•