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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.h

Issue 2689213013: Move previous border box size out of global map into LayoutBox::m_previousSize (Closed)
Patch Set: - Created 3 years, 10 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 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 setHeight(size); 311 setHeight(size);
312 else 312 else
313 setWidth(size); 313 setWidth(size);
314 } 314 }
315 315
316 LayoutPoint location() const { return m_frameRect.location(); } 316 LayoutPoint location() const { return m_frameRect.location(); }
317 LayoutSize locationOffset() const { 317 LayoutSize locationOffset() const {
318 return LayoutSize(m_frameRect.x(), m_frameRect.y()); 318 return LayoutSize(m_frameRect.x(), m_frameRect.y());
319 } 319 }
320 LayoutSize size() const { return m_frameRect.size(); } 320 LayoutSize size() const { return m_frameRect.size(); }
321 LayoutSize previousSize() const { return m_previousSize; }
321 IntSize pixelSnappedSize() const { return m_frameRect.pixelSnappedSize(); } 322 IntSize pixelSnappedSize() const { return m_frameRect.pixelSnappedSize(); }
322 323
323 void setLocation(const LayoutPoint& location) { 324 void setLocation(const LayoutPoint& location) {
324 if (location == m_frameRect.location()) 325 if (location == m_frameRect.location())
325 return; 326 return;
326 m_frameRect.setLocation(location); 327 m_frameRect.setLocation(location);
327 locationChanged(); 328 locationChanged();
328 } 329 }
329 330
330 // The ancestor box that this object's location and physicalLocation are 331 // The ancestor box that this object's location and physicalLocation are
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 1302
1302 // Returns true if the box intersects the viewport visible to the user. 1303 // Returns true if the box intersects the viewport visible to the user.
1303 bool intersectsVisibleViewport() const; 1304 bool intersectsVisibleViewport() const;
1304 1305
1305 bool hasNonCompositedScrollbars() const final; 1306 bool hasNonCompositedScrollbars() const final;
1306 1307
1307 void ensureIsReadyForPaintInvalidation() override; 1308 void ensureIsReadyForPaintInvalidation() override;
1308 1309
1309 virtual bool hasControlClip() const { return false; } 1310 virtual bool hasControlClip() const { return false; }
1310 1311
1312 class MutableForPainting : public LayoutObject::MutableForPainting {
1313 public:
1314 void setPreviousSize(const LayoutSize& size) {
1315 static_cast<LayoutBox&>(m_layoutObject).m_previousSize = size;
1316 }
1317
1318 protected:
1319 friend class LayoutBox;
1320 MutableForPainting(const LayoutBox& box)
1321 : LayoutObject::MutableForPainting(box) {}
1322 };
1323 MutableForPainting getMutableForPainting() const {
1324 return MutableForPainting(*this);
1325 }
1326
1311 protected: 1327 protected:
1312 virtual LayoutRect controlClipRect(const LayoutPoint&) const { 1328 virtual LayoutRect controlClipRect(const LayoutPoint&) const {
1313 return LayoutRect(); 1329 return LayoutRect();
1314 } 1330 }
1315 1331
1316 void willBeDestroyed() override; 1332 void willBeDestroyed() override;
1317 1333
1318 void insertedIntoTree() override; 1334 void insertedIntoTree() override;
1319 void willBeRemovedFromTree() override; 1335 void willBeRemovedFromTree() override;
1320 1336
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 1516
1501 void locationChanged(); 1517 void locationChanged();
1502 void sizeChanged(); 1518 void sizeChanged();
1503 1519
1504 virtual bool isInSelfHitTestingPhase(HitTestAction hitTestAction) const { 1520 virtual bool isInSelfHitTestingPhase(HitTestAction hitTestAction) const {
1505 return hitTestAction == HitTestForeground; 1521 return hitTestAction == HitTestForeground;
1506 } 1522 }
1507 1523
1508 void updateBackgroundAttachmentFixedStatusAfterStyleChange(); 1524 void updateBackgroundAttachmentFixedStatusAfterStyleChange();
1509 1525
1526 void inflateVisualRectForFilter(LayoutRect&) const;
1527 void inflateVisualRectForFilterUnderContainer(
1528 LayoutRect&,
1529 const LayoutObject& container,
1530 const LayoutBoxModelObject* ancestorToStopAt) const;
1531
1532 LayoutRectOutsets m_marginBoxOutsets;
1533
1534 void addSnapArea(const LayoutBox&);
1535 void removeSnapArea(const LayoutBox&);
1536
1537 LayoutRect debugRect() const override;
1538
1510 // The CSS border box rect for this box. 1539 // The CSS border box rect for this box.
1511 // 1540 //
1512 // The rectangle is in this box's physical coordinates but with a 1541 // The rectangle is in this box's physical coordinates but with a
1513 // flipped block-flow direction (see the COORDINATE SYSTEMS section 1542 // flipped block-flow direction (see the COORDINATE SYSTEMS section
1514 // in LayoutBoxModelObject). The location is the distance from this 1543 // in LayoutBoxModelObject). The location is the distance from this
1515 // object's border edge to the container's border edge (which is not 1544 // object's border edge to the container's border edge (which is not
1516 // always the parent). Thus it includes any logical top/left along 1545 // always the parent). Thus it includes any logical top/left along
1517 // with this box's margins. 1546 // with this box's margins.
1518 LayoutRect m_frameRect; 1547 LayoutRect m_frameRect;
1519 1548
1549 // Previous size of m_frameRect, updated after paint invalidation.
1550 LayoutSize m_previousSize;
1551
1520 // Our intrinsic height, used for min-height: min-content etc. Maintained by 1552 // Our intrinsic height, used for min-height: min-content etc. Maintained by
1521 // updateLogicalHeight. This is logicalHeight() before it is clamped to 1553 // updateLogicalHeight. This is logicalHeight() before it is clamped to
1522 // min/max. 1554 // min/max.
1523 mutable LayoutUnit m_intrinsicContentLogicalHeight; 1555 mutable LayoutUnit m_intrinsicContentLogicalHeight;
1524 1556
1525 void inflateVisualRectForFilter(LayoutRect&) const;
1526 void inflateVisualRectForFilterUnderContainer(
1527 LayoutRect&,
1528 const LayoutObject& container,
1529 const LayoutBoxModelObject* ancestorToStopAt) const;
1530
1531 LayoutRectOutsets m_marginBoxOutsets;
1532
1533 void addSnapArea(const LayoutBox&);
1534 void removeSnapArea(const LayoutBox&);
1535
1536 LayoutRect debugRect() const override;
1537
1538 protected: 1557 protected:
1539 // The logical width of the element if it were to break its lines at every 1558 // The logical width of the element if it were to break its lines at every
1540 // possible opportunity. 1559 // possible opportunity.
1541 // 1560 //
1542 // See LayoutObject::minPreferredLogicalWidth() for more details. 1561 // See LayoutObject::minPreferredLogicalWidth() for more details.
1543 LayoutUnit m_minPreferredLogicalWidth; 1562 LayoutUnit m_minPreferredLogicalWidth;
1544 1563
1545 // The logical width of the element if it never breaks any lines at all. 1564 // The logical width of the element if it never breaks any lines at all.
1546 // 1565 //
1547 // See LayoutObject::maxPreferredLogicalWidth() for more details. 1566 // See LayoutObject::maxPreferredLogicalWidth() for more details.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 breakValue == EBreakBetween::kLeft || 1653 breakValue == EBreakBetween::kLeft ||
1635 breakValue == EBreakBetween::kPage || 1654 breakValue == EBreakBetween::kPage ||
1636 breakValue == EBreakBetween::kRecto || 1655 breakValue == EBreakBetween::kRecto ||
1637 breakValue == EBreakBetween::kRight || 1656 breakValue == EBreakBetween::kRight ||
1638 breakValue == EBreakBetween::kVerso; 1657 breakValue == EBreakBetween::kVerso;
1639 } 1658 }
1640 1659
1641 } // namespace blink 1660 } // namespace blink
1642 1661
1643 #endif // LayoutBox_h 1662 #endif // LayoutBox_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698