summaryrefslogtreecommitdiffstats
path: root/WebCore/platform
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2010-03-17 21:15:55 +0000
committerNicolas Roard <nicolas@android.com>2010-03-18 15:16:50 +0000
commita9fc241ad9f93bcec6abf9dd251c079ae8bbea12 (patch)
tree6a51bc0d279131d3a8f1c7c59053799cafa14b4c /WebCore/platform
parent8026280044128436d8e89736519a0b32b6540201 (diff)
downloadexternal_webkit-a9fc241ad9f93bcec6abf9dd251c079ae8bbea12.zip
external_webkit-a9fc241ad9f93bcec6abf9dd251c079ae8bbea12.tar.gz
external_webkit-a9fc241ad9f93bcec6abf9dd251c079ae8bbea12.tar.bz2
Fix click issues when using fixed elements. This CL also fix the positioning
of a fixed layer when no position is defined, and also only use the screen to position only the fixed elements, not other types of positioned elements. Bug:2521087 The click issues were due to not returning the fixed element when looking for a parent stackingContext in RenderLayer::stackingContext(). This resulted in incorrect coordinates for the layers children of a fixed layer, that we then had to recompute in RenderLayer::convertToLayerCoords(), but this in turns was invaliding hit test detection... Fixed elements are now positioned relative to the screen instead of the virtual viewport (ANDROID_FIXED_ELEMENTS); but this was applying indiscriminantly to all positioned elements, absolute elements included. The CL modify RenderBox::containingBlockWidthForPositioned() and RenderBox::containingBlockHeightForPositioned() to only do this for fixed elements. Finally, fixed layers were wrongly positioned if the positions were not fully set (e.g. only setting top:0 but no left or right). The change to LayerAndroid::updateFixedLayersPositions() fixes this. Change-Id: I07a179dd631a2bc1a313e33ffcf69ef388ecb7ca
Diffstat (limited to 'WebCore/platform')
-rw-r--r--WebCore/platform/graphics/android/LayerAndroid.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp
index c17a034..3b1743d 100644
--- a/WebCore/platform/graphics/android/LayerAndroid.cpp
+++ b/WebCore/platform/graphics/android/LayerAndroid.cpp
@@ -245,25 +245,25 @@ const LayerAndroid* LayerAndroid::find(int x, int y) const
///////////////////////////////////////////////////////////////////////////////
-void LayerAndroid::updateFixedLayersPositions(const SkRect& viewport) {
-
+void LayerAndroid::updateFixedLayersPositions(const SkRect& viewport)
+{
if (m_isFixed) {
- float x = 0;
- float y = 0;
float w = viewport.width();
float h = viewport.height();
float dx = viewport.fLeft;
float dy = viewport.fTop;
+ float x = dx;
+ float y = dy;
if (m_fixedLeft.defined())
- x = dx + m_fixedLeft.calcFloatValue(w);
+ x += m_fixedLeft.calcFloatValue(w);
else if (m_fixedRight.defined())
- x = dx + w - m_fixedRight.calcFloatValue(w) - m_fixedWidth;
+ x += w - m_fixedRight.calcFloatValue(w) - m_fixedWidth;
if (m_fixedTop.defined())
- y = dy + m_fixedTop.calcFloatValue(h);
+ y += m_fixedTop.calcFloatValue(h);
else if (m_fixedBottom.defined())
- y = dy + h - m_fixedBottom.calcFloatValue(h) - m_fixedHeight;
+ y += h - m_fixedBottom.calcFloatValue(h) - m_fixedHeight;
this->setPosition(x, y);
}