WAHtmlTreeDocument


Seaside-Document

Comment:



Hierarchy:

ProtoObject
Object
WAHtmlDocument
WAHtmlTreeDocument

Summary:

instance variables:

body head stack

methods:

instance class
accessing as yet unclassified markup stack operations as yet unclassified

Detail:

instance variables:

body
InitialValue:
a WAHtmlElement
inferredType:
WAHtmlElement
head
inferredType:
UndefinedObject
stack
InitialValue:
an OrderedCollection(a WAHtmlElement)
inferredType:
OrderedCollection

instance methods:

accessing
initializeWithRoot: anHtmlRoot

	super initializeWithRoot: anHtmlRoot.
	body _ WAHtmlElement named: 'body'.
	stack _ OrderedCollection with: body

as yet unclassified
writeBodyOn: aStream

	body childrenDo: [:ea | ea writeOn: aStream]
writeOn: aStream

	root writeOn: aStream.
	self writeBodyOn: aStream.
	aStream nextPutAll: '</body></html>'

markup
closeTag: aString

	self popElement name = aString ifFalse: [self error: 'Mismatched tags']
openTag: aString attributes: anAttributes

	| element |
	element _ WAHtmlElement named: aString attributes: anAttributes.
	(self shouldPrintCloseTagFor: aString)
		ifTrue: [element beClosed]
		ifFalse: [element notClosed].
	self pushElement: element
text: aString

	self addElement: aString

stack operations
addElement: anObject

	stack last add: anObject
popElement

	^ stack removeLast
pushElement: anObject

	self addElement: anObject.
	stack add: anObject.
withElement: anElement do: aBlock

	self pushElement: anElement.
	aBlock value.
	self popElement.

class methods:

as yet unclassified
new

	^ super new initialize

^top


- made by Dandelion -