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

Side by Side Diff: sky/engine/core/rendering/RenderBox.cpp

Issue 686653002: Remove a bunch of fixed position dead code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 414
415 if (parentBox) 415 if (parentBox)
416 parentBox->scrollRectToVisible(newRect, alignX, alignY); 416 parentBox->scrollRectToVisible(newRect, alignX, alignY);
417 } 417 }
418 418
419 void RenderBox::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumul atedOffset) const 419 void RenderBox::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumul atedOffset) const
420 { 420 {
421 rects.append(pixelSnappedIntRect(accumulatedOffset, size())); 421 rects.append(pixelSnappedIntRect(accumulatedOffset, size()));
422 } 422 }
423 423
424 void RenderBox::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const 424 void RenderBox::absoluteQuads(Vector<FloatQuad>& quads) const
425 { 425 {
426 quads.append(localToAbsoluteQuad(FloatRect(0, 0, width().toFloat(), height() .toFloat()), 0 /* mode */, wasFixed)); 426 quads.append(localToAbsoluteQuad(FloatRect(0, 0, width().toFloat(), height() .toFloat()), 0 /* mode */));
427 } 427 }
428 428
429 void RenderBox::updateLayerTransformAfterLayout() 429 void RenderBox::updateLayerTransformAfterLayout()
430 { 430 {
431 // Transform-origin depends on box size, so we need to update the layer tran sform after layout. 431 // Transform-origin depends on box size, so we need to update the layer tran sform after layout.
432 if (hasLayer()) 432 if (hasLayer())
433 layer()->updateTransformationMatrix(); 433 layer()->updateTransformationMatrix();
434 } 434 }
435 435
436 LayoutUnit RenderBox::constrainLogicalWidthByMinMax(LayoutUnit logicalWidth, Lay outUnit availableWidth, RenderBlock* cb) const 436 LayoutUnit RenderBox::constrainLogicalWidthByMinMax(LayoutUnit logicalWidth, Lay outUnit availableWidth, RenderBlock* cb) const
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 ? view()->frameView()->unscaledVisibleContentSize().height() 1531 ? view()->frameView()->unscaledVisibleContentSize().height()
1532 : view()->frameView()->unscaledVisibleContentSize().width(); 1532 : view()->frameView()->unscaledVisibleContentSize().width();
1533 LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeig ht(ExcludeMarginBorderPadding); 1533 LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeig ht(ExcludeMarginBorderPadding);
1534 return std::min(fillAvailableExtent, fillFallbackExtent); 1534 return std::min(fillAvailableExtent, fillFallbackExtent);
1535 } 1535 }
1536 1536
1537 // Use the content box logical height as specified by the style. 1537 // Use the content box logical height as specified by the style.
1538 return cb->adjustContentBoxLogicalHeightForBoxSizing(logicalHeightLength.val ue()); 1538 return cb->adjustContentBoxLogicalHeightForBoxSizing(logicalHeightLength.val ue());
1539 } 1539 }
1540 1540
1541 void RenderBox::mapLocalToContainer(const RenderLayerModelObject* paintInvalidat ionContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wa sFixed, const PaintInvalidationState* paintInvalidationState) const 1541 void RenderBox::mapLocalToContainer(const RenderLayerModelObject* paintInvalidat ionContainer, TransformState& transformState, MapCoordinatesFlags mode, const Pa intInvalidationState* paintInvalidationState) const
1542 { 1542 {
1543 if (paintInvalidationContainer == this) 1543 if (paintInvalidationContainer == this)
1544 return; 1544 return;
1545 1545
1546 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain tInvalidationContainer)) { 1546 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain tInvalidationContainer)) {
1547 LayoutSize offset = paintInvalidationState->paintOffset() + locationOffs et(); 1547 LayoutSize offset = paintInvalidationState->paintOffset() + locationOffs et();
1548 if (style()->hasInFlowPosition() && layer()) 1548 if (style()->hasInFlowPosition() && layer())
1549 offset += layer()->offsetForInFlowPosition(); 1549 offset += layer()->offsetForInFlowPosition();
1550 transformState.move(offset); 1550 transformState.move(offset);
1551 return; 1551 return;
1552 } 1552 }
1553 1553
1554 bool containerSkipped; 1554 bool containerSkipped;
1555 RenderObject* o = container(paintInvalidationContainer, &containerSkipped); 1555 RenderObject* o = container(paintInvalidationContainer, &containerSkipped);
1556 if (!o) 1556 if (!o)
1557 return; 1557 return;
1558 1558
1559 bool hasTransform = hasLayer() && layer()->transform();
1560 // If this box has a transform, it acts as a fixed position container for fi xed descendants,
1561 // and may itself also be fixed position. So propagate 'fixed' up only if th is box is fixed position.
1562 if (hasTransform)
1563 mode &= ~IsFixed;
1564
1565 if (wasFixed)
1566 *wasFixed = mode & IsFixed;
1567
1568 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans formState.mappedPoint())); 1559 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans formState.mappedPoint()));
1569 1560
1570 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl e()->preserves3D()); 1561 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl e()->preserves3D());
1571 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { 1562 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
1572 TransformationMatrix t; 1563 TransformationMatrix t;
1573 getTransformFromContainer(o, containerOffset, t); 1564 getTransformFromContainer(o, containerOffset, t);
1574 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate Transform : TransformState::FlattenTransform); 1565 transformState.applyTransform(t, preserve3D ? TransformState::Accumulate Transform : TransformState::FlattenTransform);
1575 } else 1566 } else
1576 transformState.move(containerOffset.width(), containerOffset.height(), p reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo rm); 1567 transformState.move(containerOffset.width(), containerOffset.height(), p reserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransfo rm);
1577 1568
1578 if (containerSkipped) { 1569 if (containerSkipped) {
1579 // There can't be a transform between paintInvalidationContainer and o, because transforms create containers, so it should be safe 1570 // There can't be a transform between paintInvalidationContainer and o, because transforms create containers, so it should be safe
1580 // to just subtract the delta between the paintInvalidationContainer and o. 1571 // to just subtract the delta between the paintInvalidationContainer and o.
1581 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces torContainer(o); 1572 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces torContainer(o);
1582 transformState.move(-containerOffset.width(), -containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTrans form); 1573 transformState.move(-containerOffset.width(), -containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTrans form);
1583 return; 1574 return;
1584 } 1575 }
1585 1576
1586 mode &= ~ApplyContainerFlip; 1577 mode &= ~ApplyContainerFlip;
1587 1578
1588 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, was Fixed); 1579 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode);
1589 }
1590
1591 void RenderBox::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState & transformState) const
1592 {
1593 bool hasTransform = hasLayer() && layer()->transform();
1594 if (hasTransform) {
1595 // If this box has a transform, it acts as a fixed position container fo r fixed descendants,
1596 // and may itself also be fixed position. So propagate 'fixed' up only i f this box is fixed position.
1597 mode &= ~IsFixed;
1598 }
1599
1600 RenderBoxModelObject::mapAbsoluteToLocalPoint(mode, transformState);
1601 } 1580 }
1602 1581
1603 LayoutSize RenderBox::offsetFromContainer(const RenderObject* o, const LayoutPoi nt& point, bool* offsetDependsOnPoint) const 1582 LayoutSize RenderBox::offsetFromContainer(const RenderObject* o, const LayoutPoi nt& point, bool* offsetDependsOnPoint) const
1604 { 1583 {
1605 ASSERT(o == container()); 1584 ASSERT(o == container());
1606 1585
1607 LayoutSize offset; 1586 LayoutSize offset;
1608 if (isRelPositioned()) 1587 if (isRelPositioned())
1609 offset += offsetForInFlowPosition(); 1588 offset += offsetForInFlowPosition();
1610 1589
(...skipping 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after
4185 4164
4186 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 4165 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
4187 { 4166 {
4188 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); 4167 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor);
4189 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 4168 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
4190 ASSERT(hasBackground == style.hasBackground()); 4169 ASSERT(hasBackground == style.hasBackground());
4191 hasBorder = style.hasBorder(); 4170 hasBorder = style.hasBorder();
4192 } 4171 }
4193 4172
4194 } // namespace blink 4173 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBox.h ('k') | sky/engine/core/rendering/RenderBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698