Commit 483c3788 authored by darin's avatar darin

Everything else reviewed by Maciej, dtd.cpp and htmlparser.cpp changes reviewed by Dave.

	- fixed 3151098 -- REGRESSION: Frequent assert about renderer in DOM code

        * khtml/html/dtd.cpp: (DOM::checkChild): Disallow text inside colgroup so it can be handled as a special case
	inside the parser.
        * khtml/html/htmlparser.cpp: (KHTMLParser::insertNode): Discard text inside colgroup and don't pop the colgroup.

	- fixed 3149792 -- memory trasher at robinlionheart.com
	- fixed 3150664 -- failed assertion in HTMLFrameSetElementImpl::attach on page with frameset inside frameset

	The key to fixing the 3149792 memory trasher was to avoid constructing trees where there
	is a render object nested inside an object that is not a suitable container. In particular,
	the code assumed that RenderFlow objects would only be inside other RenderFlow objects, and
	this does not happen if you have an <object> that is an image, with objects inside it that
	are intended to be used if the image fails to load.

	The key to fixing the 3150664 assertion was to handle the case where a frame set's parent
	didn't have a renderer, rather than just asserting about it.

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::layout): Added an assertion and a FIXME from Dave's and my review of this code.
        (RenderFlow::splitInlines): Add assertions that we have actual RenderFlow objects. Casting
	non-RenderFlow objects was the cause of the memory trashing. The other parts of this change
	assure we never hit these assertions by not creating any render objects for DOM objects
	that are inside non-RenderFlow.
        (RenderFlow::addChildWithContinuation): Add a similar assertion here.

        * khtml/rendering/render_object.h: Declare new member function.
        * khtml/rendering/render_object.cpp: (RenderObject::canHaveChildren): Return false.
        * khtml/rendering/render_container.h: Declare new member function.
        * khtml/rendering/render_container.cpp: (RenderContainer::canHaveChildren): Return true.
        * khtml/rendering/render_replaced.h: Declare new member function.
        * khtml/rendering/render_replaced.cpp: (RenderReplaced::canHaveChildren): Return false.

        * khtml/xml/dom_nodeimpl.h: Declare new member functions.
        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::createRendererIfNeeded): Added. Checks to see if a renderer should be created,
	and creates it if so. The bug fix is checking canHaveChildren() here. This also reduces
	the amount of repeated code in various attach() methods.
        (NodeImpl::styleForRenderer): Added. Default is parent style.
        (NodeImpl::rendererIsNeeded): Added. Default is to create only if display is not none.
        (NodeImpl::createRenderer): Added. Must never reach this function, but I didn't make it a pure
	virtual because of subclasses like AttrImpl that don't ever call createRendererIfNeeded.
	Could rethink this and improve it even more.

        * khtml/xml/dom_elementimpl.h: Declare new member functions.
        * khtml/xml/dom_elementimpl.cpp:
        (ElementImpl::styleForRenderer): Override to get the style from the style selector rather
	than from the parent renderer.
        (ElementImpl::createRenderer): Call RenderObject::createObject to create the right type of renderer.
        (ElementImpl::attach): Call createRendererIfNeeded to do most of the work.

        * khtml/html/html_baseimpl.h: Declare new member functions.
        * khtml/html/html_baseimpl.cpp:
        (HTMLBodyElementImpl::createRenderer): Create a RenderBody.
        (HTMLBodyElementImpl::attach): Call createRendererIfNeeded to do most of the work.
        (HTMLFrameElementImpl::rendererIsNeeded): Override to implement the different policy
	this element uses to decide whether to make a renderer (same as old code).
        (HTMLFrameElementImpl::createRenderer): Create a RenderFrame.
        (HTMLFrameElementImpl::attach): Call createRendererIfNeeded to do most of the work.
        (HTMLFrameSetElementImpl::rendererIsNeeded): Override to implement the different policy
	this element uses to decide whether to make a renderer (same as old code).
        (HTMLFrameSetElementImpl::createRenderer): Create a RenderFrameSet.
        (HTMLFrameSetElementImpl::attach): Call createRendererIfNeeded to do most of the work.
	This fixes a bug where the parent doesn't have a renderer; we were asserting in
	that case rather than just not creating a renderer ourselves, which was wrong.
        (HTMLHtmlElementImpl::rendererIsNeeded): Override to implement the different policy
	this element uses to decide whether to make a renderer (same as old code).
        (HTMLHtmlElementImpl::createRenderer): Create a RenderHtml.
        (HTMLHtmlElementImpl::attach): Call createRendererIfNeeded to do most of the work.
        (HTMLIFrameElementImpl::createRenderer): Create a RenderPartObject.
        (HTMLIFrameElementImpl::attach): Call createRendererIfNeeded to do most of the work.

        * khtml/html/html_formimpl.h: Declare new member functions.
        * khtml/html/html_formimpl.cpp:
        (HTMLGenericFormElementImpl::attach): Remove now-unneeded code that is handled by
	createRendererIfNeeded now.
        (HTMLInputElementImpl::rendererIsNeeded): Return false for HIDDEN, otherwise call base.
        (HTMLInputElementImpl::createRenderer): Create the appropriate type of RenderObject.
        (HTMLInputElementImpl::attach): Call createRendererIfNeeded to do most of the work.
	Determined that we don't need the special case for image buttons any more.
        (HTMLSelectElementImpl::createRenderer): Create a RenderSelect.
        (HTMLSelectElementImpl::attach): Call createRendererIfNeeded to do most of the work.
        (HTMLTextAreaElementImpl::createRenderer): Create a RenderTextArea.
        (HTMLTextAreaElementImpl::attach): Call createRendererIfNeeded to do most of the work.

        * khtml/html/html_imageimpl.h: Declare new member function.
        * khtml/html/html_imageimpl.cpp:
        (HTMLImageElementImpl::createRenderer): Create a RenderImage.
        (HTMLImageElementImpl::attach): Call createRendererIfNeeded to do most of the work.

        * khtml/html/html_inlineimpl.h: Declare new member function.
        * khtml/html/html_inlineimpl.cpp:
        (HTMLBRElementImpl::createRenderer): Create a RenderBR.
        (HTMLBRElementImpl::attach): Call createRendererIfNeeded to do most of the work.

        * khtml/html/html_objectimpl.h: Declare new member functions.
        * khtml/html/html_objectimpl.cpp:
        (HTMLAppletElementImpl::rendererIsNeeded): Override to implement the different policy
	this element uses to decide whether to make a renderer (same as old code).
        (HTMLAppletElementImpl::createRenderer): Create either a RenderApplet or RenderEmptyApplet.
        (HTMLAppletElementImpl::attach): Call createRendererIfNeeded to do most of the work.
        (HTMLEmbedElementImpl::rendererIsNeeded): Override to implement the different policy
	this element uses to decide whether to make a renderer (same as old code).
        (HTMLEmbedElementImpl::createRenderer): Create a RenderPartObject.
        (HTMLEmbedElementImpl::attach): Call createRendererIfNeeded to do most of the work.
        (HTMLObjectElementImpl::rendererIsNeeded): Override to implement the different policy
	this element uses to decide whether to make a renderer (same as old code).
        (HTMLObjectElementImpl::createRenderer): Create either a RenderImage or a RenderPartObject.
        (HTMLObjectElementImpl::attach): Call createRendererIfNeeded to do most of the work.

        * khtml/xml/dom_textimpl.h: Declare new member functions.
        * khtml/xml/dom_textimpl.cpp:
        (TextImpl::rendererIsNeeded): Moved logic about not making renderers for only-whitespace
	elements here. Left out the special case for textarea, since the fact that RenderReplaced
	returns false from the canHaveChildren function now takes care of that of that case.
        (TextImpl::createRenderer): Create a RenderText.
        (TextImpl::attach): Call createRendererIfNeeded to do most of the work.

	- fixed a buffer overrun that libgmalloc detected

        * khtml/misc/decoder.cpp:
        (KanjiCode::judge): Pass in a size parameter instead of using strlen.
        (Decoder::decode): Pass in a size parameter.

	- a little housekeeping

        * WebCore.pbproj/project.pbxproj: Remove a bunch of the .moc files
	from the project. I'm not sure why I put them in originally, but they
	do no good in there.
        * khtml/khtmlview.moc: Empty out this file.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 382a4ea1
