Skip to content

Commit

Permalink
Phase 1 of style context deCOMtamination (bug 114713). Remove all dep…
Browse files Browse the repository at this point in the history
…endencies on nsIStyleContext from outside of content and layout. Make nsIFrame::GetStyleData be a non-inline virtual function when called from outside of layout, since the nsStyleContext implementation won't be available to those callers. r=dbaron, sr=bzbarsky.
  • Loading branch information
bryner%netscape.com committed Jan 9, 2003
1 parent 872ded6 commit 7f0488e
Show file tree
Hide file tree
Showing 162 changed files with 434 additions and 542 deletions.
22 changes: 9 additions & 13 deletions accessible/src/base/nsAccessible.cpp
Expand Up @@ -77,7 +77,6 @@
#include "nsGUIEvent.h"

#include "nsILink.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsReadableUtils.h"
#include "nsIBindingManager.h"
Expand Down Expand Up @@ -731,12 +730,10 @@ PRBool nsAccessible::IsPartiallyVisible(PRBool *aIsOffscreen)
return PR_FALSE;

// If visibility:hidden or visibility:collapsed then mark with STATE_INVISIBLE
nsCOMPtr<nsIStyleContext> styleContext;
frame->GetStyleContext(getter_AddRefs(styleContext));
if (styleContext) {
const nsStyleVisibility* vis =
(const nsStyleVisibility*)styleContext->GetStyleData(eStyleStruct_Visibility);
if (!vis || !vis->IsVisible())
const nsStyleVisibility* vis;
::GetStyleData(frame, &vis);
if (!vis || !vis->IsVisible())
{
return PR_FALSE;
}

Expand Down Expand Up @@ -1330,15 +1327,14 @@ NS_IMETHODIMP nsAccessible::AppendFlatStringFromContentNode(nsIContent *aContent
// If this text is inside a block level frame (as opposed to span level), we need to add spaces around that
// block's text, so we don't get words jammed together in final name
// Extra spaces will be trimmed out later
nsCOMPtr<nsIStyleContext> styleContext;
frame->GetStyleContext(getter_AddRefs(styleContext));
if (styleContext) {
const nsStyleDisplay* display = (const nsStyleDisplay*)styleContext->GetStyleData(eStyleStruct_Display);
if (display->IsBlockLevel() || display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) {
const nsStyleDisplay* display;
::GetStyleData(frame, &display);
if (display && (display->IsBlockLevel() ||
display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL))
{
isHTMLBlock = PR_TRUE;
if (!aFlatString->IsEmpty())
aFlatString->Append(NS_LITERAL_STRING(" "));
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion accessible/src/xul/nsXULTabAccessible.cpp
Expand Up @@ -49,7 +49,6 @@
#include "nsIFrame.h"
#include "nsIPluginViewer.h"
#include "nsIScriptGlobalObject.h"
#include "nsIStyleContext.h"
#include "nsIWebShell.h"
#include "nsIWebShellWindow.h"
#include "nsplugindefs.h"
Expand Down
9 changes: 6 additions & 3 deletions content/base/src/nsStyleSet.cpp
Expand Up @@ -341,7 +341,7 @@ class StyleSetImpl : public nsIStyleSet

#ifdef DEBUG
void List(FILE* out, PRInt32 aIndent, nsISupportsArray* aSheets);
void ListContexts(nsIStyleContext* aRootContext, FILE* out, PRInt32 aIndent);
void ListContexts(nsIFrame* aRootFrame, FILE* out, PRInt32 aIndent);
#endif

nsCOMPtr<nsISupportsArray> mOverrideSheets; // most significant first
Expand Down Expand Up @@ -1762,9 +1762,12 @@ void StyleSetImpl::List(FILE* out, PRInt32 aIndent)
}


void StyleSetImpl::ListContexts(nsIStyleContext* aRootContext, FILE* out, PRInt32 aIndent)
void StyleSetImpl::ListContexts(nsIFrame* aRootFrame, FILE* out, PRInt32 aIndent)
{
aRootContext->List(out, aIndent);
nsCOMPtr<nsIStyleContext> sc;
aRootFrame->GetStyleContext(getter_AddRefs(sc));
if (sc)
sc->List(out, aIndent);
}
#endif

Expand Down
1 change: 0 additions & 1 deletion content/events/src/nsEventStateManager.cpp
Expand Up @@ -44,7 +44,6 @@
#include "nsIDocument.h"
#include "nsIFrame.h"
#include "nsIWidget.h"
#include "nsIStyleContext.h"
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsDOMEvent.h"
Expand Down
9 changes: 0 additions & 9 deletions content/html/content/src/nsAttributeContent.cpp
Expand Up @@ -66,15 +66,6 @@
#include "nsINameSpaceManager.h"
#include "nsITextContent.h"

class nsIDOMAttr;
class nsIDOMNodeList;
class nsIFrame;
class nsIStyleContext;
class nsIStyleRule;
class nsISupportsArray;
class nsIDOMText;


// XXX share all id's in this dir


Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLAppletElement.cpp
Expand Up @@ -41,7 +41,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIDocument.h"
Expand Down
2 changes: 1 addition & 1 deletion content/html/content/src/nsHTMLAreaElement.cpp
Expand Up @@ -42,8 +42,8 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsILink.h"
#include "nsIPresShell.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIEventStateManager.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLBRElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLBaseFontElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"

Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLBodyElement.cpp
Expand Up @@ -43,7 +43,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIPresShell.h"
Expand Down
2 changes: 1 addition & 1 deletion content/html/content/src/nsHTMLButtonElement.cpp
Expand Up @@ -42,7 +42,7 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsIPresShell.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIFormControl.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLDListElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLDelElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"

Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLDirectoryElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLDivElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLFieldSetElement.cpp
Expand Up @@ -41,7 +41,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIForm.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLFontElement.cpp
Expand Up @@ -42,7 +42,6 @@
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIDeviceContext.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLFormElement.cpp
Expand Up @@ -47,7 +47,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIDocument.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLFrameSetElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIFrameSetElement.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLHRElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLHeadElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"

Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLHeadingElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLHtmlElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIDocument.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLIFrameElement.cpp
Expand Up @@ -43,7 +43,6 @@
#include "nsIFrameLoader.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsIDocument.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLImageElement.cpp
Expand Up @@ -41,7 +41,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIPresShell.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLInputElement.cpp
Expand Up @@ -54,7 +54,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLInsElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"

Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLLIElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLLabelElement.cpp
Expand Up @@ -42,7 +42,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIFormControl.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLLegendElement.cpp
Expand Up @@ -41,7 +41,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIForm.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLLinkElement.cpp
Expand Up @@ -42,7 +42,6 @@
#include "nsGenericHTMLElement.h"
#include "nsILink.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIDOMStyleSheet.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLMapElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "GenericElementCollection.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLMenuElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLMetaElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"

Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLModElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"

Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLOListElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLOptGroupElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIFrame.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLOptionElement.cpp
Expand Up @@ -44,7 +44,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsIFormControl.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLParagraphElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLPreElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"
#include "nsHTMLAttributes.h"
Expand Down
1 change: 0 additions & 1 deletion content/html/content/src/nsHTMLQuoteElement.cpp
Expand Up @@ -40,7 +40,6 @@
#include "nsIHTMLContent.h"
#include "nsGenericHTMLElement.h"
#include "nsHTMLAtoms.h"
#include "nsIStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIPresContext.h"

Expand Down

0 comments on commit 7f0488e

Please sign in to comment.