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 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 screenRect = viewBounds; | 1538 screenRect = viewBounds; |
1539 screenRect.intersect(objectBounds); | 1539 screenRect.intersect(objectBounds); |
1540 } | 1540 } |
1541 | 1541 |
1542 int screenArea = 0; | 1542 int screenArea = 0; |
1543 if (!screenRect.isEmpty() && isVisible) | 1543 if (!screenRect.isEmpty() && isVisible) |
1544 screenArea = static_cast<uint32_t>(screenRect.width() * screenRect.heigh
t()); | 1544 screenArea = static_cast<uint32_t>(screenRect.width() * screenRect.heigh
t()); |
1545 return ResourcePriority(isVisible ? ResourcePriority::Visible : ResourcePrio
rity::NotVisible, screenArea); | 1545 return ResourcePriority(isVisible ? ResourcePriority::Visible : ResourcePrio
rity::NotVisible, screenArea); |
1546 } | 1546 } |
1547 | 1547 |
1548 void LayoutBox::frameRectChanged() | |
1549 { | |
1550 if (node() && node()->isElementNode()) { | |
1551 Element& element = toElement(*node()); | |
1552 element.setNeedsResizeObserverUpdate(); | |
1553 } | |
1554 // The frame rect may change because of layout of other objects. | |
1555 // Should check this object for paint invalidation. | |
1556 if (!needsLayout()) | |
1557 setMayNeedPaintInvalidation(); | |
1558 } | |
1559 | |
1560 bool LayoutBox::intersectsVisibleViewport() const | 1548 bool LayoutBox::intersectsVisibleViewport() const |
1561 { | 1549 { |
1562 LayoutRect rect = visualOverflowRect(); | 1550 LayoutRect rect = visualOverflowRect(); |
1563 LayoutView* layoutView = view(); | 1551 LayoutView* layoutView = view(); |
1564 while (layoutView->frame()->ownerLayoutObject()) | 1552 while (layoutView->frame()->ownerLayoutObject()) |
1565 layoutView = layoutView->frame()->ownerLayoutObject()->view(); | 1553 layoutView = layoutView->frame()->ownerLayoutObject()->view(); |
1566 mapToVisualRectInAncestorSpace(layoutView, rect); | 1554 mapToVisualRectInAncestorSpace(layoutView, rect); |
1567 return rect.intersects(LayoutRect(layoutView->frameView()->getScrollableArea
()->visibleContentRectDouble())); | 1555 return rect.intersects(LayoutRect(layoutView->frameView()->getScrollableArea
()->visibleContentRectDouble())); |
1568 } | 1556 } |
1569 | 1557 |
(...skipping 3210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4780 m_rareData->m_snapAreas->remove(&snapArea); | 4768 m_rareData->m_snapAreas->remove(&snapArea); |
4781 } | 4769 } |
4782 } | 4770 } |
4783 | 4771 |
4784 SnapAreaSet* LayoutBox::snapAreas() const | 4772 SnapAreaSet* LayoutBox::snapAreas() const |
4785 { | 4773 { |
4786 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4774 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
4787 } | 4775 } |
4788 | 4776 |
4789 } // namespace blink | 4777 } // namespace blink |
OLD | NEW |