Changeset 149137 in webkit
- Timestamp:
- Apr 25, 2013 1:02:55 PM (11 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r149135 r149137 5239 5239 } 5240 5240 5241 Platform::IntSize WebPage::fixedElementSizeDelta() 5242 { 5243 ASSERT(userInterfaceThreadMessageClient()->isCurrentThread()); 5244 5245 // Traverse the layer tree and find the fixed element rect if there is one. 5246 IntRect fixedElementRect; 5247 if (d->compositor() && d->compositor()->rootLayer()) 5248 d->compositor()->findFixedElementRect(d->compositor()->rootLayer(), fixedElementRect); 5249 5250 // Ignore the fixed element if it is not at the top of page. 5251 if (!fixedElementRect.isEmpty() && !fixedElementRect.y()) 5252 return Platform::IntSize(0, fixedElementRect.height()); 5253 return Platform::IntSize(); 5254 } 5255 5241 5256 bool WebPagePrivate::compositorDrawsRootLayer() const 5242 5257 { -
trunk/Source/WebKit/blackberry/Api/WebPage.h
r148543 r149137 333 333 334 334 Platform::IntPoint adjustDocumentScrollPosition(const Platform::IntPoint& documentScrollPosition, const Platform::IntRect& documentPaddingRect); 335 Platform::IntSize fixedElementSizeDelta(); 335 336 336 337 // FIXME: Needs API review on this header. See PR #120402. -
trunk/Source/WebKit/blackberry/Api/WebPageCompositor.cpp
r148676 r149137 281 281 } 282 282 283 void WebPageCompositorPrivate::findFixedElementRect(LayerCompositingThread* layer, WebCore::IntRect& fixedElementRect) 284 { 285 if ((layer->hasFixedContainer() || layer->isFixedPosition() || layer->hasFixedAncestorInDOMTree()) && layer->layerRenderer()) { 286 IntRect fixedRect = layer->layerRenderer()->toPixelViewportCoordinates(layer->getDrawRect()); 287 // FIXME: It's possible that the rects don't intersect now, but will be connected by a fixed rect found later. 288 // We need to handle it as well. 289 if (fixedElementRect.isEmpty() || fixedElementRect.intersects(fixedRect)) // Unite rects if they intersect each other. 290 fixedElementRect.unite(fixedRect); 291 else if (fixedRect.y() < fixedElementRect.y()) // Replace the fixedElementRect with fixedRect if fixedRect is above it (closer to top). 292 fixedElementRect = fixedRect; 293 } 294 295 const Vector<RefPtr<LayerCompositingThread> >& sublayers = layer->getSublayers(); 296 for (size_t i = 0; i < sublayers.size(); i++) 297 findFixedElementRect(sublayers[i].get(), fixedElementRect); 298 } 299 283 300 WebPageCompositor::WebPageCompositor(WebPage* page, WebPageCompositorClient* client) 284 301 { -
trunk/Source/WebKit/blackberry/Api/WebPageCompositor_p.h
r147136 r149137 105 105 void removeOverlay(WebCore::LayerCompositingThread*); 106 106 107 void findFixedElementRect(WebCore::LayerCompositingThread*, WebCore::IntRect&); 108 107 109 protected: 108 110 WebPageCompositorPrivate(WebPagePrivate*, WebPageCompositorClient*); -
trunk/Source/WebKit/blackberry/ChangeLog
r149135 r149137 1 2013-04-25 Iris Wu <shuwu@blackberry.com> 2 3 [BlackBerry] Make scroll position adjustment work with pages with fixed position elements. 4 https://bugs.webkit.org/show_bug.cgi?id=115178 5 6 Reviewed by Rob Buis. 7 8 PR 308796 9 10 Currently the position WebPage::adjustDocumentScrollPosition adjusts is the top 11 left point of the viewport. 12 On the page with fixed position elements, we want it to adjust the position beneath 13 the fixed elements so it can be always visible. 14 15 The basic idea is: 16 1. Detect if there are fixed position elements before going through ProximityDetector. 17 2. If the fixed element exists, calculate its the size and the actual visible position 18 beneath it. 19 3. Pass the position to ProximityDetector. Then according to the new position we get, 20 calculate the top left position of the viewport (final scroll position). 21 22 * Api/WebPage.cpp: 23 (BlackBerry::WebKit::WebPage::fixedElementSizeDelta): 24 (WebKit): 25 * Api/WebPage.h: 26 * Api/WebPageCompositor.cpp: 27 (BlackBerry::WebKit::WebPageCompositorPrivate::findFixedElementRect): 28 (WebKit): 29 * Api/WebPageCompositor_p.h: 30 (WebPageCompositorPrivate): 31 1 32 2013-04-25 Mike Lattanzio <mlattanzio@blackberry.com> 2 33
Note: See TracChangeset
for help on using the changeset viewer.