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

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

Issue 2465983002: Rename "paint invalidation rect" etc. to "visual rect". (Closed)
Patch Set: - Created 4 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. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2258 // the changed part of children when the box got resized. In SPv2 this is 2258 // the changed part of children when the box got resized. In SPv2 this is
2259 // handled by detecting paint property changes. 2259 // handled by detecting paint property changes.
2260 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 2260 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
2261 if (hasClipRelatedProperty() || hasControlClip() || hasMask()) 2261 if (hasClipRelatedProperty() || hasControlClip() || hasMask())
2262 return false; 2262 return false;
2263 } 2263 }
2264 2264
2265 return true; 2265 return true;
2266 } 2266 }
2267 2267
2268 LayoutRect LayoutBox::localOverflowRectForPaintInvalidation() const { 2268 LayoutRect LayoutBox::localVisualRect() const {
2269 if (style()->visibility() != EVisibility::Visible) 2269 if (style()->visibility() != EVisibility::Visible)
2270 return LayoutRect(); 2270 return LayoutRect();
2271 2271
2272 return selfVisualOverflowRect(); 2272 return selfVisualOverflowRect();
2273 } 2273 }
2274 2274
2275 void LayoutBox::inflateVisualRectForFilterUnderContainer( 2275 void LayoutBox::inflateVisualRectForFilterUnderContainer(
2276 LayoutRect& rect, 2276 LayoutRect& rect,
2277 const LayoutObject& container, 2277 const LayoutObject& container,
2278 const LayoutBoxModelObject* ancestorToStopAt) const { 2278 const LayoutBoxModelObject* ancestorToStopAt) const {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 2396
2397 if (container->isLayoutView()) 2397 if (container->isLayoutView())
2398 return toLayoutView(container)->mapToVisualRectInAncestorSpace( 2398 return toLayoutView(container)->mapToVisualRectInAncestorSpace(
2399 ancestor, rect, position == FixedPosition ? IsFixed : 0, 2399 ancestor, rect, position == FixedPosition ? IsFixed : 0,
2400 visualRectFlags); 2400 visualRectFlags);
2401 else 2401 else
2402 return container->mapToVisualRectInAncestorSpace(ancestor, rect, 2402 return container->mapToVisualRectInAncestorSpace(ancestor, rect,
2403 visualRectFlags); 2403 visualRectFlags);
2404 } 2404 }
2405 2405
2406 void LayoutBox::inflateVisualRectForFilter( 2406 void LayoutBox::inflateVisualRectForFilter(LayoutRect& visualRect) const {
2407 LayoutRect& paintInvalidationRect) const {
2408 if (layer() && layer()->hasFilterInducingProperty()) 2407 if (layer() && layer()->hasFilterInducingProperty())
2409 paintInvalidationRect = 2408 visualRect = layer()->mapLayoutRectForFilter(visualRect);
2410 layer()->mapLayoutRectForFilter(paintInvalidationRect);
2411 } 2409 }
2412 2410
2413 void LayoutBox::updateLogicalWidth() { 2411 void LayoutBox::updateLogicalWidth() {
2414 LogicalExtentComputedValues computedValues; 2412 LogicalExtentComputedValues computedValues;
2415 computeLogicalWidth(computedValues); 2413 computeLogicalWidth(computedValues);
2416 2414
2417 setLogicalWidth(computedValues.m_extent); 2415 setLogicalWidth(computedValues.m_extent);
2418 setLogicalLeft(computedValues.m_position); 2416 setLogicalLeft(computedValues.m_position);
2419 setMarginStart(computedValues.m_margins.m_start); 2417 setMarginStart(computedValues.m_margins.m_start);
2420 setMarginEnd(computedValues.m_margins.m_end); 2418 setMarginEnd(computedValues.m_margins.m_end);
(...skipping 2836 matching lines...) Expand 10 before | Expand all | Expand 10 after
5257 LayoutBox* boxToSplit = toLayoutBox(beforeChild->parent()); 5255 LayoutBox* boxToSplit = toLayoutBox(beforeChild->parent());
5258 if (boxToSplit->slowFirstChild() != beforeChild && 5256 if (boxToSplit->slowFirstChild() != beforeChild &&
5259 boxToSplit->isAnonymous()) { 5257 boxToSplit->isAnonymous()) {
5260 // We have to split the parent box into two boxes and move children 5258 // We have to split the parent box into two boxes and move children
5261 // from |beforeChild| to end into the new post box. 5259 // from |beforeChild| to end into the new post box.
5262 LayoutBox* postBox = boxToSplit->createAnonymousBoxWithSameTypeAs(this); 5260 LayoutBox* postBox = boxToSplit->createAnonymousBoxWithSameTypeAs(this);
5263 postBox->setChildrenInline(boxToSplit->childrenInline()); 5261 postBox->setChildrenInline(boxToSplit->childrenInline());
5264 LayoutBox* parentBox = toLayoutBox(boxToSplit->parent()); 5262 LayoutBox* parentBox = toLayoutBox(boxToSplit->parent());
5265 // We need to invalidate the |parentBox| before inserting the new node 5263 // We need to invalidate the |parentBox| before inserting the new node
5266 // so that the table paint invalidation logic knows the structure is 5264 // so that the table paint invalidation logic knows the structure is
5267 // dirty. 5265 // dirty. See for example LayoutTableCell:localVisualRect().
5268 // See for example LayoutTableCell:localOverflowRectForPaintInvalidation.
5269 markBoxForRelayoutAfterSplit(parentBox); 5266 markBoxForRelayoutAfterSplit(parentBox);
5270 parentBox->virtualChildren()->insertChildNode(parentBox, postBox, 5267 parentBox->virtualChildren()->insertChildNode(parentBox, postBox,
5271 boxToSplit->nextSibling()); 5268 boxToSplit->nextSibling());
5272 boxToSplit->moveChildrenTo(postBox, beforeChild, 0, true); 5269 boxToSplit->moveChildrenTo(postBox, beforeChild, 0, true);
5273 5270
5274 LayoutObject* child = postBox->slowFirstChild(); 5271 LayoutObject* child = postBox->slowFirstChild();
5275 ASSERT(child); 5272 ASSERT(child);
5276 if (child && !child->nextSibling()) 5273 if (child && !child->nextSibling())
5277 collapseLoneAnonymousBlockChild(postBox, child); 5274 collapseLoneAnonymousBlockChild(postBox, child);
5278 child = boxToSplit->slowFirstChild(); 5275 child = boxToSplit->slowFirstChild();
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
5478 5475
5479 StyleImage* borderImage = style()->borderImage().image(); 5476 StyleImage* borderImage = style()->borderImage().image();
5480 return borderImage && borderImage->canRender() && borderImage->isLoaded(); 5477 return borderImage && borderImage->canRender() && borderImage->isLoaded();
5481 } 5478 }
5482 5479
5483 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const { 5480 ShapeOutsideInfo* LayoutBox::shapeOutsideInfo() const {
5484 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this) 5481 return ShapeOutsideInfo::isEnabledFor(*this) ? ShapeOutsideInfo::info(*this)
5485 : nullptr; 5482 : nullptr;
5486 } 5483 }
5487 5484
5488 void LayoutBox::clearPreviousPaintInvalidationRects() { 5485 void LayoutBox::clearPreviousVisualRects() {
5489 LayoutBoxModelObject::clearPreviousPaintInvalidationRects(); 5486 LayoutBoxModelObject::clearPreviousVisualRects();
5490 if (PaintLayerScrollableArea* scrollableArea = this->getScrollableArea()) 5487 if (PaintLayerScrollableArea* scrollableArea = this->getScrollableArea())
5491 scrollableArea->clearPreviousPaintInvalidationRects(); 5488 scrollableArea->clearPreviousVisualRects();
5492 } 5489 }
5493 5490
5494 void LayoutBox::setPercentHeightContainer(LayoutBlock* container) { 5491 void LayoutBox::setPercentHeightContainer(LayoutBlock* container) {
5495 ASSERT(!container || !percentHeightContainer()); 5492 ASSERT(!container || !percentHeightContainer());
5496 if (!container && !m_rareData) 5493 if (!container && !m_rareData)
5497 return; 5494 return;
5498 ensureRareData().m_percentHeightContainer = container; 5495 ensureRareData().m_percentHeightContainer = container;
5499 } 5496 }
5500 5497
5501 void LayoutBox::removeFromPercentHeightContainer() { 5498 void LayoutBox::removeFromPercentHeightContainer() {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
5633 LayoutRect rect = frameRect(); 5630 LayoutRect rect = frameRect();
5634 5631
5635 LayoutBlock* block = containingBlock(); 5632 LayoutBlock* block = containingBlock();
5636 if (block) 5633 if (block)
5637 block->adjustChildDebugRect(rect); 5634 block->adjustChildDebugRect(rect);
5638 5635
5639 return rect; 5636 return rect;
5640 } 5637 }
5641 5638
5642 } // namespace blink 5639 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698