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, 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 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1555 screenRect = viewBounds; | 1555 screenRect = viewBounds; |
1556 screenRect.intersect(objectBounds); | 1556 screenRect.intersect(objectBounds); |
1557 } | 1557 } |
1558 | 1558 |
1559 int screenArea = 0; | 1559 int screenArea = 0; |
1560 if (!screenRect.isEmpty() && isVisible) | 1560 if (!screenRect.isEmpty() && isVisible) |
1561 screenArea = static_cast<uint32_t>(screenRect.width() * screenRect.heigh
t()); | 1561 screenArea = static_cast<uint32_t>(screenRect.width() * screenRect.heigh
t()); |
1562 return ResourcePriority(isVisible ? ResourcePriority::Visible : ResourcePrio
rity::NotVisible, screenArea); | 1562 return ResourcePriority(isVisible ? ResourcePriority::Visible : ResourcePrio
rity::NotVisible, screenArea); |
1563 } | 1563 } |
1564 | 1564 |
| 1565 void LayoutBox::frameRectChanged() |
| 1566 { |
| 1567 if (node() && node()->isElementNode()) { |
| 1568 Element& element = toElement(*node()); |
| 1569 element.setNeedsResizeObserverUpdate(); |
| 1570 } |
| 1571 // The frame rect may change because of layout of other objects. |
| 1572 // Should check this object for paint invalidation. |
| 1573 if (!needsLayout()) |
| 1574 setMayNeedPaintInvalidation(); |
| 1575 } |
| 1576 |
1565 bool LayoutBox::intersectsVisibleViewport() const | 1577 bool LayoutBox::intersectsVisibleViewport() const |
1566 { | 1578 { |
1567 LayoutRect rect = visualOverflowRect(); | 1579 LayoutRect rect = visualOverflowRect(); |
1568 LayoutView* layoutView = view(); | 1580 LayoutView* layoutView = view(); |
1569 while (layoutView->frame()->ownerLayoutObject()) | 1581 while (layoutView->frame()->ownerLayoutObject()) |
1570 layoutView = layoutView->frame()->ownerLayoutObject()->view(); | 1582 layoutView = layoutView->frame()->ownerLayoutObject()->view(); |
1571 mapToVisualRectInAncestorSpace(layoutView, rect); | 1583 mapToVisualRectInAncestorSpace(layoutView, rect); |
1572 return rect.intersects(LayoutRect(layoutView->frameView()->getScrollableArea
()->visibleContentRectDouble())); | 1584 return rect.intersects(LayoutRect(layoutView->frameView()->getScrollableArea
()->visibleContentRectDouble())); |
1573 } | 1585 } |
1574 | 1586 |
(...skipping 3210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4785 m_rareData->m_snapAreas->remove(&snapArea); | 4797 m_rareData->m_snapAreas->remove(&snapArea); |
4786 } | 4798 } |
4787 } | 4799 } |
4788 | 4800 |
4789 SnapAreaSet* LayoutBox::snapAreas() const | 4801 SnapAreaSet* LayoutBox::snapAreas() const |
4790 { | 4802 { |
4791 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4803 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
4792 } | 4804 } |
4793 | 4805 |
4794 } // namespace blink | 4806 } // namespace blink |
OLD | NEW |