d90a4be6137fc780b3742b75efd07318364d9231
[WebKit-https.git] / Source / WebKit / blackberry / ChangeLog
1 2012-03-16  Mike Fenton  <mifenton@rim.com>
2
3         [BlackBerry] Input processing mode should be cancelled when processing hot keys
4         https://bugs.webkit.org/show_bug.cgi?id=81348
5
6         Reviewed by Rob Buis.
7
8         Don't suppress IMF notifications if we are handling
9         the event as a hotkey.
10
11         Reviewed Internally by Nima Ghanavatian.
12
13         * WebCoreSupport/EditorClientBlackBerry.cpp:
14         (WebCore::EditorClientBlackBerry::handleKeyboardEvent):
15
16 2012-03-16  Robin Cao  <robin.cao@torchmobile.com.cn>
17
18         [BlackBerry] Can not open certain links from bridge applications
19         https://bugs.webkit.org/show_bug.cgi?id=81197
20
21         Reviewed by Rob Buis.
22
23         Currently, the engine asks the client to handle some type of requests externally.
24         But WebPageClient::handleStringPattern is not yet implemented and exposed to
25         the client. Before that, we still need to give the client a chance to decide
26         how to handle requests such as 'mailto:'.
27
28         To address this problem, r108763 introduced a change that ask the client to
29         decide how to handle the navigation in dispatchDecidePolicyForNewWindowAction().
30         This is not intuitive and will bring troubles, because this navigation will
31         happen in the new page. So the new page client is to decide how to handle
32         the navigation, not the old one.
33
34         This patch reverts r108763 and skips calling WebPageClient::handleStringPattern
35         since it's not implemented.
36
37         This way the new window action will continue, and the logic in
38         dispatchDecidePolicyForNavigationAction() will handle the navigation correctly.
39
40         * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
41         (WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForNewWindowAction):
42         (WebCore::FrameLoaderClientBlackBerry::decidePolicyForExternalLoad):
43
44 2012-03-16  Leo Yang  <leo.yang@torchmobile.com.cn>
45
46         [BlackBerry] Crash when going back from an xhtml document containing <img>
47         https://bugs.webkit.org/show_bug.cgi?id=81297
48
49         Reviewed by Rob Buis.
50
51         This is manually reverting the offending internal commit which checked-in before upstreaming.
52
53         * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
54         (WebCore::FrameLoaderClientBlackBerry::canCachePage):
55
56 2012-03-16  Genevieve Mak  <gmak@rim.com>
57
58         [BlackBerry] viewportRect has changed to viewportSize
59         https://bugs.webkit.org/show_bug.cgi?id=81262
60
61         Reviewed by Antonio Gomes.
62
63         Set size instead of rect in constructor.
64         * WebKitSupport/InRegionScrollableArea.cpp:
65         (BlackBerry::WebKit::InRegionScrollableArea::InRegionScrollableArea):
66
67 2012-03-16  Andrew Lo  <anlo@rim.com>
68
69         [BlackBerry] Enable PAGE_VISIBILITY_API
70         https://bugs.webkit.org/show_bug.cgi?id=81257
71
72         Set Page visibility state for BlackBerry port.
73
74         Reviewed by Rob Buis.
75
76         * Api/WebPage.cpp:
77         (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
78         (WebKit):
79         (BlackBerry::WebKit::WebPagePrivate::setPageVisibilityState):
80         (BlackBerry::WebKit::WebPagePrivate::setVisible):
81         (BlackBerry::WebKit::WebPage::setVisible):
82         (BlackBerry::WebKit::WebPagePrivate::notifyAppActivationStateChange):
83         (BlackBerry::WebKit::WebPage::notifyAppActivationStateChange):
84         * Api/WebPage_p.h:
85         (WebPagePrivate):
86
87 2012-03-14  Arvid Nilsson  <anilsson@rim.com>
88
89         [BlackBerry] Make sure WebPage and BackingStore don't crash without a Window
90         https://bugs.webkit.org/show_bug.cgi?id=81099
91
92         Reviewed by Rob Buis.
93
94         Also rename the "compositing/blitting to main window" variables to
95         instead refer to OpenGL compositing. The code paths it triggers are
96         related to the BackingStore using OpenGL compositing, and can be useful
97         even when there's no window.
98
99         * Api/BackingStore.cpp:
100         (BlackBerry::WebKit::BackingStorePrivate::isOpenGLCompositing):
101         (BlackBerry::WebKit::BackingStorePrivate::render):
102         (BlackBerry::WebKit::BackingStorePrivate::copyPreviousContentsToBackSurfaceOfWindow):
103         (BlackBerry::WebKit::BackingStorePrivate::paintDefaultBackground):
104         (BlackBerry::WebKit::BackingStorePrivate::blitContents):
105         (BlackBerry::WebKit::BackingStorePrivate::blitTileRect):
106         (BlackBerry::WebKit::BackingStorePrivate::blendCompositingSurface):
107         (BlackBerry::WebKit::BackingStorePrivate::renderContents):
108         (BlackBerry::WebKit::BackingStorePrivate::blitToWindow):
109         (BlackBerry::WebKit::BackingStorePrivate::checkerWindow):
110         (BlackBerry::WebKit::BackingStorePrivate::invalidateWindow):
111         (BlackBerry::WebKit::BackingStorePrivate::clearWindow):
112         (BlackBerry::WebKit::BackingStorePrivate::drawSubLayers):
113         (BlackBerry::WebKit::BackingStorePrivate::surfaceSize):
114         (BlackBerry::WebKit::BackingStorePrivate::buffer):
115         * Api/BackingStore_p.h:
116         * Api/WebPage.cpp:
117         (BlackBerry::WebKit::WebPagePrivate::didPluginEnterFullScreen):
118         (BlackBerry::WebKit::WebPagePrivate::didPluginExitFullScreen):
119         (BlackBerry::WebKit::WebPagePrivate::drawLayersOnCommit):
120         (BlackBerry::WebKit::WebPagePrivate::drawSubLayers):
121         (BlackBerry::WebKit::WebPagePrivate::rootLayerCommitTimerFired):
122         * WebCoreSupport/ChromeClientBlackBerry.cpp:
123         (WebCore::ChromeClientBlackBerry::windowRect):
124         (WebCore::ChromeClientBlackBerry::screenToWindow):
125         (WebCore::ChromeClientBlackBerry::windowToScreen):
126         * WebKitSupport/GLES2Context.cpp:
127         (BlackBerry::WebKit::GLES2Context::GLES2Context):
128         * WebKitSupport/TouchEventHandler.h:
129         * WebKitSupport/WebPageCompositor.cpp:
130         (BlackBerry::WebKit::WebPageCompositor::WebPageCompositor):
131         (BlackBerry::WebKit::WebPageCompositor::setBackingStoreUsesOpenGL):
132         (BlackBerry::WebKit::WebPageCompositor::drawLayers):
133         * WebKitSupport/WebPageCompositor.h:
134
135 2012-03-13  Jon Lee  <jonlee@apple.com>
136
137         Separate NOTIFICATIONS and LEGACY_NOTIFICATIONS
138         https://bugs.webkit.org/show_bug.cgi?id=80922
139         <rdar://problem/11035082>
140
141         Reviewed by Jian Li.
142
143         You can include either NOTIFICATIONS or LEGACY_NOTIFICATIONS and have a complete API.
144         LEGACY_NOTIFICATIONS should cover all of the previous functionality, and NOTIFICATIONS will cover the
145         new API. Therefore, APIs that are common between the two will have:
146         #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
147
148         This patch initially sets both to be exactly the same. As other bugs with patches begin to migrate to
149         the new API, the defines will begin to split. This allows ports to decide which set of APIs to include.
150
151         Update everything to be #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
152         * Api/WebPage.cpp:
153         (BlackBerry::WebKit::WebPagePrivate::init):
154         * WebCoreSupport/NotificationPresenterImpl.cpp:
155         * WebCoreSupport/NotificationPresenterImpl.h:
156
157 2012-03-14  Nima Ghanavatian  <nghanavatian@rim.com>
158
159         [BlackBerry] Syncing up left over bits in Api from our local branch to upstream
160         https://bugs.webkit.org/show_bug.cgi?id=81105
161
162         Reviewed by Rob Buis.
163
164         * Api/BackingStore.cpp:
165         (BlackBerry::WebKit::BackingStorePrivate::renderContents):
166         (BlackBerry::WebKit::BackingStorePrivate::isActive):
167         (BlackBerry::WebKit::BackingStore::createBackingStoreMemory):
168         (WebKit):
169         (BlackBerry::WebKit::BackingStore::releaseBackingStoreMemory):
170         * Api/BackingStore.h:
171         * Api/WebPage.cpp:
172         (BlackBerry::WebKit::toWebCoreMouseEventType):
173         (BlackBerry::WebKit::WebPagePrivate::init):
174         (BlackBerry::WebKit::WebPagePrivate::setLoadState):
175         (BlackBerry::WebKit::WebPagePrivate::activeNodeContext):
176         (BlackBerry::WebKit::WebPage::activeNodeContext):
177         (BlackBerry::WebKit::WebPagePrivate::updateCursor):
178         (BlackBerry::WebKit::WebPagePrivate::contextNode):
179         (BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
180         * Api/WebPage.h:
181         * Api/WebPage_p.h:
182         (WebPagePrivate):
183
184 2012-03-14  Andrew Lo  <anlo@rim.com>
185
186         [BlackBerry] Implement REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR using AnimationFrameRateController
187         https://bugs.webkit.org/show_bug.cgi?id=81000
188
189         Set the platform display ID, needed for DisplayRefreshMonitor.
190
191         Reviewed by Antonio Gomes.
192
193         * Api/WebPage.cpp:
194         (BlackBerry::WebKit::WebPagePrivate::init):
195
196 2012-03-14  Leo Yang  <leo.yang@torchmobile.com.cn>
197
198         [BlackBerry] Upstream the BlackBerry change to platform/Cursor.h
199         https://bugs.webkit.org/show_bug.cgi?id=81086
200
201         Reviewed by Rob Buis.
202
203         There was an alias named PlatformCursorHandle for PlatformCursor
204         in the internal version of Cursor.h. But it's not necessary so it's
205         not included in the upstreaming version of Cursor.h. As a result,
206         use PlatformCursor directly.
207
208         * Api/WebPage.cpp:
209         (BlackBerry::WebKit::WebPagePrivate::setCursor):
210         * Api/WebPage_p.h:
211         (WebPagePrivate):
212
213 2012-03-13  Mike Fenton  <mifenton@rim.com>
214
215         [BlackBerry] Input focus state should unfocus the frame selection instead of the field.
216         https://bugs.webkit.org/show_bug.cgi?id=81023
217
218         Reviewed by Antonio Gomes.
219
220         PR 137400.
221
222         Prevent cursor drawing by unfocusing the frame selection
223         when input mode is not ready.
224
225         Greatly simplify the decision to focus input fields by removing
226         all ties to the page load state and base it on input.  Input mode
227         is disabled when a page load begins and enabled on any user input.
228
229         The field is focused and ready for input immediately, only the
230         frame selection (or cursor) is unfocused.
231
232         Reviewed Internally by Gen Mak, Antonio Gomes and Nima Ghanavatian.
233
234         * Api/WebPage.cpp:
235         (BlackBerry::WebKit::WebPagePrivate::setLoadState):
236         (BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
237         * Api/WebPageClient.h:
238         * WebCoreSupport/EditorClientBlackBerry.cpp:
239         (WebCore::EditorClientBlackBerry::shouldBeginEditing):
240         * WebKitSupport/InputHandler.cpp:
241         (BlackBerry::WebKit::InputHandler::InputHandler):
242         (BlackBerry::WebKit::InputHandler::setElementUnfocused):
243         (BlackBerry::WebKit::InputHandler::enableInputMode):
244         (BlackBerry::WebKit::InputHandler::setElementFocused):
245         (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
246         (BlackBerry::WebKit::InputHandler::notifyClientOfKeyboardVisibilityChange):
247         (BlackBerry::WebKit::InputHandler::handleKeyboardInput):
248         (BlackBerry::WebKit::InputHandler::setComposingText):
249         * WebKitSupport/InputHandler.h:
250         (InputHandler):
251         * WebKitSupport/TouchEventHandler.cpp:
252         (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
253
254 2012-03-13  Adam Barth  <abarth@webkit.org> && Benjamin Poulain  <bpoulain@apple.com>
255
256         Always enable ENABLE(CLIENT_BASED_GEOLOCATION)
257         https://bugs.webkit.org/show_bug.cgi?id=78853
258
259         Reviewed by Adam Barth.
260
261         * Api/WebPage.cpp:
262         (BlackBerry::WebKit::WebPagePrivate::init):
263         * WebCoreSupport/AboutDataEnableFeatures.in:
264         * WebCoreSupport/ChromeClientBlackBerry.cpp:
265         * WebCoreSupport/ChromeClientBlackBerry.h:
266         (ChromeClientBlackBerry):
267         * WebKitSupport/DumpRenderTreeSupport.cpp:
268         (toGeolocationClientMock):
269         (DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests):
270         (DumpRenderTreeSupport::resetGeolocationMock):
271         (DumpRenderTreeSupport::setMockGeolocationError):
272         (DumpRenderTreeSupport::setMockGeolocationPermission):
273         (DumpRenderTreeSupport::setMockGeolocationPosition):
274
275 2012-03-13  Mike Lattanzio  <mlattanzio@rim.com>
276
277         Remove ActiveNodeContext in favour of BlackBerry::Platform::WebContext
278         https://bugs.webkit.org/show_bug.cgi?id=80984
279
280         Remove ActiveNodeContext, and switch the implementation to
281         provide a BlackBerry::Platform::WebContext. The new object
282         adds an explicit IsImage flag, as well as IsAudio and IsVideo
283         for the HTML5 elements.
284
285         Note that for many videos both IsVideo and IsAudio will be true,
286         as videos typically have audio streams as well.
287
288         Reviewed by George Staikos.
289
290         * Api/ActiveNodeContext.h: Removed.
291         * Api/WebPage.cpp:
292         (BlackBerry::WebKit::WebPagePrivate::webContext):
293         (BlackBerry::WebKit::WebPage::webContext):
294         * Api/WebPage.h:
295         * Api/WebPage_p.h:
296
297 2012-03-12  Andy Chen  <andchen@rim.com>
298
299         [Blackberry] Make the process of marking all matches interruptible and asynchronous for find-in-page
300         https://bugs.webkit.org/show_bug.cgi?id=80831
301
302         Reviewed by Antonio Gomes.
303
304         * WebKitSupport/InPageSearchManager.cpp:
305         (BlackBerry::WebKit::InPageSearchManager::DeferredScopeStringMatches::DeferredScopeStringMatches):
306         (BlackBerry::WebKit::InPageSearchManager::DeferredScopeStringMatches::doTimeout):
307         (BlackBerry::WebKit::InPageSearchManager::InPageSearchManager):
308         (BlackBerry::WebKit::InPageSearchManager::~InPageSearchManager):
309         (BlackBerry::WebKit::InPageSearchManager::findNextString):
310         (BlackBerry::WebKit::InPageSearchManager::shouldSearchForText):
311         (BlackBerry::WebKit::InPageSearchManager::findAndMarkText):
312         (BlackBerry::WebKit::InPageSearchManager::clearTextMatches):
313         (BlackBerry::WebKit::InPageSearchManager::frameUnloaded):
314         (BlackBerry::WebKit::InPageSearchManager::scopeStringMatches):
315         (BlackBerry::WebKit::InPageSearchManager::scopeStringMatchesSoon):
316         (BlackBerry::WebKit::InPageSearchManager::callScopeStringMatches):
317         (BlackBerry::WebKit::InPageSearchManager::cancelPendingScopingEffort):
318         * WebKitSupport/InPageSearchManager.h:
319
320 2012-03-09  Jon Lee  <jonlee@apple.com>
321
322         Rename NotificationPresenter to NotificationClient
323         https://bugs.webkit.org/show_bug.cgi?id=80488
324         <rdar://problem/10965558>
325
326         Reviewed by Kentaro Hara.
327
328         Refactor to use renamed WebCore::NotificationClient.
329         * WebCoreSupport/NotificationPresenterImpl.cpp:
330         (WebCore::NotificationPresenterImpl::instance):
331         (WebCore::NotificationPresenterImpl::show):
332         (WebCore::NotificationPresenterImpl::checkPermission):
333         * WebCoreSupport/NotificationPresenterImpl.h:
334         (NotificationPresenterImpl):
335
336 2012-03-09  Charles Wei  <charles.wei@torchmobile.com.cn>
337
338         [BlackBerry] Web Notification not working after rebase
339         https://bugs.webkit.org/show_bug.cgi?id=80690
340
341         Reviewed by George Staikos.
342
343         1. NotificationPresenterImpl should be in namespace WebCore
344         2. Need to connect NotificationPresenterImpl to webcore the new way:
345            WebCore::provideNotification(Page*, NotificationPresenter*)
346         3. Remove the old way of connecting the Notification:
347            ChromeClientBlackBerry::notificationPresenter()
348
349         * Api/WebPage.cpp:
350         (BlackBerry::WebKit::WebPagePrivate::init):
351         * WebCoreSupport/ChromeClientBlackBerry.cpp:
352         (WebCore):
353         * WebCoreSupport/ChromeClientBlackBerry.h:
354         (ChromeClientBlackBerry):
355         * WebCoreSupport/NotificationPresenterImpl.cpp:
356         * WebCoreSupport/NotificationPresenterImpl.h:
357
358 2012-03-08  Mike Fenton  <mifenton@rim.com>
359
360         [BlackBerry] Always use the current focused node when processing focus changes
361         https://bugs.webkit.org/show_bug.cgi?id=80594
362
363         Reviewed by Antonio Gomes.
364
365         Guard against toRange or fromRange being null when called
366         as part of a clear event.
367
368         * WebCoreSupport/EditorClientBlackBerry.cpp:
369         (WebCore::EditorClientBlackBerry::shouldChangeSelectedRange):
370
371 2012-03-08  Yong Li  <yoli@rim.com>
372
373         [BlackBerry] Block file-to-file access by default
374         https://bugs.webkit.org/show_bug.cgi?id=80605
375
376         Reviewed by Rob Buis.
377
378         Turn off allowFileAccessFromFileURLs() by default.
379
380         * Api/WebPage.cpp:
381         (BlackBerry::WebKit::WebPagePrivate::init):
382
383 2012-03-08  Mike Fenton  <mifenton@rim.com>
384
385         [BlackBerry] Always use the current focused node when processing focus changes
386         https://bugs.webkit.org/show_bug.cgi?id=80594
387
388         Reviewed by Antonio Gomes.
389
390         Update InputHandler focused node handling to strictly use
391         the currently focused node.  This prevents a handling loop
392         when JS is modifying the focus and we get a late notification
393         of a past change from ChromeClientBlackBerry with the previously
394         unfocused node.
395
396         * WebCoreSupport/ChromeClientBlackBerry.cpp:
397         (WebCore::ChromeClientBlackBerry::focusedNodeChanged):
398         * WebCoreSupport/EditorClientBlackBerry.cpp:
399         (WebCore::EditorClientBlackBerry::shouldChangeSelectedRange):
400         (WebCore::EditorClientBlackBerry::setInputMethodState):
401         * WebKitSupport/InputHandler.cpp:
402         (BlackBerry::WebKit::InputHandler::focusedNodeChanged):
403         * WebKitSupport/InputHandler.h:
404
405 2012-03-07  Jacky Jiang  <zhajiang@rim.com>
406
407         [BlackBerry] WebKit rendering problem when show/hide VKB
408         https://bugs.webkit.org/show_bug.cgi?id=80448
409         RIM PR: 141727
410
411         Reviewed by Antonio Gomes.
412
413         When setting viewport size, layout happens inside
414         WebPagePrivate::setDefaultLayoutSize(), in this way, the layout is
415         outside of the code path of "needsLayout" so that the contents are
416         not rendered into the backing store. This is a regression of r108718,
417         switch back to do the layout inside the public API
418         WebPage::setDefaultLayoutSize().
419
420         We haven't upstreamed the manual tests directory yet, therefore,
421         the new manual test case will be upstreamed later.
422
423         * Api/WebPage.cpp:
424         (BlackBerry::WebKit::WebPagePrivate::setDefaultLayoutSize):
425         (BlackBerry::WebKit::WebPage::setDefaultLayoutSize):
426
427 2012-03-06  Lianghui Chen  <liachen@rim.com>
428
429         [BlackBerry] Set correct ResourceRequest target type.
430         https://bugs.webkit.org/show_bug.cgi?id=80430
431
432         Reviewed by Rob Buis.
433
434         Removed unused code in dispatchWillSendRequest(). These codes are too
435         late as the target type has already been referred to when calling
436         ResourceRequest::initializePlatformRequest().
437
438         * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
439         (WebCore::FrameLoaderClientBlackBerry::dispatchWillSendRequest):
440
441 2012-03-06  Lianghui Chen  <liachen@rim.com>
442
443         [BlackBerry] Remove unused and unneeded WebPageClient::downloadRequested(NetworkRequest&)
444         https://bugs.webkit.org/show_bug.cgi?id=80438
445
446         Reviewed by Antonio Gomes.
447
448         * Api/WebPageClient.h:
449
450 2012-03-06  Jakob Petsovits  <jpetsovits@rim.com>
451
452         [BlackBerry] Don't suspend accel comp when backgrounding a page.
453         https://bugs.webkit.org/show_bug.cgi?id=80369
454         RIM PR: 137609
455
456         Reviewed by Adam Treat.
457
458         Just because the page is in the background doesn't mean
459         it's invisible, doesn't mean it won't have to be redrawn
460         at some point - on rotation, for instance.
461
462         We still suspend accelerated compositing on setVisible(false).
463
464         * Api/WebPage.cpp:
465         (BlackBerry::WebKit::WebPage::notifyPageBackground):
466         (BlackBerry::WebKit::WebPage::notifyPageForeground):
467
468 2012-03-06  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
469
470         [BlackBerry] function rename issue after MediaPlayerPrivateBlackBerry.[cpp\h] upstream
471         https://bugs.webkit.org/show_bug.cgi?id=80377
472
473         Reviewed by Rob Buis.
474
475         As some of the function names changed in class MediaPlayerPrivate
476         with the upstream of MediaPlayerPrivateBlackBerry.[cpp|h], we
477         should update WebKit/blackberry/Api/WebPage.cpp which uses these
478         functions accordingly.
479         Renamed functions in class MediaPlayerPrivate:
480         windowGet() -> getWindow()
481         windowPositionGet() -> getWindowPosition()
482         mmrContextNameGet() -> mmrContextName()
483
484         * Api/WebPage.cpp:
485         (BlackBerry::WebKit::WebPagePrivate::enterFullscreenForNode):
486
487 2012-03-05  Eli Fidler  <efidler@rim.com>
488
489         The minimum font size WebSetting should actually change the LOGICAL font size in WebCore.
490         https://bugs.webkit.org/show_bug.cgi?id=80312
491         RIM PR: 139874
492
493         Reviewed by George Staikos.
494
495         * Api/WebPage.cpp:
496         (BlackBerry::WebKit::WebPagePrivate::didChangeSettings):
497
498 2012-03-05  Jakob Petsovits  <jpetsovits@rim.com>
499
500         Make accelerated compositing work again with direct rendering.
501         https://bugs.webkit.org/show_bug.cgi?id=80181
502         RIM PR: 139110
503
504         Reviewed by Antonio Gomes.
505         Internally reviewed by Arvid Nilsson.
506
507         The significant amount of refactoring and optimization work
508         that has gone into accelerated compositing missed out on
509         some of the code paths that are being used in direct rendering.
510
511         Animations were relying on blitVisibleContents() only (which
512         is a no-op in direct rendering mode). There were early returns
513         which are suitable to determine whether screen contents need
514         to be updated at all; however, when we're already forcing a
515         re-render then those checks would cause the composition surface
516         not to appear at all, or avoid drawing new animation frames.
517
518         We went through dispatchMessage(), potentially causing
519         mismatches between rendered (but not yet posted) back content
520         and layers composited on top of it. As we're rendering onto
521         the sole target surface (the window) directly and posting
522         from the same thread, we have to wait for compositing on the
523         UI thread to finish before posting the window.
524
525         In turn, this patch combines both drawSubLayers() and
526         blendCompositingSurface() calls into one method, reducing
527         the number of messages to the UI thread within
528         renderDirectToWindow() to one.
529
530         blendCompositingMessage() in renderDirectToScreen() was called
531         with contents coordinates rather than viewport coordinates.
532         That caused some of the composited content to be cut off when
533         the scroll position wasn't (0, 0).
534
535         We called copyPreviousContentsToBackSurfaceOfWindow() twice for
536         one frame, in both renderDirectToWindow() and invalidateWindow().
537         Only one of those (the latter one) is necessary.
538
539         * Api/BackingStore.cpp:
540         (BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate):
541         (BlackBerry::WebKit::BackingStorePrivate::renderDirectToWindow):
542         (BlackBerry::WebKit::BackingStorePrivate::drawSubLayers):
543         (WebKit):
544         (BlackBerry::WebKit::BackingStorePrivate::drawAndBlendLayersForDirectRendering):
545         * Api/BackingStore.h:
546         (WebKit):
547         * Api/BackingStore_p.h:
548         (BackingStorePrivate):
549         (BlackBerry::WebKit::BackingStorePrivate::isDirectRenderingAnimationMessageScheduled):
550         (BlackBerry::WebKit::BackingStorePrivate::setDirectRenderingAnimationMessageScheduled):
551         * Api/WebPage_p.h:
552         (BlackBerry::WebKit::WebPagePrivate::isAcceleratedCompositingActive):
553         (WebPagePrivate):
554         * WebKitSupport/WebPageCompositor.cpp:
555         (BlackBerry::WebKit::WebPageCompositor::WebPageCompositor):
556         (BlackBerry::WebKit::WebPageCompositor::~WebPageCompositor):
557         (BlackBerry::WebKit::WebPageCompositor::drawLayers):
558         (BlackBerry::WebKit::WebPageCompositor::animationTimerFired):
559         * WebKitSupport/WebPageCompositor.h:
560         (WebPageCompositor):
561
562 2012-03-05  George Staikos  <gstaikos@rim.com>
563
564         [BlackBerry] DOMSupport visibleSelectionForRangeInputElement incorrectly dereferences a null range.
565         https://bugs.webkit.org/show_bug.cgi?id=80274
566
567         Reviewed by Antonio Gomes.
568
569         A null range can be returned so we should not blindly deref it.
570         Reviewed Internally by Mike Fenton.
571
572         * WebKitSupport/DOMSupport.cpp:
573         (BlackBerry::WebKit::DOMSupport::visibleSelectionForRangeInputElement):
574
575 2012-03-04  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
576
577         [BlackBerry] upstream CredentialManager and CredentialTransformData implementation
578         https://bugs.webkit.org/show_bug.cgi?id=80107
579
580         Reviewed by Antonio Gomes.
581
582         Initial upstream of CredentialManager.[h|cpp] and
583         CredentialTransformData.[h|cpp].
584         No new test.
585
586         * WebCoreSupport/CredentialManager.cpp: Added.
587         (WebCore):
588         (WebCore::CredentialManager::CredentialManager):
589         (WebCore::CredentialManager::autofillAuthenticationChallenge):
590         (WebCore::CredentialManager::autofillPasswordForms):
591         (WebCore::CredentialManager::saveCredentialIfConfirmed):
592         * WebCoreSupport/CredentialManager.h: Added.
593         (WebKit):
594         (WebCore):
595         (CredentialManager):
596         * WebCoreSupport/CredentialTransformData.cpp: Added.
597         (WebCore::CredentialTransformData::CredentialTransformData):
598         (WebCore):
599         (WebCore::CredentialTransformData::url):
600         (WebCore::CredentialTransformData::credential):
601         (WebCore::CredentialTransformData::setCredential):
602         (WebCore::CredentialTransformData::findPasswordFormFields):
603         * WebCoreSupport/CredentialTransformData.h: Added.
604         (WebCore):
605         (CredentialTransformData):
606         (WebCore::CredentialTransformData::isValid):
607         (WebCore::CredentialTransformData::protectionSpace):
608
609 2012-03-04  Antonio Gomes  <agomes@rim.com>
610
611         [BlackBerry] Fixed positioned element not correctly positioned after orientation change, when viewport metatag is used
612         https://bugs.webkit.org/show_bug.cgi?id=80228
613         PR #138865
614
615         Reviewed by George Staikos.
616
617         Viewport size changes in two main scenarios:
618         - orientation changes;
619         - virtual keyboard pop up/hide.
620
621         When we are setting a new viewport size, we need to
622         update the FixedReportedSize of the mainframe. This size
623         is used to return innerWidth|Heigth as well as to calculate
624         the fixed position elements height relative to the RenderView [1].
625
626         [1] RenderBox::containingBlockLogicalHeightForPositioned.
627
628         When we are rotating, we need to delay setting the new FixedReportedSize
629         till we layout and are able to figure out the new contents size. At this
630         time we call setFixedReportedSize, but we do not reposition the fixed elemts
631         afterwards.
632
633         Patch adds a call to FrameView::repaintFixedElementsAfterScrolling, after
634         setting the new size.
635
636         Source/WebKit/blackberry:
637         * Api/WebPage.cpp:
638         (BlackBerry::WebKit::WebPagePrivate::setViewportSize):
639
640 2012-03-02  Mike Fenton  <mifenton@rim.com>
641
642         [BlackBerry] Expose WebInspector state to client and clean up WebSettings
643         https://bugs.webkit.org/show_bug.cgi?id=80177
644
645         Reviewed by Antonio Gomes.
646
647         Expose the Web Inspector state to WebPage client's and
648         re-order initialization of WebSettings to be alphabetical
649         matching their definitions.
650
651         * Api/WebPage.cpp:
652         (BlackBerry::WebKit::WebPage::isWebInspectorEnabled):
653         * Api/WebPage.h:
654         * Api/WebSettings.cpp:
655         (BlackBerry::WebKit::WebSettings::standardSettings):
656
657 2012-03-02  Arvid Nilsson  <anilsson@rim.com>
658
659         Accelerated compositing: Checkerboard never goes away
660         https://bugs.webkit.org/show_bug.cgi?id=79020
661         RIM PR #134164
662
663         Reviewed by Adam Treat.
664
665         Checkerboard appears in accelerated compositing layers when there's no
666         texture for (part of) a layer. The layer renderer queues up some render
667         jobs and schedules a commit to make the WebKit thread process those
668         jobs. Render jobs performed during commit cause texture upload jobs to
669         be scheduled on the UI thread. Texture uploads are performed when next
670         drawing the layers.
671
672         Unfortunately, sometimes commit operation happens without a subsequent
673         call draw the layers.
674
675         In order to implement one-shot drawing sync, I added a call to
676         commitRootLayerIfNeeded() in BackingStore::renderContents(), and
677         I was lucky that most of the time, renderContents() is followed by
678         blit(Visible)Contents() which in turn draws the layers.
679         However, render is not always followed by a blit, for example when
680         rendering offscreen tiles in BackingStore::renderOnIdle(), and in
681         direct rendering mode.
682
683         Fixed by making sure that every call to commitRootLayerIfNeeded() that
684         returns true is followed by a call to drawLayersOnCommit(), unless a
685         blit was requested already.
686
687         Also tweak the logic for one-shot drawing sync to make the code in
688         drawLayersOnCommit() reusable outside of rootLayerCommitTimerFired().
689
690         * Api/BackingStore.cpp:
691         (BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate):
692         (BlackBerry::WebKit::BackingStorePrivate::renderOnTimer):
693         (BlackBerry::WebKit::BackingStorePrivate::renderOnIdle):
694         (BlackBerry::WebKit::BackingStorePrivate::willFireTimer):
695         (BlackBerry::WebKit::BackingStorePrivate::renderDirectToWindow):
696         (BlackBerry::WebKit::BackingStorePrivate::render):
697         (BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents):
698         (BlackBerry::WebKit::BackingStorePrivate::blitContents):
699         (BlackBerry::WebKit::BackingStorePrivate::renderContents):
700         (WebKit):
701         (BlackBerry::WebKit::BackingStorePrivate::drawLayersOnCommitIfNeeded):
702         * Api/BackingStore_p.h:
703         (BackingStorePrivate):
704         (BlackBerry::WebKit::BackingStorePrivate::willDrawLayersOnCommit):
705
706 2012-03-02  Adam Treat  <atreat@rim.com>
707
708         https://bugs.webkit.org/show_bug.cgi?id=80161
709         PR: 141157
710
711         BlackBerryPlatformScreen.h API has been updated.  Reflect those
712         changes in our usage.
713
714         Reviewed by Antonio Gomes.
715         Internally reviewed by Jakob Petsovits.
716
717         * Api/BackingStore.cpp:
718         (BlackBerry::WebKit::BackingStorePrivate::tileWidth):
719         (BlackBerry::WebKit::BackingStorePrivate::tileHeight):
720         * Api/WebPage.cpp:
721         (BlackBerry::WebKit::WebPagePrivate::init):
722         (BlackBerry::WebKit::WebPagePrivate::transformedViewportSize):
723         (BlackBerry::WebKit::WebPagePrivate::fixedLayoutSize):
724         (BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments):
725         (BlackBerry::WebKit::WebPagePrivate::setDefaultLayoutSize):
726         (BlackBerry::WebKit::WebPagePrivate::defaultMaxLayoutSize):
727         * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
728         (WebCore::FrameLoaderClientBlackBerry::restoreViewState):
729         * WebKitSupport/SurfacePool.cpp:
730         (BlackBerry::WebKit::createCompositingSurface):
731
732 2012-03-02  Konrad Piascik  <kpiascik@rim.com>
733
734         [BlackBerry] Set the devicePixelRatio from the results of computeViewportAttributes
735         https://bugs.webkit.org/show_bug.cgi?id=80160
736
737         Reviewed by Antonio Gomes.
738
739         Tested by going to layout test fast/viewport/viewport-95.html and viewport-93.html
740         Previously when executing window.devicePixelRatio these two pages returned 1 now
741         they report the devicePixelRatio returned by computeViewportAttributes.
742
743         * Api/WebPage.cpp:
744         (BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments):
745
746 2012-03-02  Jacky Jiang  <zhajiang@rim.com>
747
748         Fix a warning in InputHandler::learnText()
749         https://bugs.webkit.org/show_bug.cgi?id=80049
750
751         Reviewed by Antonio Gomes.
752
753         Fix a warning of the comparison "textInField.length() <=
754         MaxLearnTextDataSize" in InputHandler::learnText().
755
756         Rubber-stamped internally by Mike Fenton.
757
758         * WebKitSupport/InputHandler.cpp:
759         (BlackBerry::WebKit::InputHandler::learnText):
760
761 2012-03-01  Andy Chen  <andchen@rim.com>
762
763         [BlackBerry] Implement features for find-in-page
764         https://bugs.webkit.org/show_bug.cgi?id=79820
765
766         Reviewed by Antonio Gomes.
767
768         - Make it be able to search text around the whole page instead of single frame.
769         - Make it be able to start new search from active selection and last active match.
770
771         No new tests as this patch doesn't change behavior.
772
773         * Api/WebPage.cpp:
774         (BlackBerry::WebKit::WebPagePrivate::frameUnloaded):
775         * Api/WebPage_p.h:
776         * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
777         (WebCore::FrameLoaderClientBlackBerry::dispatchWillClose):
778         (WebCore::FrameLoaderClientBlackBerry::detachedFromParent2):
779         * WebKitSupport/DOMSupport.cpp:
780         (BlackBerry::WebKit::DOMSupport::incrementFrame):
781         * WebKitSupport/DOMSupport.h:
782         * WebKitSupport/InPageSearchManager.cpp:
783         (BlackBerry::WebKit::InPageSearchManager::findNextString):
784         (BlackBerry::WebKit::InPageSearchManager::shouldSearchForText):
785         (BlackBerry::WebKit::InPageSearchManager::findAndMarkText):
786         (BlackBerry::WebKit::InPageSearchManager::setMarkerActive):
787         (BlackBerry::WebKit::InPageSearchManager::frameUnloaded):
788         * WebKitSupport/InPageSearchManager.h:
789         * WebKitSupport/InputHandler.cpp:
790         (BlackBerry::WebKit::InputHandler::frameUnloaded):
791         * WebKitSupport/InputHandler.h:
792
793 2012-03-01  Charles Wei  <charles.wei@torchmobile.com.cn>
794
795         [BlackBerry] Web Notification crashes the browser.
796         https://bugs.webkit.org/show_bug.cgi?id=79897
797
798         Reviewed by Antonio Gomes.
799
800         The reason of the crash is that it still uses the iterator
801         after been removed from the container, which invalidates the
802         iterator. 
803         We should stop processing after we have found the element
804         and removed from the container through the iterator.
805
806         This patch only fixes the crash issue, but not any notification
807         functionality issue, which is tracked seperatly.
808
809         Test case: http://sandbox.gtaero.net/chrome/notifications.php
810
811         * WebCoreSupport/NotificationPresenterImpl.cpp:
812         (WebKit::NotificationPresenterImpl::onPermission):
813         (WebKit::NotificationPresenterImpl::notificationClicked):
814
815 2012-03-01  Mike Fenton  <mifenton@rim.com>
816
817         Autocomplete attribute should apply to textarea's.
818         https://bugs.webkit.org/show_bug.cgi?id=79929
819
820         Reviewed by Antonio Gomes.
821
822         Add local static Qualified name for autocorrect attribute.
823
824         * WebKitSupport/DOMSupport.cpp:
825         (BlackBerry::WebKit::DOMSupport::elementSupportsAutocorrect):
826
827 2012-02-29  Mike Fenton  <mifenton@rim.com>
828
829         Autocomplete attribute should apply to textarea's.
830         https://bugs.webkit.org/show_bug.cgi?id=79929
831
832         Reviewed by Antonio Gomes.
833
834         Allow the autocomplete attribute to bubble back to the form setting.
835
836         Expand support to include checking autocorrect, autocomplete and
837         name/id matching to text areas.
838
839         Reviewed internally by Nima Ghanavatian and Gen Mak.
840
841         * WebKitSupport/DOMSupport.cpp:
842         (BlackBerry::WebKit::DOMSupport::elementSupportsAutocorrect):
843         (BlackBerry::WebKit::DOMSupport::elementSupportsAutocomplete):
844         (BlackBerry::WebKit::DOMSupport::elementAttributeState):
845         * WebKitSupport/DOMSupport.h:
846         * WebKitSupport/InputHandler.cpp:
847         (BlackBerry::WebKit::inputStyle):
848
849 2012-02-29  Max Feil  <mfeil@rim.com>
850
851         [BlackBerry] Add support for FLAC audio and OGG/Vorbis audio
852         https://bugs.webkit.org/show_bug.cgi?id=79519
853
854         Reviewed by Antonio Gomes.
855
856         * Api/WebSettings.cpp:
857         (BlackBerry::WebKit::mimeTypeAssociationMap):
858
859 2012-02-28  Konrad Piascik  <kpiascik@rim.com>
860
861         [BlackBerry] Change the API to use std::string
862         https://bugs.webkit.org/show_bug.cgi?id=79818
863
864         Reviewed by Antonio Gomes.
865
866         * Api/WebPage.cpp:
867         (BlackBerry::WebKit::WebPage::dispatchInspectorMessage):
868         * Api/WebPage.h:
869
870 2012-02-28  Jacky Jiang  <zhajiang@rim.com>
871
872         [BlackBerry] x86 build fix after cleaning up WebPage.cpp
873         https://bugs.webkit.org/show_bug.cgi?id=79814
874
875         Reviewed by Antonio Gomes.
876
877         x86 build fix, keep WebPage::destroyWebPageCompositor() method where it
878         was which was outside of USE(ACCELERATED_COMPOSITING).
879
880         * Api/WebPage.cpp:
881         (BlackBerry::WebKit::WebPage::destroyWebPageCompositor):
882         (WebKit):
883
884 2012-02-28  Mike Fenton  <mifenton@rim.com>
885
886         [BlackBerry] Remove unused focusedNodeChange notifications from the Chrome client.
887         https://bugs.webkit.org/show_bug.cgi?id=79794
888
889         Reviewed by Rob Buis.
890
891         Remove unused notification for focusedNodeChanged.
892
893         Internally reviewed by Gen Mak.
894
895         * Api/WebPageClient.h:
896         * WebCoreSupport/ChromeClientBlackBerry.cpp:
897         (WebCore::ChromeClientBlackBerry::focusedNodeChanged):
898
899 2012-02-27  Jacky Jiang  <zhajiang@rim.com>
900
901         [BlackBerry] Upstream BlackBerry API web page related files
902         https://bugs.webkit.org/show_bug.cgi?id=74380
903
904         Reviewed by Antonio Gomes.
905
906         Clean up WebPage.{h, cpp} and WebPage_p.h.
907         - Remove WebPage::mainFrame() as it is bad to expose WebCore::Frame in
908           the public API, adapt to the change by adding a new method
909           WebPagePrivate::core(Const WebPage*) and expose it to
910           DumpRenderTreeSupport.
911         - Rename WebPage::spellCheckingEnabled to
912           WebPage::setSpellCheckingEnabled.
913         - Remove unused WebPage::focusNodeRect().
914         - Remove extra blank lines.
915         - Put WebPage methods and their associated WebPagePrivate methods
916           together.
917
918         No new tests as this patch doesn't change behavior.
919
920         * Api/WebPage.cpp:
921         (BlackBerry::WebKit::WebPage::WebPage):
922         (WebKit):
923         (BlackBerry::WebKit::WebPage::~WebPage):
924         (BlackBerry::WebKit::WebPagePrivate::core):
925         (BlackBerry::WebKit::WebPage::load):
926         (BlackBerry::WebKit::WebPage::loadExtended):
927         (BlackBerry::WebKit::WebPage::loadFile):
928         (BlackBerry::WebKit::WebPage::download):
929         (BlackBerry::WebKit::WebPage::loadString):
930         (BlackBerry::WebKit::WebPage::executeJavaScript):
931         (BlackBerry::WebKit::WebPage::executeJavaScriptInIsolatedWorld):
932         (BlackBerry::WebKit::WebPage::stopLoading):
933         (BlackBerry::WebKit::WebPage::prepareToDestroy):
934         (BlackBerry::WebKit::WebPage::setScrollPosition):
935         (BlackBerry::WebKit::WebPage::scrollBy):
936         (BlackBerry::WebKit::WebPage::notifyInRegionScrollStatusChanged):
937         (BlackBerry::WebKit::WebPage::zoomToFitScale):
938         (BlackBerry::WebKit::WebPage::initialScale):
939         (BlackBerry::WebKit::WebPage::maximumScale):
940         (BlackBerry::WebKit::WebPage::scrollPosition):
941         (BlackBerry::WebKit::WebPage::viewportSize):
942         (BlackBerry::WebKit::WebPage::activeNodeContext):
943         (BlackBerry::WebKit::WebPage::assignFocus):
944         (BlackBerry::WebKit::WebPage::blockZoomAnimationFinished):
945         (BlackBerry::WebKit::WebPage::onInputLocaleChanged):
946         (BlackBerry::WebKit::WebPage::setScreenOrientation):
947         (BlackBerry::WebKit::WebPage::applyPendingOrientationIfNeeded):
948         (BlackBerry::WebKit::WebPage::setViewportSize):
949         (BlackBerry::WebKit::WebPage::setDefaultLayoutSize):
950         (BlackBerry::WebKit::WebPage::setScrollOriginPoint):
951         (BlackBerry::WebKit::WebPage::textEncoding):
952         (BlackBerry::WebKit::WebPage::forcedTextEncoding):
953         (BlackBerry::WebKit::WebPage::setForcedTextEncoding):
954         (BlackBerry::WebKit::WebPage::setSpellCheckingEnabled):
955         (BlackBerry::WebKit::parentLayer):
956         (BlackBerry::WebKit::WebPagePrivate::inRegionScrollableAreasForPoint):
957         (BlackBerry::WebKit::WebPage::destroyWebPageCompositor):
958         * Api/WebPage.h:
959         (WebCore):
960         (WebKit):
961         * Api/WebPage_p.h:
962         (WebCore):
963         (WebKit):
964         * WebKitSupport/DumpRenderTreeSupport.cpp:
965         (DumpRenderTreeSupport::corePage):
966         (DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests):
967         (DumpRenderTreeSupport::resetGeolocationMock):
968         (DumpRenderTreeSupport::setMockGeolocationError):
969         (DumpRenderTreeSupport::setMockGeolocationPermission):
970         (DumpRenderTreeSupport::setMockGeolocationPosition):
971         (DumpRenderTreeSupport::scalePageBy):
972         * WebKitSupport/DumpRenderTreeSupport.h:
973         (WebCore):
974         (DumpRenderTreeSupport):
975
976 2012-02-27  Mike Fenton  <mifenton@rim.com>
977
978         [BlackBerry] Selection handling should be entirely directional
979         https://bugs.webkit.org/show_bug.cgi?id=79692
980
981         Reviewed by Antonio Gomes.
982
983         Make all VisibleSelections directional.
984
985         * WebKitSupport/SelectionHandler.cpp:
986         (BlackBerry::WebKit::SelectionHandler::updateOrHandleInputSelection):
987         (BlackBerry::WebKit::SelectionHandler::setSelection):
988
989 2012-02-27  Ed Baker  <edbaker@rim.com>
990
991         [BlackBerry] Dragging a selection handle outside of the content bounding box does not update the selection range correctly
992         https://bugs.webkit.org/show_bug.cgi?id=78608
993
994         Ensure that when selection handles leave the content bounding box that
995         the handle not being dragged remains fixed. Do not apply padding to a
996         direction that would cause the selection to shrink when performing the
997         handle direction detection.
998
999         Reviewed by Antonio Gomes.
1000
1001         * WebKitSupport/DOMSupport.cpp:
1002         (BlackBerry::WebKit::DOMSupport::convertPointToFrame):
1003         * WebKitSupport/DOMSupport.h:
1004         * WebKitSupport/SelectionHandler.cpp:
1005         (BlackBerry::WebKit::clamp):
1006         (BlackBerry::WebKit::directionalVisiblePositionAtExtentOfBox):
1007         (BlackBerry::WebKit::SelectionHandler::extendSelectionToFieldBoundary):
1008         (BlackBerry::WebKit::SelectionHandler::setSelection):
1009         (BlackBerry::WebKit::SelectionHandler::clipPointToVisibleContainer):
1010         * WebKitSupport/SelectionHandler.h:
1011
1012 2012-02-27  Leo Yang  <leo.yang@torchmobile.com.cn>
1013
1014         [BlackBerry] Upstream accelerated compositing helper class
1015         https://bugs.webkit.org/show_bug.cgi?id=78448
1016
1017         Reviewed by Antonio Gomes.
1018
1019         Initial upstream, no new tests.
1020
1021         * WebKitSupport/FrameLayers.cpp: Added.
1022         * WebKitSupport/FrameLayers.h: Added.
1023
1024 2012-02-26  Hajime Morrita  <morrita@chromium.org>
1025
1026         Move ChromeClient::showContextMenu() to ContextMenuClient
1027         https://bugs.webkit.org/show_bug.cgi?id=79427
1028
1029         Reviewed by Adam Barth.
1030
1031         * WebCoreSupport/ChromeClientBlackBerry.h:
1032         (ChromeClientBlackBerry):
1033
1034 2012-02-24  Mike Fenton  <mifenton@rim.com>
1035
1036         [BlackBerry] Eliminate excessive BlackBerry::Platform use in InputHandler
1037         https://bugs.webkit.org/show_bug.cgi?id=79393
1038
1039         Reviewed by Antonio Gomes.
1040
1041         Cleanup usage of BlackBerry::Platform in InputHandler.
1042
1043         * WebKitSupport/InputHandler.cpp:
1044         (BlackBerry::WebKit::convertStringToWchar):
1045         (BlackBerry::WebKit::convertStringToWcharVector):
1046         (BlackBerry::WebKit::convertSpannableStringToString):
1047         (BlackBerry::WebKit::InputHandler::learnText):
1048         (BlackBerry::WebKit::InputHandler::setElementUnfocused):
1049         (BlackBerry::WebKit::InputHandler::shouldAcceptInputFocus):
1050         (BlackBerry::WebKit::InputHandler::setElementFocused):
1051         (BlackBerry::WebKit::InputHandler::nodeTextChanged):
1052         (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
1053         (BlackBerry::WebKit::InputHandler::frameUnloaded):
1054         (BlackBerry::WebKit::InputHandler::selectionChanged):
1055         (BlackBerry::WebKit::InputHandler::setSelection):
1056         (BlackBerry::WebKit::InputHandler::handleKeyboardInput):
1057         (BlackBerry::WebKit::InputHandler::deleteTextRelativeToCursor):
1058         (BlackBerry::WebKit::InputHandler::deleteText):
1059         (BlackBerry::WebKit::InputHandler::spannableTextInRange):
1060         (BlackBerry::WebKit::InputHandler::setComposingRegion):
1061         (BlackBerry::WebKit::InputHandler::finishComposition):
1062         (BlackBerry::WebKit::InputHandler::setText):
1063         (BlackBerry::WebKit::InputHandler::setTextAttributes):
1064         (BlackBerry::WebKit::InputHandler::setRelativeCursorPosition):
1065         (BlackBerry::WebKit::InputHandler::setSpannableTextAndRelativeCursor):
1066         (BlackBerry::WebKit::InputHandler::setComposingText):
1067         (BlackBerry::WebKit::InputHandler::commitText):
1068
1069 2012-02-24  Mike Fenton  <mifenton@rim.com>
1070
1071         [BlackBerry] Eliminate excessive BlackBerry::Platform use in SelectionHandler.
1072         https://bugs.webkit.org/show_bug.cgi?id=79391
1073
1074         Reviewed by Antonio Gomes.
1075
1076         Clean up usage of BlackBerry::Platform in SelectionHandler and
1077         explicitly define what namespace to use for ambiguous objects like
1078         IntRect and IntPoint.
1079
1080         * WebKitSupport/SelectionHandler.cpp:
1081         (BlackBerry::WebKit::SelectionHandler::cancelSelection):
1082         (BlackBerry::WebKit::SelectionHandler::getConsolidatedRegionOfTextQuadsForSelection):
1083         (BlackBerry::WebKit::visiblePositionForPointIgnoringClipping):
1084         (BlackBerry::WebKit::directionOfPointRelativeToRect):
1085         (BlackBerry::WebKit::SelectionHandler::shouldUpdateSelectionOrCaretForPoint):
1086         (BlackBerry::WebKit::SelectionHandler::setCaretPosition):
1087         (BlackBerry::WebKit::directionalVisiblePositionAtExtentOfBox):
1088         (BlackBerry::WebKit::pointIsOutsideOfBoundingBoxInDirection):
1089         (BlackBerry::WebKit::SelectionHandler::extendSelectionToFieldBoundary):
1090         (BlackBerry::WebKit::SelectionHandler::updateOrHandleInputSelection):
1091         (BlackBerry::WebKit::SelectionHandler::clipPointToFocusNode):
1092         (BlackBerry::WebKit::SelectionHandler::setSelection):
1093         (BlackBerry::WebKit::SelectionHandler::selectAtPoint):
1094         (BlackBerry::WebKit::SelectionHandler::selectObject):
1095         (BlackBerry::WebKit::comparePointsToReferencePoint):
1096         (BlackBerry::WebKit::minXMinYCorner):
1097         (BlackBerry::WebKit::maxXMinYCorner):
1098         (BlackBerry::WebKit::minXMaxYCorner):
1099         (BlackBerry::WebKit::maxXMaxYCorner):
1100         (BlackBerry::WebKit::caretLocationForRect):
1101         (BlackBerry::WebKit::caretComparisonPointForRect):
1102         (BlackBerry::WebKit::adjustCaretRects):
1103         (BlackBerry::WebKit::SelectionHandler::clipRegionToVisibleContainer):
1104         (BlackBerry::WebKit::referencePoint):
1105         (BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):
1106         (BlackBerry::WebKit::SelectionHandler::caretPositionChanged):
1107         (BlackBerry::WebKit::SelectionHandler::selectionContains):
1108
1109 2012-02-24  Shinya Kawanaka  <shinyak@chromium.org>
1110
1111         SpellCheckRequest needs to know the context where the spellcheck happened.
1112         https://bugs.webkit.org/show_bug.cgi?id=79320
1113
1114         Reviewed by Hajime Morita.
1115
1116         * WebCoreSupport/EditorClientBlackBerry.cpp:
1117         (WebCore::EditorClientBlackBerry::requestCheckingOfString):
1118         * WebCoreSupport/EditorClientBlackBerry.h:
1119         (EditorClientBlackBerry):
1120
1121 2012-02-24  Charles Wei  <charles.wei@torchmobile.com.cn>
1122
1123         [BlackBerry] Anchor mailto: with target set won't launch Messaging application when clicked
1124         https://bugs.webkit.org/show_bug.cgi?id=79318
1125
1126         Need to give the client a chance to decide how to handle the new window request.
1127
1128         Reviewed by Rob Buis.
1129
1130         * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
1131         (WebCore::FrameLoaderClientBlackBerry::dispatchDecidePolicyForNewWindowAction):
1132
1133 2012-02-23  Mike Fenton  <mifenton@rim.com>
1134
1135         [BlackBerry] Selection handler has compile failure with logs enabled.
1136         https://bugs.webkit.org/show_bug.cgi?id=79392
1137
1138         Reviewed by Antonio Gomes.
1139
1140         Build Fix.  Update log to avoid usage of toString which was removed.
1141
1142         * WebKitSupport/SelectionHandler.cpp:
1143         (BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):
1144
1145 2012-02-19  Antonio Gomes  <agomes@rim.com>
1146
1147         Fat fingers - Add a clearer way to distinguish the node we want (shadow or non-shadow)
1148         https://bugs.webkit.org/show_bug.cgi?id=79256
1149         PR #127814 / MKS_2587410
1150
1151         Reviewed by Rob Buis.
1152
1153         Patch adds a cleaner way for call sites of FatFingersResult to
1154         query for the appropriated target node: shadow or non-shadow DOM nodes.
1155
1156         It also renames FatFingersResults::validNode to ::node, assuming
1157         that "invalid" nodes are not applicable in any context.
1158
1159         * Api/WebPage.cpp:
1160         (BlackBerry::WebKit::WebPagePrivate::clearDocumentData):
1161         (BlackBerry::WebKit::WebPagePrivate::contextNode):
1162         (BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
1163         * WebKitSupport/FatFingers.h:
1164         (FatFingersResult):
1165         (BlackBerry::WebKit::FatFingersResult::node):
1166         (BlackBerry::WebKit::FatFingersResult::nodeAsElementIfApplicable):
1167         * WebKitSupport/SelectionHandler.cpp:
1168         (BlackBerry::WebKit::SelectionHandler::selectAtPoint):
1169         * WebKitSupport/TouchEventHandler.cpp:
1170         (BlackBerry::WebKit::TouchEventHandler::touchHoldEvent):
1171         (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
1172
1173 2012-02-23  Jacky Jiang  <zhajiang@rim.com>
1174
1175         [BlackBerry] Upstream BlackBerry API web page related files
1176         https://bugs.webkit.org/show_bug.cgi?id=74380
1177
1178         Reviewed by Antonio Gomes.
1179
1180         Initial upstream, no new tests.
1181
1182         * Api/WebPage.cpp: Added.
1183         * Api/WebPage.h: Added.
1184         * Api/WebPage_p.h: Added.
1185
1186 2012-02-23  Leo Yang  <leo.yang@torchmobile.com.cn>
1187
1188         [BlackBerry] Remove unused ChromeClientBlackBerry::platformCompositingWindow(), platformWindow() and WebPageClient::compositingWindow()
1189         https://bugs.webkit.org/show_bug.cgi?id=78681
1190
1191         Reviewed by Antonio Gomes.
1192
1193         * Api/WebPageClient.h:
1194         * WebCoreSupport/ChromeClientBlackBerry.cpp:
1195         (WebCore):
1196         * WebCoreSupport/ChromeClientBlackBerry.h:
1197         (ChromeClientBlackBerry):
1198
1199 2012-02-23  Leo Yang  <leo.yang@torchmobile.com.cn>
1200
1201         [BlackBerry] Upstream GLES2Context.{h, cpp}
1202         https://bugs.webkit.org/show_bug.cgi?id=79196
1203
1204         Reviewed by Rob Buis.
1205
1206         Initial upstream, no new tests.
1207
1208         * WebKitSupport/GLES2Context.cpp: Added.
1209         * WebKitSupport/GLES2Context.h: Added.
1210
1211 2012-02-23  Mike Fenton  <mifenton@rim.com>
1212
1213         [BlackBerry] InputHandler requires cleanup of Navigation Mode handling.
1214         https://bugs.webkit.org/show_bug.cgi?id=79366
1215
1216         Reviewed by Rob Buis.
1217
1218         Cleanup InputHandler navigation based code.
1219
1220         1) Remove the concept of NavigationMode and replace it
1221            with simple showKeyboard calls.
1222
1223         2) Remove navigation move events and replace with standard
1224            key events.
1225
1226         3) Standardize function/variable names and remove obsolete
1227            functions.
1228
1229         * Api/WebPageClient.h:
1230         * WebKitSupport/InputHandler.cpp:
1231         (BlackBerry::WebKit::InputHandler::InputHandler):
1232         (BlackBerry::WebKit::InputHandler::nodeFocused):
1233         (BlackBerry::WebKit::InputHandler::setElementUnfocused):
1234         (BlackBerry::WebKit::InputHandler::setElementFocused):
1235         (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):
1236         (BlackBerry::WebKit::InputHandler::setDelayKeyboardVisibilityChange):
1237         (BlackBerry::WebKit::InputHandler::processPendingKeyboardVisibilityChange):
1238         (BlackBerry::WebKit::InputHandler::notifyClientOfKeyboardVisibilityChange):
1239         * WebKitSupport/InputHandler.h:
1240         (InputHandler):
1241         * WebKitSupport/SelectionHandler.cpp:
1242         (BlackBerry::WebKit::SelectionHandler::setCaretPosition):
1243         (BlackBerry::WebKit::SelectionHandler::updateOrHandleInputSelection):
1244         * WebKitSupport/TouchEventHandler.cpp:
1245         (BlackBerry::WebKit::TouchEventHandler::touchEventCancel):
1246         (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
1247
1248 2012-02-21  Ryosuke Niwa  <rniwa@webkit.org>
1249
1250         Remove the remaining uses of CSSStyleDeclaration in Editor
1251         https://bugs.webkit.org/show_bug.cgi?id=78939
1252
1253         Reviewed by Enrica Casucci.
1254
1255         * WebCoreSupport/EditorClientBlackBerry.cpp:
1256         (WebCore::EditorClientBlackBerry::shouldApplyStyle):
1257         * WebCoreSupport/EditorClientBlackBerry.h:
1258         (EditorClientBlackBerry):
1259
1260 2012-02-22  Mike Fenton  <mifenton@rim.com>
1261
1262         [BlackBerry] InputHandler has signed vs unsigned comparison.
1263         https://bugs.webkit.org/show_bug.cgi?id=79261
1264
1265         Fix warning by casting the unsigned int to an int.
1266
1267         Reviewed by Rob Buis.
1268
1269         * WebKitSupport/InputHandler.cpp:
1270         (BlackBerry::WebKit::InputHandler::rectForCaret):
1271
1272 2012-02-22  Ryosuke Niwa  <rniwa@webkit.org>
1273
1274         Remove the remaining uses of CSSStyleDeclaration in Editor
1275         https://bugs.webkit.org/show_bug.cgi?id=78939
1276
1277         Reviewed by Enrica Casucci.
1278
1279         * WebCoreSupport/EditorClientBlackBerry.cpp:
1280         (WebCore::EditorClientBlackBerry::shouldApplyStyle):
1281         * WebCoreSupport/EditorClientBlackBerry.h:
1282         (EditorClientBlackBerry):
1283
1284 2012-02-18  Antonio Gomes  <agomes@rim.com>
1285
1286         Fat fingers - cache the first rect-based hit test so we do not need to do it again
1287         https://bugs.webkit.org/show_bug.cgi?id=79115
1288
1289         Reviewed by Adam Treat.
1290
1291         Our FatFingers implementation runs currently in two phases:
1292         the first checks for the elements intrinsically clickable;
1293         the second checks for elements made clickable by the page
1294         (for example, a div with a onclick event listener attached to it).
1295         For each phase, we perform a rect hittest, which is not needed since
1296         the result of each is the same.
1297
1298         Patch introduces a caching mechanism so we avoid on rect hittest:
1299         when the first phase runs, it caches each nodeset per document in
1300         a hashmap. This second phase works with the cached results.
1301
1302         No behavioral change, but performance is better since we
1303         avoid one (possibly expensive) rect hittest.
1304
1305         I measured the performance gain on https://www.kvd.se/, and we
1306         save up to 0.04 seconds, by caching and re-using the results.
1307
1308         * WebKitSupport/FatFingers.cpp:
1309         (BlackBerry::WebKit::dumpHitTestResult):
1310         (BlackBerry::WebKit::FatFingers::findBestPoint):
1311         (BlackBerry::WebKit::FatFingers::findIntersectingRegions):
1312         (BlackBerry::WebKit::FatFingers::cachingStrategy):
1313         (WebKit):
1314         (BlackBerry::WebKit::FatFingers::getNodesFromRect):
1315         * WebKitSupport/FatFingers.h:
1316
1317 2012-02-20  Antonio Gomes  <agomes@rim.com>
1318
1319         All default video/audio control elements should be rect-hit testable (Part II)
1320         PR #139518 / MKS_3005538
1321
1322         Reviewed by George Staikos.
1323
1324         Add HTMLInputElement::isMediaControlElement as a criteria
1325         to consider a element as clickable.
1326
1327         Note that is should be only used while in the "ClickableByDefault"
1328         phase of FatFingers.
1329
1330         * WebKitSupport/FatFingers.cpp:
1331         (BlackBerry::WebKit::FatFingers::isElementClickable):
1332
1333 2012-02-16  Antonio Gomes  <agomes@rim.com>
1334
1335         [BlackBerry] Implemented a way to defer client navigation change client notifications
1336         https://bugs.webkit.org/show_bug.cgi?id=78848
1337
1338         Reviewed by Rob Buis.
1339
1340         Currently we postpone touch_down till touch_up if user touches
1341         the screen and an input field has the WebKit focus. This is done
1342         so we can scroll the page without hidding the vkb needlessly.
1343
1344         However, it breaks the conversion of touch to mouse events
1345         if an input field has the focus in the following scenario:
1346         an <input type=text> is focused and an user grab and-drag
1347         a <input type=range> knob/slide. It does not work until the
1348         user unfocuses the currently focused edit field.
1349
1350         Patch introduces a way to unfocus a currently focused input field,
1351         without requesting the client to show or hide the virtual keyboard
1352         right way. Instead it gets a delayed notification of the vkb mode requested
1353         at either touch_released/mouse_up or touch_cancel time.
1354
1355         For now, due to content side issues with major web sites,
1356         only delay navigation mode notification changes if we are not dealing with
1357         input modes.
1358
1359         * WebKitSupport/InputHandler.cpp:
1360         (BlackBerry::WebKit::InputHandler::InputHandler):
1361         (BlackBerry::WebKit::InputHandler::nodeFocused):
1362         (BlackBerry::WebKit::InputHandler::setElementFocused):
1363         (BlackBerry::WebKit::InputHandler::setNavigationMode):
1364         (WebKit):
1365         (BlackBerry::WebKit::InputHandler::setDelayClientNotificationOfNavigationModeChange):
1366         (BlackBerry::WebKit::InputHandler::processPendingClientNavigationModeChangeNotification):
1367         (BlackBerry::WebKit::InputHandler::notifyClientOfNavigationModeChange):
1368         (BlackBerry::WebKit::InputHandler::willOpenPopupForNode):
1369         (BlackBerry::WebKit::InputHandler::setPopupListIndexes):
1370         (BlackBerry::WebKit::InputHandler::spannableTextInRange):
1371         (BlackBerry::WebKit::InputHandler::removeComposedText):
1372         (BlackBerry::WebKit::InputHandler::firstSpanInString):
1373         (BlackBerry::WebKit::InputHandler::setText):
1374         (BlackBerry::WebKit::InputHandler::setRelativeCursorPosition):
1375         * WebKitSupport/InputHandler.h:
1376         (InputHandler):
1377
1378 2012-02-16  Antonio Gomes  <agomes@rim.com>
1379
1380         Crash @WebPagePrivate::enqueueRenderingOfClippedContentOfScrollableNodeAfterInRegionScrolling MKS_2986818
1381         https://bugs.webkit.org/show_bug.cgi?id=78845
1382
1383         Reviewed by Rob Buis.
1384
1385         We were trying to operate on a cached Node when its page/frame/document
1386         were gone to PageCache already. To avoid such problems, lets clean up
1387         any document data we have cached when the Frame goes into the cache.
1388
1389         * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
1390         (WebCore::FrameLoaderClientBlackBerry::didSaveToPageCache):
1391         (WebCore):
1392         * WebCoreSupport/FrameLoaderClientBlackBerry.h:
1393         (FrameLoaderClientBlackBerry):
1394
1395 2012-02-16  Antonio Gomes  <agomes@rim.com>
1396
1397         [BlackBerry] Upstream touch handling related classes
1398         https://bugs.webkit.org/show_bug.cgi?id=78509
1399
1400         Reviewed by Adam Treat and Rob Buis.
1401
1402         FatFingers is the class responsible to the whole touch
1403         accuracy of the BlackBerry port. Initial upstream.
1404
1405         * WebKitSupport/FatFingers.cpp: Added.
1406         (WebKit):
1407         (BlackBerry::WebKit::FatFingers::fingerRectForPoint):
1408         (BlackBerry::WebKit::hasMousePressListener):
1409         (BlackBerry::WebKit::FatFingers::isElementClickable):
1410         (BlackBerry::WebKit::isFieldWithText):
1411         (BlackBerry::WebKit::distanceBetweenPoints):
1412         (BlackBerry::WebKit::compareDistanceBetweenPoints):
1413         (BlackBerry::WebKit::isValidFrameOwner):
1414         (BlackBerry::WebKit::FatFingers::FatFingers):
1415         (BlackBerry::WebKit::FatFingers::~FatFingers):
1416         (BlackBerry::WebKit::FatFingers::findBestPoint):
1417         (BlackBerry::WebKit::FatFingers::checkFingerIntersection):
1418         (BlackBerry::WebKit::FatFingers::findIntersectingRegions):
1419         (BlackBerry::WebKit::FatFingers::checkForClickableElement):
1420         (BlackBerry::WebKit::FatFingers::checkForText):
1421         (BlackBerry::WebKit::FatFingers::getPaddings):
1422         (BlackBerry::WebKit::FatFingers::nodesFromRect):
1423         (BlackBerry::WebKit::FatFingers::getRelevantInfoFromPoint):
1424         (BlackBerry::WebKit::FatFingers::setSuccessfulFatFingersResult):
1425         * WebKitSupport/FatFingers.h: Added.
1426         (WebCore):
1427         (WebKit):
1428         (FatFingersResult):
1429         (BlackBerry::WebKit::FatFingersResult::FatFingersResult):
1430         (BlackBerry::WebKit::FatFingersResult::reset):
1431         (BlackBerry::WebKit::FatFingersResult::originPosition):
1432         (BlackBerry::WebKit::FatFingersResult::adjustedPosition):
1433         (BlackBerry::WebKit::FatFingersResult::positionWasAdjusted):
1434         (BlackBerry::WebKit::FatFingersResult::isTextInput):
1435         (BlackBerry::WebKit::FatFingersResult::isValid):
1436         (BlackBerry::WebKit::FatFingersResult::validNode):
1437         (BlackBerry::WebKit::FatFingersResult::nodeAsElementIfApplicable):
1438         (FatFingers):
1439
1440 2012-02-16  Antonio Gomes  <agomes@rim.com>
1441
1442         [BlackBerry] Upstream touch handling related classes
1443         https://bugs.webkit.org/show_bug.cgi?id=78509
1444
1445         Reviewed by Adam Treat.
1446
1447         Initial upstream of the Blackberry specific single touch event
1448         handler class.
1449
1450         * blackberry/WebKitSupport/TouchEventHandler.cpp: Added.
1451         (WebKit):
1452         (BlackBerry::WebKit::hasMouseMoveListener):
1453         (BlackBerry::WebKit::hasTouchListener):
1454         (BlackBerry::WebKit::elementExpectsMouseEvents):
1455         (BlackBerry::WebKit::shouldConvertTouchToMouse):
1456         (BlackBerry::WebKit::TouchEventHandler::TouchEventHandler):
1457         (BlackBerry::WebKit::TouchEventHandler::~TouchEventHandler):
1458         (BlackBerry::WebKit::TouchEventHandler::shouldSuppressMouseDownOnTouchDown):
1459         [BlackBerry] Upstream touch handling related classes
1460         https://bugs.webkit.org/show_bug.cgi?id=78509
1461
1462         Reviewed by Rob Buis.
1463
1464         InRegionScrollableArea specializes the BlackBerry specific ScrollViewBase,
1465         working as a read-only wrapper object for a scrollable areas in the page.
1466         It is used in our client side to control in-region scrolling (scrollable boxes,
1467         inner frames, etc).
1468
1469         Initial upstream.
1470
1471         * WebKitSupport/InRegionScrollableArea.cpp: Added.
1472         (WebKit):
1473         (BlackBerry::WebKit::InRegionScrollableArea::InRegionScrollableArea):
1474         (BlackBerry::WebKit::InRegionScrollableArea::calculateMinimumScrollPosition):
1475         (BlackBerry::WebKit::InRegionScrollableArea::calculateMaximumScrollPosition):
1476         (BlackBerry::WebKit::InRegionScrollableArea::layer):
1477         (BlackBerry):
1478         * WebKitSupport/InRegionScrollableArea.h: Added.
1479         (WebCore):
1480         (WebKit):
1481         (InRegionScrollableArea):
1482
1483 2012-02-16  Antonio Gomes  <agomes@rim.com>
1484
1485         (BlackBerry::WebKit::TouchEventHandler::touchEventCancel):
1486         (BlackBerry::WebKit::TouchEventHandler::touchHoldEvent):
1487         (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
1488         (BlackBerry::WebKit::TouchEventHandler::spellCheck):
1489         (BlackBerry::WebKit::TouchEventHandler::handleFatFingerPressed):
1490         (BlackBerry::WebKit::elementForTapHighlight):
1491         (BlackBerry::WebKit::TouchEventHandler::drawTapHighlight):
1492         * blackberry/WebKitSupport/TouchEventHandler.h: Added.
1493         (WebCore):
1494         (WebKit):
1495         (TouchEventHandler):
1496         (BlackBerry::WebKit::TouchEventHandler::lastFatFingersResult):
1497         (BlackBerry::WebKit::TouchEventHandler::resetLastFatFingersResult):
1498