diff options
-rw-r--r-- | WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 11 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 16 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.h | 12 |
3 files changed, 34 insertions, 5 deletions
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 93469b0..7b479bf 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -241,7 +241,16 @@ void GraphicsLayerAndroid::updateFixedPosition() int w = view->rightVisibleOverflow() - view->leftVisibleOverflow(); int h = view->bottomVisibleOverflow() - view->topVisibleOverflow(); - m_contentLayer->setFixedPosition(left, top, right, bottom, w, h); + SkLength marginLeft, marginTop, marginRight, marginBottom; + marginLeft = convertLength(view->style()->marginLeft()); + marginTop = convertLength(view->style()->marginTop()); + marginRight = convertLength(view->style()->marginRight()); + marginBottom = convertLength(view->style()->marginBottom()); + + m_contentLayer->setFixedPosition(left, top, right, bottom, + marginLeft, marginTop, + marginRight, marginBottom, + w, h); } } diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index 3b1743d..bfb086c 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -79,6 +79,10 @@ LayerAndroid::LayerAndroid(const LayerAndroid& layer) : SkLayer(layer), m_fixedTop = layer.m_fixedTop; m_fixedRight = layer.m_fixedRight; m_fixedBottom = layer.m_fixedBottom; + m_fixedMarginLeft = layer.m_fixedMarginLeft; + m_fixedMarginTop = layer.m_fixedMarginTop; + m_fixedMarginRight = layer.m_fixedMarginRight; + m_fixedMarginBottom = layer.m_fixedMarginBottom; m_fixedWidth = layer.m_fixedWidth; m_fixedHeight = layer.m_fixedHeight; @@ -256,14 +260,14 @@ void LayerAndroid::updateFixedLayersPositions(const SkRect& viewport) float y = dy; if (m_fixedLeft.defined()) - x += m_fixedLeft.calcFloatValue(w); + x += m_fixedMarginLeft.calcFloatValue(w) + m_fixedLeft.calcFloatValue(w); else if (m_fixedRight.defined()) - x += w - m_fixedRight.calcFloatValue(w) - m_fixedWidth; + x += w - m_fixedMarginRight.calcFloatValue(w) - m_fixedRight.calcFloatValue(w) - m_fixedWidth; if (m_fixedTop.defined()) - y += m_fixedTop.calcFloatValue(h); + y += m_fixedMarginTop.calcFloatValue(h) + m_fixedTop.calcFloatValue(h); else if (m_fixedBottom.defined()) - y += h - m_fixedBottom.calcFloatValue(h) - m_fixedHeight; + y += h - m_fixedMarginBottom.calcFloatValue(h) - m_fixedBottom.calcFloatValue(h) - m_fixedHeight; this->setPosition(x, y); } @@ -492,6 +496,10 @@ 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); + writeLength(file, indentLevel + 1, "fixedMarginLeft", m_fixedMarginLeft); + writeLength(file, indentLevel + 1, "fixedMarginTop", m_fixedMarginTop); + writeLength(file, indentLevel + 1, "fixedMarginRight", m_fixedMarginRight); + writeLength(file, indentLevel + 1, "fixedMarginBottom", m_fixedMarginBottom); writeIntVal(file, indentLevel + 1, "fixedWidth", m_fixedWidth); writeIntVal(file, indentLevel + 1, "fixedHeight", m_fixedHeight); diff --git a/WebCore/platform/graphics/android/LayerAndroid.h b/WebCore/platform/graphics/android/LayerAndroid.h index 247e902..b92f4ac 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.h +++ b/WebCore/platform/graphics/android/LayerAndroid.h @@ -92,12 +92,20 @@ public: SkLength top, // CSS top property SkLength right, // CSS right property SkLength bottom, // CSS bottom property + SkLength marginLeft, // CSS margin-left property + SkLength marginTop, // CSS margin-top property + SkLength marginRight, // CSS margin-right property + SkLength marginBottom, // CSS margin-bottom property int width, // visible overflow width int height) { // visible overflow height m_fixedLeft = left; m_fixedTop = top; m_fixedRight = right; m_fixedBottom = bottom; + m_fixedMarginLeft = marginLeft; + m_fixedMarginTop = marginTop; + m_fixedMarginRight = marginRight; + m_fixedMarginBottom = marginBottom; m_fixedWidth = width; m_fixedHeight = height; m_isFixed = true; @@ -173,6 +181,10 @@ private: SkLength m_fixedTop; SkLength m_fixedRight; SkLength m_fixedBottom; + SkLength m_fixedMarginLeft; + SkLength m_fixedMarginTop; + SkLength m_fixedMarginRight; + SkLength m_fixedMarginBottom; int m_fixedWidth; int m_fixedHeight; |