From 770495626b08b5d06162c31be5eed944aea127cb Mon Sep 17 00:00:00 2001 From: Nicolas Roard Date: Thu, 25 Feb 2010 14:41:12 +0000 Subject: 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). --- WebCore/platform/graphics/android/LayerAndroid.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'WebCore/platform/graphics/android/LayerAndroid.cpp') 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 = ["); -- cgit v1.1