diff --git a/mozilla/content/html/content/makefile.win b/mozilla/content/html/content/makefile.win
new file mode 100644
index 00000000000..5620ead1bde
--- /dev/null
+++ b/mozilla/content/html/content/makefile.win
@@ -0,0 +1,22 @@
+#!nmake
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL. You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All Rights
+# Reserved.
+
+DEPTH=..\..\..
+
+DIRS=src
+
+include <$(DEPTH)\layout\config\rules.mak>
diff --git a/mozilla/content/html/content/src/makefile.win b/mozilla/content/html/content/src/makefile.win
new file mode 100644
index 00000000000..032035e7b33
--- /dev/null
+++ b/mozilla/content/html/content/src/makefile.win
@@ -0,0 +1,51 @@
+#!nmake
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL. You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All Rights
+# Reserved.
+
+DEPTH=..\..\..\..
+
+LIBRARY_NAME = nglhtmlcon_s
+MODULE=raptor
+REQUIRES=xpcom raptor js
+DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
+
+CPPSRCS= \
+ nsHTMLHead.cpp \
+ nsHTMLMeta.cpp \
+ $(NULL)
+
+CPP_OBJS= \
+ .\$(OBJDIR)\nsHTMLHead.obj \
+ .\$(OBJDIR)\nsHTMLMeta.obj \
+ $(NULL)
+
+LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\js \
+ -I$(PUBLIC)\dom -I$(PUBLIC)\netlib \
+ -I..\..\style\src -I..\..\..\css\layout\src \
+ -I..\..\..\base\src -I..\..\base\src
+
+LCFLAGS = \
+ $(LCFLAGS) \
+ $(DEFINES) \
+ $(NULL)
+
+include <$(DEPTH)\layout\config\rules.mak>
+
+libs:: $(LIBRARY)
+ $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
+
+clobber::
+ rm -f $(DIST)\lib\$(LIBRARY_NAME).lib
diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp
index 1eee94c0e93..a7d4468c574 100644
--- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp
+++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp
@@ -150,6 +150,7 @@ protected:
nsresult ProcessAREATag(const nsIParserNode& aNode);
nsresult ProcessBASETag(const nsIParserNode& aNode);
+ nsresult ProcessMETATag(const nsIParserNode& aNode);
nsresult ProcessSTYLETag(const nsIParserNode& aNode);
nsresult ProcessSCRIPTTag(const nsIParserNode& aNode);
@@ -752,6 +753,11 @@ PRInt32 HTMLContentSink::AddLeaf(const nsIParserNode& aNode)
case eHTMLTag_area:
ProcessAREATag(aNode);
return 0;
+
+ case eHTMLTag_meta:
+ // Add meta objects to the head object
+ ProcessMETATag(aNode);
+ return 0;
}
eHTMLTags parentType;
@@ -976,6 +982,27 @@ nsresult HTMLContentSink::ProcessBASETag(const nsIParserNode& aNode)
return NS_OK;
}
+nsresult
+HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode)
+{
+ NS_PRECONDITION(nsnull != mHead, "bad parser: meta before head");
+ nsresult rv = NS_OK;
+ if (nsnull != mHead) {
+ nsAutoString tmp(aNode.GetText());
+ tmp.ToUpperCase();
+ nsIAtom* atom = NS_NewAtom(tmp);
+
+ nsIHTMLContent* it = nsnull;
+ rv = NS_NewHTMLMeta(&it, atom) ;
+ if (NS_OK == rv) {
+ rv = AddAttributes(aNode, it);
+ mHead->AppendChild(it, PR_FALSE);
+ }
+ NS_RELEASE(atom);
+ }
+ return rv;
+}
+
nsresult HTMLContentSink::ProcessBRTag(nsIHTMLContent** aInstancePtrResult,
const nsIParserNode& aNode)
{
diff --git a/mozilla/layout/generic/nsHTMLParts.h b/mozilla/layout/generic/nsHTMLParts.h
index 934a10752a2..3d26eafd0f3 100644
--- a/mozilla/layout/generic/nsHTMLParts.h
+++ b/mozilla/layout/generic/nsHTMLParts.h
@@ -43,9 +43,14 @@ extern nsresult NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
extern nsresult
NS_NewRootPart(nsIHTMLContent** aInstancePtrResult,
nsIDocument* aDocument);
+
+// Head parts
extern nsresult
NS_NewHTMLHead(nsIHTMLContent** aInstancePtrResult,
nsIAtom* aTag);
+extern nsresult
+ NS_NewHTMLMeta(nsIHTMLContent** aInstancePtrResult,
+ nsIAtom* aTag);
// Create an html body part
extern nsresult
diff --git a/mozilla/layout/html/Makefile b/mozilla/layout/html/Makefile
index c398fa8ab75..ade9e2b075b 100644
--- a/mozilla/layout/html/Makefile
+++ b/mozilla/layout/html/Makefile
@@ -19,7 +19,7 @@ DEPTH = ../..
# Don't do tests for now
#DIRS = base document forms style table build tests
-DIRS = base document forms style table
+DIRS = base content document forms style table
include $(DEPTH)/config/config.mk
diff --git a/mozilla/layout/html/base/src/Makefile b/mozilla/layout/html/base/src/Makefile
index 39cd49c59da..8b131b11c98 100644
--- a/mozilla/layout/html/base/src/Makefile
+++ b/mozilla/layout/html/base/src/Makefile
@@ -33,10 +33,10 @@ CPPSRCS = \
nsHTMLContainer.cpp \
nsHTMLContainerFrame.cpp \
nsHTMLContent.cpp \
- nsHTMLHead.cpp \
nsHTMLIIDs.cpp \
nsHTMLImage.cpp \
- nsHTMLReflowCommand.cpp \
+ nsHTMLMeta.cpp \
+ nsHTMLReflowCommand.cpp \
nsHTMLTagContent.cpp \
nsHTMLTags.cpp \
nsImageMap.cpp \
diff --git a/mozilla/layout/html/base/src/makefile.win b/mozilla/layout/html/base/src/makefile.win
index f218fa0f614..8daf4e220a1 100644
--- a/mozilla/layout/html/base/src/makefile.win
+++ b/mozilla/layout/html/base/src/makefile.win
@@ -35,7 +35,6 @@ CPPSRCS= \
nsHTMLContainer.cpp \
nsHTMLContainerFrame.cpp \
nsHTMLContent.cpp \
- nsHTMLHead.cpp \
nsHTMLIIDs.cpp \
nsHTMLImage.cpp \
nsHTMLReflowCommand.cpp \
@@ -66,7 +65,6 @@ CPP_OBJS= \
.\$(OBJDIR)\nsHTMLContainer.obj \
.\$(OBJDIR)\nsHTMLContainerFrame.obj \
.\$(OBJDIR)\nsHTMLContent.obj \
- .\$(OBJDIR)\nsHTMLHead.obj \
.\$(OBJDIR)\nsHTMLIIDs.obj \
.\$(OBJDIR)\nsHTMLImage.obj \
.\$(OBJDIR)\nsHTMLReflowCommand.obj \
diff --git a/mozilla/layout/html/base/src/nsHRPart.cpp b/mozilla/layout/html/base/src/nsHRPart.cpp
index 004a49cc2ec..50ed7c2e182 100644
--- a/mozilla/layout/html/base/src/nsHRPart.cpp
+++ b/mozilla/layout/html/base/src/nsHRPart.cpp
@@ -72,6 +72,10 @@ public:
HRuleFrame(nsIContent* aContent,
nsIFrame* aParentFrame);
+ NS_IMETHOD Reflow(nsIPresContext* aPresContext,
+ nsReflowMetrics& aDesiredSize,
+ const nsReflowState& aReflowState,
+ nsReflowStatus& aStatus);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect);
@@ -223,6 +227,33 @@ HRuleFrame::Paint(nsIPresContext& aPresContext,
return NS_OK;
}
+NS_IMETHODIMP
+HRuleFrame::Reflow(nsIPresContext* aPresContext,
+ nsReflowMetrics& aDesiredSize,
+ const nsReflowState& aReflowState,
+ nsReflowStatus& aStatus)
+{
+ NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
+
+ // XXX add in code to check for width/height being set via css
+ // and if set use them instead of calling GetDesiredSize.
+
+
+ GetDesiredSize(aPresContext, aReflowState, aDesiredSize);
+ AddBordersAndPadding(aPresContext, aDesiredSize);
+
+ // HR's do not impact the max-element-size, otherwise tables behave
+ // badly. This makes sense they are springy.
+ if (nsnull != aDesiredSize.maxElementSize) {
+ nscoord onePixel = nscoord(aPresContext->GetPixelsToTwips());
+ aDesiredSize.maxElementSize->width = onePixel;
+ aDesiredSize.maxElementSize->height = onePixel;
+ }
+
+ aStatus = NS_FRAME_COMPLETE;
+ return NS_OK;
+}
+
void
HRuleFrame::GetDesiredSize(nsIPresContext* aPresContext,
const nsReflowState& aReflowState,
diff --git a/mozilla/layout/html/base/src/nsHTMLContainer.cpp b/mozilla/layout/html/base/src/nsHTMLContainer.cpp
index 2fbfefe039e..aafce3c303c 100644
--- a/mozilla/layout/html/base/src/nsHTMLContainer.cpp
+++ b/mozilla/layout/html/base/src/nsHTMLContainer.cpp
@@ -504,6 +504,21 @@ nsContentAttr nsHTMLContainer::AttributeToString(nsIAtom* aAttribute,
}
}
}
+ else if (aValue.GetUnit() == eHTMLUnit_Integer) {
+ if (mTag == nsHTMLAtoms::font) {
+ if ((aAttribute == nsHTMLAtoms::size) ||
+ (aAttribute == nsHTMLAtoms::pointSize) ||
+ (aAttribute == nsHTMLAtoms::fontWeight)) {
+ aResult.Truncate();
+ PRInt32 value = aValue.GetIntValue();
+ if (value >= 0) {
+ aResult.Append('+');
+ }
+ aResult.Append(value, 10);
+ ca = eContentAttr_HasValue;
+ }
+ }
+ }
return ca;
}
@@ -603,7 +618,8 @@ void nsHTMLContainer::MapAttributesInto(nsIStyleContext* aContext,
if (parentFont->mFont.size < (nscoord)((float)normal.size * kFontScale[index]))
break;
size = ((index - 1) + size);
- if (7 < size) size = 7;
+ if (size < 0) size = 0;
+ if (size > 6) size = 6;
font->mFont.size = (nscoord)((float)normal.size * kFontScale[size]);
}
else if ((-7 <= size) && (size < 0)) {
@@ -613,6 +629,7 @@ void nsHTMLContainer::MapAttributesInto(nsIStyleContext* aContext,
break;
size = ((index + 1) + size);
if (size < 0) size = 0;
+ if (size > 6) size = 6;
font->mFont.size = (nscoord)((float)normal.size * kFontScale[size]);
}
else if (0 == size) {
diff --git a/mozilla/layout/html/base/src/nsHTMLParts.h b/mozilla/layout/html/base/src/nsHTMLParts.h
index 934a10752a2..3d26eafd0f3 100644
--- a/mozilla/layout/html/base/src/nsHTMLParts.h
+++ b/mozilla/layout/html/base/src/nsHTMLParts.h
@@ -43,9 +43,14 @@ extern nsresult NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
extern nsresult
NS_NewRootPart(nsIHTMLContent** aInstancePtrResult,
nsIDocument* aDocument);
+
+// Head parts
extern nsresult
NS_NewHTMLHead(nsIHTMLContent** aInstancePtrResult,
nsIAtom* aTag);
+extern nsresult
+ NS_NewHTMLMeta(nsIHTMLContent** aInstancePtrResult,
+ nsIAtom* aTag);
// Create an html body part
extern nsresult
diff --git a/mozilla/layout/html/content/Makefile b/mozilla/layout/html/content/Makefile
new file mode 100644
index 00000000000..b0ff7c06fd4
--- /dev/null
+++ b/mozilla/layout/html/content/Makefile
@@ -0,0 +1,24 @@
+#!gmake
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL. You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All Rights
+# Reserved.
+
+DEPTH = ../../..
+
+DIRS = src
+
+include $(DEPTH)/config/config.mk
+
+include $(DEPTH)/config/rules.mk
diff --git a/mozilla/layout/html/content/makefile.win b/mozilla/layout/html/content/makefile.win
new file mode 100644
index 00000000000..5620ead1bde
--- /dev/null
+++ b/mozilla/layout/html/content/makefile.win
@@ -0,0 +1,22 @@
+#!nmake
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL. You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All Rights
+# Reserved.
+
+DEPTH=..\..\..
+
+DIRS=src
+
+include <$(DEPTH)\layout\config\rules.mak>
diff --git a/mozilla/layout/html/content/src/Makefile b/mozilla/layout/html/content/src/Makefile
new file mode 100644
index 00000000000..f35afa3afe8
--- /dev/null
+++ b/mozilla/layout/html/content/src/Makefile
@@ -0,0 +1,39 @@
+#!gmake
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL. You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All Rights
+# Reserved.
+
+DEPTH=../../../..
+
+LIBRARY_NAME = nglhtmlcon_s
+
+# Note the sophisticated alphabetical ordering :-|
+CPPSRCS = \
+ nsHTMLHead.cpp \
+ nsHTMLMeta.cpp \
+ $(NULL)
+
+MODULE = raptor
+
+REQUIRES = xpcom raptor dom js
+
+include $(DEPTH)/config/config.mk
+
+LCFLAGS += -D_IMPL_NS_HTML
+
+INCLUDES += -I../../style/src -I../../../base/src -I../../../css/layout/src \
+ -I../../base/src
+
+include $(DEPTH)/config/rules.mk
diff --git a/mozilla/layout/html/content/src/makefile.win b/mozilla/layout/html/content/src/makefile.win
new file mode 100644
index 00000000000..032035e7b33
--- /dev/null
+++ b/mozilla/layout/html/content/src/makefile.win
@@ -0,0 +1,51 @@
+#!nmake
+#
+# The contents of this file are subject to the Netscape Public License
+# Version 1.0 (the "NPL"); you may not use this file except in
+# compliance with the NPL. You may obtain a copy of the NPL at
+# http://www.mozilla.org/NPL/
+#
+# Software distributed under the NPL is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+# for the specific language governing rights and limitations under the
+# NPL.
+#
+# The Initial Developer of this code under the NPL is Netscape
+# Communications Corporation. Portions created by Netscape are
+# Copyright (C) 1998 Netscape Communications Corporation. All Rights
+# Reserved.
+
+DEPTH=..\..\..\..
+
+LIBRARY_NAME = nglhtmlcon_s
+MODULE=raptor
+REQUIRES=xpcom raptor js
+DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
+
+CPPSRCS= \
+ nsHTMLHead.cpp \
+ nsHTMLMeta.cpp \
+ $(NULL)
+
+CPP_OBJS= \
+ .\$(OBJDIR)\nsHTMLHead.obj \
+ .\$(OBJDIR)\nsHTMLMeta.obj \
+ $(NULL)
+
+LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\js \
+ -I$(PUBLIC)\dom -I$(PUBLIC)\netlib \
+ -I..\..\style\src -I..\..\..\css\layout\src \
+ -I..\..\..\base\src -I..\..\base\src
+
+LCFLAGS = \
+ $(LCFLAGS) \
+ $(DEFINES) \
+ $(NULL)
+
+include <$(DEPTH)\layout\config\rules.mak>
+
+libs:: $(LIBRARY)
+ $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
+
+clobber::
+ rm -f $(DIST)\lib\$(LIBRARY_NAME).lib
diff --git a/mozilla/layout/html/content/src/nsHTMLHead.cpp b/mozilla/layout/html/content/src/nsHTMLHead.cpp
new file mode 100644
index 00000000000..1b3bcf3ab3c
--- /dev/null
+++ b/mozilla/layout/html/content/src/nsHTMLHead.cpp
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+#include "nsHTMLParts.h"
+#include "nsHTMLContainer.h"
+#include "nsFrame.h"
+#include "nsHTMLIIDs.h"
+
+class nsHTMLHead : public nsHTMLContainer {
+public:
+ nsHTMLHead(nsIAtom* aTag);
+
+ virtual nsresult CreateFrame(nsIPresContext* aPresContext,
+ nsIFrame* aParentFrame,
+ nsIStyleContext* aStyleContext,
+ nsIFrame*& aResult);
+
+protected:
+ virtual ~nsHTMLHead();
+};
+
+nsHTMLHead::nsHTMLHead(nsIAtom* aTag)
+ : nsHTMLContainer(aTag)
+{
+}
+
+nsHTMLHead::~nsHTMLHead()
+{
+}
+
+nsresult
+nsHTMLHead::CreateFrame(nsIPresContext* aPresContext,
+ nsIFrame* aParentFrame,
+ nsIStyleContext* aStyleContext,
+ nsIFrame*& aResult)
+{
+ nsIFrame* frame;
+ nsFrame::NewFrame(&frame, this, aParentFrame);
+ if (nsnull == frame) {
+ return NS_ERROR_OUT_OF_MEMORY;
+ }
+ frame->SetStyleContext(aPresContext, aStyleContext);
+ aResult = frame;
+ return NS_OK;
+}
+
+nsresult
+NS_NewHTMLHead(nsIHTMLContent** aInstancePtrResult,
+ nsIAtom* aTag)
+{
+ NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
+ if (nsnull == aInstancePtrResult) {
+ return NS_ERROR_NULL_POINTER;
+ }
+ nsIHTMLContent* it = new nsHTMLHead(aTag);
+ if (nsnull == it) {
+ return NS_ERROR_OUT_OF_MEMORY;
+ }
+ return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult);
+}
diff --git a/mozilla/layout/html/content/src/nsHTMLMeta.cpp b/mozilla/layout/html/content/src/nsHTMLMeta.cpp
new file mode 100644
index 00000000000..76e27fc2d42
--- /dev/null
+++ b/mozilla/layout/html/content/src/nsHTMLMeta.cpp
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.0 (the "NPL"); you may not use this file except in
+ * compliance with the NPL. You may obtain a copy of the NPL at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the NPL is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
+ * for the specific language governing rights and limitations under the
+ * NPL.
+ *
+ * The Initial Developer of this code under the NPL is Netscape
+ * Communications Corporation. Portions created by Netscape are
+ * Copyright (C) 1998 Netscape Communications Corporation. All Rights
+ * Reserved.
+ */
+#include "nsHTMLParts.h"
+#include "nsHTMLContainer.h"
+#include "nsFrame.h"
+#include "nsHTMLIIDs.h"
+
+#define nsHTMLMetaSuper nsHTMLTagContent
+
+class nsHTMLMeta : public nsHTMLMetaSuper {
+public:
+ nsHTMLMeta(nsIAtom* aTag);
+
+ virtual nsresult CreateFrame(nsIPresContext* aPresContext,
+ nsIFrame* aParentFrame,
+ nsIStyleContext* aStyleContext,
+ nsIFrame*& aResult);
+
+protected:
+ virtual ~nsHTMLMeta();
+};
+
+nsHTMLMeta::nsHTMLMeta(nsIAtom* aTag)
+ : nsHTMLMetaSuper(aTag)
+{
+}
+
+nsHTMLMeta::~nsHTMLMeta()
+{
+}
+
+nsresult
+nsHTMLMeta::CreateFrame(nsIPresContext* aPresContext,
+ nsIFrame* aParentFrame,
+ nsIStyleContext* aStyleContext,
+ nsIFrame*& aResult)
+{
+ nsIFrame* frame;
+ nsFrame::NewFrame(&frame, this, aParentFrame);
+ if (nsnull == frame) {
+ return NS_ERROR_OUT_OF_MEMORY;
+ }
+ frame->SetStyleContext(aPresContext, aStyleContext);
+ aResult = frame;
+ return NS_OK;
+}
+
+nsresult
+NS_NewHTMLMeta(nsIHTMLContent** aInstancePtrResult,
+ nsIAtom* aTag)
+{
+ NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
+ if (nsnull == aInstancePtrResult) {
+ return NS_ERROR_NULL_POINTER;
+ }
+ nsIHTMLContent* it = new nsHTMLMeta(aTag);
+ if (nsnull == it) {
+ return NS_ERROR_OUT_OF_MEMORY;
+ }
+ return it->QueryInterface(kIHTMLContentIID, (void **) aInstancePtrResult);
+}
diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
index 1eee94c0e93..a7d4468c574 100644
--- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
+++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp
@@ -150,6 +150,7 @@ protected:
nsresult ProcessAREATag(const nsIParserNode& aNode);
nsresult ProcessBASETag(const nsIParserNode& aNode);
+ nsresult ProcessMETATag(const nsIParserNode& aNode);
nsresult ProcessSTYLETag(const nsIParserNode& aNode);
nsresult ProcessSCRIPTTag(const nsIParserNode& aNode);
@@ -752,6 +753,11 @@ PRInt32 HTMLContentSink::AddLeaf(const nsIParserNode& aNode)
case eHTMLTag_area:
ProcessAREATag(aNode);
return 0;
+
+ case eHTMLTag_meta:
+ // Add meta objects to the head object
+ ProcessMETATag(aNode);
+ return 0;
}
eHTMLTags parentType;
@@ -976,6 +982,27 @@ nsresult HTMLContentSink::ProcessBASETag(const nsIParserNode& aNode)
return NS_OK;
}
+nsresult
+HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode)
+{
+ NS_PRECONDITION(nsnull != mHead, "bad parser: meta before head");
+ nsresult rv = NS_OK;
+ if (nsnull != mHead) {
+ nsAutoString tmp(aNode.GetText());
+ tmp.ToUpperCase();
+ nsIAtom* atom = NS_NewAtom(tmp);
+
+ nsIHTMLContent* it = nsnull;
+ rv = NS_NewHTMLMeta(&it, atom) ;
+ if (NS_OK == rv) {
+ rv = AddAttributes(aNode, it);
+ mHead->AppendChild(it, PR_FALSE);
+ }
+ NS_RELEASE(atom);
+ }
+ return rv;
+}
+
nsresult HTMLContentSink::ProcessBRTag(nsIHTMLContent** aInstancePtrResult,
const nsIParserNode& aNode)
{
diff --git a/mozilla/layout/html/makefile.win b/mozilla/layout/html/makefile.win
index 03c818f0259..80470763315 100644
--- a/mozilla/layout/html/makefile.win
+++ b/mozilla/layout/html/makefile.win
@@ -17,6 +17,6 @@
DEPTH=..\..
-DIRS = base document forms style table tests
+DIRS = base content document forms style table tests
include <$(DEPTH)\layout\config\rules.mak>
diff --git a/mozilla/layout/html/tests/makefile.win b/mozilla/layout/html/tests/makefile.win
index 0fa03b8b215..f76e860d440 100644
--- a/mozilla/layout/html/tests/makefile.win
+++ b/mozilla/layout/html/tests/makefile.win
@@ -47,6 +47,7 @@ LINCS= \
LLIBS= \
$(DIST)\lib\raptorhtmlbase_s.lib \
$(DIST)\lib\nglcsslay_s.lib \
+ $(DIST)\lib\nglhtmlcon_s.lib \
$(DIST)\lib\raptorhtmlstyle_s.lib \
$(DIST)\lib\raptorlayout_s.lib \
$(DIST)\lib\raptorgfx.lib \