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

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

Issue 308683007: Rename childrenAffectedBy methods and constants. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Renamed as proposed. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/ContainerNode.h ('k') | Source/core/page/TouchAdjustment.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 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 void ContainerNode::focusStateChanged() 882 void ContainerNode::focusStateChanged()
883 { 883 {
884 // If we're just changing the window's active state and the focused node has no 884 // If we're just changing the window's active state and the focused node has no
885 // renderer we can just ignore the state change. 885 // renderer we can just ignore the state change.
886 if (!renderer()) 886 if (!renderer())
887 return; 887 return;
888 888
889 if (styleChangeType() < SubtreeStyleChange) { 889 if (styleChangeType() < SubtreeStyleChange) {
890 if (renderStyle()->affectedByFocus() && renderStyle()->hasPseudoStyle(FI RST_LETTER)) 890 if (renderStyle()->affectedByFocus() && renderStyle()->hasPseudoStyle(FI RST_LETTER))
891 setNeedsStyleRecalc(SubtreeStyleChange); 891 setNeedsStyleRecalc(SubtreeStyleChange);
892 else if (isElementNode() && toElement(this)->childrenAffectedByFocus()) 892 else if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedB yFocus())
893 document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().sched uleStyleInvalidationForPseudoChange(CSSSelector::PseudoFocus, *toElement(this)); 893 document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().sched uleStyleInvalidationForPseudoChange(CSSSelector::PseudoFocus, *toElement(this));
894 else if (renderStyle()->affectedByFocus()) 894 else if (renderStyle()->affectedByFocus())
895 setNeedsStyleRecalc(LocalStyleChange); 895 setNeedsStyleRecalc(LocalStyleChange);
896 } 896 }
897 897
898 if (renderer() && renderer()->style()->hasAppearance()) 898 if (renderer() && renderer()->style()->hasAppearance())
899 RenderTheme::theme().stateChanged(renderer(), FocusControlState); 899 RenderTheme::theme().stateChanged(renderer(), FocusControlState);
900 } 900 }
901 901
902 void ContainerNode::setFocus(bool received) 902 void ContainerNode::setFocus(bool received)
903 { 903 {
904 if (focused() == received) 904 if (focused() == received)
905 return; 905 return;
906 906
907 Node::setFocus(received); 907 Node::setFocus(received);
908 908
909 focusStateChanged(); 909 focusStateChanged();
910 910
911 if (renderer() || received) 911 if (renderer() || received)
912 return; 912 return;
913 913
914 // If :focus sets display: none, we lose focus but still need to recalc our style. 914 // If :focus sets display: none, we lose focus but still need to recalc our style.
915 if (isElementNode() && toElement(this)->childrenAffectedByFocus() && styleCh angeType() < SubtreeStyleChange) 915 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByFocus() && styleChangeType() < SubtreeStyleChange)
916 document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleS tyleInvalidationForPseudoChange(CSSSelector::PseudoFocus, *toElement(this)); 916 document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().scheduleS tyleInvalidationForPseudoChange(CSSSelector::PseudoFocus, *toElement(this));
917 else 917 else
918 setNeedsStyleRecalc(LocalStyleChange); 918 setNeedsStyleRecalc(LocalStyleChange);
919 } 919 }
920 920
921 void ContainerNode::setActive(bool down) 921 void ContainerNode::setActive(bool down)
922 { 922 {
923 if (down == active()) 923 if (down == active())
924 return; 924 return;
925 925
926 Node::setActive(down); 926 Node::setActive(down);
927 927
928 // FIXME: Why does this not need to handle the display: none transition like :hover does? 928 // FIXME: Why does this not need to handle the display: none transition like :hover does?
929 if (renderer()) { 929 if (renderer()) {
930 if (styleChangeType() < SubtreeStyleChange) { 930 if (styleChangeType() < SubtreeStyleChange) {
931 if (renderStyle()->affectedByActive() && renderStyle()->hasPseudoSty le(FIRST_LETTER)) 931 if (renderStyle()->affectedByActive() && renderStyle()->hasPseudoSty le(FIRST_LETTER))
932 setNeedsStyleRecalc(SubtreeStyleChange); 932 setNeedsStyleRecalc(SubtreeStyleChange);
933 else if (isElementNode() && toElement(this)->childrenAffectedByActiv e()) 933 else if (isElementNode() && toElement(this)->childrenOrSiblingsAffec tedByActive())
934 document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().s cheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoActive, *toElement(th is)); 934 document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().s cheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoActive, *toElement(th is));
935 else if (renderStyle()->affectedByActive()) 935 else if (renderStyle()->affectedByActive())
936 setNeedsStyleRecalc(LocalStyleChange); 936 setNeedsStyleRecalc(LocalStyleChange);
937 } 937 }
938 938
939 if (renderStyle()->hasAppearance()) 939 if (renderStyle()->hasAppearance())
940 RenderTheme::theme().stateChanged(renderer(), PressedControlState); 940 RenderTheme::theme().stateChanged(renderer(), PressedControlState);
941 } 941 }
942 } 942 }
943 943
944 void ContainerNode::setHovered(bool over) 944 void ContainerNode::setHovered(bool over)
945 { 945 {
946 if (over == hovered()) 946 if (over == hovered())
947 return; 947 return;
948 948
949 Node::setHovered(over); 949 Node::setHovered(over);
950 950
951 // If :hover sets display: none we lose our hover but still need to recalc o ur style. 951 // If :hover sets display: none we lose our hover but still need to recalc o ur style.
952 if (!renderer()) { 952 if (!renderer()) {
953 if (over) 953 if (over)
954 return; 954 return;
955 if (isElementNode() && toElement(this)->childrenAffectedByHover() && sty leChangeType() < SubtreeStyleChange) 955 if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedByHove r() && styleChangeType() < SubtreeStyleChange)
956 document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().sched uleStyleInvalidationForPseudoChange(CSSSelector::PseudoHover, *toElement(this)); 956 document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().sched uleStyleInvalidationForPseudoChange(CSSSelector::PseudoHover, *toElement(this));
957 else 957 else
958 setNeedsStyleRecalc(LocalStyleChange); 958 setNeedsStyleRecalc(LocalStyleChange);
959 return; 959 return;
960 } 960 }
961 961
962 if (styleChangeType() < SubtreeStyleChange) { 962 if (styleChangeType() < SubtreeStyleChange) {
963 if (renderStyle()->affectedByHover() && renderStyle()->hasPseudoStyle(FI RST_LETTER)) 963 if (renderStyle()->affectedByHover() && renderStyle()->hasPseudoStyle(FI RST_LETTER))
964 setNeedsStyleRecalc(SubtreeStyleChange); 964 setNeedsStyleRecalc(SubtreeStyleChange);
965 else if (isElementNode() && toElement(this)->childrenAffectedByHover()) 965 else if (isElementNode() && toElement(this)->childrenOrSiblingsAffectedB yHover())
966 document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().sched uleStyleInvalidationForPseudoChange(CSSSelector::PseudoHover, *toElement(this)); 966 document().ensureStyleResolver().ensureUpdatedRuleFeatureSet().sched uleStyleInvalidationForPseudoChange(CSSSelector::PseudoHover, *toElement(this));
967 else if (renderStyle()->affectedByHover()) 967 else if (renderStyle()->affectedByHover())
968 setNeedsStyleRecalc(LocalStyleChange); 968 setNeedsStyleRecalc(LocalStyleChange);
969 } 969 }
970 970
971 if (renderer()->style()->hasAppearance()) 971 if (renderer()->style()->hasAppearance())
972 RenderTheme::theme().stateChanged(renderer(), HoverControlState); 972 RenderTheme::theme().stateChanged(renderer(), HoverControlState);
973 } 973 }
974 974
975 PassRefPtrWillBeRawPtr<HTMLCollection> ContainerNode::children() 975 PassRefPtrWillBeRawPtr<HTMLCollection> ContainerNode::children()
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 return true; 1275 return true;
1276 1276
1277 if (node->isElementNode() && toElement(node)->shadow()) 1277 if (node->isElementNode() && toElement(node)->shadow())
1278 return true; 1278 return true;
1279 1279
1280 return false; 1280 return false;
1281 } 1281 }
1282 #endif 1282 #endif
1283 1283
1284 } // namespace WebCore 1284 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/ContainerNode.h ('k') | Source/core/page/TouchAdjustment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698