Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 if (parent() && diff.needsPaintInvalidationLayer()) { | 171 if (parent() && diff.needsPaintInvalidationLayer()) { |
| 172 if (oldStyle->hasAutoClip() != newStyle.hasAutoClip() | 172 if (oldStyle->hasAutoClip() != newStyle.hasAutoClip() |
| 173 || oldStyle->clip() != newStyle.clip()) | 173 || oldStyle->clip() != newStyle.clip()) |
| 174 layer()->clipper().clearClipRectsIncludingDescendants(); | 174 layer()->clipper().clearClipRectsIncludingDescendants(); |
| 175 } | 175 } |
| 176 } | 176 } |
| 177 | 177 |
| 178 LayoutObject::styleWillChange(diff, newStyle); | 178 LayoutObject::styleWillChange(diff, newStyle); |
| 179 } | 179 } |
| 180 | 180 |
| 181 static inline LayoutBox* findScrollAncestor(const Node* startNode) | |
|
chrishtr
2015/11/04 01:55:18
enclosingLayer()->ancestorScrollingLayer()
flackr
2015/11/25 20:47:52
ancestorScrollingLayer uses ancestorDependentCompo
| |
| 182 { | |
| 183 ASSERT(startNode->layoutObject()); | |
| 184 LayoutBox* curBox = startNode->layoutObject()->containingBlock(); | |
| 185 | |
| 186 // Scrolling propagates along the containing block chain. | |
| 187 while (curBox && !curBox->isLayoutView()) { | |
| 188 if (curBox->hasOverflowClip()) | |
| 189 return curBox; | |
| 190 curBox = curBox->containingBlock(); | |
| 191 } | |
| 192 | |
| 193 return nullptr; | |
| 194 } | |
| 195 | |
| 181 void LayoutBoxModelObject::styleDidChange(StyleDifference diff, const ComputedSt yle* oldStyle) | 196 void LayoutBoxModelObject::styleDidChange(StyleDifference diff, const ComputedSt yle* oldStyle) |
| 182 { | 197 { |
| 183 bool hadTransform = hasTransformRelatedProperty(); | 198 bool hadTransform = hasTransformRelatedProperty(); |
| 184 bool hadLayer = hasLayer(); | 199 bool hadLayer = hasLayer(); |
| 185 bool layerWasSelfPainting = hadLayer && layer()->isSelfPaintingLayer(); | 200 bool layerWasSelfPainting = hadLayer && layer()->isSelfPaintingLayer(); |
| 186 bool wasFloatingBeforeStyleChanged = FloatStateForStyleChange::wasFloating(t his); | 201 bool wasFloatingBeforeStyleChanged = FloatStateForStyleChange::wasFloating(t his); |
| 187 | 202 |
| 188 LayoutObject::styleDidChange(diff, oldStyle); | 203 LayoutObject::styleDidChange(diff, oldStyle); |
| 189 updateFromStyle(); | 204 updateFromStyle(); |
| 190 | 205 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 261 bool newStoleBodyBackground = toLayoutBoxModelObject(bodyLayout)->ba ckgroundStolenForBeingBody(style()); | 276 bool newStoleBodyBackground = toLayoutBoxModelObject(bodyLayout)->ba ckgroundStolenForBeingBody(style()); |
| 262 bool oldStoleBodyBackground = oldStyle && toLayoutBoxModelObject(bod yLayout)->backgroundStolenForBeingBody(oldStyle); | 277 bool oldStoleBodyBackground = oldStyle && toLayoutBoxModelObject(bod yLayout)->backgroundStolenForBeingBody(oldStyle); |
| 263 if (newStoleBodyBackground != oldStoleBodyBackground | 278 if (newStoleBodyBackground != oldStoleBodyBackground |
| 264 && bodyLayout->style() && bodyLayout->style()->hasBackground()) { | 279 && bodyLayout->style() && bodyLayout->style()->hasBackground()) { |
| 265 bodyLayout->setShouldDoFullPaintInvalidation(); | 280 bodyLayout->setShouldDoFullPaintInvalidation(); |
| 266 } | 281 } |
| 267 } | 282 } |
| 268 } | 283 } |
| 269 | 284 |
| 270 if (FrameView *frameView = view()->frameView()) { | 285 if (FrameView *frameView = view()->frameView()) { |
| 271 bool newStyleIsViewportConstained = style()->hasViewportConstrainedPosit ion(); | 286 bool newStyleIsViewportConstained = style()->position() == FixedPosition ; |
| 272 bool oldStyleIsViewportConstrained = oldStyle && oldStyle->hasViewportCo nstrainedPosition(); | 287 bool oldStyleIsViewportConstrained = oldStyle && oldStyle->position() == FixedPosition; |
| 288 | |
| 289 // Sticky positioned elements are only viewport constrained if they have no ancestor scroller. | |
| 290 if (style()->position() == StickyPosition || (oldStyle && oldStyle->posi tion() == StickyPosition)) { | |
| 291 if (!findScrollAncestor(node())) { | |
| 292 newStyleIsViewportConstained |= style()->position() == StickyPos ition; | |
| 293 oldStyleIsViewportConstrained |= oldStyle && oldStyle->position( ) == StickyPosition; | |
| 294 } | |
| 295 } | |
| 296 | |
| 273 if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) { | 297 if (newStyleIsViewportConstained != oldStyleIsViewportConstrained) { |
| 274 if (newStyleIsViewportConstained && layer()) | 298 if (newStyleIsViewportConstained && layer()) |
| 275 frameView->addViewportConstrainedObject(this); | 299 frameView->addViewportConstrainedObject(this); |
| 276 else | 300 else |
| 277 frameView->removeViewportConstrainedObject(this); | 301 frameView->removeViewportConstrainedObject(this); |
| 278 } | 302 } |
| 279 } | 303 } |
| 280 } | 304 } |
| 281 | 305 |
| 282 void LayoutBoxModelObject::createLayer(PaintLayerType type) | 306 void LayoutBoxModelObject::createLayer(PaintLayerType type) |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 608 | 632 |
| 609 else if (!style()->bottom().isAuto() | 633 else if (!style()->bottom().isAuto() |
| 610 && (!containingBlock->hasAutoHeightOrContainingBlockWithAutoHeight() | 634 && (!containingBlock->hasAutoHeightOrContainingBlockWithAutoHeight() |
| 611 || !style()->bottom().hasPercent() | 635 || !style()->bottom().hasPercent() |
| 612 || containingBlock->stretchesToViewport())) | 636 || containingBlock->stretchesToViewport())) |
| 613 offset.expand(0, -valueForLength(style()->bottom(), containingBlock->ava ilableHeight())); | 637 offset.expand(0, -valueForLength(style()->bottom(), containingBlock->ava ilableHeight())); |
| 614 | 638 |
| 615 return offset; | 639 return offset; |
| 616 } | 640 } |
| 617 | 641 |
| 642 void LayoutBoxModelObject::computeStickyPositionConstraints(StickyPositionViewpo rtConstraints& constraints, const LayoutRect& constrainingRect) const | |
| 643 { | |
| 644 LayoutBlock* containingBlock = this->containingBlock(); | |
| 645 | |
| 646 LayoutRect containerContentRect = containingBlock->contentBoxRect(); | |
| 647 LayoutUnit maxWidth = containingBlock->availableLogicalWidth(); | |
| 648 | |
| 649 // Sticky positioned element ignore any override logical width on the contai ning block (as they don't call | |
| 650 // containingBlockLogicalWidthForContent). It's unclear whether this is tota lly fine. | |
| 651 // Compute the container-relative area within which the sticky element is al lowed to move. | |
| 652 containerContentRect.contractEdges( | |
| 653 minimumValueForLength(style()->marginTop(), maxWidth), | |
| 654 minimumValueForLength(style()->marginRight(), maxWidth), | |
| 655 minimumValueForLength(style()->marginBottom(), maxWidth), | |
| 656 minimumValueForLength(style()->marginLeft(), maxWidth)); | |
| 657 | |
| 658 // Map to the view to avoid including page scale factor. | |
|
chrishtr
2015/11/04 01:55:18
Why would this avoid including page scale factor?
flackr
2015/11/25 20:47:52
The page scale is applied above the view().
| |
| 659 constraints.setAbsoluteContainingBlockRect(LayoutRect(containingBlock->local ToContainerQuad(FloatRect(containerContentRect), view()).boundingBox())); | |
| 660 | |
| 661 LayoutRect stickyBoxRect = frameRectForStickyPositioning(); | |
| 662 LayoutRect flippedStickyBoxRect = stickyBoxRect; | |
| 663 containingBlock->flipForWritingMode(flippedStickyBoxRect); | |
| 664 LayoutPoint stickyLocation = flippedStickyBoxRect.location(); | |
| 665 | |
| 666 // FIXME: sucks to call localToAbsolute again, but we can't just offset from the previously computed rect if there are transforms. | |
| 667 // Map to the view to avoid including page scale factor. | |
| 668 LayoutRect absContainerFrame = LayoutRect(containingBlock->localToContainerQ uad(FloatRect(FloatPoint(), FloatSize(containingBlock->size())), view()).boundin gBox()); | |
| 669 | |
| 670 if (containingBlock->hasOverflowClip()) { | |
| 671 LayoutSize scrollOffset(containingBlock->layer()->scrollableArea()->adju stedScrollOffset()); | |
| 672 stickyLocation -= scrollOffset; | |
| 673 } | |
| 674 | |
| 675 // We can't call localToAbsolute on |this| because that will recur. FIXME: F or now, assume that |this| is not transformed. | |
| 676 constraints.setAbsoluteStickyBoxRect(LayoutRect(LayoutPoint(absContainerFram e.location()) + stickyLocation, flippedStickyBoxRect.size())); | |
| 677 | |
| 678 LayoutUnit horizontalOffsets = minimumValueForLength(style()->right(), const rainingRect.width()) + | |
| 679 minimumValueForLength(style()->left(), constrainingRect.width()); | |
| 680 bool skipRight = false; | |
| 681 bool skipLeft = false; | |
| 682 if (!style()->left().isAuto() && !style()->right().isAuto()) { | |
| 683 if (horizontalOffsets > containerContentRect.width() | |
| 684 || horizontalOffsets + containerContentRect.width() > constrainingRe ct.width()) { | |
| 685 skipRight = style()->isLeftToRightDirection(); | |
| 686 skipLeft = !skipRight; | |
| 687 } | |
| 688 } | |
| 689 | |
| 690 if (!style()->left().isAuto() && !skipLeft) { | |
| 691 constraints.setLeftOffset(minimumValueForLength(style()->left(), constra iningRect.width())); | |
| 692 constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeLeft); | |
| 693 } | |
| 694 | |
| 695 if (!style()->right().isAuto() && !skipRight) { | |
| 696 constraints.setRightOffset(minimumValueForLength(style()->right(), const rainingRect.width())); | |
| 697 constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeRight); | |
| 698 } | |
| 699 | |
| 700 bool skipBottom = false; | |
| 701 // FIXME(ostap): Exclude top or bottom edge offset depending on the writing mode when related | |
| 702 // sections are fixed in spec: http://lists.w3.org/Archives/Public/www-style /2014May/0286.html | |
| 703 LayoutUnit verticalOffsets = minimumValueForLength(style()->top(), constrain ingRect.width()) + | |
| 704 minimumValueForLength(style()->bottom(), constrainingRect.width()); | |
| 705 if (!style()->top().isAuto() && !style()->bottom().isAuto()) { | |
| 706 if (verticalOffsets > containerContentRect.height() | |
| 707 || verticalOffsets + containerContentRect.height() > constrainingRec t.height()) { | |
| 708 skipBottom = true; | |
| 709 } | |
| 710 } | |
| 711 | |
| 712 if (!style()->top().isAuto()) { | |
| 713 constraints.setTopOffset(minimumValueForLength(style()->top(), constrain ingRect.height())); | |
| 714 constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeTop); | |
| 715 } | |
| 716 | |
| 717 if (!style()->bottom().isAuto() && !skipBottom) { | |
| 718 constraints.setBottomOffset(minimumValueForLength(style()->bottom(), con strainingRect.height())); | |
| 719 constraints.addAnchorEdge(ViewportConstraints::AnchorEdgeBottom); | |
| 720 } | |
| 721 } | |
| 722 | |
| 723 LayoutRect LayoutBoxModelObject::computeStickyConstrainingRect() const | |
| 724 { | |
| 725 LayoutRect constrainingRect; | |
| 726 | |
| 727 ASSERT(hasLayer()); | |
| 728 LayoutBox* enclosingClippingBox = findScrollAncestor(node()); | |
| 729 if (enclosingClippingBox) { | |
| 730 LayoutRect clipRect = enclosingClippingBox->overflowClipRect(LayoutPoint ()); | |
| 731 clipRect.move(enclosingClippingBox->paddingLeft(), enclosingClippingBox- >paddingTop()); | |
| 732 clipRect.contract(LayoutSize(enclosingClippingBox->paddingLeft() + enclo singClippingBox->paddingRight(), | |
| 733 enclosingClippingBox->paddingTop() + enclosingClippingBox->paddingBo ttom())); | |
| 734 constrainingRect = LayoutRect(enclosingClippingBox->localToContainerQuad (FloatRect(clipRect), view()).boundingBox()); | |
| 735 } else { | |
| 736 constrainingRect = LayoutRect(view()->frameView()->visibleContentRect()) ; | |
| 737 } | |
| 738 | |
| 739 return constrainingRect; | |
| 740 } | |
| 741 | |
| 742 LayoutSize LayoutBoxModelObject::stickyPositionOffset() const | |
| 743 { | |
| 744 LayoutRect constrainingRect = computeStickyConstrainingRect(); | |
| 745 StickyPositionViewportConstraints constraints; | |
| 746 computeStickyPositionConstraints(constraints, constrainingRect); | |
| 747 | |
| 748 // The sticky offset is physical, so we can just return the delta computed i n absolute coords (though it may be wrong with transforms). | |
| 749 return LayoutSize(constraints.computeStickyOffset(constrainingRect)); | |
| 750 } | |
| 751 | |
| 618 LayoutPoint LayoutBoxModelObject::adjustedPositionRelativeToOffsetParent(const L ayoutPoint& startPoint) const | 752 LayoutPoint LayoutBoxModelObject::adjustedPositionRelativeToOffsetParent(const L ayoutPoint& startPoint) const |
| 619 { | 753 { |
| 620 // If the element is the HTML body element or doesn't have a parent | 754 // If the element is the HTML body element or doesn't have a parent |
| 621 // return 0 and stop this algorithm. | 755 // return 0 and stop this algorithm. |
| 622 if (isBody() || !parent()) | 756 if (isBody() || !parent()) |
| 623 return LayoutPoint(); | 757 return LayoutPoint(); |
| 624 | 758 |
| 625 LayoutPoint referencePoint = startPoint; | 759 LayoutPoint referencePoint = startPoint; |
| 626 referencePoint.move(parent()->columnOffset(referencePoint)); | 760 referencePoint.move(parent()->columnOffset(referencePoint)); |
| 627 | 761 |
| 628 // If the offsetParent of the element is null, or is the HTML body element, | 762 // If the offsetParent of the element is null, or is the HTML body element, |
| 629 // return the distance between the canvas origin and the left border edge | 763 // return the distance between the canvas origin and the left border edge |
| 630 // of the element and stop this algorithm. | 764 // of the element and stop this algorithm. |
| 631 Element* element = offsetParent(); | 765 Element* element = offsetParent(); |
| 632 if (!element) | 766 if (!element) |
| 633 return referencePoint; | 767 return referencePoint; |
| 634 | 768 |
| 635 if (const LayoutBoxModelObject* offsetParent = element->layoutBoxModelObject ()) { | 769 if (const LayoutBoxModelObject* offsetParent = element->layoutBoxModelObject ()) { |
| 636 if (offsetParent->isBox() && !offsetParent->isBody()) | 770 if (offsetParent->isBox() && !offsetParent->isBody()) |
| 637 referencePoint.move(-toLayoutBox(offsetParent)->borderLeft(), -toLay outBox(offsetParent)->borderTop()); | 771 referencePoint.move(-toLayoutBox(offsetParent)->borderLeft(), -toLay outBox(offsetParent)->borderTop()); |
| 638 if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) { | 772 if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) { |
| 639 if (isInFlowPositioned()) | 773 if (isInFlowPositioned()) |
| 640 referencePoint.move(relativePositionOffset()); | 774 referencePoint.move(offsetForInFlowPosition()); |
| 641 | 775 |
| 642 LayoutObject* current; | 776 LayoutObject* current; |
| 643 for (current = parent(); current != offsetParent && current->parent( ); current = current->parent()) { | 777 for (current = parent(); current != offsetParent && current->parent( ); current = current->parent()) { |
| 644 // FIXME: What are we supposed to do inside SVG content? | 778 // FIXME: What are we supposed to do inside SVG content? |
| 645 if (!isOutOfFlowPositioned()) { | 779 if (!isOutOfFlowPositioned()) { |
| 646 if (current->isBox() && !current->isTableRow()) | 780 if (current->isBox() && !current->isTableRow()) |
| 647 referencePoint.moveBy(toLayoutBox(current)->topLeftLocat ion()); | 781 referencePoint.moveBy(toLayoutBox(current)->topLeftLocat ion()); |
| 648 referencePoint.move(current->parent()->columnOffset(referenc ePoint)); | 782 referencePoint.move(current->parent()->columnOffset(referenc ePoint)); |
| 649 } | 783 } |
| 650 } | 784 } |
| 651 | 785 |
| 652 if (offsetParent->isBox() && offsetParent->isBody() && !offsetParent ->isPositioned()) | 786 if (offsetParent->isBox() && offsetParent->isBody() && !offsetParent ->isPositioned()) |
| 653 referencePoint.moveBy(toLayoutBox(offsetParent)->topLeftLocation ()); | 787 referencePoint.moveBy(toLayoutBox(offsetParent)->topLeftLocation ()); |
| 654 } | 788 } |
| 655 } | 789 } |
| 656 | 790 |
| 657 return referencePoint; | 791 return referencePoint; |
| 658 } | 792 } |
| 659 | 793 |
| 660 LayoutSize LayoutBoxModelObject::offsetForInFlowPosition() const | 794 LayoutSize LayoutBoxModelObject::offsetForInFlowPosition() const |
| 661 { | 795 { |
| 662 return isRelPositioned() ? relativePositionOffset() : LayoutSize(); | 796 if (isRelPositioned()) |
| 797 return relativePositionOffset(); | |
| 798 | |
| 799 if (isStickyPositioned()) | |
| 800 return stickyPositionOffset(); | |
| 801 | |
| 802 return LayoutSize(); | |
| 663 } | 803 } |
| 664 | 804 |
| 665 LayoutUnit LayoutBoxModelObject::offsetLeft() const | 805 LayoutUnit LayoutBoxModelObject::offsetLeft() const |
| 666 { | 806 { |
| 667 // Note that LayoutInline and LayoutBox override this to pass a different | 807 // Note that LayoutInline and LayoutBox override this to pass a different |
| 668 // startPoint to adjustedPositionRelativeToOffsetParent. | 808 // startPoint to adjustedPositionRelativeToOffsetParent. |
| 669 return adjustedPositionRelativeToOffsetParent(LayoutPoint()).x(); | 809 return adjustedPositionRelativeToOffsetParent(LayoutPoint()).x(); |
| 670 } | 810 } |
| 671 | 811 |
| 672 LayoutUnit LayoutBoxModelObject::offsetTop() const | 812 LayoutUnit LayoutBoxModelObject::offsetTop() const |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 974 const LayoutObject* LayoutBoxModelObject::pushMappingToContainer(const LayoutBox ModelObject* ancestorToStopAt, LayoutGeometryMap& geometryMap) const | 1114 const LayoutObject* LayoutBoxModelObject::pushMappingToContainer(const LayoutBox ModelObject* ancestorToStopAt, LayoutGeometryMap& geometryMap) const |
| 975 { | 1115 { |
| 976 ASSERT(ancestorToStopAt != this); | 1116 ASSERT(ancestorToStopAt != this); |
| 977 | 1117 |
| 978 bool ancestorSkipped; | 1118 bool ancestorSkipped; |
| 979 LayoutObject* container = this->container(ancestorToStopAt, &ancestorSkipped ); | 1119 LayoutObject* container = this->container(ancestorToStopAt, &ancestorSkipped ); |
| 980 if (!container) | 1120 if (!container) |
| 981 return nullptr; | 1121 return nullptr; |
| 982 | 1122 |
| 983 bool isInline = isLayoutInline(); | 1123 bool isInline = isLayoutInline(); |
| 984 bool isFixedPos = !isInline && style()->position() == FixedPosition; | 1124 bool isViewportConstrained = !isInline && (style()->hasViewportConstrainedPo sition()); |
| 985 bool hasTransform = !isInline && hasLayer() && layer()->transform(); | 1125 bool hasTransform = !isInline && hasLayer() && layer()->transform(); |
| 986 | 1126 |
| 987 LayoutSize adjustmentForSkippedAncestor; | 1127 LayoutSize adjustmentForSkippedAncestor; |
| 988 if (ancestorSkipped) { | 1128 if (ancestorSkipped) { |
| 989 // There can't be a transform between paintInvalidationContainer and anc estorToStopAt, because transforms create containers, so it should be safe | 1129 // There can't be a transform between paintInvalidationContainer and anc estorToStopAt, because transforms create containers, so it should be safe |
| 990 // to just subtract the delta between the ancestor and ancestorToStopAt. | 1130 // to just subtract the delta between the ancestor and ancestorToStopAt. |
| 991 adjustmentForSkippedAncestor = -ancestorToStopAt->offsetFromAncestorCont ainer(container); | 1131 adjustmentForSkippedAncestor = -ancestorToStopAt->offsetFromAncestorCont ainer(container); |
| 992 } | 1132 } |
| 993 | 1133 |
| 994 bool offsetDependsOnPoint = false; | 1134 bool offsetDependsOnPoint = false; |
| 995 LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), & offsetDependsOnPoint); | 1135 LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), & offsetDependsOnPoint); |
| 996 | 1136 |
| 997 bool preserve3D = container->style()->preserves3D() || style()->preserves3D( ); | 1137 bool preserve3D = container->style()->preserves3D() || style()->preserves3D( ); |
| 998 if (shouldUseTransformFromContainer(container)) { | 1138 if (shouldUseTransformFromContainer(container)) { |
| 999 TransformationMatrix t; | 1139 TransformationMatrix t; |
| 1000 getTransformFromContainer(container, containerOffset, t); | 1140 getTransformFromContainer(container, containerOffset, t); |
| 1001 t.translateRight(adjustmentForSkippedAncestor.width().toFloat(), adjustm entForSkippedAncestor.height().toFloat()); | 1141 t.translateRight(adjustmentForSkippedAncestor.width().toFloat(), adjustm entForSkippedAncestor.height().toFloat()); |
| 1002 geometryMap.push(this, t, preserve3D, offsetDependsOnPoint, isFixedPos, hasTransform); | 1142 geometryMap.push(this, t, preserve3D, offsetDependsOnPoint, isViewportCo nstrained, hasTransform); |
| 1003 } else { | 1143 } else { |
| 1004 containerOffset += adjustmentForSkippedAncestor; | 1144 containerOffset += adjustmentForSkippedAncestor; |
| 1005 geometryMap.push(this, containerOffset, preserve3D, offsetDependsOnPoint , isFixedPos, hasTransform); | 1145 geometryMap.push(this, containerOffset, preserve3D, offsetDependsOnPoint , isViewportConstrained, hasTransform); |
| 1006 } | 1146 } |
| 1007 | 1147 |
| 1008 return ancestorSkipped ? ancestorToStopAt : container; | 1148 return ancestorSkipped ? ancestorToStopAt : container; |
| 1009 } | 1149 } |
| 1010 | 1150 |
| 1011 void LayoutBoxModelObject::moveChildTo(LayoutBoxModelObject* toBoxModelObject, L ayoutObject* child, LayoutObject* beforeChild, bool fullRemoveInsert) | 1151 void LayoutBoxModelObject::moveChildTo(LayoutBoxModelObject* toBoxModelObject, L ayoutObject* child, LayoutObject* beforeChild, bool fullRemoveInsert) |
| 1012 { | 1152 { |
| 1013 // We assume that callers have cleared their positioned objects list for chi ld moves (!fullRemoveInsert) so the | 1153 // We assume that callers have cleared their positioned objects list for chi ld moves (!fullRemoveInsert) so the |
| 1014 // positioned layoutObject maps don't become stale. It would be too slow to do the map lookup on each call. | 1154 // positioned layoutObject maps don't become stale. It would be too slow to do the map lookup on each call. |
| 1015 ASSERT(!fullRemoveInsert || !isLayoutBlock() || !toLayoutBlock(this)->hasPos itionedObjects()); | 1155 ASSERT(!fullRemoveInsert || !isLayoutBlock() || !toLayoutBlock(this)->hasPos itionedObjects()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1063 if (rootElementStyle->hasBackground()) | 1203 if (rootElementStyle->hasBackground()) |
| 1064 return false; | 1204 return false; |
| 1065 | 1205 |
| 1066 if (node() != document().firstBodyElement()) | 1206 if (node() != document().firstBodyElement()) |
| 1067 return false; | 1207 return false; |
| 1068 | 1208 |
| 1069 return true; | 1209 return true; |
| 1070 } | 1210 } |
| 1071 | 1211 |
| 1072 } // namespace blink | 1212 } // namespace blink |
| OLD | NEW |