Sfoglia il codice sorgente

Remove uses of PlatformDom >> newXxx.

Use raw DOM calls instead.
Herbert Vojčík 7 anni fa
parent
commit
300f7f72dd
2 ha cambiato i file con 10 aggiunte e 10 eliminazioni
  1. 8 8
      src/Platform-DOM.js
  2. 2 2
      src/Platform-DOM.st

+ 8 - 8
src/Platform-DOM.js

@@ -198,17 +198,17 @@ var self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-return $recv($globals.PlatformDom)._newTextNode_(self._asString());
+return $recv(document)._createTextNode_(self._asString());
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"asDomNode",{},$globals.CharacterArray)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "asDomNode\x0a\x09^ PlatformDom newTextNode: self asString",
-referencedClasses: ["PlatformDom"],
+source: "asDomNode\x0a\x09^ document createTextNode: self asString",
+referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["newTextNode:", "asString"]
+messageSends: ["createTextNode:", "asString"]
 }),
 $globals.CharacterArray);
 
@@ -222,7 +222,7 @@ var fragment;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-fragment=$recv($globals.PlatformDom)._newDocumentFragment();
+fragment=$recv(document)._createDocumentFragment();
 self._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -239,10 +239,10 @@ return fragment;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "asDomNode\x0a\x09| fragment |\x0a\x09fragment := PlatformDom newDocumentFragment.\x0a\x09self do: [ :each | fragment appendChild: each asDomNode ].\x0a\x09^ fragment",
-referencedClasses: ["PlatformDom"],
+source: "asDomNode\x0a\x09| fragment |\x0a\x09fragment := document createDocumentFragment.\x0a\x09self do: [ :each | fragment appendChild: each asDomNode ].\x0a\x09^ fragment",
+referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: ["newDocumentFragment", "do:", "appendChild:", "asDomNode"]
+messageSends: ["createDocumentFragment", "do:", "appendChild:", "asDomNode"]
 }),
 $globals.Collection);
 

+ 2 - 2
src/Platform-DOM.st

@@ -55,14 +55,14 @@ isFeasible
 !CharacterArray methodsFor: '*Platform-DOM'!
 
 asDomNode
-	^ PlatformDom newTextNode: self asString
+	^ document createTextNode: self asString
 ! !
 
 !Collection methodsFor: '*Platform-DOM'!
 
 asDomNode
 	| fragment |
-	fragment := PlatformDom newDocumentFragment.
+	fragment := document createDocumentFragment.
 	self do: [ :each | fragment appendChild: each asDomNode ].
 	^ fragment
 ! !