diff options
Diffstat (limited to 'WebCore/rendering/RenderBox.cpp')
-rw-r--r-- | WebCore/rendering/RenderBox.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp index 772879c..fe78fd5 100644 --- a/WebCore/rendering/RenderBox.cpp +++ b/WebCore/rendering/RenderBox.cpp @@ -39,6 +39,7 @@ #include "FloatQuad.h" #include "Frame.h" #include "Page.h" +#include "PlatformBridge.h" #include "RenderArena.h" #include "RenderFlexibleBox.h" #include "RenderInline.h" @@ -2077,6 +2078,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 +2115,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(); |