diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2011-01-28 14:00:43 -0800 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2011-01-30 09:40:54 -0800 |
commit | 0026842c0dc9cc472966e6ef44b707683ca5317b (patch) | |
tree | 62d6fbadc39b8c0b033dbc1bb9491966a5f338fd /WebCore/rendering | |
parent | 5e3e997a109b7e20ddd7e04c6ec14b01dac2f32a (diff) | |
download | external_webkit-0026842c0dc9cc472966e6ef44b707683ca5317b.zip external_webkit-0026842c0dc9cc472966e6ef44b707683ca5317b.tar.gz external_webkit-0026842c0dc9cc472966e6ef44b707683ca5317b.tar.bz2 |
Fixed element positioning fix
This is for fixed bottom/ right, in the zooming case.
The width and height in webkit should be calculated as the visibleRect
we use for drawing. And that is document coordinate for visible size.
Basically it is send the Rect info from webView to webViewCore.
Then at RenderBox, it will go through the PlatformBridge to pick the
info up.
Notice that the touch is not 100% working yet, the layout call in webkit
can have a early return such that fixed element layer didn't get update.
And a touch/click is not really causing the whole layout update yet.
That will be addressed in seperate change though.
bug:3404129
Change-Id: I225d41815143a05d540ed32bfc76f823603ca89c
Diffstat (limited to 'WebCore/rendering')
-rw-r--r-- | WebCore/rendering/RenderBox.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp index 772879c..54bcf11 100644 --- a/WebCore/rendering/RenderBox.cpp +++ b/WebCore/rendering/RenderBox.cpp @@ -2077,6 +2077,13 @@ void RenderBox::computeBlockDirectionMargins(RenderBlock* containingBlock) int RenderBox::containingBlockWidthForPositioned(const RenderBoxModelObject* containingBlock) const { + // Fixed element's position should be decided by the visible screen size. + // That is in the doc coordindate. + if (style()->position() == FixedPosition && containingBlock->isRenderView()) { + const RenderView* view = toRenderView(containingBlock); + return PlatformBridge::visibleScreenWidth(view->frameView()); + } + if (containingBlock->isBox()) { const RenderBox* containingBlockBox = toRenderBox(containingBlock); return containingBlockBox->width() - containingBlockBox->borderLeft() - containingBlockBox->borderRight() - containingBlockBox->verticalScrollbarWidth(); @@ -2107,6 +2114,13 @@ int RenderBox::containingBlockWidthForPositioned(const RenderBoxModelObject* con int RenderBox::containingBlockHeightForPositioned(const RenderBoxModelObject* containingBlock) const { + // Fixed element's position should be decided by the visible screen size. + // That is in the doc coordindate. + if (style()->position() == FixedPosition && containingBlock->isRenderView()) { + const RenderView* view = toRenderView(containingBlock); + return PlatformBridge::visibleScreenHeight(view->frameView()); + } + int heightResult = 0; if (containingBlock->isBox()) heightResult = toRenderBox(containingBlock)->height(); |