author | Arnaud Sourioux <six.dsn@gmail.com> |
Wed, 24 Sep 2014 06:34:00 +0200 | |
changeset 230381 | 1de156cbeddd61f7e5d2dcb78b79b99f558fb224 |
parent 230380 | 22deb0f2260dde5acb0ed10c28c4c19368e92e46 |
child 230382 | 03ed854c4872a0f7109601d3593ef45ce36f5130 |
push id | 4187 |
push user | bhearsum@mozilla.com |
push date | Fri, 28 Nov 2014 15:29:12 +0000 |
treeherder | mozilla-beta@f23cc6a30c11 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | dbaron |
bugs | 1038570 |
milestone | 35.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -258,21 +258,21 @@ public: private: nsCOMPtr<nsIContent> mContent; }; NS_IMPL_ISUPPORTS(PluginTimerCallBack, nsITimerCallback) #endif already_AddRefed<Accessible> -nsAccessibilityService::CreatePluginAccessible(nsObjectFrame* aFrame, +nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame, nsIContent* aContent, Accessible* aContext) { - // nsObjectFrame means a plugin, so we need to use the accessibility support + // nsPluginFrame means a plugin, so we need to use the accessibility support // of the plugin. if (aFrame->GetRect().IsEmpty()) return nullptr; #if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK) nsRefPtr<nsNPAPIPluginInstance> pluginInstance; if (NS_SUCCEEDED(aFrame->GetPluginInstance(getter_AddRefs(pluginInstance))) && pluginInstance) { @@ -1614,17 +1614,17 @@ nsAccessibilityService::CreateAccessible case eImageType: newAcc = new ImageAccessibleWrap(aContent, document); break; case eOuterDocType: newAcc = new OuterDocAccessible(aContent, document); break; case ePluginType: { - nsObjectFrame* objectFrame = do_QueryFrame(aFrame); + nsPluginFrame* objectFrame = do_QueryFrame(aFrame); newAcc = CreatePluginAccessible(objectFrame, aContent, aContext); break; } case eTextLeafType: newAcc = new TextLeafAccessibleWrap(aContent, document); break; default: MOZ_ASSERT(false);
--- a/accessible/base/nsAccessibilityService.h +++ b/accessible/base/nsAccessibilityService.h @@ -10,17 +10,17 @@ #include "mozilla/a11y/DocManager.h" #include "mozilla/a11y/FocusManager.h" #include "mozilla/a11y/SelectionManager.h" #include "nsIObserver.h" class nsImageFrame; -class nsObjectFrame; +class nsPluginFrame; class nsITreeView; namespace mozilla { namespace a11y { class ApplicationAccessible; /** @@ -58,17 +58,17 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIACCESSIBLERETRIEVAL NS_DECL_NSIOBSERVER // nsIAccessibilityService virtual Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell, bool aCanCreate); already_AddRefed<Accessible> - CreatePluginAccessible(nsObjectFrame* aFrame, nsIContent* aContent, + CreatePluginAccessible(nsPluginFrame* aFrame, nsIContent* aContent, Accessible* aContext); /** * Adds/remove ATK root accessible for gtk+ native window to/from children * of the application accessible. */ virtual Accessible* AddNativeRootAccessible(void* aAtkAccessible); virtual void RemoveNativeRootAccessible(Accessible* aRootAccessible);
--- a/accessible/interfaces/nsIAccessibilityService.h +++ b/accessible/interfaces/nsIAccessibilityService.h @@ -19,17 +19,17 @@ class Accessible; } // namespace a11y } // namespace mozilla class nsINode; class nsIContent; class nsIFrame; class nsIPresShell; -class nsObjectFrame; +class nsPluginFrame; // 10ff6dca-b219-4b64-9a4c-67a62b86edce #define NS_IACCESSIBILITYSERVICE_IID \ { 0x84dd9182, 0x6639, 0x4377, \ { 0xa4, 0x13, 0xad, 0xe1, 0xae, 0x4e, 0x52, 0xdd } } class nsIAccessibilityService : public nsIAccessibleRetrieval {
--- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -855,17 +855,17 @@ nsObjectLoadingContent::InstantiatePlugi mInstanceOwner = newOwner; // Ensure the frame did not change during instantiation re-entry (common). // HasNewFrame would not have mInstanceOwner yet, so the new frame would be // dangling. (Bug 854082) nsIFrame* frame = thisContent->GetPrimaryFrame(); if (frame && mInstanceOwner) { - mInstanceOwner->SetFrame(static_cast<nsObjectFrame*>(frame)); + mInstanceOwner->SetFrame(static_cast<nsPluginFrame*>(frame)); // Bug 870216 - Adobe Reader renders with incorrect dimensions until it gets // a second SetWindow call. This is otherwise redundant. mInstanceOwner->CallSetWindow(); } // Set up scripting interfaces. NotifyContentObjectWrapper(); @@ -1291,17 +1291,17 @@ nsObjectLoadingContent::HasNewFrame(nsIO // We are successfully setup as type plugin, but have not spawned an // instance due to a lack of a frame. AsyncStartPluginInstance(); return NS_OK; } // Otherwise, we're just changing frames // Set up relationship between instance owner and frame. - nsObjectFrame *objFrame = static_cast<nsObjectFrame*>(aFrame); + nsPluginFrame *objFrame = static_cast<nsPluginFrame*>(aFrame); mInstanceOwner->SetFrame(objFrame); return NS_OK; } NS_IMETHODIMP nsObjectLoadingContent::GetPluginInstance(nsNPAPIPluginInstance** aInstance) { @@ -2713,23 +2713,23 @@ nsObjectLoadingContent::GetTypeOfContent if (caps & eSupportPlugins && PluginExistsForType(aMIMEType.get())) { // ShouldPlay will handle checking for disabled plugins return eType_Plugin; } return eType_Null; } -nsObjectFrame* +nsPluginFrame* nsObjectLoadingContent::GetExistingFrame() { nsCOMPtr<nsIContent> thisContent = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this)); nsIFrame* frame = thisContent->GetPrimaryFrame(); nsIObjectFrame* objFrame = do_QueryFrame(frame); - return static_cast<nsObjectFrame*>(objFrame); + return static_cast<nsPluginFrame*>(objFrame); } void nsObjectLoadingContent::CreateStaticClone(nsObjectLoadingContent* aDest) const { nsImageLoadingContent::CreateStaticImageClone(aDest); aDest->mType = mType; @@ -3571,17 +3571,17 @@ nsObjectLoadingContent::SetupProtoChain( nsresult nsObjectLoadingContent::GetPluginJSObject(JSContext *cx, JS::Handle<JSObject*> obj, nsNPAPIPluginInstance *plugin_inst, JS::MutableHandle<JSObject*> plugin_obj, JS::MutableHandle<JSObject*> plugin_proto) { // NB: We need an AutoEnterCompartment because we can be called from - // nsObjectFrame when the plugin loads after the JS object for our content + // nsPluginFrame when the plugin loads after the JS object for our content // node has been created. JSAutoCompartment ac(cx, obj); if (plugin_inst) { plugin_inst->GetJSObject(cx, plugin_obj.address()); if (plugin_obj) { if (!::JS_GetPrototype(cx, plugin_obj, plugin_proto)) { return NS_ERROR_UNEXPECTED;
--- a/content/base/src/nsObjectLoadingContent.h +++ b/content/base/src/nsObjectLoadingContent.h @@ -21,17 +21,17 @@ #include "nsIRunnable.h" #include "nsIThreadInternal.h" #include "nsIFrame.h" #include "nsIFrameLoader.h" class nsAsyncInstantiateEvent; class nsStopPluginRunnable; class AutoSetInstantiatingToFalse; -class nsObjectFrame; +class nsPluginFrame; class nsFrameLoader; class nsXULElement; class nsPluginInstanceOwner; namespace mozilla { namespace dom { template<typename T> class Sequence; struct MozPluginParameter; @@ -497,17 +497,17 @@ class nsObjectLoadingContent : public ns * click-to-play or other content policy checks */ ObjectType GetTypeOfContent(const nsCString& aMIMEType); /** * Gets the frame that's associated with this content node. * Does not flush. */ - nsObjectFrame* GetExistingFrame(); + nsPluginFrame* GetExistingFrame(); // Helper class for SetupProtoChain class SetupProtoChainRunner MOZ_FINAL : public nsIRunnable { ~SetupProtoChainRunner(); public: NS_DECL_ISUPPORTS
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -1675,17 +1675,17 @@ nsEventStatus nsPluginInstanceOwner::Pro pluginEvent.lParam = 0; pPluginEvent = &pluginEvent; break; } } if (pPluginEvent && !pPluginEvent->event) { // Don't send null events to plugins. - NS_WARNING("nsObjectFrame ProcessEvent: trying to send null event to plugin."); + NS_WARNING("nsPluginFrame ProcessEvent: trying to send null event to plugin."); return rv; } if (pPluginEvent) { int16_t response = kNPEventNotHandled; mInstance->HandleEvent(const_cast<NPEvent*>(pPluginEvent), &response, NS_PLUGIN_CALL_SAFE_TO_REENTER_GECKO); @@ -2367,17 +2367,17 @@ nsresult nsPluginInstanceOwner::Init(nsI mLastEventloopNestingLevel = GetEventloopNestingLevel(); mContent = aContent; // Get a frame, don't reflow. If a reflow was necessary it should have been // done at a higher level than this (content). nsIFrame* frame = aContent->GetPrimaryFrame(); nsIObjectFrame* iObjFrame = do_QueryFrame(frame); - nsObjectFrame* objFrame = static_cast<nsObjectFrame*>(iObjFrame); + nsPluginFrame* objFrame = static_cast<nsPluginFrame*>(iObjFrame); if (objFrame) { SetFrame(objFrame); // Some plugins require a specific sequence of shutdown and startup when // a page is reloaded. Shutdown happens usually when the last instance // is destroyed. Here we make sure the plugin instance in the old // document is destroyed before we try to create the new one. objFrame->PresContext()->EnsureVisible(); } else { @@ -2575,17 +2575,17 @@ void* nsPluginInstanceOwner::FixUpPlugin { if (!mWidget || !mPluginWindow || !mInstance || !mObjectFrame) return nullptr; nsCOMPtr<nsIPluginWidget> pluginWidget = do_QueryInterface(mWidget); if (!pluginWidget) return nullptr; - // If we've already set up a CGContext in nsObjectFrame::PaintPlugin(), we + // If we've already set up a CGContext in nsPluginFrame::PaintPlugin(), we // don't want calls to SetPluginPortAndDetectChange() to step on our work. if (mInCGPaintLevel < 1) { SetPluginPortAndDetectChange(); } // We'll need the top-level Cocoa window for the Cocoa event model. nsIWidget* widget = mObjectFrame->GetNearestWidget(); if (!widget) @@ -2813,17 +2813,17 @@ nsPluginInstanceOwner::GetContentsScaleF scaleFactor = double(nsPresContext::AppUnitsPerCSSPixel())/ presShell->GetPresContext()->DeviceContext()->UnscaledAppUnitsPerDevPixel(); } #endif *result = scaleFactor; return NS_OK; } -void nsPluginInstanceOwner::SetFrame(nsObjectFrame *aFrame) +void nsPluginInstanceOwner::SetFrame(nsPluginFrame *aFrame) { // Don't do anything if the frame situation hasn't changed. if (mObjectFrame == aFrame) { return; } // If we already have a frame that is changing or going away... if (mObjectFrame) { @@ -2848,17 +2848,17 @@ void nsPluginInstanceOwner::SetFrame(nsO nsFocusManager* fm = nsFocusManager::GetFocusManager(); const nsIContent* content = aFrame->GetContent(); if (fm && content) { mContentFocused = (content == fm->GetFocusedContent()); } } } -nsObjectFrame* nsPluginInstanceOwner::GetFrame() +nsPluginFrame* nsPluginInstanceOwner::GetFrame() { return mObjectFrame; } NS_IMETHODIMP nsPluginInstanceOwner::PrivateModeChanged(bool aEnabled) { return mInstance ? mInstance->PrivateModeStateChanged(aEnabled) : NS_OK; }
--- a/dom/plugins/base/nsPluginInstanceOwner.h +++ b/dom/plugins/base/nsPluginInstanceOwner.h @@ -21,17 +21,17 @@ #ifdef XP_MACOSX #include "mozilla/gfx/QuartzSupport.h" #include <ApplicationServices/ApplicationServices.h> #endif class nsIInputStream; struct nsIntRect; class nsPluginDOMContextMenuListener; -class nsObjectFrame; +class nsPluginFrame; class nsDisplayListBuilder; namespace mozilla { namespace dom { struct MozPluginParameter; } } @@ -138,30 +138,30 @@ public: // store a copy of plugin port info and to detect when it's been changed. void* GetPluginPortCopy(); // Set plugin port info in the plugin (in the 'window' member of the // NPWindow structure passed to the plugin by SetWindow()) and set a // flag (mPluginPortChanged) to indicate whether or not this info has // changed, and SetWindow() needs to be called again. void* SetPluginPortAndDetectChange(); // Flag when we've set up a Thebes (and CoreGraphics) context in - // nsObjectFrame::PaintPlugin(). We need to know this in + // nsPluginFrame::PaintPlugin(). We need to know this in // FixUpPluginWindow() (i.e. we need to know when FixUpPluginWindow() has - // been called from nsObjectFrame::PaintPlugin() when we're using the + // been called from nsPluginFrame::PaintPlugin() when we're using the // CoreGraphics drawing model). void BeginCGPaint(); void EndCGPaint(); #else // XP_MACOSX void UpdateWindowPositionAndClipRect(bool aSetWindow); void UpdateWindowVisibility(bool aVisible); void UpdateDocumentActiveState(bool aIsActive); #endif // XP_MACOSX - void SetFrame(nsObjectFrame *aFrame); - nsObjectFrame* GetFrame(); + void SetFrame(nsPluginFrame *aFrame); + nsPluginFrame* GetFrame(); uint32_t GetLastEventloopNestingLevel() const { return mLastEventloopNestingLevel; } static uint32_t GetEventloopNestingLevel(); void ConsiderNewEventloopNestingLevel() { @@ -271,17 +271,17 @@ private: void RemovePluginView(); bool mFullScreen; void* mJavaView; #endif nsPluginNativeWindow *mPluginWindow; nsRefPtr<nsNPAPIPluginInstance> mInstance; - nsObjectFrame *mObjectFrame; + nsPluginFrame *mObjectFrame; nsIContent *mContent; // WEAK, content owns us nsCString mDocumentBase; bool mWidgetCreationComplete; nsCOMPtr<nsIWidget> mWidget; nsRefPtr<nsPluginHost> mPluginHost; #ifdef XP_MACOSX NP_CGContext mCGPluginPortCopy;
--- a/dom/plugins/base/nsPluginNativeWindowGtk.cpp +++ b/dom/plugins/base/nsPluginNativeWindowGtk.cpp @@ -140,17 +140,17 @@ nsresult nsPluginNativeWindowGtk::CallSe } if (!mSocketWidget) { return NS_ERROR_FAILURE; } // Make sure to resize and re-place the window if required. SetAllocation(); - // Need to reset "window" each time as nsObjectFrame::DidReflow sets it + // Need to reset "window" each time as nsPluginFrame::DidReflow sets it // to the ancestor window. #if (MOZ_WIDGET_GTK == 2) if (GTK_IS_XTBIN(mSocketWidget)) { // Point the NPWindow structures window to the actual X window SetWindow(GTK_XTBIN(mSocketWidget)->xtwindow); } else { // XEmbed or OOP&Xt SetWindow(gtk_socket_get_id(GTK_SOCKET(mSocketWidget))); @@ -220,17 +220,17 @@ nsresult nsPluginNativeWindowGtk::Create SetAllocation(); gtk_widget_show(mSocketWidget); gdk_flush(); SetWindow(gtk_socket_get_id(GTK_SOCKET(mSocketWidget))); // Fill out the ws_info structure. - // (The windowless case is done in nsObjectFrame.cpp.) + // (The windowless case is done in nsPluginFrame.cpp.) GdkWindow *gdkWindow = gdk_x11_window_lookup_for_display(display, GetWindow()); if(!gdkWindow) return NS_ERROR_FAILURE; mWsInfo.display = GDK_WINDOW_XDISPLAY(gdkWindow); #if (MOZ_WIDGET_GTK == 2) mWsInfo.colormap = GDK_COLORMAP_XCOLORMAP(gdk_drawable_get_colormap(gdkWindow)); GdkVisual* gdkVisual = gdk_drawable_get_visual(gdkWindow);
--- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -1943,17 +1943,17 @@ PluginInstanceChild::SharedSurfacePaint( case RENDER_NATIVE: // pass the internal hdc to the plugin UpdatePaintClipRect(pRect); evcopy.wParam = WPARAM(mSharedSurfaceDib.GetHDC()); return mPluginIface->event(&mData, reinterpret_cast<void*>(&evcopy)); break; case RENDER_BACK_ONE: // Handle a double pass render used in alpha extraction for transparent - // plugins. (See nsObjectFrame and gfxWindowsNativeDrawing for details.) + // plugins. (See nsPluginFrame and gfxWindowsNativeDrawing for details.) // We render twice, once to the shared dib, and once to a cache which // we copy back on a second paint. These paints can't be spread across // multiple rpc messages as delays cause animation frame changes. if (!mAlphaExtract.bmp && !AlphaExtractCacheSetup()) { mAlphaExtract.doublePass = RENDER_NATIVE; return false; }
--- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -362,17 +362,17 @@ PluginInstanceParent::AnswerNPN_SetValue const int& drawingModel, OptionalShmem *shmem, CrossProcessMutexHandle *mutex, NPError* result) { *shmem = null_t(); #ifdef XP_MACOSX if (drawingModel == NPDrawingModelCoreAnimation || drawingModel == NPDrawingModelInvalidatingCoreAnimation) { // We need to request CoreGraphics otherwise - // the nsObjectFrame will try to draw a CALayer + // the nsPluginFrame will try to draw a CALayer // that can not be shared across process. mDrawingModel = drawingModel; *result = mNPNIface->setvalue(mNPP, NPPVpluginDrawingModel, (void*)NPDrawingModelCoreGraphics); } else #endif if (drawingModel == NPDrawingModelAsyncBitmapSurface #ifdef XP_WIN @@ -1226,17 +1226,17 @@ PluginInstanceParent::NPP_HandleEvent(vo !wcscmp(szClass, kFlashFullscreenClass)) { return 0; } } break; case WM_WINDOWPOSCHANGED: { - // We send this in nsObjectFrame just before painting + // We send this in nsPluginFrame just before painting return SendWindowPosChanged(npremoteevent); } break; } } #endif #if defined(MOZ_X11)
--- a/dom/plugins/test/testplugin/nptest_macosx.mm +++ b/dom/plugins/test/testplugin/nptest_macosx.mm @@ -95,17 +95,17 @@ RectEquals(const NPRect& r1, const NPRec r1.right == r2.right && r1.bottom == r2.bottom; } void pluginDoSetWindow(InstanceData* instanceData, NPWindow* newWindow) { // Ugh. Due to a terrible Gecko bug, we have to ignore position changes // when the clip rect doesn't change; the position can be wrong - // when set by a path other than nsObjectFrame::FixUpPluginWindow. + // when set by a path other than nsPluginFrame::FixUpPluginWindow. int32_t oldX = instanceData->window.x; int32_t oldY = instanceData->window.y; bool clipChanged = !RectEquals(instanceData->window.clipRect, newWindow->clipRect); instanceData->window = *newWindow; if (!clipChanged) { instanceData->window.x = oldX; instanceData->window.y = oldY;
--- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -2855,17 +2855,17 @@ nsRootPresContext::UnregisterPluginForGe { mRegisteredPlugins.RemoveEntry(aPlugin); } static PLDHashOperator SetPluginHidden(nsRefPtrHashKey<nsIContent>* aEntry, void* userArg) { nsIFrame* root = static_cast<nsIFrame*>(userArg); - nsObjectFrame* f = static_cast<nsObjectFrame*>(aEntry->GetKey()->GetPrimaryFrame()); + nsPluginFrame* f = static_cast<nsPluginFrame*>(aEntry->GetKey()->GetPrimaryFrame()); if (!f) { NS_WARNING("Null frame in SetPluginHidden"); return PL_DHASH_NEXT; } if (!nsLayoutUtils::IsAncestorFrameCrossDoc(root, f)) { // f is not managed by this frame so we should ignore it. return PL_DHASH_NEXT; } @@ -3015,34 +3015,34 @@ SortConfigurations(nsTArray<nsIWidget::C aConfigurations->AppendElement(pluginsToMove[i]); pluginsToMove.RemoveElementAt(i); } } static PLDHashOperator PluginDidSetGeometryEnumerator(nsRefPtrHashKey<nsIContent>* aEntry, void* userArg) { - nsObjectFrame* f = static_cast<nsObjectFrame*>(aEntry->GetKey()->GetPrimaryFrame()); + nsPluginFrame* f = static_cast<nsPluginFrame*>(aEntry->GetKey()->GetPrimaryFrame()); if (!f) { NS_WARNING("Null frame in PluginDidSetGeometryEnumerator"); return PL_DHASH_NEXT; } f->DidSetWidgetGeometry(); return PL_DHASH_NEXT; } struct PluginGetGeometryUpdateClosure { nsTArray<nsIWidget::Configuration> mConfigurations; }; static PLDHashOperator PluginGetGeometryUpdate(nsRefPtrHashKey<nsIContent>* aEntry, void* userArg) { PluginGetGeometryUpdateClosure* closure = static_cast<PluginGetGeometryUpdateClosure*>(userArg); - nsObjectFrame* f = static_cast<nsObjectFrame*>(aEntry->GetKey()->GetPrimaryFrame()); + nsPluginFrame* f = static_cast<nsPluginFrame*>(aEntry->GetKey()->GetPrimaryFrame()); if (!f) { NS_WARNING("Null frame in GetPluginGeometryUpdate"); return PL_DHASH_NEXT; } f->GetWidgetConfiguration(&closure->mConfigurations); return PL_DHASH_NEXT; }
--- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -55,17 +55,17 @@ class nsIAtom; class nsICSSPseudoComparator; struct nsStyleBackground; struct nsStyleBorder; class nsIRunnable; class gfxUserFontSet; class gfxTextPerfMetrics; class nsUserFontSet; struct nsFontFaceRuleContainer; -class nsObjectFrame; +class nsPluginFrame; class nsTransitionManager; class nsAnimationManager; class nsRefreshDriver; class nsIWidget; class nsDeviceContext; namespace mozilla { class EventStateManager; @@ -1440,17 +1440,17 @@ public: bool NeedToComputePluginGeometryUpdates() { return mRegisteredPlugins.Count() > 0; } /** * Compute geometry updates for each plugin given that aList is the display * list for aFrame. The updates are not yet applied; * ApplyPluginGeometryUpdates is responsible for that. In the meantime they - * are stored on each nsObjectFrame. + * are stored on each nsPluginFrame. * This needs to be called even when aFrame is a popup, since although * windowed plugins aren't allowed in popups, windowless plugins are * and ComputePluginGeometryUpdates needs to be called for them. */ void ComputePluginGeometryUpdates(nsIFrame* aFrame, nsDisplayListBuilder* aBuilder, nsDisplayList* aList);
--- a/layout/generic/nsFrameIdList.h +++ b/layout/generic/nsFrameIdList.h @@ -98,17 +98,17 @@ FRAME_ID(nsMathMLmunderFrame) FRAME_ID(nsMathMLmunderoverFrame) FRAME_ID(nsMathMLsemanticsFrame) FRAME_ID(nsMathMLTokenFrame) FRAME_ID(nsMenuBarFrame) FRAME_ID(nsMenuFrame) FRAME_ID(nsMenuPopupFrame) FRAME_ID(nsMeterFrame) FRAME_ID(nsNumberControlFrame) -FRAME_ID(nsObjectFrame) +FRAME_ID(nsPluginFrame) FRAME_ID(nsPageBreakFrame) FRAME_ID(nsPageContentFrame) FRAME_ID(nsPageFrame) FRAME_ID(nsPlaceholderFrame) FRAME_ID(nsPopupSetFrame) FRAME_ID(nsProgressFrame) FRAME_ID(nsProgressMeterFrame) FRAME_ID(nsRangeFrame)
--- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -483,19 +483,19 @@ nsHTMLScrollFrame::ReflowScrolledFrame(S // it to the correct size anyway in PlaceScrollArea. Allowing it to // resize here would size it to the natural height of the frame, // which will usually be different from the scrollport height; // invalidating the difference will cause unnecessary repainting. FinishReflowChild(mHelper.mScrolledFrame, presContext, *aMetrics, &kidReflowState, 0, 0, NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW); - // XXX Some frames (e.g., nsObjectFrame, nsFrameFrame, nsTextFrame) don't bother + // XXX Some frames (e.g., nsPluginFrame, nsFrameFrame, nsTextFrame) don't bother // setting their mOverflowArea. This is wrong because every frame should - // always set mOverflowArea. In fact nsObjectFrame and nsFrameFrame don't + // always set mOverflowArea. In fact nsPluginFrame and nsFrameFrame don't // support the 'outline' property because of this. Rather than fix the world // right now, just fix up the overflow area if necessary. Note that we don't // check HasOverflowRect() because it could be set even though the // overflow area doesn't include the frame bounds. aMetrics->UnionOverflowAreasWithDesiredBounds(); if (MOZ_UNLIKELY(StyleDisplay()->mOverflowClipBox == NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX)) {
--- a/layout/generic/nsPluginFrame.cpp +++ b/layout/generic/nsPluginFrame.cpp @@ -92,17 +92,17 @@ using mozilla::DefaultXDisplay; #endif #ifdef PR_LOGGING static PRLogModuleInfo * GetObjectFrameLog() { static PRLogModuleInfo *sLog; if (!sLog) - sLog = PR_NewLogModule("nsObjectFrame"); + sLog = PR_NewLogModule("nsPluginFrame"); return sLog; } #endif /* PR_LOGGING */ #if defined(XP_MACOSX) && !defined(__LP64__) // The header files QuickdrawAPI.h and QDOffscreen.h are missing on OS X 10.7 // and up (though the QuickDraw APIs defined in them are still present) -- so @@ -140,17 +140,17 @@ extern "C" { #endif /* #if defined(XP_MACOSX) && !defined(__LP64__) */ using namespace mozilla; using namespace mozilla::gfx; using namespace mozilla::layers; class PluginBackgroundSink : public ReadbackSink { public: - PluginBackgroundSink(nsObjectFrame* aFrame, uint64_t aStartSequenceNumber) + PluginBackgroundSink(nsPluginFrame* aFrame, uint64_t aStartSequenceNumber) : mLastSequenceNumber(aStartSequenceNumber), mFrame(aFrame) {} ~PluginBackgroundSink() { if (mFrame) { mFrame->mBackgroundSink = nullptr; } } @@ -182,67 +182,67 @@ protected: mFrame->mInstanceOwner) { mLastSequenceNumber = aSequenceNumber; return true; } return false; } uint64_t mLastSequenceNumber; - nsObjectFrame* mFrame; + nsPluginFrame* mFrame; }; -nsObjectFrame::nsObjectFrame(nsStyleContext* aContext) - : nsObjectFrameSuper(aContext) +nsPluginFrame::nsPluginFrame(nsStyleContext* aContext) + : nsPluginFrameSuper(aContext) , mReflowCallbackPosted(false) { PR_LOG(GetObjectFrameLog(), PR_LOG_DEBUG, - ("Created new nsObjectFrame %p\n", this)); + ("Created new nsPluginFrame %p\n", this)); } -nsObjectFrame::~nsObjectFrame() +nsPluginFrame::~nsPluginFrame() { PR_LOG(GetObjectFrameLog(), PR_LOG_DEBUG, - ("nsObjectFrame %p deleted\n", this)); + ("nsPluginFrame %p deleted\n", this)); } -NS_QUERYFRAME_HEAD(nsObjectFrame) - NS_QUERYFRAME_ENTRY(nsObjectFrame) +NS_QUERYFRAME_HEAD(nsPluginFrame) + NS_QUERYFRAME_ENTRY(nsPluginFrame) NS_QUERYFRAME_ENTRY(nsIObjectFrame) -NS_QUERYFRAME_TAIL_INHERITING(nsObjectFrameSuper) +NS_QUERYFRAME_TAIL_INHERITING(nsPluginFrameSuper) #ifdef ACCESSIBILITY a11y::AccType -nsObjectFrame::AccessibleType() +nsPluginFrame::AccessibleType() { return a11y::ePluginType; } #ifdef XP_WIN -NS_IMETHODIMP nsObjectFrame::GetPluginPort(HWND *aPort) +NS_IMETHODIMP nsPluginFrame::GetPluginPort(HWND *aPort) { *aPort = (HWND) mInstanceOwner->GetPluginPortFromWidget(); return NS_OK; } #endif #endif void -nsObjectFrame::Init(nsIContent* aContent, +nsPluginFrame::Init(nsIContent* aContent, nsContainerFrame* aParent, nsIFrame* aPrevInFlow) { PR_LOG(GetObjectFrameLog(), PR_LOG_DEBUG, - ("Initializing nsObjectFrame %p for content %p\n", this, aContent)); + ("Initializing nsPluginFrame %p for content %p\n", this, aContent)); - nsObjectFrameSuper::Init(aContent, aParent, aPrevInFlow); + nsPluginFrameSuper::Init(aContent, aParent, aPrevInFlow); } void -nsObjectFrame::DestroyFrom(nsIFrame* aDestructRoot) +nsPluginFrame::DestroyFrom(nsIFrame* aDestructRoot) { if (mReflowCallbackPosted) { PresContext()->PresShell()->CancelReflowCallback(this); } // Tell content owner of the instance to disconnect its frame. nsCOMPtr<nsIObjectLoadingContent> objContent(do_QueryInterface(mContent)); NS_ASSERTION(objContent, "Why not an object loading content?"); @@ -254,51 +254,51 @@ nsObjectFrame::DestroyFrom(nsIFrame* aDe mInstanceOwner->SetFrame(nullptr); } objContent->HasNewFrame(nullptr); if (mBackgroundSink) { mBackgroundSink->Destroy(); } - nsObjectFrameSuper::DestroyFrom(aDestructRoot); + nsPluginFrameSuper::DestroyFrom(aDestructRoot); } /* virtual */ void -nsObjectFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext) +nsPluginFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext) { if (HasView()) { nsView* view = GetView(); nsViewManager* vm = view->GetViewManager(); if (vm) { nsViewVisibility visibility = IsHidden() ? nsViewVisibility_kHide : nsViewVisibility_kShow; vm->SetViewVisibility(view, visibility); } } - nsObjectFrameSuper::DidSetStyleContext(aOldStyleContext); + nsPluginFrameSuper::DidSetStyleContext(aOldStyleContext); } nsIAtom* -nsObjectFrame::GetType() const +nsPluginFrame::GetType() const { return nsGkAtoms::objectFrame; } #ifdef DEBUG_FRAME_DUMP nsresult -nsObjectFrame::GetFrameName(nsAString& aResult) const +nsPluginFrame::GetFrameName(nsAString& aResult) const { return MakeFrameName(NS_LITERAL_STRING("ObjectFrame"), aResult); } #endif nsresult -nsObjectFrame::PrepForDrawing(nsIWidget *aWidget) +nsPluginFrame::PrepForDrawing(nsIWidget *aWidget) { mWidget = aWidget; nsView* view = GetView(); NS_ASSERTION(view, "Object frames must have views"); if (!view) { return NS_ERROR_FAILURE; } @@ -406,39 +406,39 @@ nsObjectFrame::PrepForDrawing(nsIWidget return NS_OK; } #define EMBED_DEF_WIDTH 240 #define EMBED_DEF_HEIGHT 200 /* virtual */ nscoord -nsObjectFrame::GetMinISize(nsRenderingContext *aRenderingContext) +nsPluginFrame::GetMinISize(nsRenderingContext *aRenderingContext) { nscoord result = 0; if (!IsHidden(false)) { nsIAtom *atom = mContent->Tag(); if (atom == nsGkAtoms::applet || atom == nsGkAtoms::embed) { result = nsPresContext::CSSPixelsToAppUnits(EMBED_DEF_WIDTH); } } DISPLAY_MIN_WIDTH(this, result); return result; } /* virtual */ nscoord -nsObjectFrame::GetPrefISize(nsRenderingContext *aRenderingContext) +nsPluginFrame::GetPrefISize(nsRenderingContext *aRenderingContext) { - return nsObjectFrame::GetMinISize(aRenderingContext); + return nsPluginFrame::GetMinISize(aRenderingContext); } void -nsObjectFrame::GetDesiredSize(nsPresContext* aPresContext, +nsPluginFrame::GetDesiredSize(nsPresContext* aPresContext, const nsHTMLReflowState& aReflowState, nsHTMLReflowMetrics& aMetrics) { // By default, we have no area aMetrics.ClearSize(); if (IsHidden(false)) { return; @@ -493,22 +493,22 @@ nsObjectFrame::GetDesiredSize(nsPresCont // XXXbz don't add in the border and padding, because we screw up our // plugin's size and positioning if we do... Eventually we _do_ want to // paint borders, though! At that point, we will need to adjust the desired // size either here or in Reflow.... Further, we will need to fix Paint() to // call the superclass in all cases. } void -nsObjectFrame::Reflow(nsPresContext* aPresContext, +nsPluginFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus) { - DO_GLOBAL_REFLOW_COUNT("nsObjectFrame"); + DO_GLOBAL_REFLOW_COUNT("nsPluginFrame"); DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus); // Get our desired size GetDesiredSize(aPresContext, aReflowState, aMetrics); aMetrics.SetOverflowAreasToDesiredBounds(); FinishAndStoreOverflow(&aMetrics); // delay plugin instantiation until all children have @@ -543,31 +543,31 @@ nsObjectFrame::Reflow(nsPresContext* aStatus = NS_FRAME_COMPLETE; NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics); } ///////////// nsIReflowCallback /////////////// bool -nsObjectFrame::ReflowFinished() +nsPluginFrame::ReflowFinished() { mReflowCallbackPosted = false; CallSetWindow(); return true; } void -nsObjectFrame::ReflowCallbackCanceled() +nsPluginFrame::ReflowCallbackCanceled() { mReflowCallbackPosted = false; } void -nsObjectFrame::FixupWindow(const nsSize& aSize) +nsPluginFrame::FixupWindow(const nsSize& aSize) { nsPresContext* presContext = PresContext(); if (!mInstanceOwner) return; NPWindow *window; mInstanceOwner->GetWindow(window); @@ -608,17 +608,17 @@ nsObjectFrame::FixupWindow(const nsSize& #else mInstanceOwner->UpdateWindowPositionAndClipRect(false); #endif NotifyPluginReflowObservers(); } nsresult -nsObjectFrame::CallSetWindow(bool aCheckIsHidden) +nsPluginFrame::CallSetWindow(bool aCheckIsHidden) { NPWindow *win = nullptr; nsresult rv = NS_ERROR_FAILURE; nsRefPtr<nsNPAPIPluginInstance> pi; if (!mInstanceOwner || NS_FAILED(rv = mInstanceOwner->GetInstance(getter_AddRefs(pi))) || !pi || @@ -678,17 +678,17 @@ nsObjectFrame::CallSetWindow(bool aCheck } instanceOwnerRef->ReleasePluginPort(window->window); return rv; } void -nsObjectFrame::RegisterPluginForGeometryUpdates() +nsPluginFrame::RegisterPluginForGeometryUpdates() { nsRootPresContext* rpc = PresContext()->GetRootPresContext(); NS_ASSERTION(rpc, "We should have a root pres context!"); if (mRootPresContextRegisteredWith == rpc || !rpc) { // Already registered with current root pres context, // or null root pres context... return; } @@ -697,28 +697,28 @@ nsObjectFrame::RegisterPluginForGeometry // re-register with our current one... UnregisterPluginForGeometryUpdates(); } mRootPresContextRegisteredWith = rpc; mRootPresContextRegisteredWith->RegisterPluginForGeometryUpdates(mContent); } void -nsObjectFrame::UnregisterPluginForGeometryUpdates() +nsPluginFrame::UnregisterPluginForGeometryUpdates() { if (!mRootPresContextRegisteredWith) { // Not registered... return; } mRootPresContextRegisteredWith->UnregisterPluginForGeometryUpdates(mContent); mRootPresContextRegisteredWith = nullptr; } void -nsObjectFrame::SetInstanceOwner(nsPluginInstanceOwner* aOwner) +nsPluginFrame::SetInstanceOwner(nsPluginInstanceOwner* aOwner) { // The ownership model here is historically fuzzy. This should only be called // by nsPluginInstanceOwner when it is given a new frame, and // nsObjectLoadingContent should be arbitrating frame-ownership via its // HasNewFrame callback. mInstanceOwner = aOwner; if (mInstanceOwner) { return; @@ -738,25 +738,25 @@ nsObjectFrame::SetInstanceOwner(nsPlugin mWidget->Show(false); mWidget->Enable(false); mWidget->SetParent(nullptr); } } } bool -nsObjectFrame::IsFocusable(int32_t *aTabIndex, bool aWithMouse) +nsPluginFrame::IsFocusable(int32_t *aTabIndex, bool aWithMouse) { if (aTabIndex) *aTabIndex = -1; - return nsObjectFrameSuper::IsFocusable(aTabIndex, aWithMouse); + return nsPluginFrameSuper::IsFocusable(aTabIndex, aWithMouse); } bool -nsObjectFrame::IsHidden(bool aCheckVisibilityStyle) const +nsPluginFrame::IsHidden(bool aCheckVisibilityStyle) const { if (aCheckVisibilityStyle) { if (!StyleVisibility()->IsVisibleOrCollapsed()) return true; } // only <embed> tags support the HIDDEN attribute if (mContent->Tag() == nsGkAtoms::embed) { @@ -775,17 +775,17 @@ nsObjectFrame::IsHidden(bool aCheckVisib !hidden.LowerCaseEqualsLiteral("off")))) { return true; } } return false; } -nsIntPoint nsObjectFrame::GetWindowOriginInPixels(bool aWindowless) +nsIntPoint nsPluginFrame::GetWindowOriginInPixels(bool aWindowless) { nsView * parentWithView; nsPoint origin(0,0); GetOffsetFromView(origin, &parentWithView); // if it's windowless, let's make sure we have our origin set right // it may need to be corrected, like after scrolling @@ -796,61 +796,61 @@ nsIntPoint nsObjectFrame::GetWindowOrigi } origin += GetContentRectRelativeToSelf().TopLeft(); return nsIntPoint(PresContext()->AppUnitsToDevPixels(origin.x), PresContext()->AppUnitsToDevPixels(origin.y)); } void -nsObjectFrame::DidReflow(nsPresContext* aPresContext, +nsPluginFrame::DidReflow(nsPresContext* aPresContext, const nsHTMLReflowState* aReflowState, nsDidReflowStatus aStatus) { // Do this check before calling the superclass, as that clears // NS_FRAME_FIRST_REFLOW if (aStatus == nsDidReflowStatus::FINISHED && (GetStateBits() & NS_FRAME_FIRST_REFLOW)) { nsCOMPtr<nsIObjectLoadingContent> objContent(do_QueryInterface(mContent)); NS_ASSERTION(objContent, "Why not an object loading content?"); objContent->HasNewFrame(this); } - nsObjectFrameSuper::DidReflow(aPresContext, aReflowState, aStatus); + nsPluginFrameSuper::DidReflow(aPresContext, aReflowState, aStatus); // The view is created hidden; once we have reflowed it and it has been // positioned then we show it. if (aStatus != nsDidReflowStatus::FINISHED) return; if (HasView()) { nsView* view = GetView(); nsViewManager* vm = view->GetViewManager(); if (vm) vm->SetViewVisibility(view, IsHidden() ? nsViewVisibility_kHide : nsViewVisibility_kShow); } } /* static */ void -nsObjectFrame::PaintPrintPlugin(nsIFrame* aFrame, nsRenderingContext* aCtx, +nsPluginFrame::PaintPrintPlugin(nsIFrame* aFrame, nsRenderingContext* aCtx, const nsRect& aDirtyRect, nsPoint aPt) { gfxContext* ctx = aCtx->ThebesContext(); // Translate the context: nsPoint pt = aPt + aFrame->GetContentRectRelativeToSelf().TopLeft(); gfxPoint devPixelPt = nsLayoutUtils::PointToGfxPoint(pt, aFrame->PresContext()->AppUnitsPerDevPixel()); gfxContextMatrixAutoSaveRestore autoSR(ctx); ctx->SetMatrix(ctx->CurrentMatrix().Translate(devPixelPt)); // FIXME - Bug 385435: Doesn't aDirtyRect need translating too? - static_cast<nsObjectFrame*>(aFrame)->PrintPlugin(*aCtx, aDirtyRect); + static_cast<nsPluginFrame*>(aFrame)->PrintPlugin(*aCtx, aDirtyRect); } /** * nsDisplayPluginReadback creates an active ReadbackLayer. The ReadbackLayer * obtains from the compositor the contents of the window underneath * the ReadbackLayer, which we then use as an opaque buffer for plugins to * asynchronously draw onto. */ @@ -871,17 +871,17 @@ public: bool* aSnap) MOZ_OVERRIDE; NS_DISPLAY_DECL_NAME("PluginReadback", TYPE_PLUGIN_READBACK) virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE { - return static_cast<nsObjectFrame*>(mFrame)->BuildLayer(aBuilder, aManager, this, aContainerParameters); + return static_cast<nsPluginFrame*>(mFrame)->BuildLayer(aBuilder, aManager, this, aContainerParameters); } virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerLayerParameters& aParameters) MOZ_OVERRIDE { return LAYER_ACTIVE; } @@ -920,17 +920,17 @@ public: bool* aSnap) MOZ_OVERRIDE; NS_DISPLAY_DECL_NAME("PluginVideo", TYPE_PLUGIN_VIDEO) virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE { - return static_cast<nsObjectFrame*>(mFrame)->BuildLayer(aBuilder, aManager, this, aContainerParameters); + return static_cast<nsPluginFrame*>(mFrame)->BuildLayer(aBuilder, aManager, this, aContainerParameters); } virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerLayerParameters& aParameters) MOZ_OVERRIDE { return LAYER_ACTIVE; } @@ -956,27 +956,27 @@ nsDisplayPlugin::GetBounds(nsDisplayList *aSnap = true; return GetDisplayItemBounds(aBuilder, this, mFrame); } void nsDisplayPlugin::Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) { - nsObjectFrame* f = static_cast<nsObjectFrame*>(mFrame); + nsPluginFrame* f = static_cast<nsPluginFrame*>(mFrame); bool snap; f->PaintPlugin(aBuilder, *aCtx, mVisibleRect, GetBounds(aBuilder, &snap)); } bool nsDisplayPlugin::ComputeVisibility(nsDisplayListBuilder* aBuilder, nsRegion* aVisibleRegion) { if (aBuilder->IsForPluginGeometry()) { - nsObjectFrame* f = static_cast<nsObjectFrame*>(mFrame); + nsPluginFrame* f = static_cast<nsPluginFrame*>(mFrame); if (!aBuilder->IsInTransform() || f->IsPaintedByGecko()) { // Since transforms induce reference frames, we don't need to worry // about this method fluffing out due to non-rectilinear transforms. nsRect rAncestor = nsLayoutUtils::TransformFrameRectToAncestor(f, f->GetContentRectRelativeToSelf(), ReferenceFrame()); nscoord appUnitsPerDevPixel = ReferenceFrame()->PresContext()->AppUnitsPerDevPixel(); f->mNextConfigurationBounds = rAncestor.ToNearestPixels(appUnitsPerDevPixel); @@ -1011,17 +1011,17 @@ nsDisplayPlugin::ComputeVisibility(nsDis } nsRegion nsDisplayPlugin::GetOpaqueRegion(nsDisplayListBuilder* aBuilder, bool* aSnap) { *aSnap = false; nsRegion result; - nsObjectFrame* f = static_cast<nsObjectFrame*>(mFrame); + nsPluginFrame* f = static_cast<nsPluginFrame*>(mFrame); if (!aBuilder->IsForPluginGeometry()) { nsIWidget* widget = f->GetWidget(); if (widget) { // Be conservative and treat plugins with widgets as not opaque, // because that's simple and we might need the content under the widget // if the widget is unexpectedly clipped away. (As can happen when // chrome content over a plugin forces us to clip out the plugin for // security reasons.) @@ -1040,31 +1040,31 @@ nsDisplayPlugin::GetOpaqueRegion(nsDispl result = bounds; } } return result; } nsresult -nsObjectFrame::PluginEventNotifier::Run() { +nsPluginFrame::PluginEventNotifier::Run() { nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService(); obsSvc->NotifyObservers(nullptr, "plugin-changed-event", mEventType.get()); return NS_OK; } void -nsObjectFrame::NotifyPluginReflowObservers() +nsPluginFrame::NotifyPluginReflowObservers() { nsContentUtils::AddScriptRunner(new PluginEventNotifier(NS_LITERAL_STRING("reflow"))); } void -nsObjectFrame::DidSetWidgetGeometry() +nsPluginFrame::DidSetWidgetGeometry() { #if defined(XP_MACOSX) if (mInstanceOwner) { mInstanceOwner->FixUpPluginWindow(nsPluginInstanceOwner::ePluginPaintEnable); } #else if (!mWidget && mInstanceOwner) { // UpdateWindowVisibility will notify the plugin of position changes @@ -1075,31 +1075,31 @@ nsObjectFrame::DidSetWidgetGeometry() mInstanceOwner->UpdateWindowVisibility( nsLayoutUtils::IsPopup(nsLayoutUtils::GetDisplayRootFrame(this)) || !mNextConfigurationBounds.IsEmpty()); } #endif } bool -nsObjectFrame::IsOpaque() const +nsPluginFrame::IsOpaque() const { #if defined(XP_MACOSX) // ??? return false; #elif defined(MOZ_WIDGET_ANDROID) // We don't know, so just assume transparent return false; #else return !IsTransparentMode(); #endif } bool -nsObjectFrame::IsTransparentMode() const +nsPluginFrame::IsTransparentMode() const { #if defined(XP_MACOSX) // ??? return false; #else if (!mInstanceOwner) return false; @@ -1120,33 +1120,33 @@ nsObjectFrame::IsTransparentMode() const bool transparent = false; pi->IsTransparent(&transparent); return transparent; #endif } void -nsObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, +nsPluginFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { // XXX why are we painting collapsed object frames? if (!IsVisibleOrCollapsedForPainting(aBuilder)) return; DisplayBorderBackgroundOutline(aBuilder, aLists); nsPresContext::nsPresContextType type = PresContext()->Type(); // If we are painting in Print Preview do nothing.... if (type == nsPresContext::eContext_PrintPreview) return; - DO_GLOBAL_REFLOW_COUNT_DSP("nsObjectFrame"); + DO_GLOBAL_REFLOW_COUNT_DSP("nsPluginFrame"); #ifndef XP_MACOSX if (mWidget && aBuilder->IsInTransform()) { // Windowed plugins should not be rendered inside a transform. return; } #endif @@ -1202,17 +1202,17 @@ nsObjectFrame::BuildDisplayList(nsDispla #endif aLists.Content()->AppendNewToTop(new (aBuilder) nsDisplayPlugin(aBuilder, this)); } } void -nsObjectFrame::PrintPlugin(nsRenderingContext& aRenderingContext, +nsPluginFrame::PrintPlugin(nsRenderingContext& aRenderingContext, const nsRect& aDirtyRect) { nsCOMPtr<nsIObjectLoadingContent> obj(do_QueryInterface(mContent)); if (!obj) return; nsIFrame* frame = nullptr; obj->GetPrintFrame(&frame); @@ -1415,33 +1415,33 @@ nsObjectFrame::PrintPlugin(nsRenderingCo // XXX Nav 4.x always sent a SetWindow call after print. Should we do the same? // XXX Calling DidReflow here makes no sense!!! nsDidReflowStatus status = nsDidReflowStatus::FINISHED; // should we use a special status? frame->DidReflow(presContext, nullptr, status); // DidReflow will take care of it } nsRect -nsObjectFrame::GetPaintedRect(nsDisplayPlugin* aItem) +nsPluginFrame::GetPaintedRect(nsDisplayPlugin* aItem) { if (!mInstanceOwner) return nsRect(); nsRect r = GetContentRectRelativeToSelf(); if (!mInstanceOwner->UseAsyncRendering()) return r; nsIntSize size = mInstanceOwner->GetCurrentImageSize(); nsPresContext* pc = PresContext(); r.IntersectRect(r, nsRect(0, 0, pc->DevPixelsToAppUnits(size.width), pc->DevPixelsToAppUnits(size.height))); return r; } LayerState -nsObjectFrame::GetLayerState(nsDisplayListBuilder* aBuilder, +nsPluginFrame::GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager) { if (!mInstanceOwner) return LAYER_NONE; #ifdef MOZ_WIDGET_ANDROID // We always want a layer on Honeycomb and later if (AndroidBridge::Bridge()->GetAPIVersion() >= 11) @@ -1451,17 +1451,17 @@ nsObjectFrame::GetLayerState(nsDisplayLi if (!mInstanceOwner->UseAsyncRendering()) { return LAYER_NONE; } return LAYER_ACTIVE; } already_AddRefed<Layer> -nsObjectFrame::BuildLayer(nsDisplayListBuilder* aBuilder, +nsPluginFrame::BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, nsDisplayItem* aItem, const ContainerLayerParameters& aContainerParameters) { if (!mInstanceOwner) return nullptr; NPWindow* window = nullptr; @@ -1589,17 +1589,17 @@ nsObjectFrame::BuildLayer(nsDisplayListB gfxPoint p = r.TopLeft() + aContainerParameters.mOffset; Matrix transform = Matrix::Translation(p.x, p.y); layer->SetBaseTransform(Matrix4x4::From2D(transform)); return layer.forget(); } void -nsObjectFrame::PaintPlugin(nsDisplayListBuilder* aBuilder, +nsPluginFrame::PaintPlugin(nsDisplayListBuilder* aBuilder, nsRenderingContext& aRenderingContext, const nsRect& aDirtyRect, const nsRect& aPluginRect) { #if defined(MOZ_WIDGET_ANDROID) if (mInstanceOwner) { gfxRect frameGfxRect = PresContext()->AppUnitsToGfxUnits(aPluginRect); gfxRect dirtyGfxRect = @@ -1821,17 +1821,17 @@ nsObjectFrame::PaintPlugin(nsDisplayList } ctx->SetMatrix(currentMatrix); } #endif } nsresult -nsObjectFrame::HandleEvent(nsPresContext* aPresContext, +nsPluginFrame::HandleEvent(nsPresContext* aPresContext, WidgetGUIEvent* anEvent, nsEventStatus* anEventStatus) { NS_ENSURE_ARG_POINTER(anEvent); NS_ENSURE_ARG_POINTER(anEventStatus); nsresult rv = NS_OK; if (!mInstanceOwner) @@ -1864,17 +1864,17 @@ nsObjectFrame::HandleEvent(nsPresContext anEvent->IsNativeEventDelivererForPlugin()) { *anEventStatus = mInstanceOwner->ProcessEvent(*anEvent); // Due to plugin code reentering Gecko, this frame may be dead at this // point. return rv; } #ifdef XP_WIN - rv = nsObjectFrameSuper::HandleEvent(aPresContext, anEvent, anEventStatus); + rv = nsPluginFrameSuper::HandleEvent(aPresContext, anEvent, anEventStatus); return rv; #endif #ifdef XP_MACOSX // we want to process some native mouse events in the cocoa event model if ((anEvent->message == NS_MOUSE_ENTER || anEvent->message == NS_WHEEL_WHEEL) && mInstanceOwner->GetEventModel() == NPEventModelCocoa) { @@ -1888,76 +1888,76 @@ nsObjectFrame::HandleEvent(nsPresContext // and mouse-up) are needed to make the routing of mouse events while // dragging conform to standard OS X practice, and to the Cocoa NPAPI spec. // See bug 525078 and bug 909678. if (anEvent->message == NS_MOUSE_BUTTON_DOWN) { nsIPresShell::SetCapturingContent(GetContent(), CAPTURE_IGNOREALLOWED); } #endif - rv = nsObjectFrameSuper::HandleEvent(aPresContext, anEvent, anEventStatus); + rv = nsPluginFrameSuper::HandleEvent(aPresContext, anEvent, anEventStatus); // We need to be careful from this point because the call to - // nsObjectFrameSuper::HandleEvent() might have killed us. + // nsPluginFrameSuper::HandleEvent() might have killed us. #ifdef XP_MACOSX if (anEvent->message == NS_MOUSE_BUTTON_UP) { nsIPresShell::SetCapturingContent(nullptr, 0); } #endif return rv; } nsresult -nsObjectFrame::GetPluginInstance(nsNPAPIPluginInstance** aPluginInstance) +nsPluginFrame::GetPluginInstance(nsNPAPIPluginInstance** aPluginInstance) { *aPluginInstance = nullptr; if (!mInstanceOwner) { return NS_OK; } return mInstanceOwner->GetInstance(aPluginInstance); } nsresult -nsObjectFrame::GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor) +nsPluginFrame::GetCursor(const nsPoint& aPoint, nsIFrame::Cursor& aCursor) { if (!mInstanceOwner) { return NS_ERROR_FAILURE; } nsRefPtr<nsNPAPIPluginInstance> inst; mInstanceOwner->GetInstance(getter_AddRefs(inst)); if (!inst) { return NS_ERROR_FAILURE; } bool useDOMCursor = static_cast<nsNPAPIPluginInstance*>(inst.get())->UsesDOMForCursor(); if (!useDOMCursor) { return NS_ERROR_FAILURE; } - return nsObjectFrameSuper::GetCursor(aPoint, aCursor); + return nsPluginFrameSuper::GetCursor(aPoint, aCursor); } void -nsObjectFrame::SetIsDocumentActive(bool aIsActive) +nsPluginFrame::SetIsDocumentActive(bool aIsActive) { #ifndef XP_MACOSX if (mInstanceOwner) { mInstanceOwner->UpdateDocumentActiveState(aIsActive); } #endif } // static nsIObjectFrame * -nsObjectFrame::GetNextObjectFrame(nsPresContext* aPresContext, nsIFrame* aRoot) +nsPluginFrame::GetNextObjectFrame(nsPresContext* aPresContext, nsIFrame* aRoot) { nsIFrame* child = aRoot->GetFirstPrincipalChild(); while (child) { nsIObjectFrame* outFrame = do_QueryFrame(child); if (outFrame) { nsRefPtr<nsNPAPIPluginInstance> pi; outFrame->GetPluginInstance(getter_AddRefs(pi)); // make sure we have a REAL plugin @@ -1970,52 +1970,52 @@ nsObjectFrame::GetNextObjectFrame(nsPres return outFrame; child = child->GetNextSibling(); } return nullptr; } /*static*/ void -nsObjectFrame::BeginSwapDocShells(nsISupports* aSupports, void*) +nsPluginFrame::BeginSwapDocShells(nsISupports* aSupports, void*) { NS_PRECONDITION(aSupports, ""); nsCOMPtr<nsIContent> content(do_QueryInterface(aSupports)); if (!content) { return; } // This function is called from a document content enumerator so we need - // to filter out the nsObjectFrames and ignore the rest. + // to filter out the nsPluginFrames and ignore the rest. nsIObjectFrame* obj = do_QueryFrame(content->GetPrimaryFrame()); if (!obj) return; - nsObjectFrame* objectFrame = static_cast<nsObjectFrame*>(obj); + nsPluginFrame* objectFrame = static_cast<nsPluginFrame*>(obj); NS_ASSERTION(!objectFrame->mWidget || objectFrame->mWidget->GetParent(), "Plugin windows must not be toplevel"); objectFrame->UnregisterPluginForGeometryUpdates(); } /*static*/ void -nsObjectFrame::EndSwapDocShells(nsISupports* aSupports, void*) +nsPluginFrame::EndSwapDocShells(nsISupports* aSupports, void*) { NS_PRECONDITION(aSupports, ""); nsCOMPtr<nsIContent> content(do_QueryInterface(aSupports)); if (!content) { return; } // This function is called from a document content enumerator so we need - // to filter out the nsObjectFrames and ignore the rest. + // to filter out the nsPluginFrames and ignore the rest. nsIObjectFrame* obj = do_QueryFrame(content->GetPrimaryFrame()); if (!obj) return; - nsObjectFrame* objectFrame = static_cast<nsObjectFrame*>(obj); + nsPluginFrame* objectFrame = static_cast<nsPluginFrame*>(obj); nsRootPresContext* rootPC = objectFrame->PresContext()->GetRootPresContext(); NS_ASSERTION(rootPC, "unable to register the plugin frame"); nsIWidget* widget = objectFrame->mWidget; if (widget) { // Reparent the widget. nsIWidget* parent = rootPC->PresShell()->GetRootFrame()->GetNearestWidget(); widget->SetParent(parent); @@ -2033,22 +2033,22 @@ nsObjectFrame::EndSwapDocShells(nsISuppo #else objectFrame->RegisterPluginForGeometryUpdates(); #endif } nsIFrame* NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { - return new (aPresShell) nsObjectFrame(aContext); + return new (aPresShell) nsPluginFrame(aContext); } bool -nsObjectFrame::IsPaintedByGecko() const +nsPluginFrame::IsPaintedByGecko() const { #ifdef XP_MACOSX return true; #else return !mWidget; #endif } -NS_IMPL_FRAMEARENA_HELPERS(nsObjectFrame) +NS_IMPL_FRAMEARENA_HELPERS(nsPluginFrame)
--- a/layout/generic/nsPluginFrame.h +++ b/layout/generic/nsPluginFrame.h @@ -1,17 +1,17 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* rendering objects for replaced elements implemented by a plugin */ -#ifndef nsObjectFrame_h___ -#define nsObjectFrame_h___ +#ifndef nsPluginFrame_h___ +#define nsPluginFrame_h___ #include "mozilla/Attributes.h" #include "nsIObjectFrame.h" #include "nsFrame.h" #include "nsRegion.h" #include "nsDisplayList.h" #include "nsIReflowCallback.h" @@ -35,34 +35,34 @@ class nsPluginInstanceOwner; namespace mozilla { namespace layers { class ImageContainer; class Layer; class LayerManager; } } -typedef nsFrame nsObjectFrameSuper; +typedef nsFrame nsPluginFrameSuper; -class nsObjectFrame : public nsObjectFrameSuper, +class nsPluginFrame : public nsPluginFrameSuper, public nsIObjectFrame, public nsIReflowCallback { public: typedef mozilla::LayerState LayerState; typedef mozilla::layers::Layer Layer; typedef mozilla::layers::LayerManager LayerManager; typedef mozilla::layers::ImageContainer ImageContainer; typedef mozilla::ContainerLayerParameters ContainerLayerParameters; NS_DECL_FRAMEARENA_HELPERS friend nsIFrame* NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); NS_DECL_QUERYFRAME - NS_DECL_QUERYFRAME_TARGET(nsObjectFrame) + NS_DECL_QUERYFRAME_TARGET(nsPluginFrame) virtual void Init(nsIContent* aContent, nsContainerFrame* aParent, nsIFrame* aPrevInFlow) MOZ_OVERRIDE; virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE; virtual void Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, @@ -78,17 +78,17 @@ public: virtual nsresult HandleEvent(nsPresContext* aPresContext, mozilla::WidgetGUIEvent* aEvent, nsEventStatus* aEventStatus) MOZ_OVERRIDE; virtual nsIAtom* GetType() const MOZ_OVERRIDE; virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE { - return nsObjectFrameSuper::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced)); + return nsPluginFrameSuper::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced)); } virtual bool NeedsView() MOZ_OVERRIDE { return true; } #ifdef DEBUG_FRAME_DUMP virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE; #endif @@ -178,24 +178,24 @@ public: /** * Get the rectangle (relative to this frame) which it will paint. Normally * the frame's content-box but may be smaller if the plugin is rendering * asynchronously and has a different-sized image temporarily. */ nsRect GetPaintedRect(nsDisplayPlugin* aItem); /** - * If aSupports has a nsObjectFrame, then prepare it for a DocShell swap. + * If aSupports has a nsPluginFrame, then prepare it for a DocShell swap. * @see nsSubDocumentFrame::BeginSwapDocShells. * There will be a call to EndSwapDocShells after we were moved to the * new view tree. */ static void BeginSwapDocShells(nsISupports* aSupports, void*); /** - * If aSupports has a nsObjectFrame, then set it up after a DocShell swap. + * If aSupports has a nsPluginFrame, then set it up after a DocShell swap. * @see nsSubDocumentFrame::EndSwapDocShells. */ static void EndSwapDocShells(nsISupports* aSupports, void*); nsIWidget* GetWidget() MOZ_OVERRIDE { return mInnerView ? mWidget : nullptr; } /** * Adjust the plugin's idea of its size, using aSize as its new size. @@ -206,18 +206,18 @@ public: /* * Sets up the plugin window and calls SetWindow on the plugin. */ nsresult CallSetWindow(bool aCheckIsHidden = true); void SetInstanceOwner(nsPluginInstanceOwner* aOwner); protected: - explicit nsObjectFrame(nsStyleContext* aContext); - virtual ~nsObjectFrame(); + explicit nsPluginFrame(nsStyleContext* aContext); + virtual ~nsPluginFrame(); // NOTE: This frame class does not inherit from |nsLeafFrame|, so // this is not a virtual method implementation. void GetDesiredSize(nsPresContext* aPresContext, const nsHTMLReflowState& aReflowState, nsHTMLReflowMetrics& aDesiredSize); bool IsFocusable(int32_t *aTabIndex = nullptr, @@ -268,17 +268,17 @@ private: nsString mEventType; }; nsPluginInstanceOwner* mInstanceOwner; // WEAK nsView* mInnerView; nsCOMPtr<nsIWidget> mWidget; nsIntRect mWindowlessRect; /** - * This is owned by the ReadbackLayer for this nsObjectFrame. It is + * This is owned by the ReadbackLayer for this nsPluginFrame. It is * automatically cleared if the PluginBackgroundSink is destroyed. */ PluginBackgroundSink* mBackgroundSink; /** * Bounds that we should set the plugin's widget to in the next composite, * for plugins with widgets. For plugins without widgets, bounds in device * pixels relative to the nearest frame that's a display list reference frame. @@ -322,24 +322,24 @@ public: nsRegion* aVisibleRegion) MOZ_OVERRIDE; NS_DISPLAY_DECL_NAME("Plugin", TYPE_PLUGIN) virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE { - return static_cast<nsObjectFrame*>(mFrame)->BuildLayer(aBuilder, + return static_cast<nsPluginFrame*>(mFrame)->BuildLayer(aBuilder, aManager, this, aContainerParameters); } virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerLayerParameters& aParameters) MOZ_OVERRIDE { - return static_cast<nsObjectFrame*>(mFrame)->GetLayerState(aBuilder, + return static_cast<nsPluginFrame*>(mFrame)->GetLayerState(aBuilder, aManager); } }; -#endif /* nsObjectFrame_h___ */ +#endif /* nsPluginFrame_h___ */
--- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -1016,17 +1016,17 @@ BeginSwapDocShellsForDocument(nsIDocumen shell->SetNeverPainting(true); nsIFrame* rootFrame = shell->GetRootFrame(); if (rootFrame) { ::DestroyDisplayItemDataForFrames(rootFrame); } } aDocument->EnumerateActivityObservers( - nsObjectFrame::BeginSwapDocShells, nullptr); + nsPluginFrame::BeginSwapDocShells, nullptr); aDocument->EnumerateSubDocuments(BeginSwapDocShellsForDocument, nullptr); return true; } static nsView* BeginSwapDocShellsForViews(nsView* aSibling) { // Collect the removed sibling views in reverse order in 'removedViews'. @@ -1113,17 +1113,17 @@ EndSwapDocShellsForDocument(nsIDocument* } nsCOMPtr<nsIContentViewer> prev; cv->GetPreviousViewer(getter_AddRefs(prev)); cv = prev; } } aDocument->EnumerateActivityObservers( - nsObjectFrame::EndSwapDocShells, nullptr); + nsPluginFrame::EndSwapDocShells, nullptr); aDocument->EnumerateSubDocuments(EndSwapDocShellsForDocument, nullptr); return true; } static void EndSwapDocShellsForViews(nsView* aSibling) { for ( ; aSibling; aSibling = aSibling->GetNextSibling()) {
--- a/layout/mathml/nsMathMLmactionFrame.cpp +++ b/layout/mathml/nsMathMLmactionFrame.cpp @@ -235,17 +235,17 @@ nsMathMLmactionFrame::AttributeChanged(i // Event handlers // ################################################################ NS_IMPL_ISUPPORTS(nsMathMLmactionFrame::MouseListener, nsIDOMEventListener) // helper to show a msg on the status bar -// curled from nsObjectFrame.cpp ... +// curled from nsPluginFrame.cpp ... void ShowStatus(nsPresContext* aPresContext, nsString& aStatusMsg) { nsCOMPtr<nsIDocShellTreeItem> docShellItem(aPresContext->GetDocShell()); if (docShellItem) { nsCOMPtr<nsIDocShellTreeOwner> treeOwner; docShellItem->GetTreeOwner(getter_AddRefs(treeOwner)); if (treeOwner) {