changing iframe/browser type attribute from chrome to content after being added should throw error
Categories
(Core :: XUL, defect)
Tracking
()
People
(Reporter: eviljeff, Unassigned)
References
Details
(Keywords: addon-compat)
Comment 1•14 years ago
|
||
| Reporter | ||
Comment 2•14 years ago
|
||
Comment 3•14 years ago
|
||
| Reporter | ||
Comment 4•14 years ago
|
||
Comment 5•14 years ago
|
||
Updated•6 years ago
|
Comment 6•6 years ago
|
||
It looks like we sort of try to cope with this in https://searchfox.org/mozilla-central/source/dom/base/nsFrameLoader.cpp#3101 now, but that seems sketchy to me (and is intermingled with changes relating to the primary attribute). Nika, is there any reason we shouldn't just cache the type value when the XUL Frame Element's BindToTree fires and rely only on that instead of attribute gets? This would require reinsertion of the framing element if consumers want to change it, that seems OK to me, and it seems like some of the current code could be simplified if we did this.
Alternatively, if we really want to support changing this without reinsertion (what should happen to the browsingcontext? Presumably that needs recreating if we're changing the outcome of calling IsContent()...), perhaps we can clarify what this method is trying to do for changes to primary vs. type attributes?
Comment 7•6 years ago
|
||
(In reply to :Gijs (he/him) from comment #6)
It looks like we sort of try to cope with this in https://searchfox.org/mozilla-central/source/dom/base/nsFrameLoader.cpp#3101 now, but that seems sketchy to me (and is intermingled with changes relating to the
primaryattribute).
I think that method call is a bit deceptive, and is only used to control the mPrimaryContentShell attribute on the AppWindow object (https://searchfox.org/mozilla-central/rev/202a285024f174c2d2bf2152d9cba90a03723eab/xpfe/appshell/AppWindow.cpp#2030,2035,2043). It never actually changes the type of the inner nsDocShell, as that property is completely immutable.
Nika, is there any reason we shouldn't just cache the
typevalue when the XUL Frame Element'sBindToTreefires and rely only on that instead of attribute gets? This would require reinsertion of the framing element if consumers want to change it, that seems OK to me, and it seems like some of the current code could be simplified if we did this.
It's already required to re-insert the framing element if consumers want to change it, so that wouldn't be a significant change here. It's already sort-of cached, as when the BrowsingContext is created (which is performed within BindToTree from the nsFrameLoader's constructor), it reads the type attribute once, and caches it as the mType field on the created BrowsingContext, which is completely immutable (via https://searchfox.org/mozilla-central/rev/202a285024f174c2d2bf2152d9cba90a03723eab/dom/base/nsFrameLoader.cpp#237).
We should probably ensure that it's only read in this one place, and change other code which would read the attribute to instead inspect the BrowsingContext within the nsFrameLoader to achieve this same effect.
Updated•3 years ago
|
Description
•