RESOLVED INVALID 29467
[Qt] QWebPage::findText() should allow to find text from the beginning
https://bugs.webkit.org/show_bug.cgi?id=29467
Summary [Qt] QWebPage::findText() should allow to find text from the beginning
Tor Arne Vestbø
Reported 2009-09-18 08:26:23 PDT
This bug report originated from issue QTBUG-2667 <http://bugreports.qt.nokia.com/browse/QTBUG-2667> --- Description --- There is no FindFlag to specify that findText() should find text from the beginning of the document. If findText() has already been called and a text is selected, it should be possible to search from the beginning of the document again.
Attachments
Patch for review (3.96 KB, patch)
2011-03-10 11:46 PST, Aparna Nandyal
kling: review-
Aparna Nandyal
Comment 1 2011-03-10 11:46:29 PST
Created attachment 85356 [details] Patch for review Added a new flag. If this flag is set, search will begin from the top of the document.
Alexis Menard (darktears)
Comment 2 2011-03-18 06:25:33 PDT
Comment on attachment 85356 [details] Patch for review I'm just curious what is the use case for that? A button in the UI to search from start?
Alexis Menard (darktears)
Comment 3 2011-03-18 06:28:52 PDT
Comment on attachment 85356 [details] Patch for review LGTM
Aparna Nandyal
Comment 4 2011-03-18 08:33:15 PDT
> I'm just curious what is the use case for that? A button in the UI to search from start? Yes. That seems to be the obvious use case.
Benjamin Poulain
Comment 5 2011-03-18 08:46:19 PDT
I don't think we should add API for corner case that could be solved in a more elegant way with other, better API. In that case, if we had a API to control and get the selection, this enum just become a special case. I am in favor of rejecting this bug altogether since the complexity of adding and supporting new code/doc is not worth the use case IMHO. Otherwise the patch looks good, so it really boils down to what is the opinion of the other WebKittens :)
Alexis Menard (darktears)
Comment 6 2011-03-18 08:56:18 PDT
(In reply to comment #5) > I don't think we should add API for corner case that could be solved in a more elegant way with other, better API. > > In that case, if we had a API to control and get the selection, this enum just become a special case. I have to agree. Perhaps we could introduce a very simplified version of http://doc.qt.nokia.com/4.7/qitemselectionmodel.html where you can go through the references a bit like a list? QWebPage::findText(str)->at(0) or something like that. Not sure we want to fill an entire "model" for that though (let say the number of words you find is huge). > > I am in favor of rejecting this bug altogether since the complexity of adding and supporting new code/doc is not worth the use case IMHO. > > Otherwise the patch looks good, so it really boils down to what is the opinion of the other WebKittens :)
Andreas Kling
Comment 7 2011-03-18 09:01:30 PDT
Personally I would rather see us exposing proper DOM ranges in our API. This is a big task which requires exposing text nodes, etc.
Pierre Rossi
Comment 8 2011-03-18 09:57:19 PDT
In favor of the solution proposed by Andreas, we definitely need a QtWebKit API exposing the JS range stuff.
Andreas Kling
Comment 9 2011-04-26 16:07:52 PDT
Comment on attachment 85356 [details] Patch for review View in context: https://bugs.webkit.org/attachment.cgi?id=85356&action=review > Source/WebKit/qt/Api/qwebpage.cpp:3587 > + if ((subString.isEmpty()) || (options & FindFromBeginning)) { Style, two spaces before { > Source/WebKit/qt/ChangeLog:5 > + [Qt] QWebPage::findText() should allow to find text from the beginning We should do this with a QWebElement-like API that exposes all nodes, not just elements. Please see the webkit-qt discussion about the topic.
Jocelyn Turcotte
Comment 10 2014-02-03 03:15:44 PST
=== 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.
Note You need to log in before you can comment on or make changes to this bug.