[Webkit-unassigned] [Bug 31099] New: [Qt] Add a way to access text nodes tree with QWebElement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 3 22:24:51 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=31099

           Summary: [Qt] Add a way to access text nodes tree with
                    QWebElement
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: Qt
          Severity: Normal
          Priority: P3
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: benjamin.poulain at nokia.com
                CC: hausmann at webkit.org, benjamin.poulain at nokia.com


There is no way to access text nodes children of QWebElement. This limit the
use of the API. Here is an example

How do I get "prefix" and "suffix" with QWebElement in the following snippet:
"<div>
  prefix
  <img src=""/>
  suffix
</div>"


To solve this, we could introduce a new class to iterate over the content of
the QWebElement (QWebElementIterator || QWebElementCusor).

E.g.:

QWebElementCursor cursor(element);
while (cursor.next()) {
    if (cursor.isText()) {
        cursor.setHtml(QString("<p>%1</p>").arg(cursor.text()));
        //? int selectionOffset = cursor.textSelectionBeginning();
    } else if (cursor.isElement()) {
        QWebElement child = cursor.element();
        child.encloseWith("<div>");
    }
}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list