Index: WebKit/HTTPRequest.py
===================================================================
RCS file: /cvsroot/webware/Webware/WebKit/HTTPRequest.py,v
retrieving revision 1.37
diff -u -r1.37 HTTPRequest.py
--- WebKit/HTTPRequest.py	13 Feb 2002 07:11:13 -0000	1.37
+++ WebKit/HTTPRequest.py	6 Apr 2002 22:08:38 -0000
@@ -113,6 +113,61 @@
 		self._fields = dict
 		self._pathInfo = None
 
+		# change the fields in place to accomodate an image-type submit button coupled with webkit _action_ flags
+		# image submit buttons split up the field into two fields... so, 'submit' becomes 'submit.x' and 'submit.y'
+		# with values of the x and y coordinates where the user clicked. If there was no "click" (like when the user
+		# presses enter or when the client is lynx, this split still happens, but the coordinates are 0,0
+		#
+		# NOTE: We are only doing this for _action_[something] fields, because that's really only when it matters
+		# from a webkit perspective. Webkit can't latch onto the methodname following "_action_" if the browser
+		# appends .x and .y
+		#
+		# see http://www.w3.org/TR/REC-html32#input for more on this subject
+		#
+		# @@ NOTE: this doesn't accomodate more than one image submit... should it? Can one have that situation?
+		# @@ NOTE: this currently assigns the coordinates as a tuple. Is that ok, or should it be a list?
+		# @@ NOTE: this chunk of cruft may slow down HTTPRequest overly; how can I optimize it?
+		tmpKeys = self._fields.keys()
+		tmpKeys.sort() 	# put any _something fields together, in hopes of sorting through fewer fields...
+						# _action_... fields should get placed 'near' the top
+
+		foundX = foundY = None	# flags, also store the value of those fields if I see them
+		for key in tmpKeys:
+			if foundX and foundY:
+				break # don't bother looking anymore.. we've got 'em
+			if key[:8] == "_action_":
+				if key[-2:] == ".x":
+					# grab the key
+					foundX = key
+				elif key[-2:] == ".y":
+					foundY = key
+				
+		# now, if we found both fields, get them out of input and replace them
+		if foundX and foundY:
+			# grab the coordinate values from the fields
+			xCoord = self._fields[foundX]
+			yCoord = self._fields[foundY]
+
+			# now delete those fields
+			del(self._fields[foundX])
+			del(self._fields[foundY])
+
+			# derive the label for the new field
+			label = foundX[8:-2] #strip off the _action_ and the .x
+
+			# make sure the coordinates are integers (mostly for spoofing)
+			try:
+				xCoord = int(xCoord)
+				yCoord = int(yCoord)
+			except ValueError:
+				# if something is fishy, just assign zeros
+				xCoord,yCoord = 0,0
+
+			# assign the new field with the derived label and coordinates
+			# AS A TUPLE
+			self._fields['_action_%s' % label] = (xCoord,yCoord)
+
+
 		# We use Tim O'Malley's Cookie class to get the cookies, but then change them into an ordinary dictionary of values
 		dict = {}
 		for key in self._cookies.keys():
