Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: Source/core/layout/LayoutBox.cpp

Issue 1213353003: More fixes for position:fixed with root layer scrolling. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after
2702 2702
2703 LayoutUnit LayoutBox::containingBlockLogicalWidthForPositioned(const LayoutBoxMo delObject* containingBlock, bool checkForPerpendicularWritingMode) const 2703 LayoutUnit LayoutBox::containingBlockLogicalWidthForPositioned(const LayoutBoxMo delObject* containingBlock, bool checkForPerpendicularWritingMode) const
2704 { 2704 {
2705 if (checkForPerpendicularWritingMode && containingBlock->isHorizontalWriting Mode() != isHorizontalWritingMode()) 2705 if (checkForPerpendicularWritingMode && containingBlock->isHorizontalWriting Mode() != isHorizontalWritingMode())
2706 return containingBlockLogicalHeightForPositioned(containingBlock, false) ; 2706 return containingBlockLogicalHeightForPositioned(containingBlock, false) ;
2707 2707
2708 // Use viewport as container for top-level fixed-position elements. 2708 // Use viewport as container for top-level fixed-position elements.
2709 if (style()->position() == FixedPosition && containingBlock->isLayoutView()) { 2709 if (style()->position() == FixedPosition && containingBlock->isLayoutView()) {
2710 const LayoutView* view = toLayoutView(containingBlock); 2710 const LayoutView* view = toLayoutView(containingBlock);
2711 if (FrameView* frameView = view->frameView()) { 2711 if (FrameView* frameView = view->frameView()) {
2712 LayoutRect viewportRect = LayoutRect(frameView->visibleContentRect() ); 2712 // Don't use visibleContentRect since the DeprecatedPaintLayer's siz e has not been set yet.
2713 return containingBlock->isHorizontalWritingMode() ? viewportRect.wid th() : viewportRect.height(); 2713 IntSize viewportSize = frameView->layoutViewportScrollableArea()->ex cludeScrollbars(frameView->frameRect().size());
2714 return containingBlock->isHorizontalWritingMode() ? viewportSize.wid th() : viewportSize.height();
2714 } 2715 }
2715 } 2716 }
2716 2717
2717 if (hasOverrideContainingBlockLogicalWidth()) 2718 if (hasOverrideContainingBlockLogicalWidth())
2718 return overrideContainingBlockContentLogicalWidth(); 2719 return overrideContainingBlockContentLogicalWidth();
2719 2720
2720 if (containingBlock->isBox()) 2721 if (containingBlock->isBox())
2721 return toLayoutBox(containingBlock)->clientLogicalWidth(); 2722 return toLayoutBox(containingBlock)->clientLogicalWidth();
2722 2723
2723 ASSERT(containingBlock->isLayoutInline() && containingBlock->isRelPositioned ()); 2724 ASSERT(containingBlock->isLayoutInline() && containingBlock->isRelPositioned ());
(...skipping 21 matching lines...) Expand all
2745 2746
2746 LayoutUnit LayoutBox::containingBlockLogicalHeightForPositioned(const LayoutBoxM odelObject* containingBlock, bool checkForPerpendicularWritingMode) const 2747 LayoutUnit LayoutBox::containingBlockLogicalHeightForPositioned(const LayoutBoxM odelObject* containingBlock, bool checkForPerpendicularWritingMode) const
2747 { 2748 {
2748 if (checkForPerpendicularWritingMode && containingBlock->isHorizontalWriting Mode() != isHorizontalWritingMode()) 2749 if (checkForPerpendicularWritingMode && containingBlock->isHorizontalWriting Mode() != isHorizontalWritingMode())
2749 return containingBlockLogicalWidthForPositioned(containingBlock, false); 2750 return containingBlockLogicalWidthForPositioned(containingBlock, false);
2750 2751
2751 // Use viewport as container for top-level fixed-position elements. 2752 // Use viewport as container for top-level fixed-position elements.
2752 if (style()->position() == FixedPosition && containingBlock->isLayoutView()) { 2753 if (style()->position() == FixedPosition && containingBlock->isLayoutView()) {
2753 const LayoutView* view = toLayoutView(containingBlock); 2754 const LayoutView* view = toLayoutView(containingBlock);
2754 if (FrameView* frameView = view->frameView()) { 2755 if (FrameView* frameView = view->frameView()) {
2755 LayoutRect viewportRect = LayoutRect(frameView->visibleContentRect() ); 2756 // Don't use visibleContentRect since the DeprecatedPaintLayer's siz e has not been set yet.
2756 return containingBlock->isHorizontalWritingMode() ? viewportRect.hei ght() : viewportRect.width(); 2757 IntSize viewportSize = frameView->layoutViewportScrollableArea()->ex cludeScrollbars(frameView->frameRect().size());
2758 return containingBlock->isHorizontalWritingMode() ? viewportSize.hei ght() : viewportSize.width();
2757 } 2759 }
2758 } 2760 }
2759 2761
2760 if (hasOverrideContainingBlockLogicalHeight()) 2762 if (hasOverrideContainingBlockLogicalHeight())
2761 return overrideContainingBlockContentLogicalHeight(); 2763 return overrideContainingBlockContentLogicalHeight();
2762 2764
2763 if (containingBlock->isBox()) { 2765 if (containingBlock->isBox()) {
2764 const LayoutBlock* cb = containingBlock->isLayoutBlock() ? 2766 const LayoutBlock* cb = containingBlock->isLayoutBlock() ?
2765 toLayoutBlock(containingBlock) : containingBlock->containingBlock(); 2767 toLayoutBlock(containingBlock) : containingBlock->containingBlock();
2766 return cb->clientLogicalHeight(); 2768 return cb->clientLogicalHeight();
(...skipping 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after
4748 bool LayoutBox::canRenderBorderImage() const 4750 bool LayoutBox::canRenderBorderImage() const
4749 { 4751 {
4750 if (!style()->hasBorderDecoration()) 4752 if (!style()->hasBorderDecoration())
4751 return false; 4753 return false;
4752 4754
4753 StyleImage* borderImage = style()->borderImage().image(); 4755 StyleImage* borderImage = style()->borderImage().image();
4754 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded(); 4756 return borderImage && borderImage->canRender(*this, style()->effectiveZoom() ) && borderImage->isLoaded();
4755 } 4757 }
4756 4758
4757 } // namespace blink 4759 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698