[webkit-dev] Browser application, how to serialize

2009-06-30 Thread Nitin Mahajan

HI!

I am running a example browser application on an ARM cpu on QtWebKit. I have 
implemented keyPressEvent() in WebView(derived from QWebView) class like this

239 void WebView::keyPressEvent(QKeyEvent *key)
240 {
241 switch(key-key())
242 {
243 case Qt::Key_F10:
244 QWebFrame *frame = page()-mainFrame();
245 const qreal scaleFactor = 1.2000;
246 qDebug()  Zoom Begin;
247 myLabel-show();
248 frame-setZoomFactor(scaleFactor);
249 qDebug()  Zoom end;
250 break;
251 }
252 }


myLabel is a Label widget constructed in constructor of WebView class. 

The problem is after the setZoomFactor() has finished zooming the frame, we get 
to see the label widget. The qDebug() statements however get displayed on 
console in s sequence they are written in code.

I want to display the label before starting to zoom and hide the label after 
the frame has been zoomed. Can you please help me in knowing how can I 
serialize these functionalities?

regards

-Nitin


  New Email addresses available on Yahoo!
Get the Email name you#39;ve always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Browser application, how to serialize

2009-06-30 Thread Ariya Hidayat

 The problem is after the setZoomFactor() has finished zooming the frame, we
 get to see the label widget. The qDebug() statements however get displayed
 on console in s sequence they are written in code.

 I want to display the label before starting to zoom and hide the label
 after the frame has been zoomed. Can you please help me in knowing how can
 I serialize these functionalities?

Widgets handling in Qt is asynchronous, it will not get the show event until 
the event loop/dispatcher has the chance to deliver that event (which it did 
not while zooming is still being carried out). You might want to have a look 
at http://doc.trolltech.com/4.5/qcoreapplication.html#processEvents for 
details.

A friendly warning: this is more a Qt question, less related to WebKit. Please 
ask such questions on qt-interest list, or post it to StackOverflow, or 
contact Qt support if you are a paid customer, or just call your nearest Qt 
consultant.


-- 
Ariya Hidayat, Software Engineer
Qt Software, Nokia Devices RD
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] How to flatten frames?

2009-06-30 Thread Seo K
Hi,

I want to flatten frames within a frameset so that no individual scrollbars
of frames would appear. This is the behavior of most mobile browsers
including iPhone and Android.

I found the patch from the Android WebKit source code with FLATTEN_FRAMESET.
I applied the patch to the latest version of WebKit and adjusted it the
latest changes, but it does not seem to work.

WebCore/rendering/RenderFrame.cpp

+#if USE(FLATTEN_FRAMESET)
+void RenderFrame::layout()
+{
+if (widget()  widget()-isFrameView()) {
+FrameView* view = static_castFrameView*(widget());
+RenderView* root = NULL;
+if (view-frame()  view-frame()-document() 
+view-frame()-document()-renderer() 
view-frame()-document()-renderer()-isRenderView())
+root =
static_castRenderView*(view-frame()-document()-renderer());
+if (root) {
+// Resize the widget so that the RenderView will layout
according to those dimensions.
+view-resize(m_width, m_height);
+view-layout();
+// We can only grow in width and height because if
positionFrames gives us a width and we become smaller,
+// then the fixup process of forcing the frame to fill extra
space will fail.
+if (m_width  root-docWidth()) {
+view-resize(root-docWidth(), 0);
+view-layout();
+}
+// Honor the height set by RenderFrameSet::positionFrames
unless our document height is larger.
+setHeight(max(root-docHeight(), height()));
+setWidth(max(root-docWidth(), width()));
+}
+}
+setNeedsLayout(false);
+}
+#endif
+


I tested it with http://java.sun.com/j2se/1.5.0/docs/api/ which has three
frames within a frameset.

GtkLauncher hangs when it loads the Java API page. However, after I remove
the following two lines from the patch, it seems to work and frames are
correctly flattened.

