Skip to content

Commit

Permalink
Switch from XML to HTML
Browse files Browse the repository at this point in the history
Change boolean attribute rendering from XML to HTML style.

Fixes SeasideSt#823
  • Loading branch information
marschall committed Sep 9, 2017
1 parent df7afdf commit 9035476
Show file tree
Hide file tree
Showing 35 changed files with 111 additions and 122 deletions.
Expand Up @@ -4,8 +4,10 @@ encodeOn: aDocument

self keysAndValuesDo: [ :key :value |
value == false ifFalse: [
aDocument nextPut: Character space; nextPutAll: key; nextPutAll: '="'.
value == true
ifTrue: [ aDocument nextPutAll: key ]
ifFalse: [ aDocument print: value ].
aDocument nextPut: $" ] ]
aDocument
nextPut: Character space;
nextPutAll: key.
value == true ifFalse: [
aDocument nextPutAll: '="';
print: value;
nextPut: $" ] ] ]
Expand Up @@ -3,7 +3,7 @@
"errorKeyNotFound" : "lr 7/12/2007 13:21",
"privateAt:put:" : "lr 7/12/2007 13:23",
"addStyle:" : "pmm 8/19/2014 00:17",
"encodeOn:" : "JohanBrichau 7/15/2015 10:39",
"encodeOn:" : "pmm 9/9/2017 14:33",
"addMedia:" : "pmm 3/9/2008 11:21",
"addClass:" : "JohanBrichau 7/15/2015 10:39",
"at:append:" : "JohanBrichau 7/15/2015 09:55",
Expand Down
@@ -1,4 +1,4 @@
attributes
defer
"When set, this boolean attribute provides a hint to the user agent that the script is not going to generate any document content (e.g., no 'document.write' in javascript) and thus, the user agent can continue parsing and rendering."
self attributeAt: 'defer' put: true
self attributeAt: 'defer' put: true
@@ -1,6 +1,6 @@
{
"instance" : {
"defer" : "pmm 9/22/2007 07:36",
"defer" : "pmm 9/9/2017 14:37",
"beJavascript" : "jf 9/22/2008 13:02",
"tag" : "lr 3/27/2007 11:27",
"url:" : "pmm 10/7/2006 18:10"
Expand Down
7 changes: 1 addition & 6 deletions repository/Seaside-Core.package/monticello.meta/version

Large diffs are not rendered by default.

@@ -1,10 +1,11 @@
private
attribute: aKey with: aValue
attribute: aKey with: aValue
aValue == false ifTrue: [ ^ self ].
html space.
html span
class: 'wa-attribute-key';
with: aKey.
aValue == true ifTrue: [ ^ self ].
self nextPut: $=.
html span
class: 'wa-attribute-value';
Expand Down
Expand Up @@ -2,7 +2,7 @@
"instance" : {
"openTag:attributes:closed:" : "jf 2/9/2011 23:34",
"indent" : "jf 2/9/2011 23:50",
"attribute:with:" : "jf 2/9/2011 23:41",
"attribute:with:" : "pmm 9/9/2017 14:29",
"knownEvents" : "pmm 9/8/2017 09:31",
"initializeWithContext:" : "pmm 2/19/2012 15:21",
"knownRefs" : "lr 4/20/2007 22:11",
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -5,10 +5,10 @@ testCheckboxTag
gives: '<input type="checkbox"/>'.
self
assert: [ :html | html checkbox value: true ]
gives: '<input checked="checked" type="checkbox"/>'.
gives: '<input checked type="checkbox"/>'.
self
assert: [ :html | html checkbox value: false; callback: [ :value | ] ]
gives: '<input name="1" type="checkbox"/><input name="2" type="hidden"/>'.
self
assert: [ :html | html checkbox value: true; callback: [ :value | ] ]
gives: '<input checked="checked" name="1" type="checkbox"/><input name="2" type="hidden"/>'
gives: '<input checked name="1" type="checkbox"/><input name="2" type="hidden"/>'
Expand Up @@ -2,4 +2,4 @@ tests-tags-anchors
testMapTag
self
assert: [ :html | html map callback: [ :point | ]; with: [ html image url: 'seaside.jpg' ] ]
gives: '<a href="/?1="><img alt="" ismap="ismap" src="seaside.jpg"/></a>'
gives: '<a href="/?1="><img alt="" ismap src="seaside.jpg"/></a>'
Expand Up @@ -2,16 +2,16 @@ tests-tags-forms
testMultiSelectTag
self
assert: [ :html | html multiSelect ]
gives: '<select multiple="multiple"></select>'.
gives: '<select multiple></select>'.
self
assert: [ :html | html multiSelect list: #(1 2) ]
gives: '<select multiple="multiple"><option>1</option><option>2</option></select>'.
gives: '<select multiple><option>1</option><option>2</option></select>'.
self
assert: [ :html | html multiSelect list: #(1 2); labels: [ :v | 2 * v ] ]
gives: '<select multiple="multiple"><option>2</option><option>4</option></select>'.
gives: '<select multiple><option>2</option><option>4</option></select>'.
self
assert: [ :html | html multiSelect list: #(1 2); enabled: [ :v | v even ] ]
gives: '<select multiple="multiple"><option disabled="disabled">1</option><option>2</option></select>'.
gives: '<select multiple><option disabled>1</option><option>2</option></select>'.
self
assert: [ :html | html multiSelect list: #(3 4); callback: [ :v | ] ]
gives: '<select name="1" multiple="multiple"><option value="1">3</option><option value="2">4</option></select><input name="2" type="hidden"/>'
gives: '<select name="1" multiple><option value="1">3</option><option value="2">4</option></select><input name="2" type="hidden"/>'
Expand Up @@ -8,4 +8,4 @@ testScriptTag
gives: '<script type="text/javascript">true & false</script>'.
self
assert: [ :html | html script defer; with: 'alert("<foo>")' ]
gives: '<script defer="defer" type="text/javascript">alert("<foo>")</script>'
gives: '<script defer type="text/javascript">alert("<foo>")</script>'
Expand Up @@ -11,7 +11,7 @@ testSelectTag
gives: '<select><option>2</option><option>4</option></select>'.
self
assert: [ :html | html select list: #(1 2); enabled: [ :v | v even ] ]
gives: '<select><option disabled="disabled">1</option><option>2</option></select>'.
gives: '<select><option disabled>1</option><option>2</option></select>'.
self
assert: [ :html | html select list: #(1 2); callback: [ :v | ] ]
gives: '<select name="1"><option value="1">1</option><option value="2">2</option></select>'
Expand Up @@ -10,11 +10,11 @@
"testTextInput" : "pmm 8/22/2014 17:16",
"testCoreAttributesStyle" : "lr 4/9/2007 18:18",
"testCoreAttributesClass" : "lr 10/28/2007 14:42",
"testMapTag" : "lr 3/26/2008 22:36",
"testSelectTag" : "obi 12/30/2009 14:31",
"testMapTag" : "pmm 9/9/2017 14:36",
"testSelectTag" : "pmm 9/9/2017 14:38",
"testTableColumnGroup" : "lr 3/24/2008 17:33",
"testAnchor" : "pmm 9/1/2012 16:02",
"testCheckboxTag" : "pmm 8/22/2014 17:13",
"testCheckboxTag" : "pmm 9/9/2017 14:35",
"testEditTag" : "lr 4/28/2007 18:58",
"testCanvasWithUrls" : "lr 10/28/2007 14:42",
"testExtendedNesting" : "lr 4/9/2007 18:28",
Expand Down Expand Up @@ -43,7 +43,7 @@
"testUnorderedListTag" : "lr 6/6/2007 13:55",
"testAnchorUrl" : "jf 2/15/2010 02:08",
"testSubmitButton" : "pmm 8/22/2014 17:15",
"testMultiSelectTag" : "pmm 8/22/2014 17:14",
"testMultiSelectTag" : "pmm 9/9/2017 14:36",
"testSymbolRendering" : "pmm 10/2/2007 06:53",
"testTableData" : "lr 3/24/2008 17:29",
"testClosingTimes" : "lr 10/28/2007 14:42",
Expand All @@ -52,7 +52,7 @@
"testKeyboardAttributes" : "lr 12/28/2008 11:30",
"testCoreAttributesTitle" : "lr 4/9/2007 18:18",
"testBasicNesting" : "lr 4/9/2007 18:28",
"testScriptTag" : "pmm 8/22/2014 18:04",
"testScriptTag" : "pmm 9/9/2017 14:37",
"testCancelButton" : "pmm 8/22/2014 17:12"
},
"class" : { }
Expand Down
Expand Up @@ -6,7 +6,7 @@ testConditionalComment
html script
defer;
url: 'http://www.example.com/bugs.js' ] ]
gives: '<title></title><!--[if gte IE 5.5]><script defer="defer" src="http://www.example.com/bugs.js"></script><![endif]-->'.
gives: '<title></title><!--[if gte IE 5.5]><script defer src="http://www.example.com/bugs.js"></script><![endif]-->'.

self
assertRoot: [ :html |
Expand Down
Expand Up @@ -5,4 +5,4 @@ testRevealedConditionalComment
html script
defer;
url: 'http://www.example.com/bugs.js' ] ]
gives: '<title></title><!--[if IE 7]><!--><script defer="defer" src="http://www.example.com/bugs.js"></script><!--<![endif]-->'
gives: '<title></title><!--[if IE 7]><!--><script defer src="http://www.example.com/bugs.js"></script><!--<![endif]-->'
Expand Up @@ -2,13 +2,13 @@
"instance" : {
"testContentType" : "pmm 8/26/2016 08:58",
"testStyle" : "pmm 8/26/2016 08:59",
"testConditionalComment" : "pmm 8/26/2016 09:01",
"testConditionalComment" : "pmm 9/9/2017 14:38",
"testLinkElementWithContent" : "pmm 8/26/2016 08:59",
"testJavascript" : "pmm 8/26/2016 08:58",
"testLinkElement" : "pmm 8/26/2016 08:59",
"assertRoot:gives:" : "pmm 8/26/2016 08:58",
"testInteger" : "pmm 8/26/2016 09:01",
"testRevealedConditionalComment" : "pmm 8/26/2016 08:59",
"testRevealedConditionalComment" : "pmm 9/9/2017 14:38",
"assert:gives:" : "pmm 8/26/2016 09:00"
},
"class" : { }
Expand Down

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions repository/Seaside-Tests-Development.package/.filetree
@@ -1,4 +1,5 @@
{
"noMethodMetaData" : true,
"separateMethodMetaAndSource" : false,
"useCypressPropertiesFile" : true }
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}
@@ -1,5 +1,6 @@
{
"instance" : { },
"class" : {
"seasideTestsDevelopment" : "lr 2/17/2010 15:13" },
"instance" : {
} }
"seasideTestsDevelopment" : "lr 2/17/2010 15:13"
}
}
@@ -1,2 +1,3 @@
{
"name" : "GRPackage" }
"name" : "GRPackage"
}
@@ -1,8 +1,9 @@
{
"class" : {
},
"instance" : {
"handleException:debuggerSimulation:" : "jf 3/14/2009 01:11",
"simulateWithDebugBlock:progress:result:" : "jf 9/30/2009 00:19",
"testMechanismProceed" : "lr 7/25/2011 19:00",
"testMechanismAbort" : "lr 7/25/2011 19:00",
"testMechanismProceed" : "lr 7/25/2011 19:00" } }
"handleException:debuggerSimulation:" : "jf 3/14/2009 01:11",
"simulateWithDebugBlock:progress:result:" : "jf 9/30/2009 00:19"
},
"class" : { }
}
@@ -1,14 +1,11 @@
{
"category" : "Seaside-Tests-Development",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "jf 9/19/2008 19:32",
"instvars" : [
],
"name" : "WADebugErrorHandlerTest",
"pools" : [
],
"super" : "TestCase",
"type" : "normal" }
"category" : "Seaside-Tests-Development",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WADebugErrorHandlerTest",
"type" : "normal"
}
@@ -1,5 +1,4 @@
{
"class" : {
},
"instance" : {
} }
"instance" : { },
"class" : { }
}
@@ -1,14 +1,11 @@
{
"category" : "Seaside-Tests-Development",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "WADevelopmentPlatformTest",
"pools" : [
],
"super" : "TestCase",
"type" : "normal" }
"category" : "Seaside-Tests-Development",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WADevelopmentPlatformTest",
"type" : "normal"
}
Expand Up @@ -2,4 +2,4 @@ testing
testRendering
self
assert: WAPrettyPrintedDocumentTestComponent new
rendersAs: '&lt;<span class="wa-tag">h1</span>&nbsp;<span class="wa-attribute-key">title</span>=<span class="wa-attribute-value">&quot;&amp;amp;foo;&quot;</span>&gt;&amp;amp;foo;&lt;/<span class="wa-tag">h1</span>&gt;&amp;nbsp;<br/>&lt;<span class="wa-tag">a</span>&nbsp;<span class="wa-attribute-key">onclick</span>=<span class="wa-attribute-value">&quot;<a onclick="$(&amp;quot;#seastar&amp;quot;).animate({&amp;quot;left&amp;quot;:&amp;quot;-=100px&amp;quot;},{})">$(&amp;amp;quot;#seastar&amp;amp;quot;).animate({&amp;amp;quot;left&amp;amp;quot;:&amp;amp;quot;-=100px&amp;amp;quot;},{})</a>&quot;</span>&gt;Move Left&lt;/<span class="wa-tag">a</span>&gt;'
rendersAs: '&lt;<span class="wa-tag">h1</span>&nbsp;<span class="wa-attribute-key">title</span>=<span class="wa-attribute-value">&quot;&amp;amp;foo;&quot;</span>&gt;&amp;amp;foo;&lt;/<span class="wa-tag">h1</span>&gt;&amp;nbsp;<br/>&lt;<span class="wa-tag">a</span>&nbsp;<span class="wa-attribute-key">disabled</span>&nbsp;<span class="wa-attribute-key">onclick</span>=<span class="wa-attribute-value">&quot;<a onclick="$(&amp;quot;#seastar&amp;quot;).animate({&amp;quot;left&amp;quot;:&amp;quot;-=100px&amp;quot;},{})">$(&amp;amp;quot;#seastar&amp;amp;quot;).animate({&amp;amp;quot;left&amp;amp;quot;:&amp;amp;quot;-=100px&amp;amp;quot;},{})</a>&quot;</span>&gt;Move Left&lt;/<span class="wa-tag">a</span>&gt;'
@@ -1,8 +1,9 @@
{
"class" : {
},
"instance" : {
"assert:rendersAs:" : "pmm 6/25/2011 19:47",
"testEventsInKnownEvents" : "pmm 8/5/2011 23:13",
"testKnownEventsInTagBrush" : "pmm 6/26/2011 14:20",
"testRendering" : "pmm 2/19/2012 15:40" } }
"testEventsInKnownEvents" : "pmm 8/5/2011 23:13",
"assert:rendersAs:" : "pmm 6/25/2011 19:47",
"testRendering" : "pmm 9/9/2017 14:30"
},
"class" : { }
}
@@ -1,14 +1,11 @@
{
"category" : "Seaside-Tests-Development",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "WAPrettyPrintedDocumentTest",
"pools" : [
],
"super" : "WAContextTest",
"type" : "normal" }
"category" : "Seaside-Tests-Development",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAPrettyPrintedDocumentTest",
"type" : "normal"
}
Expand Up @@ -5,5 +5,6 @@ renderContentOn: html
with: '&foo;'.
html space.
html anchor
disabled: true;
onClick: '$(&quot;#seastar&quot;).animate({&quot;left&quot;:&quot;-=100px&quot;},{})';
with: 'Move Left'
@@ -1,5 +1,6 @@
{
"class" : {
},
"instance" : {
"renderContentOn:" : "pmm 2/19/2012 15:40" } }
"renderContentOn:" : "pmm 9/9/2017 14:25"
},
"class" : { }
}
@@ -1,14 +1,11 @@
{
"category" : "Seaside-Tests-Development",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "WAPrettyPrintedDocumentTestComponent",
"pools" : [
],
"super" : "WAComponent",
"type" : "normal" }
"category" : "Seaside-Tests-Development",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "WAPrettyPrintedDocumentTestComponent",
"type" : "normal"
}
@@ -1,5 +1,6 @@
{
"class" : {
},
"instance" : {
"testFrameCount" : "pmm 9/2/2012 13:26" } }
"testFrameCount" : "pmm 9/2/2012 13:26"
},
"class" : { }
}

0 comments on commit 9035476

Please sign in to comment.