Changeset 113983 in webkit
- Timestamp:
- Apr 12, 2012 8:35:13 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r113909 r113983 1 2012-04-12 Yael Aharon <yael.aharon@nokia.com> 2 3 [Qt][WK2] Nested fixed elements scroll too fast 4 https://bugs.webkit.org/show_bug.cgi?id=83720 5 6 Reviewed by Noam Rosenthal. 7 8 * ManualTests/nested-fixed-position.html: Added. 9 1 10 2012-03-15 Martin Robinson <mrobinson@igalia.com> 2 11 -
trunk/Source/WebCore/ChangeLog
r113976 r113983 1 2012-04-12 Yael Aharon <yael.aharon@nokia.com> 2 3 [Qt][WK2] Nested fixed elements scroll too fast 4 https://bugs.webkit.org/show_bug.cgi?id=83720 5 6 Reviewed by Noam Rosenthal. 7 8 Before setting the scrollPositionDelta to a fixed layer, check if it has an ancestor which also has fixed position. 9 If it does, do not set scrollPositionDelta. 10 Added a flag to TextureMapperLayer and GraphicsLayerTextureMapper indicating if it is a fixed position layer. 11 12 * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: 13 (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper): 14 * platform/graphics/texmap/GraphicsLayerTextureMapper.h: 15 (WebCore::GraphicsLayerTextureMapper::setFixedToViewport): 16 (WebCore::GraphicsLayerTextureMapper::fixedToViewport): 17 (GraphicsLayerTextureMapper): 18 * platform/graphics/texmap/TextureMapperLayer.cpp: 19 (WebCore::TextureMapperLayer::syncCompositingStateSelf): 20 (WebCore::TextureMapperLayer::isAncestorFixedToViewport): 21 (WebCore): 22 (WebCore::TextureMapperLayer::setScrollPositionDeltaIfNeeded): 23 * platform/graphics/texmap/TextureMapperLayer.h: 24 (TextureMapperLayer): 25 (WebCore::TextureMapperLayer::setFixedToViewport): 26 1 27 2012-04-12 Charles Wei <charles.wei@torchmobile.com.cn> 2 28 -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
r113135 r113983 30 30 , m_changeMask(0) 31 31 , m_needsDisplay(false) 32 , m_fixedToViewport(false) 32 33 , m_contentsLayer(0) 33 34 , m_animationStartedTimer(this, &GraphicsLayerTextureMapper::animationStartedTimerFired) -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
r113135 r113983 95 95 #endif 96 96 97 void setFixedToViewport(bool fixed) { m_fixedToViewport = fixed; } 98 bool fixedToViewport() const { return m_fixedToViewport; } 99 97 100 private: 98 101 virtual void willBeDestroyed(); … … 104 107 int m_changeMask; 105 108 bool m_needsDisplay; 109 bool m_fixedToViewport; 106 110 TextureMapperPlatformLayer* m_contentsLayer; 107 111 FloatRect m_needsDisplayRect; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
r113791 r113983 428 428 m_state.filters = graphicsLayer->filters(); 429 429 #endif 430 m_fixedToViewport = graphicsLayer->fixedToViewport(); 430 431 431 432 m_state.needsDisplay = m_state.needsDisplay || graphicsLayer->needsDisplay(); … … 512 513 } 513 514 514 void TextureMapperLayer::setScrollPositionDelta(const IntPoint& delta) 515 bool TextureMapperLayer::isAncestorFixedToViewport() const 516 { 517 for (TextureMapperLayer* parent = m_parent; parent; parent = parent->m_parent) { 518 if (parent->m_fixedToViewport) 519 return true; 520 } 521 522 return false; 523 } 524 525 void TextureMapperLayer::setScrollPositionDeltaIfNeeded(const IntPoint& delta) 515 526 { 516 527 // delta is the difference between the scroll offset in the ui process and the scroll offset 517 528 // in the web process. We add this delta to the position of fixed layers, to make 518 // sure that they do not move while scrolling. 519 m_scrollPositionDelta = delta; 529 // sure that they do not move while scrolling. We need to reset this delta to fixed layers 530 // that have an ancestor which is also a fixed layer, because the delta will be added to the ancestor. 531 if (isAncestorFixedToViewport()) 532 m_scrollPositionDelta = IntPoint(); 533 else 534 m_scrollPositionDelta = delta; 520 535 m_transform.setPosition(m_state.pos + m_scrollPositionDelta); 521 536 } -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
r113791 r113983 127 127 void clearBackingStoresRecursive(); 128 128 129 void setScrollPositionDelta(const IntPoint&); 129 void setScrollPositionDeltaIfNeeded(const IntPoint&); 130 void setFixedToViewport(bool fixed) { m_fixedToViewport = fixed; } 130 131 131 132 private: … … 146 147 147 148 PassRefPtr<BitmapTexture> texture() { return m_backingStore ? m_backingStore->texture() : 0; } 149 bool isAncestorFixedToViewport() const; 148 150 149 151 void paintRecursive(const TextureMapperPaintOptions&); … … 221 223 TextureMapperAnimations m_animations; 222 224 IntPoint m_scrollPositionDelta; 225 bool m_fixedToViewport; 223 226 }; 224 227 -
trunk/Source/WebKit2/ChangeLog
r113974 r113983 1 2012-04-12 Yael Aharon <yael.aharon@nokia.com> 2 3 [Qt][WK2] Nested fixed elements scroll too fast 4 https://bugs.webkit.org/show_bug.cgi?id=83720 5 6 Reviewed by Noam Rosenthal. 7 8 Set the fixedToViewport flag on the fixed position layers and adjust to 9 the new function name for setting scrollPositionDelta. 10 11 * UIProcess/WebLayerTreeRenderer.cpp: 12 (WebKit::WebLayerTreeRenderer::adjustPositionForFixedLayers): 13 (WebKit::WebLayerTreeRenderer::setLayerState): 14 1 15 2012-04-12 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 16 -
trunk/Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
r113859 r113983 180 180 LayerMap::iterator end = m_fixedLayers.end(); 181 181 for (LayerMap::iterator it = m_fixedLayers.begin(); it != end; ++it) 182 toTextureMapperLayer(it->second)->setScrollPositionDelta (IntPoint(scrollPosition.x() - m_renderedContentsScrollPosition.x(), scrollPosition.y() - m_renderedContentsScrollPosition.y()));182 toTextureMapperLayer(it->second)->setScrollPositionDeltaIfNeeded(IntPoint(scrollPosition.x() - m_renderedContentsScrollPosition.x(), scrollPosition.y() - m_renderedContentsScrollPosition.y())); 183 183 } 184 184 … … 227 227 layer->setContentsRect(layerInfo.contentsRect); 228 228 layer->setDrawsContent(layerInfo.drawsContent); 229 toGraphicsLayerTextureMapper(layer)->setFixedToViewport(layerInfo.fixedToViewport); 229 230 230 231 if (layerInfo.fixedToViewport)
Note: See TracChangeset
for help on using the changeset viewer.