if (root) {
// Resize the widget so that the RenderView will layout
according to those dimensions.
-view-resize(m_width, m_height);
-view-layout();
// We can only grow in width and height because if
positionFrames gives us a width and we become smaller,
// then the fixup process of forcing the frame to fill extra
space will fail.


What's the problem here? I attached the whole patch.

Thanks,
K Seo
Index: WebCore/config.h
===
--- WebCore/config.h	(revision 45369)
+++ WebCore/config.h	(working copy)
@@ -176,3 +176,8 @@ typedef float CGFloat;
 #if PLATFORM(WIN)  PLATFORM(CG)
 #define WTF_USE_SAFARI_THEME 1
 #endif
+
+#if PLATFORM(GTK)
+#define WTF_USE_FLATTEN_FRAMESET 1
+#endif
+
Index: WebCore/html/HTMLFrameSetElement.cpp
===
--- WebCore/html/HTMLFrameSetElement.cpp	(revision 45369)
+++ WebCore/html/HTMLFrameSetElement.cpp	(working copy)
@@ -203,6 +203,9 @@ void HTMLFrameSetElement::recalcStyle(St
 {
 if (needsStyleRecalc()  renderer()) {
 renderer()-setNeedsLayout(true);
+#if USE(FLATTEN_FRAMESET)
+static_castRenderFrameSet*(renderer())-setGridNeedsLayout();
+#endif
 setNeedsStyleRecalc(NoStyleChange);
 }
 HTMLElement::recalcStyle(ch);
Index: WebCore/page/FrameView.cpp
===
--- WebCore/page/FrameView.cpp	(revision 45369)
+++ WebCore/page/FrameView.cpp	(working copy)
@@ -953,6 +953,11 @@ void FrameView::scheduleRelayout()
 printf(Scheduling layout for %d\n, delay);
 #endif
 
+#if USE(FLATTEN_FRAMESET)
+if (m_frame-ownerRenderer())
+m_frame-ownerRenderer()-setNeedsLayoutAndPrefWidthsRecalc();
+#endif
+
 m_layoutTimer.startOneShot(delay * 0.001);
 }
 
Index: WebCore/rendering/RenderFrame.cpp
===
--- WebCore/rendering/RenderFrame.cpp	(revision 45369)
+++ WebCore/rendering/RenderFrame.cpp	(working copy)
@@ -27,6 +27,12 @@
 #include FrameView.h
 #include HTMLFrameElement.h
 
+#if USE(FLATTEN_FRAMESET)
+#include Frame.h
+#include Document.h
+#include RenderView.h
+#endif
+
 namespace WebCore {
 
 RenderFrame::RenderFrame(HTMLFrameElement* frame)
@@ -58,4 +64,32 @@ void RenderFrame::viewCleared()
 view-setMarginHeight(marginh);
 }
 
+#if USE(FLATTEN_FRAMESET)
+void RenderFrame::layout()
+{
+if (widget()  widget()-isFrameView()) {
+FrameView* view = static_castFrameView*(widget());
+RenderView* root = NULL;
+if (view-frame()  view-frame()-document() 
+view-frame()-document()-renderer()  view-frame()-document()-renderer()-isRenderView())
+root = static_castRenderView*(view-frame()-document()-renderer());
+if (root) {
+// Resize the widget so that the RenderView will layout according to those dimensions.
+view-resize(m_width, m_height);
+

[webkit-dev] Using memcmp

2009-06-30 Thread Patrick Hanna
I have noticed that rather than using memcmp for comparing strings,  
webkit likes to cast to uint32_t* and compare in a for loop. For  
example, WebCore::equal in AtomicString.cpp and StringHash::equal in  
StringHash.h. Is there any reason not to memcmp? I am assuming that  
most implementations of memcmp will do the word alignment and  
basically do the same thing.


The reason I ask is because StringHash::equal does not check for  
PLATFORM(ARM) or PLATFORM(SH4) so I was going to submit a patch to use  
memcmp for ARM/SH4 but didn't know if that was frowned upon (and  
WebCore::equal does a loop for ARM/SH4 as well).


Thanks,
Patrick
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] How to flatten frames?

2009-06-30 Thread Patrick Hanna
The patch on Android is against a different webkit revision so who  
knows what will happen when patching against the latest webkit.


My first thought is to try view-resize(width(), height()) instead of  
using m_width and m_height but I don't know what that will change.


Have you looked at the stack trace when GtkLauncher hangs to find out  
why those 2 lines are the culprit?


On Jun 30, 2009, at 10:34 AM, Seo K wrote:


Hi,

I want to flatten frames within a frameset so that no individual  
scrollbars of frames would appear. This is the behavior of most  
mobile browsers including iPhone and Android.


I found the patch from the Android WebKit source code with  
FLATTEN_FRAMESET. I applied the patch to the latest version of  
WebKit and adjusted it the latest changes, but it does not seem to  
work.


WebCore/rendering/RenderFrame.cpp

+#if USE(FLATTEN_FRAMESET)
+void RenderFrame::layout()
+{
+if (widget()  widget()-isFrameView()) {
+FrameView* view = static_castFrameView*(widget());
+RenderView* root = NULL;
+if (view-frame()  view-frame()-document() 
+view-frame()-document()-renderer()  view-frame()- 
document()-renderer()-isRenderView())
+root = static_castRenderView*(view-frame()- 
document()-renderer());

+if (root) {
+// Resize the widget so that the RenderView will layout  
according to those dimensions.

+view-resize(m_width, m_height);
+view-layout();
+// We can only grow in width and height because if  
positionFrames gives us a width and we become smaller,
+// then the fixup process of forcing the frame to fill  
extra space will fail.

+if (m_width  root-docWidth()) {
+view-resize(root-docWidth(), 0);
+view-layout();
+}
+// Honor the height set by  
RenderFrameSet::positionFrames unless our document height is larger.

+setHeight(max(root-docHeight(), height()));
+setWidth(max(root-docWidth(), width()));
+}
+}
+setNeedsLayout(false);
+}
+#endif
+


I tested it with http://java.sun.com/j2se/1.5.0/docs/api/ which has  
three frames within a frameset.


GtkLauncher hangs when it loads the Java API page. However, after I  
remove the following two lines from the patch, it seems to work and  
frames are correctly flattened.


if (root) {
// Resize the widget so that the RenderView will layout  
according to those dimensions.

-view-resize(m_width, m_height);
-view-layout();
// We can only grow in width and height because if  
positionFrames gives us a width and we become smaller,
// then the fixup process of forcing the frame to fill  
extra space will fail.



What's the problem here? I attached the whole patch.

Thanks,
K Seo


FlattenFrameSet.diff___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Using memcmp

2009-06-30 Thread Maciej Stachowiak


On Jun 30, 2009, at 9:57 AM, Patrick Hanna wrote:

I have noticed that rather than using memcmp for comparing strings,  
webkit likes to cast to uint32_t* and compare in a for loop. For  
example, WebCore::equal in AtomicString.cpp and StringHash::equal in  
StringHash.h. Is there any reason not to memcmp? I am assuming that  
most implementations of memcmp will do the word alignment and  
basically do the same thing.


We found the copy loop to be a little bit faster than memcmp on the  
platforms where we tested. memcmp tends not to do as well for short  
strings because it doesn't know that the start and end have some  
alignment guarantees. Also there is the function call overhead.


The reason I ask is because StringHash::equal does not check for  
PLATFORM(ARM) or PLATFORM(SH4) so I was going to submit a patch to  
use memcmp for ARM/SH4 but didn't know if that was frowned upon (and  
WebCore::equal does a loop for ARM/SH4 as well).


Is there a reason you'd want to make the code use a different  
implementation depending on the CPU? (It's not obvious to me from your  
message).


Regards,
Maciej

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] italics and blink support on GTK port

2009-06-30 Thread zaheer ahmad
hi,There are couple of issues in latest nightlies on gtk port (issues were
there in earlier builds too),
1- italics do not work for many font families (e.g monospace, serif etc).
the issue seems to be in the fast render path (freetype), if we disable fast
rendering we do not see the issue. http://www.fonttester.com/
2- blink css tag (text-decoration: blink;} is not working
My understanding is that 1 is a bug in webkit and 2 is not supported.
appreciate if someone can corroborate on this.

thanks,
Zaheer
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] italics and blink support on GTK port

2009-06-30 Thread David Hyatt

On Jun 30, 2009, at 1:56 PM, zaheer ahmad wrote:


2- blink css tag (text-decoration: blink;} is not working


Blink is (deliberately) not supported in WebKit.

dave

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] How to flatten frames?

