This commit is contained in:
Adam D. Ruppe 2013-06-03 16:59:23 -04:00
parent b58e50dc23
commit 612aaed5eb
1 changed files with 13 additions and 25 deletions

36
dom.d
View File

@ -2426,13 +2426,10 @@ class RawSource : SpecialElement {
string source; string source;
} }
///. abstract class ServerSideCode : SpecialElement {
class PhpCode : SpecialElement { this(Document _parentDocument, string type) {
///.
this(Document _parentDocument, string s) {
super(_parentDocument); super(_parentDocument);
source = s; tagName = "#" ~ type;
tagName = "#php";
} }
///. ///.
@ -2454,30 +2451,21 @@ class PhpCode : SpecialElement {
} }
///. ///.
class AspCode : SpecialElement { class PhpCode : ServerSideCode {
///. ///.
this(Document _parentDocument, string s) { this(Document _parentDocument, string s) {
super(_parentDocument); super(_parentDocument, "php");
source = s; source = s;
tagName = "#asp"; }
} }
///. ///.
override string nodeValue() const { class AspCode : ServerSideCode {
return this.source;
}
///. ///.
override string writeToAppender(Appender!string where = appender!string()) const { this(Document _parentDocument, string s) {
auto start = where.data.length; super(_parentDocument, "asp");
where.put("<"); source = s;
where.put(source);
where.put(">");
return where.data[start .. $];
} }
///.
string source;
} }
///. ///.
@ -3819,7 +3807,7 @@ class Document : FileResource {
auto cdataStart = pos; auto cdataStart = pos;
typeof(indexOf(data, "")) end = -1; ptrdiff_t end = -1;
typeof(end) cdataEnd; typeof(end) cdataEnd;
if(pos < data.length) { if(pos < data.length) {
@ -4038,7 +4026,7 @@ class Document : FileResource {
if(tagName == "script" || tagName == "style") { if(tagName == "script" || tagName == "style") {
if(!selfClosed) { if(!selfClosed) {
string closer = "</" ~ tagName ~ ">"; string closer = "</" ~ tagName ~ ">";
typeof(indexOf(data, closer)) ending; ptrdiff_t ending;
if(pos >= data.length) if(pos >= data.length)
ending = -1; ending = -1;
else else