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

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: 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 | no next file » | 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 else if (oldChild.needsStyleInvalidation())
612 document().styleEngine().styleInvalidator().clearInvalidation(toElement( oldChild));
esprehn 2016/01/15 00:31:45 can Element::removedFrom do this? It seems like it
rune 2016/01/15 09:42:41 Yeah, I think so. It means it'll check needsStyleI
rune 2016/01/15 13:25:41 Done.
611 613
612 if (nextChild) 614 if (nextChild)
613 nextChild->setPreviousSibling(previousChild); 615 nextChild->setPreviousSibling(previousChild);
614 if (previousChild) 616 if (previousChild)
615 previousChild->setNextSibling(nextChild); 617 previousChild->setNextSibling(nextChild);
616 if (m_firstChild == &oldChild) 618 if (m_firstChild == &oldChild)
617 m_firstChild = nextChild; 619 m_firstChild = nextChild;
618 if (m_lastChild == &oldChild) 620 if (m_lastChild == &oldChild)
619 m_lastChild = previousChild; 621 m_lastChild = previousChild;
620 622
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 return true; 1545 return true;
1544 1546
1545 if (node->isElementNode() && toElement(node)->shadow()) 1547 if (node->isElementNode() && toElement(node)->shadow())
1546 return true; 1548 return true;
1547 1549
1548 return false; 1550 return false;
1549 } 1551 }
1550 #endif 1552 #endif
1551 1553
1552 } // namespace blink 1554 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698