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

Side by Side Diff: sky/engine/core/dom/Node.cpp

Issue 712173002: Remove StyleInvalidator machinery. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/dom/Node.h ('k') | sky/engine/core/dom/StyleEngine.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, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 } 496 }
497 497
498 clearChildNeedsDistributionRecalc(); 498 clearChildNeedsDistributionRecalc();
499 } 499 }
500 500
501 void Node::setIsLink(bool isLink) 501 void Node::setIsLink(bool isLink)
502 { 502 {
503 setFlag(isLink, IsLinkFlag); 503 setFlag(isLink, IsLinkFlag);
504 } 504 }
505 505
506 void Node::setNeedsStyleInvalidation()
507 {
508 setFlag(NeedsStyleInvalidationFlag);
509 markAncestorsWithChildNeedsStyleInvalidation();
510 }
511
512 void Node::markAncestorsWithChildNeedsStyleInvalidation()
513 {
514 for (Node* node = parentOrShadowHostNode(); node && !node->childNeedsStyleIn validation(); node = node->parentOrShadowHostNode())
515 node->setChildNeedsStyleInvalidation();
516 document().scheduleRenderTreeUpdateIfNeeded();
517 }
518
519 void Node::markAncestorsWithChildNeedsDistributionRecalc() 506 void Node::markAncestorsWithChildNeedsDistributionRecalc()
520 { 507 {
521 for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode()) 508 for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode())
522 node->setChildNeedsDistributionRecalc(); 509 node->setChildNeedsDistributionRecalc();
523 document().scheduleRenderTreeUpdateIfNeeded(); 510 document().scheduleRenderTreeUpdateIfNeeded();
524 } 511 }
525 512
526 namespace { 513 namespace {
527 514
528 void addJsStack(TracedValue* stackFrames) 515 void addJsStack(TracedValue* stackFrames)
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 doc.hoveredNodeDetached(this); 756 doc.hoveredNodeDetached(this);
770 if (inActiveChain()) 757 if (inActiveChain())
771 doc.activeChainNodeDetached(this); 758 doc.activeChainNodeDetached(this);
772 doc.userActionElements().didDetach(this); 759 doc.userActionElements().didDetach(this);
773 } 760 }
774 } 761 }
775 762
776 setStyleChange(NeedsReattachStyleChange); 763 setStyleChange(NeedsReattachStyleChange);
777 setChildNeedsStyleRecalc(); 764 setChildNeedsStyleRecalc();
778 765
779 if (StyleResolver* resolver = document().styleResolver())
780 resolver->ruleFeatureSet().styleInvalidator().clearInvalidation(*this);
781 clearChildNeedsStyleInvalidation();
782 clearNeedsStyleInvalidation();
783
784 #if ENABLE(ASSERT) 766 #if ENABLE(ASSERT)
785 detachingNode = 0; 767 detachingNode = 0;
786 #endif 768 #endif
787 } 769 }
788 770
789 void Node::reattachWhitespaceSiblings(Text* start) 771 void Node::reattachWhitespaceSiblings(Text* start)
790 { 772 {
791 for (Node* sibling = start; sibling; sibling = sibling->nextSibling()) { 773 for (Node* sibling = start; sibling; sibling = sibling->nextSibling()) {
792 if (sibling->isTextNode() && toText(sibling)->containsOnlyWhitespace()) { 774 if (sibling->isTextNode() && toText(sibling)->containsOnlyWhitespace()) {
793 bool hadRenderer = !!sibling->renderer(); 775 bool hadRenderer = !!sibling->renderer();
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 node->showTreeForThis(); 1858 node->showTreeForThis();
1877 } 1859 }
1878 1860
1879 void showNodePath(const blink::Node* node) 1861 void showNodePath(const blink::Node* node)
1880 { 1862 {
1881 if (node) 1863 if (node)
1882 node->showNodePathForThis(); 1864 node->showNodePathForThis();
1883 } 1865 }
1884 1866
1885 #endif 1867 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Node.h ('k') | sky/engine/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698