diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp
index 6d49d3f6a702..c56dba830936 100644
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -52,9 +52,12 @@
// Find/Serach Includes
+#if XP_NEW_SELECTION
+#else
#include "nsISelection.h"
#include "nsSelectionRange.h"
#include "nsSelectionPoint.h"
+#endif
const PRInt32 kForward = 0;
const PRInt32 kBackward = 1;
diff --git a/layout/html/document/src/makefile.win b/layout/html/document/src/makefile.win
index 9b84aefd5e7e..1ab7be78c7d1 100644
--- a/layout/html/document/src/makefile.win
+++ b/layout/html/document/src/makefile.win
@@ -21,7 +21,10 @@ LIBRARY_NAME=raptorhtmldoc_s
MODULE=raptor
REQUIRES=xpcom raptor pref
-DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
+DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
+!if defined(XP_NEW_SELECTION)
+DEFINES = $(DEFINES) -DXP_NEW_SELECTION
+!endif
CPPSRCS= \
nsHTMLContentSink.cpp \
diff --git a/layout/html/document/src/nsHTMLDocument.cpp b/layout/html/document/src/nsHTMLDocument.cpp
index 6d49d3f6a702..c56dba830936 100644
--- a/layout/html/document/src/nsHTMLDocument.cpp
+++ b/layout/html/document/src/nsHTMLDocument.cpp
@@ -52,9 +52,12 @@
// Find/Serach Includes
+#if XP_NEW_SELECTION
+#else
#include "nsISelection.h"
#include "nsSelectionRange.h"
#include "nsSelectionPoint.h"
+#endif
const PRInt32 kForward = 0;
const PRInt32 kBackward = 1;