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

Side by Side Diff: third_party/WebKit/Source/core/dom/ContainerNode.cpp

Issue 1590143002: removeBetween() -> detach() performance fix. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check needsStyleInvalidation() before clearing. Created 4 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 } 599 }
600 600
601 void ContainerNode::removeBetween(Node* previousChild, Node* nextChild, Node& ol dChild) 601 void ContainerNode::removeBetween(Node* previousChild, Node* nextChild, Node& ol dChild)
602 { 602 {
603 EventDispatchForbiddenScope assertNoEventDispatch; 603 EventDispatchForbiddenScope assertNoEventDispatch;
604 604
605 ASSERT(oldChild.parentNode() == this); 605 ASSERT(oldChild.parentNode() == this);
606 606
607 AttachContext context; 607 AttachContext context;
608 context.clearInvalidation = true; 608 context.clearInvalidation = true;
609 if (!needsAttach() || !oldChild.needsAttach()) 609 if (!oldChild.needsAttach())
610 oldChild.detach(context); 610 oldChild.detach(context);
611 611
612 if (nextChild) 612 if (nextChild)
613 nextChild->setPreviousSibling(previousChild); 613 nextChild->setPreviousSibling(previousChild);
614 if (previousChild) 614 if (previousChild)
615 previousChild->setNextSibling(nextChild); 615 previousChild->setNextSibling(nextChild);
616 if (m_firstChild == &oldChild) 616 if (m_firstChild == &oldChild)
617 m_firstChild = nextChild; 617 m_firstChild = nextChild;
618 if (m_lastChild == &oldChild) 618 if (m_lastChild == &oldChild)
619 m_lastChild = previousChild; 619 m_lastChild = previousChild;
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 return true; 1543 return true;
1544 1544
1545 if (node->isElementNode() && toElement(node)->shadow()) 1545 if (node->isElementNode() && toElement(node)->shadow())
1546 return true; 1546 return true;
1547 1547
1548 return false; 1548 return false;
1549 } 1549 }
1550 #endif 1550 #endif
1551 1551
1552 } // namespace blink 1552 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698