0

在浏览器中,如果我想提交一个包含用户名和密码输入的表单,我只需要添加一个“action”属性并将“method”属性设置为“post”:

<form method="post" name="form" action="https://www.xxx">
  <input id="username" type="text" value="xxxxxx" name="username">
  <input id="password" type="password" autocomplete="off" name="password">
  <input type="submit" value="submit" >
</form>

然后浏览器将处理帖子并将密码和用户名作为请求连接起来并发送到服务器。

我的问题是:在webkit中(我关心的是Android webkit,但我认为其他人也可以),处理这种过程的代码在哪里?我可以找到从输入元素中获取文本的代码,将它们连接起来,然后发送到服务器吗?

谢谢

4

1 回答 1

0

where there's no answer, I finally find it. For webkit, there's mainly four directory we need to consider in android:

for java part:

  • framework/base/core/java/androud/webkit

for native c part

  • external/webkit/Source/WebCore
  • external/webkit/Source/WebKit
  • external/webkit/Source/JavaScriptCore

for the form submit, the java part webkit will send a key event which will be handled by C WebCore.

we can see the code from

  • WebCore/html/HTMLFormElement.cpp
  • WebCore/loader/FormSubmission.cpp
  • WebCore/loader/FrameLoader.cpp
于 2013-06-04T07:23:44.397 回答