Eliminate nsIStyleSet as an XPCOM interface, making the implementation internal to layout. Frame constructor ownership moves to the pres shell, and the style set methods that forward to the frame constructor are gone. Rewrote style set sheet add/remove to reduce code size. For more details, see bug 64116. r+sr=dbaron.
git-svn-id: svn://10.0.0.236/trunk@150998 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -150,7 +150,6 @@
|
||||
#include "nsDefaultPlugin.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIStyleSet.h"
|
||||
#include "nsIStyleFrameConstruction.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIPresContext.h"
|
||||
@@ -310,26 +309,20 @@ nsresult nsPluginDocReframeEvent::HandlePluginDocReframeEvent() {
|
||||
|
||||
// if this document has a presentation shell, then it has frames and can be reframed
|
||||
if (shell) {
|
||||
nsCOMPtr<nsIPresContext> pc;
|
||||
nsCOMPtr<nsIStyleSet> set;
|
||||
shell->GetPresContext(getter_AddRefs(pc));
|
||||
shell->GetStyleSet(getter_AddRefs(set));
|
||||
if (pc && set) {
|
||||
nsCOMPtr<nsIStyleFrameConstruction> fc;
|
||||
set->GetStyleFrameConstruction(getter_AddRefs(fc));
|
||||
if (fc)
|
||||
|
||||
/**
|
||||
* A reframe will cause a fresh object frame, instance owner, and instance
|
||||
* to be created. Reframing of the entire document is necessary as we may have
|
||||
* recently found new plugins and we want a shot at trying to use them instead
|
||||
* of leaving alternate renderings.
|
||||
* We do not want to completely reload all the documents that had running plugins
|
||||
* because we could possibly trigger a script to run in the unload event handler
|
||||
* which may want to access our defunct plugin and cause us to crash.
|
||||
*/
|
||||
|
||||
fc->ReconstructDocElementHierarchy(pc); // causes reframe of document
|
||||
nsIPresContext *pc = shell->GetPresContext();
|
||||
if (pc) {
|
||||
/**
|
||||
* A reframe will cause a fresh object frame, instance owner, and instance
|
||||
* to be created. Reframing of the entire document is necessary as we may have
|
||||
* recently found new plugins and we want a shot at trying to use them instead
|
||||
* of leaving alternate renderings.
|
||||
* We do not want to completely reload all the documents that had running plugins
|
||||
* because we could possibly trigger a script to run in the unload event handler
|
||||
* which may want to access our defunct plugin and cause us to crash.
|
||||
*/
|
||||
|
||||
shell->FrameConstructor()->
|
||||
ReconstructDocElementHierarchy(pc); // causes reframe of document
|
||||
}
|
||||
} else { // no pres shell --> full-page plugin
|
||||
|
||||
|
||||
Reference in New Issue
Block a user