Bug 37023

Summary: [Qt] Expose HTMLTokenizer yielding parameters
Product: WebKit Reporter: Laszlo Gombos <laszlo.gombos>
Component: WebKit QtAssignee: Laszlo Gombos <laszlo.gombos>
Status: CLOSED FIXED    
Severity: Normal CC: eric, hausmann, kenneth, ostap73
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Bug Depends on:    
Bug Blocks: 35784    
Attachments:
Description Flags
proposed patch
none
2nd try, using DynamicProperties none

Description Laszlo Gombos 2010-04-02 07:06:38 PDT
These interfaces are useful in CPU-contained environments. Similar interface is exposed in Safari.
Comment 1 Laszlo Gombos 2010-04-02 07:10:00 PDT
Created attachment 52415 [details]
proposed patch
Comment 2 Kenneth Rohde Christiansen 2010-04-02 11:47:46 PDT
Laszlo should this patch be integrated in our 2.0 release branch after landing on trunk? if so, please add it as blocker.
Comment 3 Laszlo Gombos 2010-04-14 17:08:51 PDT
Comment on attachment 52415 [details]
proposed patch

Changed mind, let's use DynamicProperties instead.
Comment 4 Laszlo Gombos 2010-04-28 20:40:14 PDT
Created attachment 54667 [details]
2nd try, using DynamicProperties
Comment 5 Simon Hausmann 2010-04-29 00:36:18 PDT
Comment on attachment 54667 [details]
2nd try, using DynamicProperties

> Index: WebKit/qt/ChangeLog
> ===================================================================
> --- WebKit/qt/ChangeLog	(revision 58467)
> +++ WebKit/qt/ChangeLog	(working copy)
> @@ -1,3 +1,16 @@
> +2010-04-28  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        [Qt] Expose HTMLTokenizer yielding parameters
> +        https://bugs.webkit.org/show_bug.cgi?id=37023
> +
> +        Enables to set TimeDelay and ChunkSize for 
> +        HTMLTokenizer.
> +
> +        * Api/qwebpage.cpp:
> +        (QWebPagePrivate::dynamicPropertyChangeEvent):
> +
>  2010-04-28  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
>  
>          Unreviewed, Qt build fix.
> Index: WebKit/qt/Api/qwebpage.cpp
> ===================================================================
> --- WebKit/qt/Api/qwebpage.cpp	(revision 58462)
> +++ WebKit/qt/Api/qwebpage.cpp	(working copy)
> @@ -1219,6 +1219,14 @@ void QWebPagePrivate::dynamicPropertyCha
>              view->forceLayout();
>          }
>      }
> +    else if (event->propertyName() == "HTMLTokenizerChunkSize") {
> +        int chunkSize = q->property("HTMLTokenizerChunkSize").toInt();
> +        q->handle()->page->setCustomHTMLTokenizerChunkSize(chunkSize);
> +    }
> +    else if (event->propertyName() == "HTMLTokenizerTimeDelay") {
> +        double timeDelay = q->property("HTMLTokenizerTimeDelay").toDouble();
> +        q->handle()->page->setCustomHTMLTokenizerTimeDelay(timeDelay);
> +    }
>  }
>  
>  void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event)
WebKit/qt/Api/qwebpage.cpp:1222
 +      else if (event->propertyName() == "HTMLTokenizerChunkSize") {
Shouldn't the else be merged with the previous line? :)

WebKit/qt/Api/qwebpage.cpp:1230
 +  }
It would be nice to call the base implementation here, just for future proofing.
Comment 6 Simon Hausmann 2010-04-29 00:36:34 PDT
Do you want this patch in the 2.0 release?
Comment 7 Eric Seidel (no email) 2010-05-02 19:30:48 PDT
Attachment 54667 [details] was posted by a committer and has review+, assigning to Laszlo Gombos for commit.
Comment 8 Laszlo Gombos 2010-05-03 18:59:17 PDT
Comment on attachment 54667 [details]
2nd try, using DynamicProperties

Committed as http://trac.webkit.org/changeset/58727 with the style change pointed out by Simon. In addition prefixed the property names with _q_ as discussed in bug 38119.
Comment 9 Laszlo Gombos 2010-05-03 19:01:12 PDT
(In reply to comment #6)
> Do you want this patch in the 2.0 release?

Yes, please.
Comment 10 Simon Hausmann 2010-05-05 08:21:45 PDT
<cherry-pick-for-backport: r58727>
Comment 11 Simon Hausmann 2010-05-07 16:02:46 PDT
Revision r58727 cherry-picked into qtwebkit-2.0 with commit af21ac4af5aee469e8ea1334b0dc56f26d7aa180