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

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

Issue 2473743003: Call Element::rebuildLayoutTree from Document::updateStyle directly (Closed)
Patch Set: FirstLetterPseudoElements are not being created Created 4 years 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) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 } 906 }
907 907
908 void Node::detachLayoutTree(const AttachContext& context) { 908 void Node::detachLayoutTree(const AttachContext& context) {
909 DCHECK(document().lifecycle().stateAllowsDetach()); 909 DCHECK(document().lifecycle().stateAllowsDetach());
910 DocumentLifecycle::DetachScope willDetach(document().lifecycle()); 910 DocumentLifecycle::DetachScope willDetach(document().lifecycle());
911 911
912 if (layoutObject()) 912 if (layoutObject())
913 layoutObject()->destroyAndCleanupAnonymousWrappers(); 913 layoutObject()->destroyAndCleanupAnonymousWrappers();
914 setLayoutObject(nullptr); 914 setLayoutObject(nullptr);
915 setStyleChange(NeedsReattachStyleChange); 915 setStyleChange(NeedsReattachStyleChange);
916 setLocalNeedsReattachLayoutTree();
nainar 2016/12/07 14:48:21 make sure that we are setting the NeedsReattachLay
Bugs Nash 2016/12/07 23:21:44 this function is difficult to understand at first
nainar 2016/12/07 23:49:10 As per discussion with esprehn@, we want to set th
Bugs Nash 2016/12/08 00:27:59 If this is similar to the above call then I would
nainar 2016/12/08 00:45:48 Yup that makes sense calling setFlag(NeedsReattach
916 clearChildNeedsStyleInvalidation(); 917 clearChildNeedsStyleInvalidation();
917 } 918 }
918 919
919 void Node::reattachWhitespaceSiblingsIfNeeded(Text* start) { 920 void Node::reattachWhitespaceSiblingsIfNeeded(Text* start) {
920 ScriptForbiddenScope forbidScriptDuringRawIteration; 921 ScriptForbiddenScope forbidScriptDuringRawIteration;
921 for (Node* sibling = start; sibling; sibling = sibling->nextSibling()) { 922 for (Node* sibling = start; sibling; sibling = sibling->nextSibling()) {
922 if (sibling->isTextNode() && toText(sibling)->containsOnlyWhitespace()) { 923 if (sibling->isTextNode() && toText(sibling)->containsOnlyWhitespace()) {
923 bool hadLayoutObject = !!sibling->layoutObject(); 924 bool hadLayoutObject = !!sibling->layoutObject();
924 toText(sibling)->reattachLayoutTreeIfNeeded(); 925 toText(sibling)->reattachLayoutTreeIfNeeded();
925 // If sibling's layout object status didn't change we don't need to 926 // If sibling's layout object status didn't change we don't need to
(...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after
2541 if (node) { 2542 if (node) {
2542 std::stringstream stream; 2543 std::stringstream stream;
2543 node->printNodePathTo(stream); 2544 node->printNodePathTo(stream);
2544 LOG(INFO) << stream.str(); 2545 LOG(INFO) << stream.str();
2545 } else { 2546 } else {
2546 LOG(INFO) << "Cannot showNodePath for <null>"; 2547 LOG(INFO) << "Cannot showNodePath for <null>";
2547 } 2548 }
2548 } 2549 }
2549 2550
2550 #endif 2551 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698