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

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

Issue 1833493003: Remove ForceHorriblySlowRectMapping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pi
Patch Set: Created 4 years, 8 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 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 } 372 }
373 setHasOverflowClip(shouldClipOverflow); 373 setHasOverflowClip(shouldClipOverflow);
374 } 374 }
375 375
376 bool LayoutBlock::allowsOverflowClip() const 376 bool LayoutBlock::allowsOverflowClip() const
377 { 377 {
378 // If overflow has been propagated to the viewport, it has no effect here. 378 // If overflow has been propagated to the viewport, it has no effect here.
379 return node() != document().viewportDefiningElement(); 379 return node() != document().viewportDefiningElement();
380 } 380 }
381 381
382 void LayoutBlock::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState & childPaintInvalidationState)
383 {
384 LayoutBox::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState);
385
386 // Take care of positioned objects. This is required as PaintInvalidationSta te keeps a single clip rect.
387 if (TrackedLayoutBoxListHashSet* positionedObjects = this->positionedObjects ()) {
388 for (auto* box : *positionedObjects) {
389
390 // One of the layoutObjects we're skipping over here may be the chil d's paint invalidation container,
391 // so we can't pass our own paint invalidation container along.
392 const LayoutBoxModelObject& paintInvalidationContainerForChild = box ->containerForPaintInvalidation();
393
394 // If it's a new paint invalidation container, we won't have properl y accumulated the offset into the
395 // PaintInvalidationState.
396 // FIXME: Teach PaintInvalidationState to handle this case. crbug.co m/371485
397 if (paintInvalidationContainerForChild != childPaintInvalidationStat e.paintInvalidationContainer()) {
398 ForceHorriblySlowRectMapping slowRectMapping(&childPaintInvalida tionState);
399 PaintInvalidationState disabledPaintInvalidationState(childPaint InvalidationState, *this, paintInvalidationContainerForChild);
400 box->invalidateTreeIfNeeded(disabledPaintInvalidationState);
401 continue;
402 }
403
404 // If the positioned layoutObject is absolutely positioned and it is inside
405 // a relatively positioned inline element, we need to account for
406 // the inline elements position in PaintInvalidationState.
407 if (box->style()->position() == AbsolutePosition) {
408 LayoutObject* container = box->container(&paintInvalidationConta inerForChild, 0);
409 if (container->isInFlowPositioned() && container->isLayoutInline ()) {
410 // FIXME: We should be able to use PaintInvalidationState fo r this.
411 // Currently, we will place absolutely positioned elements i nside
412 // relatively positioned inline blocks in the wrong location . crbug.com/371485
413 ForceHorriblySlowRectMapping slowRectMapping(&childPaintInva lidationState);
414 PaintInvalidationState disabledPaintInvalidationState(childP aintInvalidationState, *this, paintInvalidationContainerForChild);
415 box->invalidateTreeIfNeeded(disabledPaintInvalidationState);
416 continue;
417 }
418 }
419
420 box->invalidateTreeIfNeeded(childPaintInvalidationState);
421 }
422 }
423 }
424
425 inline static void invalidateDisplayItemClientForStartOfContinuationsIfNeeded(co nst LayoutBlock& block) 382 inline static void invalidateDisplayItemClientForStartOfContinuationsIfNeeded(co nst LayoutBlock& block)
426 { 383 {
427 // If the block is a continuation or containing block of an inline continuat ion, invalidate the 384 // If the block is a continuation or containing block of an inline continuat ion, invalidate the
428 // start object of the continuations if it has focus ring because change of continuation may change 385 // start object of the continuations if it has focus ring because change of continuation may change
429 // the shape of the focus ring. 386 // the shape of the focus ring.
430 if (!block.isAnonymous()) 387 if (!block.isAnonymous())
431 return; 388 return;
432 389
433 LayoutObject* startOfContinuations = nullptr; 390 LayoutObject* startOfContinuations = nullptr;
434 if (LayoutInline* inlineElementContinuation = block.inlineElementContinuatio n()) { 391 if (LayoutInline* inlineElementContinuation = block.inlineElementContinuatio n()) {
(...skipping 2431 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2823 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2867 { 2824 {
2868 showLayoutObject(); 2825 showLayoutObject();
2869 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2826 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2870 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2827 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2871 } 2828 }
2872 2829
2873 #endif 2830 #endif
2874 2831
2875 } // namespace blink 2832 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698