Bug 63603
Summary: | [Qt] QWebFrame::findAllElements fails to retireve elements on non-valid web pages. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Dawit A. <adawit> |
Component: | WebKit Qt | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | allan.jensen, lindsay.mathieson, pierre.rossi |
Priority: | P2 | Keywords: | Qt |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Dawit A.
Calling "QWebFrame::findAllElements(QLatin1String("form[method=post]"))" on the reduced snippet from an actual page below fails to return all the <input> elements of the form. I am not sure if this is a bug since the HTML below is clearly invalid, but unfortunately there are many such broken web sites out there. In fact this snippet comes from a bug reported downstream, https://bugs.kde.org/show_bug.cgi?id=256029. As such for parsing web forms in kdewebkit we are forced to use JavaScript and the DOM. The question is, this something QtWebKit/webkit should handle properly ? Or is this the limitation of the QWebElement interface due to it reliance on the CSS 3 query language to retrieve elements ?
<table cellspacing=1 cellpadding=5>
<tr>
<td class=listtitle colspan=2>Please enter your Username and Password</td>
</tr>
<form action="/CMD_LOGIN" method="POST" name="form">
<input type=hidden name=referer value="/">
<tr>
<td class=list align=right>Username:</td>
<td class=list><input type=text name=username></td>
</tr>
<tr>
<td class=list align=right>Password:</td>
<td class=list><input type=password name=password></td>
</tr>
<tr>
<td class=listtitle align=right colspan=2><input type=submit value='Login'></td>
</tr>
<tr>
<td align=center colspan=2><a href="/CMD_LOST_PASSWORD">Forgot your Password?</a></td>
</tr>
</form>
</table>
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Allan Sandfeld Jensen
The form element do not necessarily contain all their inputs as children. I think they are accessible as HTMLFormElement::associatedElements(). So it is kind of a separate structure to deal with illformed html.
Jocelyn Turcotte
=== Bulk closing of Qt bugs ===
If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.
If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.