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 20 matching lines...) Expand all Loading... |
31 #include "core/editing/htmlediting.h" | 31 #include "core/editing/htmlediting.h" |
32 #include "core/frame/FrameHost.h" | 32 #include "core/frame/FrameHost.h" |
33 #include "core/frame/FrameView.h" | 33 #include "core/frame/FrameView.h" |
34 #include "core/frame/LocalFrame.h" | 34 #include "core/frame/LocalFrame.h" |
35 #include "core/frame/PinchViewport.h" | 35 #include "core/frame/PinchViewport.h" |
36 #include "core/frame/Settings.h" | 36 #include "core/frame/Settings.h" |
37 #include "core/html/HTMLElement.h" | 37 #include "core/html/HTMLElement.h" |
38 #include "core/html/HTMLFrameElementBase.h" | 38 #include "core/html/HTMLFrameElementBase.h" |
39 #include "core/html/HTMLFrameOwnerElement.h" | 39 #include "core/html/HTMLFrameOwnerElement.h" |
40 #include "core/layout/HitTestResult.h" | 40 #include "core/layout/HitTestResult.h" |
| 41 #include "core/layout/Layer.h" |
41 #include "core/layout/LayoutTableCell.h" | 42 #include "core/layout/LayoutTableCell.h" |
42 #include "core/layout/compositing/RenderLayerCompositor.h" | 43 #include "core/layout/compositing/LayerCompositor.h" |
43 #include "core/page/AutoscrollController.h" | 44 #include "core/page/AutoscrollController.h" |
44 #include "core/page/EventHandler.h" | 45 #include "core/page/EventHandler.h" |
45 #include "core/page/Page.h" | 46 #include "core/page/Page.h" |
46 #include "core/paint/BackgroundImageGeometry.h" | 47 #include "core/paint/BackgroundImageGeometry.h" |
47 #include "core/paint/BoxPainter.h" | 48 #include "core/paint/BoxPainter.h" |
48 #include "core/rendering/PaintInfo.h" | 49 #include "core/rendering/PaintInfo.h" |
49 #include "core/rendering/RenderDeprecatedFlexibleBox.h" | 50 #include "core/rendering/RenderDeprecatedFlexibleBox.h" |
50 #include "core/rendering/RenderFlexibleBox.h" | 51 #include "core/rendering/RenderFlexibleBox.h" |
51 #include "core/rendering/RenderGeometryMap.h" | 52 #include "core/rendering/RenderGeometryMap.h" |
52 #include "core/rendering/RenderGrid.h" | 53 #include "core/rendering/RenderGrid.h" |
53 #include "core/rendering/RenderInline.h" | 54 #include "core/rendering/RenderInline.h" |
54 #include "core/rendering/RenderLayer.h" | |
55 #include "core/rendering/RenderListBox.h" | 55 #include "core/rendering/RenderListBox.h" |
56 #include "core/rendering/RenderListMarker.h" | 56 #include "core/rendering/RenderListMarker.h" |
57 #include "core/rendering/RenderMultiColumnSpannerPlaceholder.h" | 57 #include "core/rendering/RenderMultiColumnSpannerPlaceholder.h" |
58 #include "core/rendering/RenderScrollbarPart.h" | 58 #include "core/rendering/RenderScrollbarPart.h" |
59 #include "core/rendering/RenderView.h" | 59 #include "core/rendering/RenderView.h" |
60 #include "core/rendering/style/ShadowList.h" | 60 #include "core/rendering/style/ShadowList.h" |
61 #include "platform/LengthFunctions.h" | 61 #include "platform/LengthFunctions.h" |
62 #include "platform/geometry/FloatQuad.h" | 62 #include "platform/geometry/FloatQuad.h" |
63 #include "platform/geometry/FloatRoundedRect.h" | 63 #include "platform/geometry/FloatRoundedRect.h" |
64 #include "platform/geometry/TransformState.h" | 64 #include "platform/geometry/TransformState.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 LayerType RenderBox::layerTypeRequired() const | 109 LayerType RenderBox::layerTypeRequired() const |
110 { | 110 { |
111 // hasAutoZIndex only returns true if the element is positioned or a flex-it
em since | 111 // hasAutoZIndex only returns true if the element is positioned or a flex-it
em since |
112 // position:static elements that are not flex-items get their z-index coerce
d to auto. | 112 // position:static elements that are not flex-items get their z-index coerce
d to auto. |
113 if (isPositioned() || createsGroup() || hasClipPath() || hasTransformRelated
Property() | 113 if (isPositioned() || createsGroup() || hasClipPath() || hasTransformRelated
Property() |
114 || hasHiddenBackface() || hasReflection() || style()->specifiesColumns() | 114 || hasHiddenBackface() || hasReflection() || style()->specifiesColumns() |
115 || !style()->hasAutoZIndex() || style()->shouldCompositeForCurrentAnimat
ions()) | 115 || !style()->hasAutoZIndex() || style()->shouldCompositeForCurrentAnimat
ions()) |
116 return NormalLayer; | 116 return NormalLayer; |
117 | 117 |
118 // Ensure that explicit use of scroll-blocks-on creates a RenderLayer (since
we might need | 118 // Ensure that explicit use of scroll-blocks-on creates a Layer (since we mi
ght need |
119 // it to be composited). | 119 // it to be composited). |
120 if (style()->hasScrollBlocksOn()) { | 120 if (style()->hasScrollBlocksOn()) { |
121 if (isDocumentElement()) { | 121 if (isDocumentElement()) { |
122 ASSERT(style()->scrollBlocksOn() == view()->style()->scrollBlocksOn(
)); | 122 ASSERT(style()->scrollBlocksOn() == view()->style()->scrollBlocksOn(
)); |
123 return NoLayer; | 123 return NoLayer; |
124 } | 124 } |
125 return NormalLayer; | 125 return NormalLayer; |
126 } | 126 } |
127 if (hasOverflowClip()) | 127 if (hasOverflowClip()) |
128 return OverflowClipLayer; | 128 return OverflowClipLayer; |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 } | 630 } |
631 | 631 |
632 bool RenderBox::canResize() const | 632 bool RenderBox::canResize() const |
633 { | 633 { |
634 // We need a special case for <iframe> because they never have | 634 // We need a special case for <iframe> because they never have |
635 // hasOverflowClip(). However, they do "implicitly" clip their contents, so | 635 // hasOverflowClip(). However, they do "implicitly" clip their contents, so |
636 // we want to allow resizing them also. | 636 // we want to allow resizing them also. |
637 return (hasOverflowClip() || isRenderIFrame()) && style()->resize() != RESIZ
E_NONE; | 637 return (hasOverflowClip() || isRenderIFrame()) && style()->resize() != RESIZ
E_NONE; |
638 } | 638 } |
639 | 639 |
640 void RenderBox::addLayerHitTestRects(LayerHitTestRects& layerRects, const Render
Layer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& container
Rect) const | 640 void RenderBox::addLayerHitTestRects(LayerHitTestRects& layerRects, const Layer*
currentLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect)
const |
641 { | 641 { |
642 LayoutPoint adjustedLayerOffset = layerOffset + locationOffset(); | 642 LayoutPoint adjustedLayerOffset = layerOffset + locationOffset(); |
643 RenderBoxModelObject::addLayerHitTestRects(layerRects, currentLayer, adjuste
dLayerOffset, containerRect); | 643 RenderBoxModelObject::addLayerHitTestRects(layerRects, currentLayer, adjuste
dLayerOffset, containerRect); |
644 } | 644 } |
645 | 645 |
646 void RenderBox::computeSelfHitTestRects(Vector<LayoutRect>& rects, const LayoutP
oint& layerOffset) const | 646 void RenderBox::computeSelfHitTestRects(Vector<LayoutRect>& rects, const LayoutP
oint& layerOffset) const |
647 { | 647 { |
648 if (!size().isEmpty()) | 648 if (!size().isEmpty()) |
649 rects.append(LayoutRect(layerOffset, size())); | 649 rects.append(LayoutRect(layerOffset, size())); |
650 } | 650 } |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 return std::max(LayoutUnit(), height); | 1129 return std::max(LayoutUnit(), height); |
1130 } | 1130 } |
1131 | 1131 |
1132 // Hit Testing | 1132 // Hit Testing |
1133 bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs
et, HitTestAction action) | 1133 bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs
et, HitTestAction action) |
1134 { | 1134 { |
1135 LayoutPoint adjustedLocation = accumulatedOffset + location(); | 1135 LayoutPoint adjustedLocation = accumulatedOffset + location(); |
1136 | 1136 |
1137 // Check kids first. | 1137 // Check kids first. |
1138 for (RenderObject* child = slowLastChild(); child; child = child->previousSi
bling()) { | 1138 for (RenderObject* child = slowLastChild(); child; child = child->previousSi
bling()) { |
1139 if ((!child->hasLayer() || !toRenderLayerModelObject(child)->layer()->is
SelfPaintingLayer()) && child->nodeAtPoint(request, result, locationInContainer,
adjustedLocation, action)) { | 1139 if ((!child->hasLayer() || !toLayoutLayerModelObject(child)->layer()->is
SelfPaintingLayer()) && child->nodeAtPoint(request, result, locationInContainer,
adjustedLocation, action)) { |
1140 updateHitTestResult(result, locationInContainer.point() - toLayoutSi
ze(adjustedLocation)); | 1140 updateHitTestResult(result, locationInContainer.point() - toLayoutSi
ze(adjustedLocation)); |
1141 return true; | 1141 return true; |
1142 } | 1142 } |
1143 } | 1143 } |
1144 | 1144 |
1145 // Check our bounds next. For this purpose always assume that we can only be
hit in the | 1145 // Check our bounds next. For this purpose always assume that we can only be
hit in the |
1146 // foreground phase (which is true for replaced elements like images). | 1146 // foreground phase (which is true for replaced elements like images). |
1147 LayoutRect boundsRect = borderBoxRect(); | 1147 LayoutRect boundsRect = borderBoxRect(); |
1148 boundsRect.moveBy(adjustedLocation); | 1148 boundsRect.moveBy(adjustedLocation); |
1149 if (visibleToHitTestRequest(request) && action == HitTestForeground && locat
ionInContainer.intersects(boundsRect)) { | 1149 if (visibleToHitTestRequest(request) && action == HitTestForeground && locat
ionInContainer.intersects(boundsRect)) { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 | 1233 |
1234 static bool isCandidateForOpaquenessTest(RenderBox* childBox) | 1234 static bool isCandidateForOpaquenessTest(RenderBox* childBox) |
1235 { | 1235 { |
1236 RenderStyle* childStyle = childBox->style(); | 1236 RenderStyle* childStyle = childBox->style(); |
1237 if (childStyle->position() != StaticPosition && childBox->containingBlock()
!= childBox->parent()) | 1237 if (childStyle->position() != StaticPosition && childBox->containingBlock()
!= childBox->parent()) |
1238 return false; | 1238 return false; |
1239 if (childStyle->visibility() != VISIBLE || childStyle->shapeOutside()) | 1239 if (childStyle->visibility() != VISIBLE || childStyle->shapeOutside()) |
1240 return false; | 1240 return false; |
1241 if (childBox->size().isZero()) | 1241 if (childBox->size().isZero()) |
1242 return false; | 1242 return false; |
1243 if (RenderLayer* childLayer = childBox->layer()) { | 1243 if (Layer* childLayer = childBox->layer()) { |
1244 // FIXME: perhaps this could be less conservative? | 1244 // FIXME: perhaps this could be less conservative? |
1245 if (childLayer->compositingState() != NotComposited) | 1245 if (childLayer->compositingState() != NotComposited) |
1246 return false; | 1246 return false; |
1247 // FIXME: Deal with z-index. | 1247 // FIXME: Deal with z-index. |
1248 if (!childStyle->hasAutoZIndex()) | 1248 if (!childStyle->hasAutoZIndex()) |
1249 return false; | 1249 return false; |
1250 if (childLayer->hasTransformRelatedProperty() || childLayer->isTranspare
nt() || childLayer->hasFilter()) | 1250 if (childLayer->hasTransformRelatedProperty() || childLayer->isTranspare
nt() || childLayer->hasFilter()) |
1251 return false; | 1251 return false; |
1252 if (childBox->hasOverflowClip() && childStyle->hasBorderRadius()) | 1252 if (childBox->hasOverflowClip() && childStyle->hasBorderRadius()) |
1253 return false; | 1253 return false; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 for (const FillLayer* curLayer = &layers; curLayer; curLayer = curLayer->nex
t()) { | 1381 for (const FillLayer* curLayer = &layers; curLayer; curLayer = curLayer->nex
t()) { |
1382 if (curLayer->image() && image == curLayer->image()->data() && curLayer-
>image()->canRender(*this, style()->effectiveZoom())) { | 1382 if (curLayer->image() && image == curLayer->image()->data() && curLayer-
>image()->canRender(*this, style()->effectiveZoom())) { |
1383 for (RenderObject* layerRenderer : layerRenderers) | 1383 for (RenderObject* layerRenderer : layerRenderers) |
1384 layerRenderer->setShouldDoFullPaintInvalidation(); | 1384 layerRenderer->setShouldDoFullPaintInvalidation(); |
1385 return true; | 1385 return true; |
1386 } | 1386 } |
1387 } | 1387 } |
1388 return false; | 1388 return false; |
1389 } | 1389 } |
1390 | 1390 |
1391 PaintInvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidati
onState& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidat
ionContainer) | 1391 PaintInvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidati
onState& paintInvalidationState, const LayoutLayerModelObject& newPaintInvalidat
ionContainer) |
1392 { | 1392 { |
1393 PaintInvalidationReason reason = RenderBoxModelObject::invalidatePaintIfNeed
ed(paintInvalidationState, newPaintInvalidationContainer); | 1393 PaintInvalidationReason reason = RenderBoxModelObject::invalidatePaintIfNeed
ed(paintInvalidationState, newPaintInvalidationContainer); |
1394 | 1394 |
1395 // If we are set to do a full paint invalidation that means the RenderView w
ill be | 1395 // If we are set to do a full paint invalidation that means the RenderView w
ill be |
1396 // issue paint invalidations. We can then skip issuing of paint invalidation
s for the child | 1396 // issue paint invalidations. We can then skip issuing of paint invalidation
s for the child |
1397 // renderers as they'll be covered by the RenderView. | 1397 // renderers as they'll be covered by the RenderView. |
1398 if (!view()->doingFullPaintInvalidation() && !isFullPaintInvalidationReason(
reason)) { | 1398 if (!view()->doingFullPaintInvalidation() && !isFullPaintInvalidationReason(
reason)) { |
1399 invalidatePaintForOverflowIfNeeded(); | 1399 invalidatePaintForOverflowIfNeeded(); |
1400 | 1400 |
1401 // Issue paint invalidations for any scrollbars if there is a scrollable
area for this renderer. | 1401 // Issue paint invalidations for any scrollbars if there is a scrollable
area for this renderer. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1554 ? view()->frameView()->unscaledVisibleContentSize().height() | 1554 ? view()->frameView()->unscaledVisibleContentSize().height() |
1555 : view()->frameView()->unscaledVisibleContentSize().width(); | 1555 : view()->frameView()->unscaledVisibleContentSize().width(); |
1556 LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeig
ht(ExcludeMarginBorderPadding); | 1556 LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeig
ht(ExcludeMarginBorderPadding); |
1557 return std::min(fillAvailableExtent, fillFallbackExtent); | 1557 return std::min(fillAvailableExtent, fillFallbackExtent); |
1558 } | 1558 } |
1559 | 1559 |
1560 // Use the content box logical height as specified by the style. | 1560 // Use the content box logical height as specified by the style. |
1561 return cb->adjustContentBoxLogicalHeightForBoxSizing(logicalHeightLength.val
ue()); | 1561 return cb->adjustContentBoxLogicalHeightForBoxSizing(logicalHeightLength.val
ue()); |
1562 } | 1562 } |
1563 | 1563 |
1564 void RenderBox::mapLocalToContainer(const RenderLayerModelObject* paintInvalidat
ionContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wa
sFixed, const PaintInvalidationState* paintInvalidationState) const | 1564 void RenderBox::mapLocalToContainer(const LayoutLayerModelObject* paintInvalidat
ionContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wa
sFixed, const PaintInvalidationState* paintInvalidationState) const |
1565 { | 1565 { |
1566 if (paintInvalidationContainer == this) | 1566 if (paintInvalidationContainer == this) |
1567 return; | 1567 return; |
1568 | 1568 |
1569 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { | 1569 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { |
1570 LayoutSize offset = paintInvalidationState->paintOffset() + locationOffs
et(); | 1570 LayoutSize offset = paintInvalidationState->paintOffset() + locationOffs
et(); |
1571 if (style()->hasInFlowPosition() && layer()) | 1571 if (style()->hasInFlowPosition() && layer()) |
1572 offset += layer()->offsetForInFlowPosition(); | 1572 offset += layer()->offsetForInFlowPosition(); |
1573 transformState.move(offset); | 1573 transformState.move(offset); |
1574 return; | 1574 return; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 ensureRareData().m_spannerPlaceholder = &placeholder; | 1761 ensureRareData().m_spannerPlaceholder = &placeholder; |
1762 } | 1762 } |
1763 | 1763 |
1764 void RenderBox::clearSpannerPlaceholder() | 1764 void RenderBox::clearSpannerPlaceholder() |
1765 { | 1765 { |
1766 if (!m_rareData) | 1766 if (!m_rareData) |
1767 return; | 1767 return; |
1768 m_rareData->m_spannerPlaceholder = 0; | 1768 m_rareData->m_spannerPlaceholder = 0; |
1769 } | 1769 } |
1770 | 1770 |
1771 LayoutRect RenderBox::clippedOverflowRectForPaintInvalidation(const RenderLayerM
odelObject* paintInvalidationContainer, const PaintInvalidationState* paintInval
idationState) const | 1771 LayoutRect RenderBox::clippedOverflowRectForPaintInvalidation(const LayoutLayerM
odelObject* paintInvalidationContainer, const PaintInvalidationState* paintInval
idationState) const |
1772 { | 1772 { |
1773 if (style()->visibility() != VISIBLE) { | 1773 if (style()->visibility() != VISIBLE) { |
1774 RenderLayer* layer = enclosingLayer(); | 1774 Layer* layer = enclosingLayer(); |
1775 layer->updateDescendantDependentFlags(); | 1775 layer->updateDescendantDependentFlags(); |
1776 if (layer->subtreeIsInvisible()) | 1776 if (layer->subtreeIsInvisible()) |
1777 return LayoutRect(); | 1777 return LayoutRect(); |
1778 } | 1778 } |
1779 | 1779 |
1780 LayoutRect r = visualOverflowRect(); | 1780 LayoutRect r = visualOverflowRect(); |
1781 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, paintInvali
dationState); | 1781 mapRectToPaintInvalidationBacking(paintInvalidationContainer, r, paintInvali
dationState); |
1782 return r; | 1782 return r; |
1783 } | 1783 } |
1784 | 1784 |
1785 void RenderBox::mapRectToPaintInvalidationBacking(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* pain
tInvalidationState) const | 1785 void RenderBox::mapRectToPaintInvalidationBacking(const LayoutLayerModelObject*
paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* pain
tInvalidationState) const |
1786 { | 1786 { |
1787 // The rect we compute at each step is shifted by our x/y offset in the pare
nt container's coordinate space. | 1787 // The rect we compute at each step is shifted by our x/y offset in the pare
nt container's coordinate space. |
1788 // Only when we cross a writing mode boundary will we have to possibly flipF
orWritingMode (to convert into a more appropriate | 1788 // Only when we cross a writing mode boundary will we have to possibly flipF
orWritingMode (to convert into a more appropriate |
1789 // offset corner for the enclosing container). This allows for a fully RL or
BT document to issue paint invalidations | 1789 // offset corner for the enclosing container). This allows for a fully RL or
BT document to issue paint invalidations |
1790 // properly even during layout, since the rect remains flipped all the way u
ntil the end. | 1790 // properly even during layout, since the rect remains flipped all the way u
ntil the end. |
1791 // | 1791 // |
1792 // RenderView::computeRectForPaintInvalidation then converts the rect to phy
sical coordinates. We also convert to | 1792 // RenderView::computeRectForPaintInvalidation then converts the rect to phy
sical coordinates. We also convert to |
1793 // physical when we hit a paintInvalidationContainer boundary. Therefore the
final rect returned is always in the | 1793 // physical when we hit a paintInvalidationContainer boundary. Therefore the
final rect returned is always in the |
1794 // physical coordinate space of the paintInvalidationContainer. | 1794 // physical coordinate space of the paintInvalidationContainer. |
1795 RenderStyle* styleToUse = style(); | 1795 RenderStyle* styleToUse = style(); |
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3879 return node && node->isElementNode() && (toElement(node)->isFormControlEleme
nt() || isHTMLImageElement(toElement(node))); | 3879 return node && node->isElementNode() && (toElement(node)->isFormControlEleme
nt() || isHTMLImageElement(toElement(node))); |
3880 } | 3880 } |
3881 | 3881 |
3882 bool RenderBox::avoidsFloats() const | 3882 bool RenderBox::avoidsFloats() const |
3883 { | 3883 { |
3884 return isReplaced() || isReplacedElement(node()) || hasOverflowClip() || isH
R() || isLegend() || isWritingModeRoot() || isFlexItemIncludingDeprecated(); | 3884 return isReplaced() || isReplacedElement(node()) || hasOverflowClip() || isH
R() || isLegend() || isWritingModeRoot() || isFlexItemIncludingDeprecated(); |
3885 } | 3885 } |
3886 | 3886 |
3887 bool RenderBox::hasNonCompositedScrollbars() const | 3887 bool RenderBox::hasNonCompositedScrollbars() const |
3888 { | 3888 { |
3889 if (RenderLayer* layer = this->layer()) { | 3889 if (Layer* layer = this->layer()) { |
3890 if (RenderLayerScrollableArea* scrollableArea = layer->scrollableArea())
{ | 3890 if (LayerScrollableArea* scrollableArea = layer->scrollableArea()) { |
3891 if (scrollableArea->hasHorizontalScrollbar() && !scrollableArea->lay
erForHorizontalScrollbar()) | 3891 if (scrollableArea->hasHorizontalScrollbar() && !scrollableArea->lay
erForHorizontalScrollbar()) |
3892 return true; | 3892 return true; |
3893 if (scrollableArea->hasVerticalScrollbar() && !scrollableArea->layer
ForVerticalScrollbar()) | 3893 if (scrollableArea->hasVerticalScrollbar() && !scrollableArea->layer
ForVerticalScrollbar()) |
3894 return true; | 3894 return true; |
3895 } | 3895 } |
3896 } | 3896 } |
3897 return false; | 3897 return false; |
3898 } | 3898 } |
3899 | 3899 |
3900 PaintInvalidationReason RenderBox::paintInvalidationReason(const RenderLayerMode
lObject& paintInvalidationContainer, | 3900 PaintInvalidationReason RenderBox::paintInvalidationReason(const LayoutLayerMode
lObject& paintInvalidationContainer, |
3901 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec
t& newBounds, const LayoutPoint& newLocation) const | 3901 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec
t& newBounds, const LayoutPoint& newLocation) const |
3902 { | 3902 { |
3903 PaintInvalidationReason invalidationReason = RenderBoxModelObject::paintInva
lidationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, ne
wLocation); | 3903 PaintInvalidationReason invalidationReason = RenderBoxModelObject::paintInva
lidationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, ne
wLocation); |
3904 if (isFullPaintInvalidationReason(invalidationReason)) | 3904 if (isFullPaintInvalidationReason(invalidationReason)) |
3905 return invalidationReason; | 3905 return invalidationReason; |
3906 | 3906 |
3907 // If the transform is not identity or translation, incremental invalidation
is not applicable | 3907 // If the transform is not identity or translation, incremental invalidation
is not applicable |
3908 // because the difference between oldBounds and newBounds doesn't cover all
area needing invalidation. | 3908 // because the difference between oldBounds and newBounds doesn't cover all
area needing invalidation. |
3909 // FIXME: Should also consider ancestor transforms since paintInvalidationCo
ntainer. crbug.com/426111. | 3909 // FIXME: Should also consider ancestor transforms since paintInvalidationCo
ntainer. crbug.com/426111. |
3910 if (invalidationReason == PaintInvalidationIncremental | 3910 if (invalidationReason == PaintInvalidationIncremental |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3943 } | 3943 } |
3944 | 3944 |
3945 if (oldBorderBoxSize.width() != newBorderBoxSize.width() && mustInvalidateBa
ckgroundOrBorderPaintOnWidthChange()) | 3945 if (oldBorderBoxSize.width() != newBorderBoxSize.width() && mustInvalidateBa
ckgroundOrBorderPaintOnWidthChange()) |
3946 return PaintInvalidationBorderBoxChange; | 3946 return PaintInvalidationBorderBoxChange; |
3947 if (oldBorderBoxSize.height() != newBorderBoxSize.height() && mustInvalidate
BackgroundOrBorderPaintOnHeightChange()) | 3947 if (oldBorderBoxSize.height() != newBorderBoxSize.height() && mustInvalidate
BackgroundOrBorderPaintOnHeightChange()) |
3948 return PaintInvalidationBorderBoxChange; | 3948 return PaintInvalidationBorderBoxChange; |
3949 | 3949 |
3950 return PaintInvalidationIncremental; | 3950 return PaintInvalidationIncremental; |
3951 } | 3951 } |
3952 | 3952 |
3953 void RenderBox::incrementallyInvalidatePaint(const RenderLayerModelObject& paint
InvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds,
const LayoutPoint& positionFromPaintInvalidationBacking) | 3953 void RenderBox::incrementallyInvalidatePaint(const LayoutLayerModelObject& paint
InvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds,
const LayoutPoint& positionFromPaintInvalidationBacking) |
3954 { | 3954 { |
3955 RenderObject::incrementallyInvalidatePaint(paintInvalidationContainer, oldBo
unds, newBounds, positionFromPaintInvalidationBacking); | 3955 RenderObject::incrementallyInvalidatePaint(paintInvalidationContainer, oldBo
unds, newBounds, positionFromPaintInvalidationBacking); |
3956 | 3956 |
3957 bool hasBoxDecorations = style()->hasBoxDecorations(); | 3957 bool hasBoxDecorations = style()->hasBoxDecorations(); |
3958 if (!style()->hasBackground() && !hasBoxDecorations) | 3958 if (!style()->hasBackground() && !hasBoxDecorations) |
3959 return; | 3959 return; |
3960 | 3960 |
3961 LayoutSize oldBorderBoxSize = computePreviousBorderBoxSize(oldBounds.size())
; | 3961 LayoutSize oldBorderBoxSize = computePreviousBorderBoxSize(oldBounds.size())
; |
3962 LayoutSize newBorderBoxSize = size(); | 3962 LayoutSize newBorderBoxSize = size(); |
3963 | 3963 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3996 LayoutUnit borderBottomRightRadiusHeight = valueForLength(style()->borde
rBottomRightRadius().height(), smallerHeight); | 3996 LayoutUnit borderBottomRightRadiusHeight = valueForLength(style()->borde
rBottomRightRadius().height(), smallerHeight); |
3997 LayoutUnit borderHeight = std::max<LayoutUnit>(borderBottom(), std::max(
borderBottomLeftRadiusHeight, borderBottomRightRadiusHeight)); | 3997 LayoutUnit borderHeight = std::max<LayoutUnit>(borderBottom(), std::max(
borderBottomLeftRadiusHeight, borderBottomRightRadiusHeight)); |
3998 LayoutRect bottomDeltaRect(positionFromPaintInvalidationBacking.x(), | 3998 LayoutRect bottomDeltaRect(positionFromPaintInvalidationBacking.x(), |
3999 positionFromPaintInvalidationBacking.y() + smallerHeight - borderHei
ght, | 3999 positionFromPaintInvalidationBacking.y() + smallerHeight - borderHei
ght, |
4000 std::max(oldBorderBoxSize.width(), newBorderBoxSize.width()), | 4000 std::max(oldBorderBoxSize.width(), newBorderBoxSize.width()), |
4001 deltaHeight + borderHeight); | 4001 deltaHeight + borderHeight); |
4002 invalidatePaintRectClippedByOldAndNewBounds(paintInvalidationContainer,
bottomDeltaRect, oldBounds, newBounds); | 4002 invalidatePaintRectClippedByOldAndNewBounds(paintInvalidationContainer,
bottomDeltaRect, oldBounds, newBounds); |
4003 } | 4003 } |
4004 } | 4004 } |
4005 | 4005 |
4006 void RenderBox::invalidatePaintRectClippedByOldAndNewBounds(const RenderLayerMod
elObject& paintInvalidationContainer, const LayoutRect& rect, const LayoutRect&
oldBounds, const LayoutRect& newBounds) | 4006 void RenderBox::invalidatePaintRectClippedByOldAndNewBounds(const LayoutLayerMod
elObject& paintInvalidationContainer, const LayoutRect& rect, const LayoutRect&
oldBounds, const LayoutRect& newBounds) |
4007 { | 4007 { |
4008 if (rect.isEmpty()) | 4008 if (rect.isEmpty()) |
4009 return; | 4009 return; |
4010 LayoutRect rectClippedByOldBounds = intersection(rect, oldBounds); | 4010 LayoutRect rectClippedByOldBounds = intersection(rect, oldBounds); |
4011 LayoutRect rectClippedByNewBounds = intersection(rect, newBounds); | 4011 LayoutRect rectClippedByNewBounds = intersection(rect, newBounds); |
4012 // Invalidate only once if the clipped rects equal. | 4012 // Invalidate only once if the clipped rects equal. |
4013 if (rectClippedByOldBounds == rectClippedByNewBounds) { | 4013 if (rectClippedByOldBounds == rectClippedByNewBounds) { |
4014 invalidatePaintUsingContainer(&paintInvalidationContainer, rectClippedBy
OldBounds, PaintInvalidationIncremental); | 4014 invalidatePaintUsingContainer(&paintInvalidationContainer, rectClippedBy
OldBounds, PaintInvalidationIncremental); |
4015 return; | 4015 return; |
4016 } | 4016 } |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4278 if (isReplaced()) { | 4278 if (isReplaced()) { |
4279 int result = direction == HorizontalLine ? marginHeight() + size().heigh
t() : marginWidth() + size().width(); | 4279 int result = direction == HorizontalLine ? marginHeight() + size().heigh
t() : marginWidth() + size().width(); |
4280 if (baselineType == AlphabeticBaseline) | 4280 if (baselineType == AlphabeticBaseline) |
4281 return result; | 4281 return result; |
4282 return result - result / 2; | 4282 return result - result / 2; |
4283 } | 4283 } |
4284 return 0; | 4284 return 0; |
4285 } | 4285 } |
4286 | 4286 |
4287 | 4287 |
4288 RenderLayer* RenderBox::enclosingFloatPaintingLayer() const | 4288 Layer* RenderBox::enclosingFloatPaintingLayer() const |
4289 { | 4289 { |
4290 const RenderObject* curr = this; | 4290 const RenderObject* curr = this; |
4291 while (curr) { | 4291 while (curr) { |
4292 RenderLayer* layer = curr->hasLayer() && curr->isBox() ? toRenderBox(cur
r)->layer() : 0; | 4292 Layer* layer = curr->hasLayer() && curr->isBox() ? toRenderBox(curr)->la
yer() : 0; |
4293 if (layer && layer->isSelfPaintingLayer()) | 4293 if (layer && layer->isSelfPaintingLayer()) |
4294 return layer; | 4294 return layer; |
4295 curr = curr->parent(); | 4295 curr = curr->parent(); |
4296 } | 4296 } |
4297 return 0; | 4297 return 0; |
4298 } | 4298 } |
4299 | 4299 |
4300 LayoutRect RenderBox::logicalVisualOverflowRectForPropagation(RenderStyle* paren
tStyle) const | 4300 LayoutRect RenderBox::logicalVisualOverflowRectForPropagation(RenderStyle* paren
tStyle) const |
4301 { | 4301 { |
4302 LayoutRect rect = visualOverflowRectForPropagation(parentStyle); | 4302 LayoutRect rect = visualOverflowRectForPropagation(parentStyle); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4572 setLogicalTop(oldLogicalTop); | 4572 setLogicalTop(oldLogicalTop); |
4573 setLogicalWidth(oldLogicalWidth); | 4573 setLogicalWidth(oldLogicalWidth); |
4574 setLogicalLeft(oldLogicalLeft); | 4574 setLogicalLeft(oldLogicalLeft); |
4575 setMarginLeft(oldMarginLeft); | 4575 setMarginLeft(oldMarginLeft); |
4576 setMarginRight(oldMarginRight); | 4576 setMarginRight(oldMarginRight); |
4577 } | 4577 } |
4578 | 4578 |
4579 void RenderBox::invalidateDisplayItemClients(DisplayItemList* displayItemList) c
onst | 4579 void RenderBox::invalidateDisplayItemClients(DisplayItemList* displayItemList) c
onst |
4580 { | 4580 { |
4581 RenderBoxModelObject::invalidateDisplayItemClients(displayItemList); | 4581 RenderBoxModelObject::invalidateDisplayItemClients(displayItemList); |
4582 if (RenderLayerScrollableArea* area = scrollableArea()) | 4582 if (LayerScrollableArea* area = scrollableArea()) |
4583 displayItemList->invalidate(area->displayItemClient()); | 4583 displayItemList->invalidate(area->displayItemClient()); |
4584 } | 4584 } |
4585 | 4585 |
4586 } // namespace blink | 4586 } // namespace blink |
OLD | NEW |