2009-06-30 Thread Seo K
Hi,

Thank you for the reply. I tried view-resize(width(), height(), but
it does not make any difference.

The stack trace is like the following when GTKLauncher hangs.

#0  0xb74e80ac in WTF::PairFirstExtractorstd::pairunsigned int,
unsigned long ::extract (p...@0x90c8860) at
JavaScriptCore/wtf/HashMap.h:93
#1  0xb74e811a in WTF::HashTableunsigned int, std::pairunsigned int,
unsigned long, WTF::PairFirstExtractorstd::pairunsigned int,
unsigned long , WTF::IntHashunsigned int,
WTF::PairHashTraitsWTF::HashTraitsunsigned int,
WTF::HashTraitsunsigned long , WTF::HashTraitsunsigned int
::isEmptyBucket (val...@0x90c8860) at
JavaScriptCore/wtf/HashTable.h:336
#2  0xb74e813d in WTF::HashTableunsigned int, std::pairunsigned int,
unsigned long, WTF::PairFirstExtractorstd::pairunsigned int,
unsigned long , WTF::IntHashunsigned int,
WTF::PairHashTraitsWTF::HashTraitsunsigned int,
WTF::HashTraitsunsigned long , WTF::HashTraitsunsigned int
::isEmptyOrDeletedBucket (val...@0x90c8860) at
JavaScriptCore/wtf/HashTable.h:338
#3  0xb74e8191 in WTF::HashTableConstIteratorunsigned int,
std::pairunsigned int, unsigned long,
WTF::PairFirstExtractorstd::pairunsigned int, unsigned long ,
WTF::IntHashunsigned int,
WTF::PairHashTraitsWTF::HashTraitsunsigned int,
WTF::HashTraitsunsigned long , WTF::HashTraitsunsigned int
::skipEmptyBuckets (this=0xbfe5bbcc) at
JavaScriptCore/wtf/HashTable.h:107
#4  0xb74e91de in HashTableConstIterator (this=0xbfe5bbcc,
table=0x90c5870, position=0x90c8798, endPosition=0x90c8998) at
JavaScriptCore/wtf/HashTable.h:115
#5  0xb74e920a in HashTableIterator (this=0xbfe5bbcc, table=0x90c5870,
pos=0x90c8798, end=0x90c8998) at JavaScriptCore/wtf/HashTable.h:232
#6  0xb74e9243 in WTF::HashTableunsigned int, std::pairunsigned int,
unsigned long, WTF::PairFirstExtractorstd::pairunsigned int,
unsigned long , WTF::IntHashunsigned int,
WTF::PairHashTraitsWTF::HashTraitsunsigned int,
WTF::HashTraitsunsigned long , WTF::HashTraitsunsigned int
::makeIterator (this=0x90c5870, pos=0x90c8798) at
JavaScriptCore/wtf/HashTable.h:381
#7  0xb74e9274 in WTF::HashTableunsigned int, std::pairunsigned int,
unsigned long, WTF::PairFirstExtractorstd::pairunsigned int,
unsigned long , WTF::IntHashunsigned int,
WTF::PairHashTraitsWTF::HashTraitsunsigned int,
WTF::HashTraitsunsigned long , WTF::HashTraitsunsigned int
::begin (this=0x90c5870) at JavaScriptCore/wtf/HashTable.h:306
#8  0xb74e95d1 in WTF::HashMapunsigned int, unsigned long,
WTF::IntHashunsigned int, WTF::HashTraitsunsigned int,
WTF::HashTraitsunsigned long ::begin (this=0x90c5870) at
JavaScriptCore/wtf/HashMap.h:137
#9  0xb74e7d96 in identifierByPthreadHandle
(pthreadhand...@0xbfe5bc60) at
JavaScriptCore/wtf/ThreadingPthreads.cpp:99
#10 0xb74e7f3d in WTF::currentThread () at
JavaScriptCore/wtf/ThreadingPthreads.cpp:221
#11 0xb74e7f7c in WTF::isMainThread () at
JavaScriptCore/wtf/ThreadingPthreads.cpp:231
#12 0xb798f01f in WebCore::FontFallbackList::primarySimpleFontData
(this=0x9b89c48, f=0x9b89d60) at
WebCore/platform/graphics/FontFallbackList.h:63
#13 0xb798e431 in WebCore::Font::primaryFont (this=0x9b89d60) at
WebCore/platform/graphics/Font.cpp:130
#14 0xb78076b5 in WebCore::Font::ascent (this=0x9b89d60) at
./WebCore/platform/graphics/Font.h:108
#15 0xb7a92e6f in WebCore::RenderObject::baselinePosition
(this=0x9b8a1a4, firstLine=false, isRootLineBox=false) at
WebCore/rendering/RenderObject.cpp:1955
#16 0xb7a0b9a8 in WebCore::InlineFlowBox::computeLogicalBoxHeights
(this=0x9f7e43c, maxpositiont...@0xbfe5bf48,
maxpositionbott...@0xbfe5bf44, maxasce...@0xbfe5bf40,
maxdesce...@0xbfe5bf3c, strictMode=false) at
WebCore/rendering/InlineFlowBox.cpp:460
#17 0xb7a0bb0e in WebCore::InlineFlowBox::computeLogicalBoxHeights
(this=0x99216d4, maxpositiont...@0xbfe5bf48,
maxpositionbott...@0xbfe5bf44, maxasce...@0xbfe5bf40,
maxdesce...@0xbfe5bf3c, strictMode=false) at
WebCore/rendering/InlineFlowBox.cpp:480
#18 0xb7a0bb0e in WebCore::InlineFlowBox::computeLogicalBoxHeights
(this=0x9f97a94, maxpositiont...@0xbfe5bf48,
maxpositionbott...@0xbfe5bf44, maxasce...@0xbfe5bf40,
maxdesce...@0xbfe5bf3c, strictMode=false) at
WebCore/rendering/InlineFlowBox.cpp:480
#19 0xb7a0bc0c in WebCore::InlineFlowBox::verticallyAlignBoxes
(this=0x9f97a94, heightOfBlock=57) at
WebCore/rendering/InlineFlowBox.cpp:345
#20 0xb7ae3076 in
WebCore::RenderBlock::computeVerticalPositionsForLine (this=0x9b89794,
lineBox=0x9f97a94, firstRun=0x9f9507c) at
WebCore/rendering/bidi.cpp:752
#21 0xb7ae8fa0 in WebCore::RenderBlock::layoutInlineChildren
(this=0x9b89794, relayoutChildren=true, repaintt...@0xbfe5c38c,
repaintbott...@0xbfe5c388) at WebCore/rendering/bidi.cpp:1019
#22 0xb7a2b9e5 in WebCore::RenderBlock::layoutBlock (this=0x9b89794,
relayoutChildren=true) at WebCore/rendering/RenderBlock.cpp:779
#23 0xb7a18d64 in WebCore::RenderBlock::layout (this=0x9b89794) at
WebCore/rendering/RenderBlock.cpp:698
#24 0xb7a2a592 in WebCore::RenderBlock::layoutBlockChildren
(this=0x9b8916c, relayoutChildren=true, 

[webkit-dev] HTML5 implementation status?

2009-06-30 Thread Daniel W. Kim
Hi,

 I'd like to know the implementation status of HTML5 drag  drop.
Can I use the HTML5 drag drop feature with the WebKit?
Anybody knows that?

Thank you.
Daniel W. Kim.
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev