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

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

Issue 1394193003: Invalidate background-attachment:fixed on scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename all SlowRepaint to BackgroundAttachmentFixed. rebaseline test. Created 5 years, 2 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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
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 2521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2532 if (m_style->contentData() && m_style->contentData()->isImage()) 2532 if (m_style->contentData() && m_style->contentData()->isImage())
2533 toImageContentData(m_style->contentData())->image()->removeClient(th is); 2533 toImageContentData(m_style->contentData())->image()->removeClient(th is);
2534 2534
2535 if (m_style->boxReflect() && m_style->boxReflect()->mask().image()) 2535 if (m_style->boxReflect() && m_style->boxReflect()->mask().image())
2536 m_style->boxReflect()->mask().image()->removeClient(this); 2536 m_style->boxReflect()->mask().image()->removeClient(this);
2537 2537
2538 removeShapeImageClient(m_style->shapeOutside()); 2538 removeShapeImageClient(m_style->shapeOutside());
2539 } 2539 }
2540 2540
2541 if (frameView()) 2541 if (frameView())
2542 setIsSlowRepaintObject(false); 2542 setIsBackgroundAttachmentFixedObject(false);
2543 } 2543 }
2544 2544
2545 void LayoutObject::insertedIntoTree() 2545 void LayoutObject::insertedIntoTree()
2546 { 2546 {
2547 // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion. 2547 // FIXME: We should ASSERT(isRooted()) here but generated content makes some out-of-order insertion.
2548 2548
2549 // Keep our layer hierarchy updated. Optimize for the common case where we d on't have any children 2549 // Keep our layer hierarchy updated. Optimize for the common case where we d on't have any children
2550 // and don't have a layer attached to ourselves. 2550 // and don't have a layer attached to ourselves.
2551 PaintLayer* layer = nullptr; 2551 PaintLayer* layer = nullptr;
2552 if (slowFirstChild() || hasLayer()) { 2552 if (slowFirstChild() || hasLayer()) {
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
3436 3436
3437 void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBoxModelObject& paintInvalidationContainer) 3437 void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBoxModelObject& paintInvalidationContainer)
3438 { 3438 {
3439 invalidatePaintOfPreviousPaintInvalidationRect(paintInvalidationContainer, P aintInvalidationLayer); 3439 invalidatePaintOfPreviousPaintInvalidationRect(paintInvalidationContainer, P aintInvalidationLayer);
3440 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { 3440 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) {
3441 if (!child->hasLayer() || !toLayoutBoxModelObject(child)->layer()->isSel fPaintingLayer()) 3441 if (!child->hasLayer() || !toLayoutBoxModelObject(child)->layer()->isSel fPaintingLayer())
3442 child->invalidatePaintIncludingNonSelfPaintingLayerDescendants(paint InvalidationContainer); 3442 child->invalidatePaintIncludingNonSelfPaintingLayerDescendants(paint InvalidationContainer);
3443 } 3443 }
3444 } 3444 }
3445 3445
3446 void LayoutObject::setIsSlowRepaintObject(bool isSlowRepaintObject) 3446 void LayoutObject::setIsBackgroundAttachmentFixedObject(bool isBackgroundAttachm entFixedObject)
3447 { 3447 {
3448 ASSERT(frameView()); 3448 ASSERT(frameView());
3449 if (m_bitfields.isSlowRepaintObject() == isSlowRepaintObject) 3449 if (m_bitfields.isBackgroundAttachmentFixedObject() == isBackgroundAttachmen tFixedObject)
3450 return; 3450 return;
3451 m_bitfields.setIsSlowRepaintObject(isSlowRepaintObject); 3451 m_bitfields.setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixed Object);
3452 if (isSlowRepaintObject) 3452 if (isBackgroundAttachmentFixedObject)
3453 frameView()->addSlowRepaintObject(); 3453 frameView()->addBackgroundAttachmentFixedObject(this);
3454 else 3454 else
3455 frameView()->removeSlowRepaintObject(); 3455 frameView()->removeBackgroundAttachmentFixedObject(this);
3456 } 3456 }
3457 3457
3458 } // namespace blink 3458 } // namespace blink
3459 3459
3460 #ifndef NDEBUG 3460 #ifndef NDEBUG
3461 3461
3462 void showTree(const blink::LayoutObject* object) 3462 void showTree(const blink::LayoutObject* object)
3463 { 3463 {
3464 if (object) 3464 if (object)
3465 object->showTreeForThis(); 3465 object->showTreeForThis();
(...skipping 20 matching lines...) Expand all
3486 const blink::LayoutObject* root = object1; 3486 const blink::LayoutObject* root = object1;
3487 while (root->parent()) 3487 while (root->parent())
3488 root = root->parent(); 3488 root = root->parent();
3489 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3489 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3490 } else { 3490 } else {
3491 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3491 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3492 } 3492 }
3493 } 3493 }
3494 3494
3495 #endif 3495 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698