mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
DeCOMtaminate nsIFrame::GetView and SetView, and add HasView, GetClosestView, and AreAncestorViewsVisible to consolidate common patterns. b=208004 r+sr=roc
This commit is contained in:
parent
35ff46488c
commit
02423381a1
@ -151,9 +151,8 @@ inFlasher::RepaintElement(nsIDOMElement* aElement)
|
|||||||
nsIFrame* parentWithView = nsnull;
|
nsIFrame* parentWithView = nsnull;
|
||||||
frame->GetParentWithView(pcontext, &parentWithView);
|
frame->GetParentWithView(pcontext, &parentWithView);
|
||||||
if (parentWithView) {
|
if (parentWithView) {
|
||||||
nsIView* view = nsnull;
|
nsIView* view = parentWithView->GetViewExternal(pcontext);
|
||||||
nsresult rv= parentWithView->GetView(pcontext, &view);
|
if (view) {
|
||||||
if (NS_SUCCEEDED(rv) && view) {
|
|
||||||
nsCOMPtr<nsIViewManager> viewManager;
|
nsCOMPtr<nsIViewManager> viewManager;
|
||||||
view->GetViewManager(*getter_AddRefs(viewManager));
|
view->GetViewManager(*getter_AddRefs(viewManager));
|
||||||
if (viewManager) {
|
if (viewManager) {
|
||||||
|
@ -199,9 +199,8 @@ inLayoutUtils::GetScreenOrigin(nsIDOMElement* aElement)
|
|||||||
|
|
||||||
while (frame) {
|
while (frame) {
|
||||||
// Look for a widget so we can get screen coordinates
|
// Look for a widget so we can get screen coordinates
|
||||||
nsIView* view = nsnull;
|
nsIView* view = frame->GetViewExternal(presContext);
|
||||||
rv = frame->GetView(presContext, &view);
|
if (view) {
|
||||||
if (NS_SUCCEEDED(rv) && view) {
|
|
||||||
rv = view->GetWidget(*getter_AddRefs(widget));
|
rv = view->GetWidget(*getter_AddRefs(widget));
|
||||||
if (widget)
|
if (widget)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user