2003-01-21 Darin Adler <darin@apple.com>
Everything else reviewed by Maciej, dtd.cpp and htmlparser.cpp changes reviewed by Dave.
- fixed 3151098 -- REGRESSION: Frequent assert about renderer in DOM code
* khtml/html/dtd.cpp: (DOM::checkChild): Disallow text inside colgroup so it can be handled as a special case
inside the parser.
* khtml/html/htmlparser.cpp: (KHTMLParser::insertNode): Discard text inside colgroup and don't pop the colgroup.
- fixed 3149792 -- memory trasher at robinlionheart.com
- fixed 3150664 -- failed assertion in HTMLFrameSetElementImpl::attach on page with frameset inside frameset
The key to fixing the 3149792 memory trasher was to avoid constructing trees where there
is a render object nested inside an object that is not a suitable container. In particular,
the code assumed that RenderFlow objects would only be inside other RenderFlow objects, and
this does not happen if you have an <object> that is an image, with objects inside it that
are intended to be used if the image fails to load.
The key to fixing the 3150664 assertion was to handle the case where a frame set's parent
didn't have a renderer, rather than just asserting about it.
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout): Added an assertion and a FIXME from Dave's and my review of this code.
(RenderFlow::splitInlines): Add assertions that we have actual RenderFlow objects. Casting
non-RenderFlow objects was the cause of the memory trashing. The other parts of this change
assure we never hit these assertions by not creating any render objects for DOM objects
that are inside non-RenderFlow.
(RenderFlow::addChildWithContinuation): Add a similar assertion here.
* khtml/rendering/render_object.h: Declare new member function.
* khtml/rendering/render_object.cpp: (RenderObject::canHaveChildren): Return false.
* khtml/rendering/render_container.h: Declare new member function.
* khtml/rendering/render_container.cpp: (RenderContainer::canHaveChildren): Return true.
* khtml/rendering/render_replaced.h: Declare new member function.
* khtml/rendering/render_replaced.cpp: (RenderReplaced::canHaveChildren): Return false.
* khtml/xml/dom_nodeimpl.h: Declare new member functions.
* khtml/xml/dom_nodeimpl.cpp:
(NodeImpl::createRendererIfNeeded): Added. Checks to see if a renderer should be created,
and creates it if so. The bug fix is checking canHaveChildren() here. This also reduces
the amount of repeated code in various attach() methods.
(NodeImpl::styleForRenderer): Added. Default is parent style.
(NodeImpl::rendererIsNeeded): Added. Default is to create only if display is not none.
(NodeImpl::createRenderer): Added. Must never reach this function, but I didn't make it a pure
virtual because of subclasses like AttrImpl that don't ever call createRendererIfNeeded.
Could rethink this and improve it even more.
* khtml/xml/dom_elementimpl.h: Declare new member functions.
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::styleForRenderer): Override to get the style from the style selector rather
than from the parent renderer.
(ElementImpl::createRenderer): Call RenderObject::createObject to create the right type of renderer.
(ElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_baseimpl.h: Declare new member functions.
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::createRenderer): Create a RenderBody.
(HTMLBodyElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLFrameElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLFrameElementImpl::createRenderer): Create a RenderFrame.
(HTMLFrameElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLFrameSetElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLFrameSetElementImpl::createRenderer): Create a RenderFrameSet.
(HTMLFrameSetElementImpl::attach): Call createRendererIfNeeded to do most of the work.
This fixes a bug where the parent doesn't have a renderer; we were asserting in
that case rather than just not creating a renderer ourselves, which was wrong.
(HTMLHtmlElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLHtmlElementImpl::createRenderer): Create a RenderHtml.
(HTMLHtmlElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLIFrameElementImpl::createRenderer): Create a RenderPartObject.
(HTMLIFrameElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_formimpl.h: Declare new member functions.
* khtml/html/html_formimpl.cpp:
(HTMLGenericFormElementImpl::attach): Remove now-unneeded code that is handled by
createRendererIfNeeded now.
(HTMLInputElementImpl::rendererIsNeeded): Return false for HIDDEN, otherwise call base.
(HTMLInputElementImpl::createRenderer): Create the appropriate type of RenderObject.
(HTMLInputElementImpl::attach): Call createRendererIfNeeded to do most of the work.
Determined that we don't need the special case for image buttons any more.
(HTMLSelectElementImpl::createRenderer): Create a RenderSelect.
(HTMLSelectElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLTextAreaElementImpl::createRenderer): Create a RenderTextArea.
(HTMLTextAreaElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_imageimpl.h: Declare new member function.
* khtml/html/html_imageimpl.cpp:
(HTMLImageElementImpl::createRenderer): Create a RenderImage.
(HTMLImageElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_inlineimpl.h: Declare new member function.
* khtml/html/html_inlineimpl.cpp:
(HTMLBRElementImpl::createRenderer): Create a RenderBR.
(HTMLBRElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_objectimpl.h: Declare new member functions.
* khtml/html/html_objectimpl.cpp:
(HTMLAppletElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLAppletElementImpl::createRenderer): Create either a RenderApplet or RenderEmptyApplet.
(HTMLAppletElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLEmbedElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLEmbedElementImpl::createRenderer): Create a RenderPartObject.
(HTMLEmbedElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLObjectElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLObjectElementImpl::createRenderer): Create either a RenderImage or a RenderPartObject.
(HTMLObjectElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/xml/dom_textimpl.h: Declare new member functions.
* khtml/xml/dom_textimpl.cpp:
(TextImpl::rendererIsNeeded): Moved logic about not making renderers for only-whitespace
elements here. Left out the special case for textarea, since the fact that RenderReplaced
returns false from the canHaveChildren function now takes care of that of that case.
(TextImpl::createRenderer): Create a RenderText.
(TextImpl::attach): Call createRendererIfNeeded to do most of the work.
- fixed a buffer overrun that libgmalloc detected
* khtml/misc/decoder.cpp:
(KanjiCode::judge): Pass in a size parameter instead of using strlen.
(Decoder::decode): Pass in a size parameter.
- a little housekeeping
* WebCore.pbproj/project.pbxproj: Remove a bunch of the .moc files
from the project. I'm not sure why I put them in originally, but they
do no good in there.
* khtml/khtmlview.moc: Empty out this file.
2003-01-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
......
2003-01-21 Darin Adler <darin@apple.com>
Everything else reviewed by Maciej, dtd.cpp and htmlparser.cpp changes reviewed by Dave.
- fixed 3151098 -- REGRESSION: Frequent assert about renderer in DOM code
* khtml/html/dtd.cpp: (DOM::checkChild): Disallow text inside colgroup so it can be handled as a special case
inside the parser.
* khtml/html/htmlparser.cpp: (KHTMLParser::insertNode): Discard text inside colgroup and don't pop the colgroup.
- fixed 3149792 -- memory trasher at robinlionheart.com
- fixed 3150664 -- failed assertion in HTMLFrameSetElementImpl::attach on page with frameset inside frameset
The key to fixing the 3149792 memory trasher was to avoid constructing trees where there
is a render object nested inside an object that is not a suitable container. In particular,
the code assumed that RenderFlow objects would only be inside other RenderFlow objects, and
this does not happen if you have an <object> that is an image, with objects inside it that
are intended to be used if the image fails to load.
The key to fixing the 3150664 assertion was to handle the case where a frame set's parent
didn't have a renderer, rather than just asserting about it.
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout): Added an assertion and a FIXME from Dave's and my review of this code.
(RenderFlow::splitInlines): Add assertions that we have actual RenderFlow objects. Casting
non-RenderFlow objects was the cause of the memory trashing. The other parts of this change
assure we never hit these assertions by not creating any render objects for DOM objects
that are inside non-RenderFlow.
(RenderFlow::addChildWithContinuation): Add a similar assertion here.
* khtml/rendering/render_object.h: Declare new member function.
* khtml/rendering/render_object.cpp: (RenderObject::canHaveChildren): Return false.
* khtml/rendering/render_container.h: Declare new member function.
* khtml/rendering/render_container.cpp: (RenderContainer::canHaveChildren): Return true.
* khtml/rendering/render_replaced.h: Declare new member function.
* khtml/rendering/render_replaced.cpp: (RenderReplaced::canHaveChildren): Return false.
* khtml/xml/dom_nodeimpl.h: Declare new member functions.
* khtml/xml/dom_nodeimpl.cpp:
(NodeImpl::createRendererIfNeeded): Added. Checks to see if a renderer should be created,
and creates it if so. The bug fix is checking canHaveChildren() here. This also reduces
the amount of repeated code in various attach() methods.
(NodeImpl::styleForRenderer): Added. Default is parent style.
(NodeImpl::rendererIsNeeded): Added. Default is to create only if display is not none.
(NodeImpl::createRenderer): Added. Must never reach this function, but I didn't make it a pure
virtual because of subclasses like AttrImpl that don't ever call createRendererIfNeeded.
Could rethink this and improve it even more.
* khtml/xml/dom_elementimpl.h: Declare new member functions.
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::styleForRenderer): Override to get the style from the style selector rather
than from the parent renderer.
(ElementImpl::createRenderer): Call RenderObject::createObject to create the right type of renderer.
(ElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_baseimpl.h: Declare new member functions.
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::createRenderer): Create a RenderBody.
(HTMLBodyElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLFrameElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLFrameElementImpl::createRenderer): Create a RenderFrame.
(HTMLFrameElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLFrameSetElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLFrameSetElementImpl::createRenderer): Create a RenderFrameSet.
(HTMLFrameSetElementImpl::attach): Call createRendererIfNeeded to do most of the work.
This fixes a bug where the parent doesn't have a renderer; we were asserting in
that case rather than just not creating a renderer ourselves, which was wrong.
(HTMLHtmlElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLHtmlElementImpl::createRenderer): Create a RenderHtml.
(HTMLHtmlElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLIFrameElementImpl::createRenderer): Create a RenderPartObject.
(HTMLIFrameElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_formimpl.h: Declare new member functions.
* khtml/html/html_formimpl.cpp:
(HTMLGenericFormElementImpl::attach): Remove now-unneeded code that is handled by
createRendererIfNeeded now.
(HTMLInputElementImpl::rendererIsNeeded): Return false for HIDDEN, otherwise call base.
(HTMLInputElementImpl::createRenderer): Create the appropriate type of RenderObject.
(HTMLInputElementImpl::attach): Call createRendererIfNeeded to do most of the work.
Determined that we don't need the special case for image buttons any more.
(HTMLSelectElementImpl::createRenderer): Create a RenderSelect.
(HTMLSelectElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLTextAreaElementImpl::createRenderer): Create a RenderTextArea.
(HTMLTextAreaElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_imageimpl.h: Declare new member function.
* khtml/html/html_imageimpl.cpp:
(HTMLImageElementImpl::createRenderer): Create a RenderImage.
(HTMLImageElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_inlineimpl.h: Declare new member function.
* khtml/html/html_inlineimpl.cpp:
(HTMLBRElementImpl::createRenderer): Create a RenderBR.
(HTMLBRElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_objectimpl.h: Declare new member functions.
* khtml/html/html_objectimpl.cpp:
(HTMLAppletElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLAppletElementImpl::createRenderer): Create either a RenderApplet or RenderEmptyApplet.
(HTMLAppletElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLEmbedElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLEmbedElementImpl::createRenderer): Create a RenderPartObject.
(HTMLEmbedElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLObjectElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLObjectElementImpl::createRenderer): Create either a RenderImage or a RenderPartObject.
(HTMLObjectElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/xml/dom_textimpl.h: Declare new member functions.
* khtml/xml/dom_textimpl.cpp:
(TextImpl::rendererIsNeeded): Moved logic about not making renderers for only-whitespace
elements here. Left out the special case for textarea, since the fact that RenderReplaced
returns false from the canHaveChildren function now takes care of that of that case.
(TextImpl::createRenderer): Create a RenderText.
(TextImpl::attach): Call createRendererIfNeeded to do most of the work.
- fixed a buffer overrun that libgmalloc detected
* khtml/misc/decoder.cpp:
(KanjiCode::judge): Pass in a size parameter instead of using strlen.
(Decoder::decode): Pass in a size parameter.
- a little housekeeping
* WebCore.pbproj/project.pbxproj: Remove a bunch of the .moc files
from the project. I'm not sure why I put them in originally, but they
do no good in there.
* khtml/khtmlview.moc: Empty out this file.
2003-01-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
......
......@@ -1639,12 +1639,6 @@
path = khtml_part.h;
refType = 4;
};
F523D15502DE42AD018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
path = khtml_part.moc;
refType = 4;
};
F523D15602DE42AD018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
......@@ -1663,12 +1657,6 @@
path = khtmlview.h;
refType = 4;
};
F523D15902DE42AD018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
path = khtmlview.moc;
refType = 4;
};
F523D15A02DE42AD018635CA = {
fileRef = F523D15102DE42AD018635CA;
isa = PBXBuildFile;
......@@ -1725,10 +1713,8 @@
F523D15402DE42AD018635CA,
F523D15602DE42AD018635CA,
F523D15302DE42AD018635CA,
F523D15502DE42AD018635CA,
F523D15702DE42AD018635CA,
F523D15802DE42AD018635CA,
F523D15902DE42AD018635CA,
);
isa = PBXGroup;
path = khtml;
......@@ -2831,12 +2817,6 @@
path = kjs_window.lut.h;
refType = 4;
};
F523D21302DE4369018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
path = kjs_window.moc;
refType = 4;
};
F523D21402DE4369018635CA = {
fileRef = F523D1F402DE4369018635CA;
isa = PBXBuildFile;
......@@ -3056,7 +3036,6 @@
F523D21002DE4369018635CA,
F523D21102DE4369018635CA,
F523D21202DE4369018635CA,
F523D21302DE4369018635CA,
);
isa = PBXGroup;
path = ecma;
......@@ -3110,12 +3089,6 @@
path = html_documentimpl.h;
refType = 4;
};
F523D23D02DE4396018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
path = html_documentimpl.moc;
refType = 4;
};
F523D23E02DE4396018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
......@@ -3248,12 +3221,6 @@
path = htmltokenizer.h;
refType = 4;
};
F523D25402DE4396018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
path = htmltokenizer.moc;
refType = 4;
};
F523D25602DE4396018635CA = {
fileRef = F523D23502DE4396018635CA;
isa = PBXBuildFile;
......@@ -3444,7 +3411,6 @@
F523D23A02DE4396018635CA,
F523D23B02DE4396018635CA,
F523D23C02DE4396018635CA,
F523D23D02DE4396018635CA,
F523D23E02DE4396018635CA,
F523D23F02DE4396018635CA,
F523D24002DE4396018635CA,
......@@ -3467,7 +3433,6 @@
F523D25102DE4396018635CA,
F523D25202DE4396018635CA,
F523D25302DE4396018635CA,
F523D25402DE4396018635CA,
);
isa = PBXGroup;
path = html;
......@@ -3551,12 +3516,6 @@
path = loader.h;
refType = 4;
};
F523D28702DE43D7018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
path = loader.moc;
refType = 4;
};
F523D28802DE43D7018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
......@@ -3674,7 +3633,6 @@
F523D28402DE43D7018635CA,
F523D28502DE43D7018635CA,
F523D28602DE43D7018635CA,
F523D28702DE43D7018635CA,
F523D28802DE43D7018635CA,
F523D28902DE43D7018635CA,
BC7294F703804B3C00A80166,
......@@ -4231,12 +4189,6 @@
path = dom_docimpl.h;
refType = 4;
};
F523D2F602DE4476018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
path = dom_docimpl.moc;
refType = 4;
};
F523D2F702DE4476018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
......@@ -4357,12 +4309,6 @@
path = xml_tokenizer.h;
refType = 4;
};
F523D30B02DE4476018635CA = {
fileEncoding = 30;
isa = PBXFileReference;
path = xml_tokenizer.moc;
refType = 4;
};
F523D30C02DE4476018635CA = {
fileRef = F523D2F402DE4476018635CA;
isa = PBXBuildFile;
......@@ -4499,7 +4445,6 @@
children = (
F523D2F402DE4476018635CA,
F523D2F502DE4476018635CA,
F523D2F602DE4476018635CA,
F523D2F702DE4476018635CA,
F523D2F802DE4476018635CA,
F523D2F902DE4476018635CA,
......@@ -4520,7 +4465,6 @@
F523D30802DE4476018635CA,
F523D30902DE4476018635CA,
F523D30A02DE4476018635CA,
F523D30B02DE4476018635CA,
);
isa = PBXGroup;
path = xml;
......
......@@ -733,7 +733,7 @@ bool DOM::checkChild(ushort tagID, ushort childID)
return false;
case ID_COLGROUP:
// COLGROUP: COL *
if(childID == ID_COL || childID == ID_TEXT || childID == ID_COMMENT) return true;
if(childID == ID_COL || childID == ID_COMMENT) return true;
return false;
case ID_TR:
// TR: _9 +
......
......@@ -181,22 +181,14 @@ void HTMLBodyElementImpl::init()
getDocument()->updateStyleSelector();
}
RenderObject *HTMLBodyElementImpl::createRenderer(RenderArena *arena, RenderStyle *style)
{
return new (arena) RenderBody(this);
}
void HTMLBodyElementImpl::attach()
{
assert(!m_render);
assert(parentNode());
if (parentNode()->renderer()) {
RenderStyle* style = getDocument()->styleSelector()->styleForElement(this);
style->ref();
if (style->display() != NONE) {
m_render = new (getDocument()->renderArena()) RenderBody(this);
m_render->setStyle(style);
parentNode()->renderer()->addChild(m_render, nextRenderer());
}
style->deref();
}
createRendererIfNeeded();
NodeBaseImpl::attach();
}
......@@ -357,24 +349,27 @@ void HTMLFrameElementImpl::init()
}
}
void HTMLFrameElementImpl::attach()
bool HTMLFrameElementImpl::rendererIsNeeded(RenderStyle *style)
{
assert(!attached());
assert(parentNode());
// ignore display: none for this element!
KHTMLView* w = getDocument()->view();
if (isURLAllowed(url) && parentNode()->renderer()) {
m_render = new (getDocument()->renderArena()) RenderFrame(this);
m_render->setStyle(getDocument()->styleSelector()->styleForElement(this));
parentNode()->renderer()->addChild(m_render, nextRenderer());
}
// Ignore display: none.
return isURLAllowed(url);
}
RenderObject *HTMLFrameElementImpl::createRenderer(RenderArena *arena, RenderStyle *style)
{
return new (arena) RenderFrame(this);
}
void HTMLFrameElementImpl::attach()
{
createRendererIfNeeded();
NodeBaseImpl::attach();
if (!m_render)
return;
KHTMLView* w = getDocument()->view();
// we need a unique name for every frame in the frameset. Hope that's unique enough.
if(name.isEmpty() || w->part()->frameExists( name.string() ) )
name = DOMString(w->part()->requestFrameName());
......@@ -520,23 +515,20 @@ void HTMLFrameSetElementImpl::init()
}
}
bool HTMLFrameSetElementImpl::rendererIsNeeded(RenderStyle *style)
{
// Ignore display: none but do pay attention if a stylesheet has caused us to delay our loading.
return style->isStyleAvailable();
}
RenderObject *HTMLFrameSetElementImpl::createRenderer(RenderArena *arena, RenderStyle *style)
{
return new (arena) RenderFrameSet(this);
}
void HTMLFrameSetElementImpl::attach()
{
assert(!m_render);
assert(parentNode());
assert(parentNode()->renderer());
// ignore display: none but do pay attention if a stylesheet has caused us to delay
// our loading.
RenderStyle* style = getDocument()->styleSelector()->styleForElement(this);
style->ref();
if (style->isStyleAvailable()) {
m_render = new (getDocument()->renderArena()) RenderFrameSet(this);
m_render->setStyle(style);
parentNode()->renderer()->addChild(m_render, nextRenderer());
}
style->deref();
createRendererIfNeeded();
NodeBaseImpl::attach();
}
......@@ -585,16 +577,20 @@ NodeImpl::Id HTMLHeadElementImpl::id() const
return ID_HEAD;
}
void HTMLHtmlElementImpl::attach()
bool HTMLHtmlElementImpl::rendererIsNeeded(RenderStyle *style)
{
assert(!m_render);
assert(parentNode());
assert(parentNode()->renderer());
// Ignore display: none.
return true;
}
m_render = new (getDocument()->renderArena()) RenderHtml(this);
m_render->setStyle(getDocument()->styleSelector()->styleForElement(this));
parentNode()->renderer()->addChild(m_render, nextRenderer());
RenderObject *HTMLHtmlElementImpl::createRenderer(RenderArena *arena, RenderStyle *style)
{
return new (arena) RenderHtml(this);
}
void HTMLHtmlElementImpl::attach()
{
createRendererIfNeeded();
NodeBaseImpl::attach();
}
......@@ -653,21 +649,20 @@ void HTMLIFrameElementImpl::parseAttribute(AttributeImpl *attr )
}
}
void HTMLIFrameElementImpl::attach()
bool HTMLIFrameElementImpl::rendererIsNeeded(RenderStyle *style)
{
assert(!attached());
assert(!m_render);
assert(parentNode());
// Don't ignore display: none the way frame does.
return isURLAllowed(url) && style->display() != NONE;
}
RenderStyle* _style = getDocument()->styleSelector()->styleForElement(this);
_style->ref();
if (isURLAllowed(url) && parentNode()->renderer() && _style->display() != NONE) {
m_render = new (getDocument()->renderArena()) RenderPartObject(this);
m_render->setStyle(_style);
parentNode()->renderer()->addChild(m_render, nextRenderer());
}
_style->deref();
RenderObject *HTMLIFrameElementImpl::createRenderer(RenderArena *arena, RenderStyle *style)
{
return new (arena) RenderPartObject(this);
}
void HTMLIFrameElementImpl::attach()
{
createRendererIfNeeded();
NodeBaseImpl::attach();
if (m_render) {
......
......@@ -59,6 +59,7 @@ public:
virtual void parseAttribute(AttributeImpl *);
virtual void init();
virtual void attach();
virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
CSSStyleSheetImpl *sheet() const { return m_styleSheet; }
......@@ -85,6 +86,8 @@ public:
virtual void parseAttribute(AttributeImpl *);
virtual void init();
virtual void attach();
virtual bool rendererIsNeeded(khtml::RenderStyle *);
virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
bool noResize() { return noresize; }
void setLocation( const DOMString& str );
......@@ -133,6 +136,8 @@ public:
virtual void parseAttribute(AttributeImpl *);
virtual void init();
virtual void attach();
virtual bool rendererIsNeeded(khtml::RenderStyle *);
virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
virtual void defaultEventHandler(EventImpl *evt);
......@@ -182,6 +187,8 @@ public:
virtual Id id() const;
virtual void attach();
virtual bool rendererIsNeeded(khtml::RenderStyle *);
virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
};
......@@ -198,6 +205,8 @@ public:
virtual void parseAttribute(AttributeImpl *attr);
virtual void attach();
virtual bool rendererIsNeeded(khtml::RenderStyle *);
virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
virtual void recalcStyle( StyleChange ch );
protected:
......
......@@ -658,11 +658,6 @@ void HTMLGenericFormElementImpl::attach()
{
assert(!attached());
if (m_render) {
assert(m_render->style());
parentNode()->renderer()->addChild(m_render, nextRenderer());
}
NodeBaseImpl::attach();
// The call to updateFromElement() needs to go after the call through
......@@ -1254,12 +1249,46 @@ void HTMLInputElementImpl::init()
m_checked = (getAttribute(ATTR_CHECKED) != 0);
}
void HTMLInputElementImpl::attach()
bool HTMLInputElementImpl::rendererIsNeeded(RenderStyle *style)
{
assert(!attached());
assert(!m_render);