diff options
author | Nicolas Roard <nicolas@android.com> | 2010-02-25 14:41:12 +0000 |
---|---|---|
committer | Nicolas Roard <nicolas@android.com> | 2010-02-25 15:38:20 +0000 |
commit | 770495626b08b5d06162c31be5eed944aea127cb (patch) | |
tree | 2740b5526e9235622c1e840b3bc9685f48de56d6 /WebCore/platform/graphics/android/LayerAndroid.cpp | |
parent | 018ebadd40c8decb6e77414ecb31bc6e597b7d53 (diff) | |
download | external_webkit-770495626b08b5d06162c31be5eed944aea127cb.zip external_webkit-770495626b08b5d06162c31be5eed944aea127cb.tar.gz external_webkit-770495626b08b5d06162c31be5eed944aea127cb.tar.bz2 |
Fix the gap when using the IME (Bug:2453748)
The problem was that layers may have a different size than their corresponding element,
but we used the layer's size instead of the element's to compute the fixed position.
The fix asks for the element visible overflow size (needed, some children may be outside the bounds of the element itself).
Diffstat (limited to 'WebCore/platform/graphics/android/LayerAndroid.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index 59533be..c21c9b3 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -85,6 +85,8 @@ LayerAndroid::LayerAndroid(const LayerAndroid& layer) : SkLayer(layer), m_fixedTop = layer.m_fixedTop; m_fixedRight = layer.m_fixedRight; m_fixedBottom = layer.m_fixedBottom; + m_fixedWidth = layer.m_fixedWidth; + m_fixedHeight = layer.m_fixedHeight; m_recordingPicture = layer.m_recordingPicture; SkSafeRef(m_recordingPicture); @@ -282,12 +284,12 @@ void LayerAndroid::updatePositions(const SkRect& viewport) { if (m_fixedLeft.defined()) x = dx + m_fixedLeft.calcFloatValue(w); else if (m_fixedRight.defined()) - x = dx + w - m_fixedRight.calcFloatValue(w) - getSize().width(); + x = dx + w - m_fixedRight.calcFloatValue(w) - m_fixedWidth; if (m_fixedTop.defined()) y = dy + m_fixedTop.calcFloatValue(h); else if (m_fixedBottom.defined()) - y = dy + h - m_fixedBottom.calcFloatValue(h) - getSize().height(); + y = dy + h - m_fixedBottom.calcFloatValue(h) - m_fixedHeight; this->setPosition(x, y); matrix.reset(); @@ -306,13 +308,8 @@ void LayerAndroid::updatePositions(const SkRect& viewport) { // now apply it to our children int count = this->countChildren(); - if (count > 0) { - SkRect tmp = viewport; - // adjust the viewport by our (the parent) position - tmp.offset(-this->getPosition()); - for (int i = 0; i < count; i++) { - this->getChild(i)->updatePositions(tmp); - } + for (int i = 0; i < count; i++) { + this->getChild(i)->updatePositions(viewport); } } @@ -487,6 +484,8 @@ void LayerAndroid::dumpLayers(FILE* file, int indentLevel) const writeLength(file, indentLevel + 1, "fixedTop", m_fixedTop); writeLength(file, indentLevel + 1, "fixedRight", m_fixedRight); writeLength(file, indentLevel + 1, "fixedBottom", m_fixedBottom); + writeIntVal(file, indentLevel + 1, "fixedWidth", m_fixedWidth); + writeIntVal(file, indentLevel + 1, "fixedHeight", m_fixedHeight); if (countChildren()) { writeln(file, indentLevel + 1, "children = ["); |