diff options
| author | Teng-Hui Zhu <ztenghui@google.com> | 2011-05-20 15:03:54 -0700 |
|---|---|---|
| committer | Teng-Hui Zhu <ztenghui@google.com> | 2011-05-23 09:15:39 -0700 |
| commit | 635861a90dfb699f7c81038576ad7d993d2a9972 (patch) | |
| tree | 2b5e80228c395a89a00aabf1aa135e30f7cef466 /WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | |
| parent | e61ae1cb52fb14cf18cef0044ed125e162c8c2dd (diff) | |
| download | external_webkit-635861a90dfb699f7c81038576ad7d993d2a9972.zip external_webkit-635861a90dfb699f7c81038576ad7d993d2a9972.tar.gz external_webkit-635861a90dfb699f7c81038576ad7d993d2a9972.tar.bz2 | |
DO NOT MERGE:Fix position update
We fixed two issues here.
First, when fixed left/right both undefined, the renderlayer position already
took the fix margin into consideration, so we don't need to compute that again.
Second, for compute the fix element's ViewRect, we just need the normal width,
not the overflow one.
bug:4440999
Change-Id: Ie3f9b0d4d87de576ce852e7a4898d57a80add7a9
Diffstat (limited to 'WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp')
| -rw-r--r-- | WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 4198608..ea95d6a 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -245,15 +245,14 @@ void GraphicsLayerAndroid::updateFixedPosition() marginRight = convertLength(view->style()->marginRight()); marginBottom = convertLength(view->style()->marginBottom()); - // The layer can be bigger than the element we want to draw; - // not only that, the layout rect of the element might also be - // different from the visible rect of that element (i.e. the element - // has a CSS shadow property -- the shadow is "outside" the element). - // We thus need to: - // 1/ get the size of the element (w,h), using the layoutOverflow rect - // 2/ pass the current offset of the painting relative to the layer - int w = view->rightLayoutOverflow() - view->leftLayoutOverflow(); - int h = view->bottomLayoutOverflow() - view->topLayoutOverflow(); + // In order to compute the fixed element's position, we need the width + // and height of the element when bottom or right is defined. + // And here we should use the non-overflowed value, that means, the + // overflowed content (e.g. outset shadow) will not be counted into the + // width and height. + int w = view->width(); + int h = view->height(); + int paintingOffsetX = - offsetFromRenderer().width(); int paintingOffsetY = - offsetFromRenderer().height(); |
