[webkit-qt] New API for comments
Michael.Tyutyunik at nokia.com
Michael.Tyutyunik at nokia.com
Wed Mar 2 15:55:14 PST 2011
Is the scope of these changes limited only to text handling use cases?
I was thinking about having something in QWebElement to detemine if there is JS event listener. It might be useful in some cases with touch screen, to handle DHTML.
Misha
________________________________________
From: webkit-qt-bounces at lists.webkit.org [webkit-qt-bounces at lists.webkit.org] on behalf of ext Benjamin Poulain [benjamin.poulain at nokia.com]
Sent: Wednesday, March 02, 2011 6:56 AM
To: Hausmann Simon (Nokia-MS-Qt/Oslo)
Cc: webkit-qt at lists.webkit.org
Subject: Re: [webkit-qt] New API for comments
On 03/02/2011 10:03 AM, Simon Hausmann wrote:
> However in general I'm not a fan of introducing a Node class. It was a very concious
> decision early on _not_ to repeat the API mistake of DOM to distinguish between Nodes and Elements,
> as it requires constant type-casting.
>
> Perhaps in our case it's not that bad, given that QWebElement is rather powerful. But I think it's would
> also be worth it to explore a cursor / iterator style API on a web element. At least for a side-by-side comparision.
I think the API could get ugly with Iterator. And that would stop us
from extending further to other kind of nodes (if cdata or comments
become popular ;)).
We are trying to solve two main kinds of problems:
1) mix of element and text: <p>Try to put this in italic <b>some
bold</b></p>
2) selection and carret position (W3C range)
For (1), let say we want to put all text node as italic:
while (iterator.hasNext()) {
if (iterator.isText())
iterator.encloseContentsWith("<i>"); -> isn't that strange to
enclose the iterator?
}
For (2), let say we want to put the selection as italic. I can't even
start to think how to deal with that with iterators.
cheers,
Benjamin
_______________________________________________
webkit-qt mailing list
webkit-qt at lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-qt
More information about the webkit-qt
mailing list