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

Side by Side Diff: Source/core/html/HTMLElement.cpp

Issue 547823002: Track reasons for |Node::SetNeedsStyleRecalc| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use AtomicString Created 6 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
« no previous file with comments | « Source/core/html/HTMLBodyElement.cpp ('k') | Source/core/html/HTMLFormControlElement.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 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved.
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
6 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 6 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 void HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged(Element * child) 742 void HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged(Element * child)
743 { 743 {
744 ASSERT(selfOrAncestorHasDirAutoAttribute()); 744 ASSERT(selfOrAncestorHasDirAutoAttribute());
745 Node* strongDirectionalityTextNode; 745 Node* strongDirectionalityTextNode;
746 TextDirection textDirection = directionality(&strongDirectionalityTextNode); 746 TextDirection textDirection = directionality(&strongDirectionalityTextNode);
747 setHasDirAutoFlagRecursively(child, false); 747 setHasDirAutoFlagRecursively(child, false);
748 if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection) { 748 if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection) {
749 Element* elementToAdjust = this; 749 Element* elementToAdjust = this;
750 for (; elementToAdjust; elementToAdjust = elementToAdjust->parentElement ()) { 750 for (; elementToAdjust; elementToAdjust = elementToAdjust->parentElement ()) {
751 if (elementAffectsDirectionality(elementToAdjust)) { 751 if (elementAffectsDirectionality(elementToAdjust)) {
752 elementToAdjust->setNeedsStyleRecalc(SubtreeStyleChange); 752 elementToAdjust->setNeedsStyleRecalc(SubtreeStyleChange, StyleCh angeReasonForTracing::create(StyleChangeReason::WritingModeChange));
753 return; 753 return;
754 } 754 }
755 } 755 }
756 } 756 }
757 } 757 }
758 758
759 void HTMLElement::calculateAndAdjustDirectionality() 759 void HTMLElement::calculateAndAdjustDirectionality()
760 { 760 {
761 Node* strongDirectionalityTextNode; 761 Node* strongDirectionalityTextNode;
762 TextDirection textDirection = directionality(&strongDirectionalityTextNode); 762 TextDirection textDirection = directionality(&strongDirectionalityTextNode);
763 setHasDirAutoFlagRecursively(this, hasDirectionAuto(), strongDirectionalityT extNode); 763 setHasDirAutoFlagRecursively(this, hasDirectionAuto(), strongDirectionalityT extNode);
764 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root()) 764 for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadow Root())
765 setHasDirAutoFlagRecursively(root, hasDirectionAuto()); 765 setHasDirAutoFlagRecursively(root, hasDirectionAuto());
766 if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection) 766 if (renderer() && renderer()->style() && renderer()->style()->direction() != textDirection)
767 setNeedsStyleRecalc(SubtreeStyleChange); 767 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::cre ate(StyleChangeReason::WritingModeChange));
768 } 768 }
769 769
770 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(const Childre nChange& change) 770 void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(const Childre nChange& change)
771 { 771 {
772 if (!selfOrAncestorHasDirAutoAttribute()) 772 if (!selfOrAncestorHasDirAutoAttribute())
773 return; 773 return;
774 774
775 Node* oldMarkedNode = change.siblingBeforeChange ? NodeTraversal::nextSkippi ngChildren(*change.siblingBeforeChange) : 0; 775 Node* oldMarkedNode = change.siblingBeforeChange ? NodeTraversal::nextSkippi ngChildren(*change.siblingBeforeChange) : 0;
776 while (oldMarkedNode && elementAffectsDirectionality(oldMarkedNode)) 776 while (oldMarkedNode && elementAffectsDirectionality(oldMarkedNode))
777 oldMarkedNode = NodeTraversal::nextSkippingChildren(*oldMarkedNode, this ); 777 oldMarkedNode = NodeTraversal::nextSkippingChildren(*oldMarkedNode, this );
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 #ifndef NDEBUG 994 #ifndef NDEBUG
995 995
996 // For use in the debugger 996 // For use in the debugger
997 void dumpInnerHTML(blink::HTMLElement*); 997 void dumpInnerHTML(blink::HTMLElement*);
998 998
999 void dumpInnerHTML(blink::HTMLElement* element) 999 void dumpInnerHTML(blink::HTMLElement* element)
1000 { 1000 {
1001 printf("%s\n", element->innerHTML().ascii().data()); 1001 printf("%s\n", element->innerHTML().ascii().data());
1002 } 1002 }
1003 #endif 1003 #endif
OLDNEW
« no previous file with comments | « Source/core/html/HTMLBodyElement.cpp ('k') | Source/core/html/HTMLFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698