ProtoObjectObjectWAHtmlDocumentWAHtmlTreeDocument
| body | head | stack |
| instance | class |
|---|---|
| accessing as yet unclassified markup stack operations | as yet unclassified |
| body |
|---|
|
|
| head |
|---|
|
| stack |
|---|
|
|
| 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. |
| as yet unclassified |
|---|
| new |
^ super new initialize |