Closed
Bug 44993
Opened 25 years ago
Closed 25 years ago
plugin in hidden div is not hidden
Categories
(Core :: DOM: HTML Parser, defect, P3)
Tracking
()
VERIFIED
FIXED
People
(Reporter: val, Assigned: serhunt)
References
()
Details
(Whiteboard: [FIX IN HAND]nsbeta3+)
Attachments
(4 files)
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk (Win98; I)
BuildID: 2000061311
Note that the OBJECT is a Flash movie, contained with a DIV.
The intention was to be able to toggle the visibility of the DIV, and thus hide
or show the movie.
Both OBJECT and EMBED tags are used for cross-browser compatibility.
However, visibility of the movie doesn't seem to be inherited from the DIV by
the OBJECT, though it is by the EMBED.
Visibility of the OBJECT can be set using a style in the OBJECT tag, but only if
'position:absolute' is also included.
And the movie will function with only the EMBED tag (without the OBJECT and
PARAM tags), but not vice-versa, despite EMBED not being a valid HTML4.01 tag.
(There may be more than one bug here, but it all appears interrelated.)
Reproducible: Always
Steps to Reproduce:
In the document at the above URL:
1. Currently the DIV is visible.
Note the brief appearance of a grey panel containing
the word 'object'. This should not happen.
2. When the visibility of the DIV is changed to 'hidden',
the movie is still visible, although the OBJECT should
have inherited the visibility of the DIV.
(But at least the grey panel is hidden.)
3. If a style="visibility:hidden" is added to the OBJECT tag,
it still will not become hidden.
4. However, if position:absolute is added to that style,
then the OBJECT will at last become hidden.
5. When the OBJECT and PARAM tags are removed, leaving
just the EMBED tag within the DIV, changing the visibility
of the DIV now changes the visibility of the movie,
and will work as intended.
6. However, remove the EMBED tag, and restore the OBJECT
and PARAM tags, and now the movie won't function at all.
This, despite the fact that OBJECT, and *not* EMBED is
the correct HTML4.01.
Actual Results:
Expected Results: No grey panel at the start.
OBJECT to inherit visibility from container - ie. DIV.
Visibility style alone in OBJECT able to set.
Browser to use OBJECT rather than EMBED version of HTML.
Comment 1•25 years ago
|
||
At least part of this is related to
http://bugzilla.mozilla.org/show_bug.cgi?id=37622 -
<embed hidden="true"> doesn't really hide.
Okay; the testcases, I believe, demonstrate that problems 1-4 are now FIXED.
Also, problems 5 and 6 are now covered under bug 46569
http://bugzilla.mozilla.org/show_bug.cgi?id=46569
I'm thus confirming the bug at the moment. Hopefully it can be resolved and
46569 can be dealt with separately.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Per Brad's comment I'm marking this bug a dup of 46569.
*** This bug has been marked as a duplicate of 46569 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Brad, before the release of M17 you said problems 1-4 are now fixed.
Attachment 11972 [details] (DIV with visibility:hidden) shows the problem of the movie not
being hidden still exists in M17.
Comment 9•25 years ago
|
||
reopening per last post
confirmed with attachment 11972 [details] and a build from the tip 8/12
resummarizing
see also related closed bug 37622
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Summary: Anomalies using OBJECT/EMBED, especially when contained within DIV. → plugin in hidden div is not hidden
Comment 11•25 years ago
|
||
This bug report seems to imply (in the last few comments) that the problems are
fixed, except those covered in bugs 46569. Closing.
Status: REOPENED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Comment 12•25 years ago
|
||
Despite some comments in this report, bug 46569 does not address the visibility
of plugins in hidden DIVs.
The testcase for this bug (plugin in hidden DIV is not hidden) is:
http://bugzilla.mozilla.org/showattachment.cgi?attach_id=11972
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 13•25 years ago
|
||
AV: this appears to be a problem with the object tag, or it's a layout bug. Can
you confirm that object is doing the right thing before passing this to buster?
Assignee: rickg → av
Status: REOPENED → NEW
Comment 14•25 years ago
|
||
Andrei, please take a look and indicate how difficult this is to get right. It
seems very important to be able to hide a plugin this way.
| Assignee | ||
Comment 15•25 years ago
|
||
The following alternation to nsObjectFrame::IsHidden() seems to fix the problem
PRBool
nsObjectFrame::IsHidden() const
{
+// check the style visibility first
+ const nsStyleDisplay* disp = (const
+nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display);
+ if (disp != nsnull)
+ {
+ if(!disp->IsVisibleOrCollapsed())
+ return PR_TRUE;
+ }
nsCOMPtr<nsIAtom> tag;
mContent->GetTag(*getter_AddRefs(tag));
if (tag.get() != nsHTMLAtoms::object) {
// The <object> tag doesn't support the 'hidden' attribute, but
// everything else does...
nsAutoString hidden;
mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::hidden, hidden);
// Yes, these are really the kooky ways that you could tell 4.x
// not to hide the <embed> once you'd put the 'hidden' attribute
// on the tag...
if (hidden.Length() &&
! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("false")) &&
! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("no")) &&
! hidden.EqualsIgnoreCase(NS_LITERAL_STRING("off"))) {
// The <embed> or <applet> is hidden.
return PR_TRUE;
}
}
return PR_FALSE;
}
Status: NEW → ASSIGNED
Comment 16•25 years ago
|
||
Patch looks good. Confirmed that
http://bugzilla.mozilla.org/showattachment.cgi?attach_id=11970 and
http://bugzilla.mozilla.org/showattachment.cgi?attach_id=11972
work correctly.
Comment 17•25 years ago
|
||
r=buster
Comment 18•25 years ago
|
||
Adding nsbeta3+ to status whiteboard.
Whiteboard: [FIX IN HAND] → [FIX IN HAND]nsbeta3+
| Assignee | ||
Comment 19•25 years ago
|
||
It is in.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•